Browse Source

优化页面和接口逻辑

master
Lj 1 month ago
parent
commit
9cf9055d0e
32 changed files with 1269 additions and 364 deletions
  1. +27
    -2
      App.vue
  2. +19
    -18
      api/model/index.js
  3. +7
    -0
      pages.json
  4. +112
    -79
      pages/component/home.vue
  5. +53
    -15
      pages/component/my.vue
  6. +314
    -89
      pages/component/recycle.vue
  7. +23
    -10
      pages/index/index.vue
  8. +1
    -1
      pages/subcomponent/admin_customer.vue
  9. +1
    -1
      pages/subcomponent/admin_edit_profile.vue
  10. +1
    -1
      pages/subcomponent/admin_faq.vue
  11. +1
    -1
      pages/subcomponent/apply.vue
  12. +1
    -1
      pages/subcomponent/brand.vue
  13. +1
    -1
      pages/subcomponent/detail.vue
  14. +48
    -16
      pages/subcomponent/edit_profile.vue
  15. +1
    -1
      pages/subcomponent/faq.vue
  16. +390
    -0
      pages/subcomponent/inspection-detail.vue
  17. +143
    -28
      pages/subcomponent/inspection-report.vue
  18. +1
    -1
      pages/subcomponent/inspection.vue
  19. +21
    -7
      pages/subcomponent/order.vue
  20. +1
    -1
      pages/subcomponent/order_edit.vue
  21. +1
    -1
      pages/subcomponent/orders.vue
  22. +24
    -47
      pages/subcomponent/pickup.vue
  23. +1
    -1
      pages/subcomponent/promo-qrcode.vue
  24. +1
    -1
      pages/subcomponent/promotion.vue
  25. +1
    -1
      pages/subcomponent/promotion_info.vue
  26. +1
    -1
      pages/subcomponent/recycle_rules.vue
  27. +64
    -30
      pages/subcomponent/select.vue
  28. +1
    -1
      pages/subcomponent/upgrad.vue
  29. +1
    -1
      pages/subcomponent/wallet.vue
  30. +1
    -1
      pages/subcomponent/withdraw.vue
  31. +5
    -6
      pages/wxUserInfo.vue
  32. +2
    -0
      utils/router-interception.js

+ 27
- 2
App.vue View File

@ -4,18 +4,43 @@
globalData: {
flag: 1,
login_status:true,
phone:null
phone:null,
bannerList: [],
pricePreviewList: []
},
onLaunch: function() {
routerInterception()
this.getBannerList()
this.getPricePreviewList()
// console.log(this.$utils)
console.log('App Launch')
},
onShow: function() {
onLoad: function() {
this.getBannerList()
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
methods: {
getBannerList() {
// this.$api
this.$api && this.$api('getBanner', {}, res => {
if (res && res.code === 200 && Array.isArray(res.result)) {
getApp().globalData.bannerList = res.result
console.log(getApp().globalData.bannerList,'bannerList')
uni.$emit('bannerListUpdated')
}
})
},
getPricePreviewList() {
this.$api && this.$api('getPricePreviewClassList', {}, res => {
if (res && res.success && Array.isArray(res.result)) {
getApp().globalData.pricePreviewList = res.result
uni.$emit('pricePreviewListUpdated')
}
})
}
}
}
</script>


+ 19
- 18
api/model/index.js View File

@ -2,9 +2,10 @@
const api = {
// 获取首页轮播图
getRiceBanner: {
getBanner: {
url: '/recycle-admin/applet/index/getBanner',
method: 'GET',
auth : false,
},
getRiceIconList: {
@ -152,20 +153,23 @@ const api = {
url: '/index_common/getCommonUser',
method: 'GET'
},
//提交反馈信息
addFeedback: {
url: '/info_common/addFeedback',
method: 'POST'
//查看最近回收质检报告
getQualityReport: {
url: '/recycle-admin/applet/index/getQualityReport',
method: 'GET',
auth : false
},
// 获取我的直接推荐间接推荐用户列表带分页
getHanHaiMemberUser: {
url: '/info_common/getHanHaiMemberUser',
method: 'GET'
// 回收规则
getGoodsRecycleRule: {
url: '/recycle-admin/applet/class/getGoodsRecycleRule',
method: 'GET',
auth : false
},
// 获取祝福背景图
getRiceBlessing: {
url: '/index_common/getRiceBlessing',
method: 'GET'
// 获取用户订单列表
getOrderListPage: {
url: '/recycle-admin/applet/order/getOrderListPage',
method: 'GET',
auth : true
},
// 查询最近回收商品
getRecentGoodsList: {
@ -178,21 +182,18 @@ const api = {
url: '/recycle-admin/applet/index/getQualityReport',
method: 'GET',
auth : false,
limit : 1000,
},
// 1.根据id获取对应商品列表
getGoodsBrandList: {
url: '/recycle-admin/applet/class/getGoodsBrandList',
method: 'GET',
auth : false,
limit : 1000,
auth : false
},
// 2.根据分类标识获取分类商品列表带分页
getClassGoodsList: {
url: '/recycle-admin/applet/class/getClassGoodsList',
method: 'GET',
auth : false,
limit : 1000,
auth : false
},
// 获取我的礼品订单
getPricePreviewClassList: {


+ 7
- 0
pages.json View File

@ -208,6 +208,13 @@
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"path": "inspection-detail",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
}
]
},


+ 112
- 79
pages/component/home.vue View File

@ -2,7 +2,18 @@
<view class="container safe-area">
<!-- 顶部banner -->
<view class="banner">
<image src="https://oss.budingxiaoshuo.com/upload/banner_1748251969135.png" mode=""></image>
<swiper
:indicator-dots="false"
:autoplay="true"
:interval="3000"
:duration="500"
circular
style="width: 100%; height: 380rpx;"
>
<swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
<image :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" />
</swiper-item>
</swiper>
</view>
<view class="content">
<!-- 回收流程 -->
@ -76,7 +87,7 @@
</view>
</view>
<view class="price-grid">
<view class="price-item" v-for="(item, index) in priceList" :key="index">
<view class="price-item" v-for="(item, index) in priceList" :key="item.id || index" @tap="goToRecycleCategory(item.id)">
<image v-if="item.icon" :src="item.icon" mode="aspectFit" class="item-icon"></image>
<view v-else class="item-icon placeholder"></view>
<text class="item-name">{{item.name}}</text>
@ -99,11 +110,11 @@
:key="index"
@tap="goToInspectionReport(item)"
>
<image src="/static/home/1745571336565.png" mode=""></image>
<text class="location">{{item.location}}</text>
<text class="user-id">****{{item.userId}}</text>
<image :src="item.image" mode=""></image>
<text class="location">{{item.name}}</text>
<text class="user-id">****{{item.phone ? item.phone.slice(-4) : ''}}</text>
<text class="user-id-f">成功完成衣物回收已到账</text>
<text class="amount">+ ¥{{item.amount}}</text>
<text class="amount">+ ¥{{item.price}}</text>
</view>
</view>
</view>
@ -183,11 +194,7 @@ export default {
{ icon: '/static/home/羽绒裤.png', name: '羽绒裤', price: '3-10', unit: '件' },
{ icon: '/static/home/儿童羽绒服.png', name: '儿童羽绒服', price: '3-10', unit: '件' }
],
records: Array(6).fill().map(() => ({
location: '天津市',
amount: '50',
userId: '5513'
})),
records: [],
destinations: [
{
icon: '/static/home/爱心援乡.png',
@ -209,7 +216,9 @@ export default {
title: '碳循再生',
desc: '减碳从出发生系统'
}
]
],
bannerList: [],
pricePreviewList: []
}
},
methods: {
@ -237,8 +246,8 @@ export default {
})
},
getPickupto(){
uni.navigateTo({
url: '/pages/subcomponent/pickup'
uni.switchTab({
url: '/pages/component/recycle'
})
},
async onRefresh() {
@ -251,6 +260,7 @@ export default {
// sort
const sorted = res.result.slice().sort((a, b) => a.sort - b.sort)
this.processes = sorted.map(item => ({
// id: item.id,
icon: item.image,
text: item.title
}))
@ -262,49 +272,49 @@ export default {
url: '/pages/subcomponent/admin_faq'
})
},
goToRecycleCategory(id) {
getApp().globalData.targetRecycleCategoryId = id
console.log(getApp().globalData.targetRecycleCategoryId,'getApp().globalData.targetRecycleCategoryId')
uni.switchTab({
url: '/pages/component/recycle'
})
},
getPricePreview() {
this.$api('getPricePreviewClassList', {}, res => {
if (res && res.success && Array.isArray(res.result)) {
console.log(res,'getPricePreview');
// sort
const firstLevel = res.result.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
this.priceList = firstLevel.map(item => {
//
const staticItem = this.priceListStatic.find(s => s.name.replace(/\s/g, '') === item.title.replace(/\s/g, ''))
console.log({
icon: staticItem ? staticItem.icon : '',
name: item.title,
price: staticItem ? staticItem.price : '',
unit: '件'
});
return {
icon: staticItem ? staticItem.icon : '',
name: item.title,
price: staticItem ? staticItem.price : '',
unit: '件'
}
})
}
})
const resList = this.pricePreviewList || []
if (Array.isArray(resList)) {
// sort
const firstLevel = resList.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
this.priceList = firstLevel.map(item => {
//
const staticItem = this.priceListStatic.find(s => s.name.replace(/\s/g, '') === item.title.replace(/\s/g, ''))
return {
id: item.id, // id
icon: staticItem ? staticItem.icon : '',
name: item.title,
price: staticItem ? staticItem.price : '',
unit: '件'
}
})
}
},
getRecentGoods() {
this.$api('getRecentGoodsList', {}, res => {
if (res && res.success && Array.isArray(res.result) && res.result.length > 0) {
// records
this.records = res.result
} else {
//
this.records = Array(6).fill().map(() => ({
location: '天津市',
amount: '50',
userId: '5513'
if (res && res.code === 200 && Array.isArray(res.result) && res.result.length > 0) {
this.records = res.result.map(item => ({
id: item.id,
image: item.image,
name: item.name,
phone: item.phone,
price: item.price
}))
} else {
this.records = []
}
})
},
goToInspectionReport(item) {
uni.navigateTo({
url: '/pages/subcomponent/inspection-report'
url: `/pages/subcomponent/inspection-report?id=${item.id}`
})
}
},
@ -312,9 +322,24 @@ export default {
this.getAreaList();
this.getPricePreview();
this.getRecentGoods();
// console.log(this.processes,'222')
}
this.pricePreviewList = getApp().globalData.pricePreviewList || []
this.bannerList = getApp().globalData.bannerList || []
uni.$on('pricePreviewListUpdated', () => {
this.pricePreviewList = getApp().globalData.pricePreviewList || []
this.getPricePreview()
})
uni.$on('bannerListUpdated', () => {
this.bannerList = getApp().globalData.bannerList || []
})
},
onUnload() {
uni.$off('pricePreviewListUpdated')
uni.$off('bannerListUpdated')
},
onShow() {
//
// uni.startPullDownRefresh()
}
}
</script>
@ -439,6 +464,7 @@ export default {
grid-template-columns: repeat(4, 1fr);
gap: 20rpx;
margin: 30rpx 0;
border: none;
}
@ -469,14 +495,14 @@ export default {
color: #999;
}
}
.submit-btn {
background: linear-gradient(to right, #ffd01e, #ff8917);
border-radius: 70rpx;
// padding: 20rpx;
padding: 20rpx;
text-align: center;
position: relative;
// border: none;
border: none;
display: flex;
flex-direction: column;
overflow: visible;
@ -484,7 +510,7 @@ export default {
color: #ffffff;
font-size: 32rpx;
font-weight: bold;
line-height: 55rpx;
line-height: 40rpx;
// display: block;
}
@ -514,6 +540,9 @@ export default {
// z-index: 4;
}
}
.submit-btn::after{
border: none !important;
}
}
.city-section {
@ -616,42 +645,43 @@ export default {
align-items: center;
background: linear-gradient(to top, #e8ffe0 0%,#fffefb 100%);
border-radius: 16rpx;
padding: 30rpx;
padding: 10rpx;
background-color: #fff8ea;
image{
width: 60rpx;
height: 60rpx;
}
image{
width: 60rpx;
height: 60rpx;
}
.location {
font-size: 24rpx;
color: #666;
font-size: 28rpx;
color: #333;
font-weight: bold;
}
.amount {
font-size: 28rpx;
font-size: 30rpx;
color: #13ac47;
font-weight: bold;
margin: 4rpx 0;
margin: 6rpx 0;
}
.user-id {
font-family: PingFang SC;
font-weight: 400;
font-size: 12rpx;
line-height: 140%;
letter-spacing: 0%;
text-align: center;
color: #183c5c;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
line-height: 140%;
letter-spacing: 0%;
text-align: center;
color: #183c5c;
}
.user-id-f{
font-family: PingFang SC;
font-weight: 400;
font-size: 22rpx;
line-height: 140%;
letter-spacing: 0%;
text-align: center;
color: #9b9b9b;
}
.user-id-f{
font-family: PingFang SC;
font-weight: 400;
font-size: 12rpx;
line-height: 140%;
letter-spacing: 0%;
text-align: center;
color: #9b9b9b;
}
}
}
@ -821,4 +851,7 @@ export default {
transform: scale(1);
}
}
</style>

+ 53
- 15
pages/component/my.vue View File

@ -2,8 +2,18 @@
<view class="container" >
<!-- 顶部banner -->
<view class="banner">
<!-- <text class="banner-title">我的循环钱包</text> -->
<image class="banner-bg" src="https://oss.budingxiaoshuo.com/upload/我的banneer(1)_1748252280266.png" mode="aspectFill"></image>
<swiper
:indicator-dots="false"
:autoplay="true"
:interval="3000"
:duration="500"
circular
style="width: 100%; height: 400rpx;"
>
<swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
<image :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" />
</swiper-item>
</swiper>
</view>
<view class="user-cards" v-if="!login_status">
<view class="user-info">
@ -86,27 +96,26 @@
</view>
<!-- 订单列表 -->
<view class="order-list">
<view class="order-item">
<view class="order-item" v-for="order in orderList" :key="order.id">
<view class="order-header">
<text class="order-id">订单编号 RE82738127861526</text>
<text class="order-id">订单编号 {{order.ordeNo}}</text>
</view>
<view class="order-content">
<image class="goods-image" src="/static/回收/衣物.png" mode="aspectFill"></image>
<image class="goods-image" :src="order.image || '/static/回收/衣物.png'" mode="aspectFill"></image>
<view class="order-info-opt">
<view class="order-info-top">
<text class="order-info-count">8 </text>
<text class="order-info-price">3-10 /</text>
<text class="order-info-count">{{order.num || 1}} </text>
<text class="order-info-price">{{order.onePrice || 0}} /</text>
</view>
<view class="order-info-estimate">
预估 76-80
预估 ¥ {{order.price}}
</view>
</view>
</view>
<view class="order-footer">
<image class="courier-avatar" src="/static/my/【上门中】快递员正在赶来.png" mode="aspectFill"></image>
<view class="delivery-info">
<text class="status">上门中快递员正在赶来</text>
<text class="time">周四 11:00~13:00</text>
<text class="status">{{order.status === 0 ? '【在线预约】' : order.status === 1 ? '【快递上门】' : order.status === 2 ? '【透明质检】' : order.status === 3 ? '【现金打款】' : ''}}</text>
<text class="time">{{order.goTime}}</text>
</view>
</view>
</view>
@ -230,7 +239,8 @@ export default {
{ name: '联系客服', icon: '/static/my/客服.png' },
{ name: '修改信息', icon: '/static/my/修改信息.png' },
{ name: '退出登录', icon: '/static/my/退出登录.png' }
]
],
orderList: []
}
},
methods: {
@ -270,6 +280,7 @@ export default {
},
switchTab(index) {
this.currentTab = index
this.fetchOrderList()
},
handleFunction(index) {
const pages = [
@ -332,6 +343,20 @@ export default {
this.login_status = false;
}
},
fetchOrderList() {
let status = ''
if (this.currentTab === 1) status = 0 //
if (this.currentTab === 2) status = 3 //
const params = { pageSize: 1, current: 1 }
if (status !== '') params.status = status
this.$api && this.$api('getOrderListPage', params, res => {
if (res && res.code === 200 && res.result && Array.isArray(res.result.records)) {
this.orderList = res.result.records
} else {
this.orderList = []
}
})
},
},
computed: {
customStyle() {
@ -339,15 +364,25 @@ export default {
// height: '80rpx',
width: '70%',
}
}
},
bannerList() {
return getApp().globalData.bannerList || []
}
},
onLoad() {
//
uni.startPullDownRefresh()
//
// uni.startPullDownRefresh()
uni.$on('refreshUserInfo', () => {
this.fetchUserInfo()
})
this.fetchUserInfo()
this.fetchOrderList()
uni.$on('bannerListUpdated', () => {
this.$forceUpdate && this.$forceUpdate()
})
if (getApp().globalData.bannerList && getApp().globalData.bannerList.length > 0) {
this.$forceUpdate && this.$forceUpdate()
}
},
onShow() {
this.fetchUserInfo()
@ -363,6 +398,9 @@ export default {
})
}, 1000)
},
onUnload() {
uni.$off('bannerListUpdated')
},
}
</script>


+ 314
- 89
pages/component/recycle.vue View File

@ -2,7 +2,18 @@
<view class="container">
<!-- 顶部banner -->
<view class="banner">
<image src="https://oss.budingxiaoshuo.com/upload/回收banner_1748252408016.png" mode=""></image>
<swiper
:indicator-dots="false"
:autoplay="true"
:interval="3000"
:duration="500"
circular
style="width: 100%; height: 400rpx;"
>
<swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
<image :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" />
</swiper-item>
</swiper>
</view>
<!-- 商品列表 -->
@ -11,21 +22,21 @@
<scroll-view class="category-nav" scroll-y>
<view
v-for="(category, index) in categories"
:key="index"
:key="category.id || index"
class="category-item"
:class="{ active: currentCategory === index }"
@tap="switchCategory(index)"
>
<view class="category-dot" v-if="getCategoryItemCount(index) > 0"></view>
{{ category.name }}
{{ category.title }}
</view>
</scroll-view>
<!-- 右侧商品列表 -->
<scroll-view class="goods-content" scroll-y>
<scroll-view class="goods-content" scroll-y @scrolltolower="loadMoreGoods" style="height: 70vh">
<view class="goods-section">
<view class="goods-item" v-for="(item, index) in recycleList" :key="index">
<image v-if="item.icon" :src="item.icon" class="goods-item-img" mode="aspectFit" />
<image v-if="item.image" :src="item.image" class="goods-item-img" mode="aspectFit" />
<view class="goods-info-wrap">
<view class="goods-header">
<text class="goods-name">{{item.name}}</text>
@ -49,7 +60,7 @@
<button class="btn-plus" @tap="updateQuantity(index, 1)">+</button>
</view>
</view>
<view class="brand-check" v-if="item.showBrandCheck" @tap="checkBrand(index)">
<view class="brand-check" v-if="item.shopCion" @tap="showBrandPopup = true">
<text>查看品牌</text>
<uni-icons type="right" size="14" color="#ff7a0e"></uni-icons>
</view>
@ -69,6 +80,8 @@
</view>
<button class="other-unrecycle-btn" disabled>+</button>
</view>
<view v-if="loadingMore" class="loading-more">加载中...</view>
<view v-else-if="finished" class="loading-more">没有更多了</view>
</scroll-view>
</view>
@ -107,7 +120,7 @@
</view>
<scroll-view class="panel-list popup-panel-list" scroll-y>
<view v-for="(item, idx) in selectedProducts" :key="idx" class="panel-item">
<image v-if="item.icon" :src="item.icon" class="panel-item-img" mode="aspectFit" />
<image v-if="item.image" :src="item.image" class="panel-item-img" mode="aspectFit" />
<view class="panel-item-info">
<text class="panel-item-name">{{item.name}}</text>
<text class="panel-item-desc">{{item.desc}}</text>
@ -183,7 +196,7 @@
<scroll-view class="brand-popup-list" scroll-y :scroll-into-view="scrollToView">
<view v-for="letter in brandIndexList" :key="letter" :id="'brand-letter-' + letter">
<view class="brand-letter">{{letter}}</view>
<view v-for="brand in filteredBrandList.filter(b => b.letter === letter)" :key="brand.name" class="brand-item">
<view v-for="brand in filteredBrandList.filter(b => b.letter === letter)" :key="brand.name" class="brand-item" @tap="openBrandConfirm(brand)">
<image :src="brand.logo" class="brand-logo" mode="aspectFit" />
<text class="brand-name">{{brand.name}}</text>
</view>
@ -200,14 +213,12 @@
<view class="rule-popup">
<view class="rule-popup-title">回收规则</view>
<scroll-view class="rule-popup-content" scroll-y>
<view class="rule-popup-desc">请完整查看以下平台回收标准不符合回收标准的物品将无法获得现金结算</view>
<view class="rule-popup-warning">以下品相问题不可回收</view>
<image :src="ruleImgUrl" class="rule-popup-img" />
<rich-text :nodes="ruleHtml" />
</scroll-view>
<button class="rule-popup-btn" @tap="closeRulePopup">我知道了</button>
<view class="rule-popup-close" @tap="closeRulePopup">
<!-- <view class="rule-popup-close" @tap="closeRulePopup">
<uni-icons type="close" size="36" color="#fff" />
</view>
</view> -->
</view>
</view>
@ -227,6 +238,22 @@
</view>
</view>
</view>
<!-- 品牌确认弹窗 -->
<view v-if="showBrandConfirm" class="brand-confirm-mask" @tap.self="closeBrandConfirm">
<view class="brand-confirm-popup">
<view class="brand-confirm-title">品牌确认提示</view>
<view class="brand-confirm-logo-wrap">
<image :src="brandConfirmInfo.logo" class="brand-confirm-logo" mode="aspectFit" />
</view>
<view class="brand-confirm-name">{{ brandConfirmInfo.name }}</view>
<view class="brand-confirm-desc">请确认所选品牌是否与实物品牌信息一致否则将无法进行回收</view>
<view class="brand-confirm-btn-row">
<button class="brand-confirm-btn retry" @tap="closeBrandConfirm">重新选择</button>
<button class="brand-confirm-btn confirm" @tap="confirmBrand">确认一致</button>
</view>
</view>
</view>
</view>
</template>
@ -238,21 +265,11 @@ export default {
return {
value:1,
ishow:true,
//
staticCategories: [
{ id: 0, name: '羽绒服' },
{ id: 1, name: '鞋子' },
{ id: 2, name: '包包' },
{ id: 3, name: '床被' },
{ id: 4, name: '品牌服饰' },
{ id: 5, name: 'T恤衬衫' }
],
staticAllProducts: {
// ...allProducts
},
//
categories: [],
allProducts: {},
allProducts: {}, // { [categoryId]: [] }
allProductsPage: {}, // { [categoryId]: }
allProductsTotal: {}, // { [categoryId]: }
pageSize: 10,
currentCategory: 0,
tabbarHeight: 0,
showDetailPanel: false,
@ -260,6 +277,11 @@ export default {
showRulePopup: false,
ruleImgUrl: '/static/回收/回收规则.png',
showPickupConfirm: false,
showBrandConfirm: false,
brandConfirmInfo: {
logo: '',
name: ''
},
brandList: [
{ logo: '/static/brand/alexander.png', name: 'Alexander McQueen/亚历山大麦昆', letter: 'A' },
{ logo: '/static/brand/alexander.png', name: 'Alexander McQueen/亚历山大麦昆', letter: 'A' },
@ -269,12 +291,17 @@ export default {
currentLetter: 'A',
scrollToView: '',
brandSearch: '',
ruleHtml: '', //
loadingMore: false,
finished: false,
pendingBrandIndex: null, // index
}
},
computed: {
//
recycleList() {
return this.allProducts[this.currentCategory] || []
const currentCategoryId = this.categories[this.currentCategory]?.id
return this.allProducts[currentCategoryId] || []
},
//
totalCount() {
@ -298,10 +325,9 @@ export default {
}
}
const total = Number(this.totalPrice)
return {
min: (total - 2.2).toFixed(1),
max: (total + 2.2).toFixed(1)
}
const min = Math.max(0, (total - 2.2)).toFixed(1)
const max = (total + 2.2).toFixed(1)
return { min, max }
},
selectedProducts() {
//
@ -311,6 +337,13 @@ export default {
if (!this.brandSearch) return this.brandList
const keyword = this.brandSearch.trim().toLowerCase()
return this.brandList.filter(b => b.name.toLowerCase().includes(keyword))
},
bannerList() {
return getApp().globalData.bannerList || []
},
categories() {
const list = getApp().globalData.pricePreviewList || []
return list.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
}
},
methods: {
@ -327,67 +360,65 @@ export default {
});
}
},
fetchClassGoodsList() {
this.$api('getClassGoodsList', {}, res => {
if (res.code === 200 && Array.isArray(res.result) && res.result.length > 0) {
this.categories = res.result.map(item => ({
id: item.categoryId,
name: item.categoryName
}))
this.allProducts = {}
res.result.forEach(item => {
this.allProducts[item.categoryId] = (item.goodsList || []).map(good => ({
...good,
quantity: 0 //
}))
})
this.currentCategory = this.categories.length > 0 ? this.categories[0].id : 0
fetchGoodsList(categoryId, page = 1, callback) {
this.$api('getClassGoodsList', {
classId: categoryId,
pageNo: page,
pageSize: this.pageSize
}, res => {
if (res.code === 200 && res.result && Array.isArray(res.result.records)) {
const oldList = this.allProducts[categoryId] || []
const newList = page === 1 ? res.result.records : oldList.concat(res.result.records)
this.$set(this.allProducts, categoryId, newList)
this.$set(this.allProductsPage, categoryId, page)
this.$set(this.allProductsTotal, categoryId, res.result.total)
}
//
if (callback) callback()
})
},
//
getCategoryItemCount(categoryId) {
getCategoryItemCount(index) {
const categoryId = this.categories[index]?.id
const categoryItems = this.allProducts[categoryId] || []
return categoryItems.reduce((sum, item) => sum + (item.quantity || 0), 0)
},
//
switchCategory(categoryId) {
this.currentCategory = categoryId
//
this.$set(this.allProducts, categoryId, [])
//
this.$api('getGoodsBrandList', { iconId: categoryId }, res => {
if (
res.code === 200 &&
res.result &&
Array.isArray(res.result.records) &&
res.result.records.length > 0
) {
//
this.$set(this.allProducts, categoryId, res.result.records.map(item => ({
...item,
quantity: 0
})))
} else {
//
if (this.staticAllProducts[categoryId]) {
this.$set(this.allProducts, categoryId, JSON.parse(JSON.stringify(this.staticAllProducts[categoryId])))
}
}
})
switchCategory(index) {
this.currentCategory = index
this.loadingMore = false
this.finished = false
const categoryId = this.categories[index]?.id
console.log(categoryId,'switchCategory')
if (!this.allProducts[categoryId]) {
this.fetchGoodsList(categoryId, 1)
}
},
//
updateQuantity(index, delta) {
const item = this.allProducts[this.currentCategory][index]
const newQuantity = (item.quantity || 0) + delta
if (newQuantity >= 0) {
this.$set(item, 'quantity', newQuantity)
const categoryId = this.categories[this.currentCategory]?.id
const item = this.allProducts[categoryId]?.[index]
if (!item) return
// 0
if (item.shopCion && (item.quantity || 0) === 0 && delta > 0) {
this.pendingBrandIndex = index
this.showBrandPopup = true //
return
}
let newQuantity = (item.quantity || 0) + delta
if (newQuantity < 0) newQuantity = 0
this.$set(item, 'quantity', newQuantity)
},
//
showRules(item) {
this.showRulePopup = true
//
this.$api('getGoodsRecycleRule', { goodsId: item.id }, res => {
if (res.code === 200 && res.result) {
this.ruleHtml = res.result
} else {
this.ruleHtml = '<p>暂无回收规则</p>'
}
this.showRulePopup = true
})
},
showMore() {
uni.showToast({
@ -426,7 +457,7 @@ export default {
//
const selectedItems = this.recycleList.filter(item => item.quantity > 0).map(item => ({
name: item.name,
icon: item.icon,
icon: item.image,
quantity: item.quantity,
unitPrice: item.price,
desc: '允许脏破烂,160码以上'
@ -494,13 +525,60 @@ export default {
closeRulePopup() {
this.showRulePopup = false
},
loadMoreGoods() {
const categoryId = this.categories[this.currentCategory]?.id
const page = (this.allProductsPage[categoryId] || 1) + 1
const total = this.allProductsTotal[categoryId] || 0
const loaded = (this.allProducts[categoryId] || []).length
if (this.loadingMore || this.finished) return
if (loaded < total) {
this.loadingMore = true
this.fetchGoodsList(categoryId, page, () => {
this.loadingMore = false
//
const newLoaded = (this.allProducts[categoryId] || []).length
this.finished = newLoaded >= (this.allProductsTotal[categoryId] || 0)
})
} else {
this.finished = true
}
},
openBrandConfirm(brand) {
this.brandConfirmInfo = {
logo: brand.logo,
name: brand.name
}
this.showBrandConfirm = true
},
closeBrandConfirm() {
this.showBrandConfirm = false
},
confirmBrand() {
this.showBrandConfirm = false
this.showBrandPopup = false
// +1
if (this.pendingBrandIndex !== null) {
const categoryId = this.categories[this.currentCategory]?.id
const item = this.allProducts[categoryId]?.[this.pendingBrandIndex]
if (item) {
this.$set(item, 'quantity', 1)
}
this.pendingBrandIndex = null
}
},
},
created() {
//
this.categories = this.staticCategories
this.allProducts = JSON.parse(JSON.stringify(this.staticAllProducts))
this.currentCategory = this.categories[0].id
this.fetchClassGoodsList()
this.currentCategory = 0
this.$nextTick(() => {
if (this.categories.length > 0) {
const firstCategoryId = this.categories[0]?.id
if (firstCategoryId) {
this.fetchGoodsList(firstCategoryId, 1)
}
}
})
},
mounted() {
this.$nextTick(() => {
@ -515,12 +593,64 @@ export default {
}).exec()
})
},
//
onPullDownRefresh() {
this.refreshData()
onLoad(options) {
if (options && options.categoryId) {
const idx = this.categories.findIndex(c => c.id == options.categoryId)
if (idx !== -1) this.currentCategory = idx
}
this.fetchGoodsList(this.categories[this.currentCategory].id, 1)
uni.$on('bannerListUpdated', () => {
this.$forceUpdate && this.$forceUpdate()
})
if (getApp().globalData.bannerList && getApp().globalData.bannerList.length > 0) {
this.$forceUpdate && this.$forceUpdate()
}
},
onUnload() {
uni.$off('bannerListUpdated')
},
onShow() {
const id = getApp().globalData.targetRecycleCategoryId
if (id) {
const trySwitch = () => {
if (this.categories.length > 0) {
const idx = this.categories.findIndex(c => String(c.id) === String(id))
if (idx !== -1) {
this.currentCategory = idx
const categoryId = this.categories[idx]?.id
if (categoryId && !this.allProducts[categoryId]) {
this.loadingMore = false
this.finished = false
this.fetchGoodsList(categoryId, 1)
}
}
getApp().globalData.targetRecycleCategoryId = null
} else {
setTimeout(trySwitch, 100)
}
}
trySwitch()
}
},
onLoad() {
this.fetchClassGoodsList()
watch: {
categories(newVal) {
const id = getApp().globalData.targetRecycleCategoryId
console.log('targetRecycleCategoryId', id)
console.log('categories:', newVal.map(c => c.id))
const idx = newVal.findIndex(c => String(c.id) === String(id))
console.log('findIndex result:', idx)
if (id && newVal.length > 0 && idx !== -1) {
this.currentCategory = idx
getApp().globalData.targetRecycleCategoryId = null
//
const categoryId = newVal[idx]?.id
if (categoryId && !this.allProducts[categoryId]) {
this.loadingMore = false
this.finished = false
this.fetchGoodsList(categoryId, 1)
}
}
}
},
}
</script>
@ -1451,4 +1581,99 @@ export default {
.uv-tabbar {
z-index: 1000;
}
.loading-more {
text-align: center;
color: #999;
padding: 20rpx 0;
font-size: 26rpx;
}
.brand-confirm-mask {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0,0,0,0.25);
z-index: 5001;
display: flex;
align-items: center;
justify-content: center;
}
.brand-confirm-popup {
width: 70vw;
max-width: 270px;
background: #fff;
border-radius: 32rpx;
box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
display: flex;
flex-direction: column;
align-items: center;
padding: 48rpx 20rpx 36rpx 20rpx;
position: relative;
}
.brand-confirm-title {
font-size: 36rpx;
color: #222;
font-weight: bold;
text-align: center;
margin-bottom: 24rpx;
}
.brand-confirm-logo-wrap {
width: 120rpx;
height: 120rpx;
background: #f8f8f8;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 18rpx;
}
.brand-confirm-logo {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
.brand-confirm-name {
font-size: 28rpx;
color: #222;
font-weight: bold;
text-align: center;
margin-bottom: 16rpx;
}
.brand-confirm-desc {
font-size: 24rpx;
color: #999;
text-align: center;
margin-bottom: 32rpx;
line-height: 1.6;
}
.brand-confirm-btn-row {
width: 100%;
display: flex;
justify-content: space-between;
gap: 24rpx;
}
.brand-confirm-btn {
flex: 1;
height: 72rpx;
border-radius: 36rpx;
font-size: 28rpx;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
border: none;
margin: 0 0;
}
.brand-confirm-btn.retry {
background: #fff;
color: #ff9c00;
border: 2rpx solid #ff9c00;
}
.brand-confirm-btn.confirm {
background: linear-gradient(to right, #ffd01e, #ff8917);
color: #fff;
border: none;
}
</style>

+ 23
- 10
pages/index/index.vue View File

@ -2,8 +2,8 @@
<view class="login-container">
<!-- 应用标题和副标题 -->
<view class="app-header">
<image src="/static/home/登录.png" mode="aspectFit"></image>
<view class="app-title">{{ '瀚海回收' }}</view>
<image :src="logoImage" alt="logo" style="width: 120rpx; height: 120rpx; display: block; margin: 0 auto;" />
<view class="app-title">{{ logoName }}</view>
<!-- <view class="app-subtitle">旧物很有用·回收很简单</view> -->
</view>
@ -73,6 +73,16 @@ export default {
needPhone: false //
}
},
computed: {
logoImage() {
const item = this.configData.find(i => i.keyName === 'logo_image')
return item ? item.keyContent : ''
},
logoName() {
const item = this.configData.find(i => i.keyName === 'logo_name')
return item ? item.keyContent : ''
}
},
onLoad() {
this.getConfigData()
},
@ -178,14 +188,20 @@ export default {
uni.setStorageSync('openid',res.result.userInfo && res.result.userInfo.appletOpenid);
getApp().globalData.login_status = true;
if (res.result.userInfo) {
// userInfo
const userInfo = res.result.userInfo;
if (!userInfo.avatarUrl || !userInfo.nickName) {
uni.navigateTo({
url: '/pages/wxUserInfo'
});
} else {
uni.reLaunch({
url: '/pages/component/home'
});
}
} else {
// userInfo
self.needPhone = true;
self.$refs.privacyPopup.open();
uni.navigateTo({
url: '/pages/wxUserInfo'
});
}
}
})
@ -199,10 +215,7 @@ export default {
//
handleRejectPrivacy() {
uni.showToast({
title: '需要同意隐私政策才能使用服务',
icon: 'none'
})
uni.reLaunch({ url: '/pages/component/home' });
},
//


+ 1
- 1
pages/subcomponent/admin_customer.vue View File

@ -114,7 +114,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()()()
},
//
openEmailPopup() {


+ 1
- 1
pages/subcomponent/admin_edit_profile.vue View File

@ -95,7 +95,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()


+ 1
- 1
pages/subcomponent/admin_faq.vue View File

@ -96,7 +96,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
openEmailPopup() { this.showEmailPopup = true },
handleCloseEmailPopup() { this.showEmailPopup = false },


+ 1
- 1
pages/subcomponent/apply.vue View File

@ -180,7 +180,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
navigateBack() {
uni.navigateBack()


+ 1
- 1
pages/subcomponent/brand.vue View File

@ -111,7 +111,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()


+ 1
- 1
pages/subcomponent/detail.vue View File

@ -239,7 +239,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()


+ 48
- 16
pages/subcomponent/edit_profile.vue View File

@ -10,7 +10,7 @@
</view>
<!-- 个人信息表单 -->
<view class="info-container">
<view class="info-container" :style="infoContainerStyle">
<view class="info-card">
<text class="section-title">个人信息</text>
<view class="divider"></view>
@ -106,6 +106,11 @@ export default {
maskedPhone() {
//
return this.userInfo.phone ? '●'.repeat(this.userInfo.phone.length) : ''
},
infoContainerStyle() {
return {
marginTop: this.navBarHeightRpx + 'rpx'
}
}
},
onLoad() {
@ -133,7 +138,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()
@ -195,6 +200,15 @@ export default {
.edit-profile {
min-height: 100vh;
background-color: #f5f5f5;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
padding-bottom: 140rpx;
box-sizing: border-box;
}
.nav-bar {
@ -236,20 +250,22 @@ export default {
}
.info-container {
margin-top: 48rpx;
/* 移除左右padding,留白交给卡片自身 */
flex: 1;
overflow-y: auto;
padding: 0 40rpx 0;
box-sizing: border-box;
}
.info-card {
background: linear-gradient(180deg, #fff7e6 0%, #fff 100%);
border-radius: 24rpx;
box-shadow: 0 8rpx 32rpx rgba(60, 167, 250, 0.08);
padding: 48rpx 32rpx 32rpx 32rpx;
padding: 48rpx 40rpx 32rpx 40rpx;
width: 100%;
max-width: 700rpx;
margin: 0 auto;
margin-top: 0;
position: relative;
box-sizing: border-box;
}
.section-title {
font-size: 36rpx;
@ -263,6 +279,12 @@ export default {
}
.info-item {
margin-bottom: 24rpx;
width: 100%;
box-sizing: border-box;
min-height: 60rpx;
display: flex;
flex-direction: column;
justify-content: center;
.label {
font-size: 28rpx;
color: #333;
@ -277,12 +299,23 @@ export default {
border: none;
background: none;
outline: none;
box-sizing: border-box;
height: 80rpx;
line-height: 48rpx;
vertical-align: middle;
}
.phone-input {
display: flex;
align-items: center;
width: 100%;
box-sizing: border-box;
input {
flex: 1;
width: 100%;
box-sizing: border-box;
height: 80rpx;
line-height: 48rpx;
vertical-align: middle;
}
}
}
@ -290,25 +323,23 @@ export default {
.avatar-container {
display: flex;
gap: 20rpx;
width: 100%;
box-sizing: border-box;
}
.avatar-box {
.avatar-box, .new-avatar {
max-width: 120rpx;
width: 120rpx;
height: 120rpx;
background: #f5f5f5;
border-radius: 18rpx;
background: #f5f5f5;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.new-avatar {
width: 120rpx;
height: 120rpx;
border-radius: 18rpx;
.avatar-box image, .new-avatar {
width: 100%;
height: 100%;
}
}
.save-button {
@ -323,6 +354,7 @@ export default {
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(255, 149, 0, 0.08);
z-index: 10;
text {
color: #fff;
font-size: 32rpx;


+ 1
- 1
pages/subcomponent/faq.vue View File

@ -108,7 +108,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
//
openEmailPopup() {


+ 390
- 0
pages/subcomponent/inspection-detail.vue View File

@ -0,0 +1,390 @@
<template>
<view class="inspection-detail-page">
<!-- 顶部导航栏 -->
<view class="nav-bar" :style="{height: navBarTotalHeight + 'px', paddingTop: statusBarHeight + 'px'}">
<view class="nav-bar-left" @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" />
<uni-icons type="camera" size="22" color="#222" style="margin-left: 12rpx;" />
</view>
</view>
<view class="main-content safe-area-inset-bottom" :style="{marginTop: navBarTotalHeight + 'px'}">
<view v-if="status === 'problem'" class="card card-problem">
<view class="card-header">
<view class="dot dot-orange"></view>
<text class="card-title card-title-orange">质检有问题不可回收</text>
</view>
<view class="card-desc card-desc-orange">
感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣并完成质检经平台专业质检员严格查验发现商品存在质量问题
</view>
<view class="timeline">
<view class="timeline-item">
<view class="timeline-dot"></view>
<view class="timeline-content">
<view class="timeline-title-row">
<text class="timeline-title">质检说明</text>
<text class="timeline-time">{{testingTime}}</text>
</view>
<view v-for="(item, idx) in problemList" :key="idx" class="problem-block">
<view class="problem-index">{{(idx+1).toString().padStart(2, '0')}} / {{problemList.length.toString().padStart(2, '0')}}</view>
<view class="problem-title">{{testingInstructions || '质量问题'}}</view>
<view class="problem-divider"></view>
<view class="problem-label">质量问题实拍</view>
<view class="problem-images">
<image v-for="(img, i) in item.images" :key="i" :src="img" class="problem-img" mode="aspectFill" />
</view>
</view>
</view>
</view>
<view class="timeline-item">
<view class="timeline-dot gray"></view>
<view class="timeline-content">
<view class="timeline-title-row">
<text class="timeline-title">开始查验质检</text>
<text class="timeline-time">{{testingTime}}</text>
</view>
<view class="timeline-desc">
感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣正在进行逐件查验
</view>
</view>
</view>
</view>
</view>
<view v-else-if="status === 'qualified'" class="card card-qualified">
<view class="card-header">
<view class="dot dot-green"></view>
<text class="card-title card-title-green">质检合格</text>
</view>
<view class="card-desc card-desc-green">
感谢您参与旧衣回收活动支持环保事业\n经平台专业质检员严格查验商品合格
</view>
<view class="timeline">
<view class="timeline-item">
<view class="timeline-dot"></view>
<view class="timeline-content">
<view class="timeline-title-row">
<text class="timeline-title">质检说明</text>
<text class="timeline-time">{{testingTime}}</text>
</view>
<view class="problem-block">
<view class="problem-index">01 / {{qualifiedImages.length < 10 ? '0' + qualifiedImages.length : qualifiedImages.length}}</view>
<view class="problem-title">质检图片</view>
<view class="problem-divider"></view>
<view class="problem-images">
<image v-for="(img, i) in qualifiedImages" :key="i" :src="img" class="problem-img" mode="aspectFill" />
</view>
</view>
</view>
</view>
<view class="timeline-item">
<view class="timeline-dot gray"></view>
<view class="timeline-content">
<view class="timeline-title-row">
<text class="timeline-title">开始查验质检</text>
<text class="timeline-time">{{testingTime}}</text>
</view>
<view class="timeline-desc">
感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣正在进行逐件查验
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
status: 'problem', // 'problem' or 'qualified'
testingStatus: '',
testingInstructions: '',
testingTime: '',
testingImages: [],
statusBarHeight: 0,
navBarHeight: 44,
navBarTotalHeight: 44,
//
problemList: [
{
title: '大面积破损',
images: [
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png'
]
},
{
title: '大面积破损',
images: [
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png'
]
},
{
title: '大面积破损',
images: [
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png'
]
}
],
//
qualifiedImages: [
'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png'
]
}
},
onLoad(options) {
//
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
this.navBarHeight = 44
this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
// options.status = 'problem'/'qualified'
if (options && options.status) {
this.status = options.status
}
if (options.testingStatus) {
this.testingStatus = options.testingStatus
}
if (options.testingInstructions) {
this.testingInstructions = decodeURIComponent(options.testingInstructions)
}
if (options.testingTime) {
this.testingTime = decodeURIComponent(options.testingTime)
}
if (options.testingImages) {
//
this.testingImages = decodeURIComponent(options.testingImages).split(',')
}
// status problemList/qualifiedImages
if (this.status === 'problem') {
this.problemList = [
{
title: this.testingInstructions || '质量问题',
images: this.testingImages
}
]
} else if (this.status === 'qualified') {
this.qualifiedImages = this.testingImages
}
},
methods: {
navigateBack() {
uni.navigateBack()
}
}
}
</script>
<style lang="scss" scoped>
.inspection-detail-page {
min-height: 100vh;
background: #f7f7f7;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
}
.nav-bar {
position: fixed;
left: 0;
top: 0;
right: 0;
z-index: 1000;
background: #fff;
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
display: flex;
align-items: center;
justify-content: space-between;
height: 100rpx;
padding: 0 24rpx;
.nav-bar-left, .nav-bar-right {
display: flex;
align-items: center;
min-width: 60rpx;
}
.nav-bar-title {
flex: 1;
text-align: center;
font-size: 34rpx;
font-weight: bold;
color: #222;
}
max-width: 750rpx;
margin: 0 auto;
width: 100%;
box-sizing: border-box;
}
.main-content {
padding: 32rpx 0 0 0;
width: 100%;
max-width: 750rpx;
margin: 0 auto;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
overflow: hidden;
}
.safe-area-inset-bottom {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.card {
margin: 0 24rpx;
border-radius: 32rpx;
padding: 32rpx 32rpx 24rpx 32rpx;
box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08);
background: #fff;
max-width: 700rpx;
width: 100%;
box-sizing: border-box;
position: relative;
}
.card-problem {
background: linear-gradient(180deg, #fff7e6 0%, #fff 40%);
}
.card-qualified {
background: linear-gradient(180deg, #e8ffe0 0%, #fff 100%);
}
.card-header {
display: flex;
align-items: center;
margin-bottom: 12rpx;
}
.dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
margin-right: 12rpx;
&.dot-orange { background: #ffa800; }
&.dot-green { background: #13ac47; }
&.gray { background: #bbb; }
}
.card-title {
font-size: 30rpx;
font-weight: bold;
}
.card-title-orange { color: #ffa800; }
.card-title-green { color: #13ac47; }
.card-desc {
font-size: 24rpx;
color: #888;
margin-bottom: 24rpx;
line-height: 1.7;
margin-left: 32rpx + 16rpx;
}
.card-desc-orange { color: #888; }
.card-desc-green { color: #888; }
.timeline {
position: relative;
margin-left: 0;
padding-left: 0;
}
.timeline:before {
content: '';
position: absolute;
left: 8rpx;
top: 0;
bottom: 0;
width: 2rpx;
background: #eee;
z-index: 0;
}
.timeline-item {
display: flex;
align-items: flex-start;
margin-bottom: 32rpx;
position: relative;
}
.timeline-dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background: #bbb;
margin-right: 16rpx;
margin-top: 8rpx;
flex-shrink: 0;
position: relative;
z-index: 1;
}
.timeline-dot.dot-orange { background: #ffa800; }
.timeline-dot.dot-green { background: #13ac47; }
.timeline-dot.gray { background: #bbb; }
.timeline-content {
flex: 1;
min-width: 0;
}
.timeline-title-row {
display: flex;
align-items: center;
margin-bottom: 12rpx;
}
.timeline-title {
font-size: 26rpx;
color: #222;
font-weight: bold;
margin-right: 16rpx;
}
.timeline-time {
font-size: 22rpx;
color: #bbb;
}
.problem-block {
background: #f7f8fa;
border-radius: 20rpx;
padding: 24rpx 20rpx 16rpx 20rpx;
margin-bottom: 20rpx;
max-width: 100%;
box-sizing: border-box;
}
.problem-index {
font-size: 22rpx;
color: #bbb;
margin-bottom: 6rpx;
}
.problem-title {
font-size: 26rpx;
color: #222;
font-weight: bold;
margin-bottom: 8rpx;
}
.problem-divider {
border-bottom: 2rpx dashed #ddd;
margin: 12rpx 0 10rpx 0;
}
.problem-label {
font-size: 22rpx;
color: #bbb;
margin-bottom: 8rpx;
}
.problem-images {
display: flex;
flex-wrap: wrap;
gap: 12rpx;
max-width: 100%;
}
.problem-img {
width: 120rpx;
height: 120rpx;
border-radius: 12rpx;
background: #eee;
max-width: 40vw;
max-height: 40vw;
}
.timeline-desc {
font-size: 24rpx;
color: #888;
margin-top: 8rpx;
line-height: 1.7;
}
</style>

+ 143
- 28
pages/subcomponent/inspection-report.vue View File

@ -24,10 +24,10 @@
</view>
<!-- 主内容区卡片悬浮覆盖打钩区 -->
<view class="main-content">
<view class="inspection-card">
<view v-if="showQualified && goodsList.length" class="inspection-card">
<view class="report-title">质检合格</view>
<view class="goods-list">
<view class="goods-item" v-for="(item, i) in goodsList" :key="i">
<view class="goods-item" v-for="(item, i) in goodsList" :key="i" @tap="goToInspectionDetail('qualified')">
<image class="goods-img" :src="item.img" mode="aspectFit" />
<view class="goods-info">
<view class="goods-row">
@ -41,7 +41,6 @@
<text class="goods-unit">/</text>
<text class="goods-count">x{{item.count}}</text>
</view>
<view class="goods-total">{{item.total}}</view>
</view>
</view>
</view>
@ -51,6 +50,58 @@
<text>结算金额<text class="highlight">{{totalAmount}}</text></text>
</view>
</view>
<view v-if="showProblem && problemList.length" class="inspection-card problem-card">
<view class="report-title">质量问题</view>
<view class="goods-list">
<view class="goods-item" v-for="(item, i) in problemList" :key="i" @tap="goToInspectionDetail('problem')">
<image class="goods-img" :src="item.img" mode="aspectFit" />
<view class="goods-info">
<view class="goods-row">
<view class="goods-name">{{item.name}}</view>
<view v-if="item.detail" class="detail-link">查看详情 <uni-icons type="right" size="16" color="#bbb" /></view>
</view>
<view class="goods-desc">{{item.desc}}</view>
<view class="goods-bottom-row">
<view class="goods-price-row problem-price-row">
<text class="goods-price">{{item.price}}</text>
<text class="goods-unit">/</text>
<text class="goods-count">x{{item.count}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="summary-row">
<text>件数<text class="highlight">{{problemCount}}</text> </text>
<text>结算金额<text class="highlight">{{problemAmount}}</text></text>
</view>
</view>
<view v-if="showUnrecyclable && unrecyclableList.length" class="inspection-card problem-card">
<view class="report-title">不可回收</view>
<view class="goods-list">
<view class="goods-item" v-for="(item, i) in unrecyclableList" :key="i">
<image class="goods-img" :src="item.img" mode="aspectFit" />
<view class="goods-info">
<view class="goods-row">
<view class="goods-name">{{item.name}}</view>
</view>
<view class="goods-desc">{{item.desc}}</view>
<view class="goods-bottom-row">
<view class="goods-price-row">
<text class="goods-price">{{item.price}}</text>
<text class="goods-unit">/</text>
<text class="goods-count">x{{item.count}}</text>
</view>
<view class="goods-total">0</view>
</view>
</view>
</view>
</view>
<view class="summary-row">
<text>件数<text class="highlight">{{unrecyclableCount}}</text> </text>
<text>结算金额<text class="highlight">0</text></text>
</view>
</view>
</view>
</view>
</template>
@ -66,25 +117,13 @@ export default {
navBarHeight: 14,
navBarTotalHeight: 14,
featureTags: ['透明检', '专业验', '公正评', '逐件验'],
goodsList: [
{
img: '/static/goods1.png',
name: '羽绒服',
desc: '允许脏破烂,160码以上',
price: 8,
count: 8,
total: 64
},
{
img: '/static/goods2.png',
name: '品牌羽绒服',
desc: '允许脏破烂,160码以上',
price: 10,
count: 1,
total: 8,
detail: true
}
]
goodsList: [], //
problemList: [], //
unrecyclableList: [], //
reportData: null,
showQualified: false,
showProblem: false,
showUnrecyclable: false
}
},
computed: {
@ -93,22 +132,87 @@ export default {
},
totalAmount() {
return this.goodsList.reduce((sum, item) => sum + item.total, 0).toFixed(1)
},
problemCount() {
return this.problemList.reduce((sum, item) => sum + item.count, 0)
},
problemAmount() {
return this.problemList.reduce((sum, item) => sum + item.total, 0).toFixed(1)
},
unrecyclableCount() {
return this.unrecyclableList.reduce((sum, item) => sum + item.count, 0)
}
},
onLoad() {
onLoad(options) {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
this.navBarHeight = 14
this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
// id goodsId id
const goodsId = options.id || options.goodsId
if (goodsId) {
this.fetchQualityReport(goodsId)
}
},
methods: {
async fetchQualityReport(goodsId) {
// this.$api
this.$api && this.$api('getQualityReport', { goodsId }, res => {
if (res && res.code === 200 && res.result) {
this.reportData = res.result
//
const status = Number(res.result.testingStatus)
// 0: 1: 2:
this.showQualified = status === 1 || status === 0 // 01
this.showProblem = status === 0 || status === 1 // 01
this.showUnrecyclable = status === 2
// /
if (status === 1) {
this.goodsList = [this.mapReportToGoods(res.result)]
this.problemList = []
this.unrecyclableList = []
} else if (status === 0) {
this.goodsList = []
this.problemList = [this.mapReportToGoods(res.result, true)]
this.unrecyclableList = []
} else if (status === 2) {
this.goodsList = []
this.problemList = []
this.unrecyclableList = [this.mapReportToGoods(res.result)]
}
}
})
},
mapReportToGoods(data, isProblem = false) {
return {
img: data.image,
name: data.title || '未知品类',
desc: data.details || '',
price: data.onePrice || 0,
count: data.num || 1,
total: (data.onePrice || 0) * (data.num || 1),
detail: true,
problemDesc: isProblem ? (data.testingInstructions || '') : ''
}
},
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
navigateBack() {
uni.navigateBack()
},
goToInspectionDetail(status) {
//
const d = this.reportData || {}
uni.navigateTo({
url: `/pages/subcomponent/inspection-detail?status=${status}` +
`&testingStatus=${d.testingStatus || ''}` +
`&testingInstructions=${encodeURIComponent(d.testingInstructions || '')}` +
`&testingTime=${encodeURIComponent(d.testingTime || '')}` +
`&testingImages=${encodeURIComponent(d.testingImages || '')}`
})
}
}
}
@ -118,6 +222,8 @@ export default {
.inspection-page {
min-height: 100vh;
background: #422525;
height: 100vh;
overflow: hidden;
// padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
}
@ -179,6 +285,7 @@ export default {
display: flex;
flex-direction: column;
align-items: stretch;
justify-content: center;
}
.feature-desc {
@ -192,7 +299,7 @@ export default {
}
.feature-tags {
margin: 0 32rpx;
// margin: 0 32rpx;
background: #533030;
border-radius: 12rpx;
box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08);
@ -235,7 +342,7 @@ export default {
margin-top: 20rpx;
padding-top: 88rpx;
background: linear-gradient(180deg, #fef7e6 0%, #fff 50%);
min-height: 100vh;
height: calc(100vh - 88rpx);
width: 100vw;
box-sizing: border-box;
position: relative;
@ -315,12 +422,12 @@ export default {
align-items: baseline;
.goods-price {
font-size: 26rpx;
color: #f79400;
color: #bbb;
font-weight: bold;
}
.goods-unit {
font-size: 24rpx;
color: #f79400;
color: #bbb;
margin-left: 2rpx;
}
.goods-count {
@ -370,4 +477,12 @@ export default {
margin-right: 10rpx;
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
}
.problem-card {
margin-top: 40rpx;
}
.problem-price-row {
color: #bbb !important;
}
</style>

+ 1
- 1
pages/subcomponent/inspection.vue View File

@ -151,7 +151,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()


+ 21
- 7
pages/subcomponent/order.vue View File

@ -171,7 +171,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()
@ -253,15 +253,16 @@ export default {
<style lang="scss" scoped>
.container {
min-height: 100vh;
background: #f8f8f8;
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
overflow: hidden;
height: 100vh;
}
.nav-bar {
display: flex;
align-items: center;
height: calc(88rpx + var(--status-bar-height));
height: calc(150rpx + var(--status-bar-height));
padding: 0 32rpx;
padding-top: var(--status-bar-height);
background: #fff;
@ -298,9 +299,12 @@ export default {
}
.content {
padding: 30rpx;
margin-top: calc(88rpx + var(--status-bar-height));
min-height: calc(100vh - 88rpx - var(--status-bar-height));
padding: 30rpx 0 0 0;
margin-top: calc(150rpx + var(--status-bar-height) + 80rpx);
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
box-sizing: border-box;
.page-header {
@ -326,6 +330,12 @@ export default {
background: #f5f5f5;
border-radius: 8rpx;
margin-bottom: 30rpx;
position: fixed;
top: calc(150rpx + var(--status-bar-height));
left: 0;
width: 100%;
z-index: 998;
box-sizing: border-box;
.tab-item {
flex: 1;
@ -362,7 +372,11 @@ export default {
}
.order-list {
height: calc(100vh - 400rpx);
flex: 1;
min-height: 0;
overflow-y: scroll;
padding-bottom: env(safe-area-inset-bottom);
box-sizing: border-box;
}
.order-card {


+ 1
- 1
pages/subcomponent/order_edit.vue View File

@ -243,7 +243,7 @@
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()


+ 1
- 1
pages/subcomponent/orders.vue View File

@ -328,7 +328,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
navigateBack() {
uni.navigateBack()


+ 24
- 47
pages/subcomponent/pickup.vue View File

@ -155,48 +155,7 @@ export default {
selectedAddress: null,
selectedTime: '',
agreed: false,
selectedItems: [
{
name: '羽绒服',
icon: '/static/home/羽绒服.png',
desc: '允许脏破烂,160码以上',
unitPrice: 8,
quantity: 8
},
{
name: '品牌服饰',
icon: '/static/home/品牌服饰.png',
desc: '允许脏破烂,160码以上',
unitPrice: 8,
quantity: 1
},{
name: '羽绒服',
icon: '/static/home/羽绒服.png',
desc: '允许脏破烂,160码以上',
unitPrice: 8,
quantity: 8
},
{
name: '品牌服饰',
icon: '/static/home/品牌服饰.png',
desc: '允许脏破烂,160码以上',
unitPrice: 8,
quantity: 1
},{
name: '羽绒服',
icon: '/static/home/羽绒服.png',
desc: '允许脏破烂,160码以上',
unitPrice: 8,
quantity: 8
},
{
name: '品牌服饰',
icon: '/static/home/品牌服饰.png',
desc: '允许脏破烂,160码以上',
unitPrice: 8,
quantity: 1
}
],
selectedItems: [],
showTimePicker: false,
currentDateTab: 0,
dateTabs: ['今天 04-20', '明天 04-21', '后天 04-22', '周一 04-23', '周二 04-24', '周三 04-25'],
@ -236,9 +195,10 @@ export default {
//
uni.$on('addressSelected', (address) => {
console.log('接收到选中的地址:', address)
this.selectedAddress = address
this.address = address.address
// addressDetails
if (address.addressDetails) this.selectedAddress.addressDetails = address.addressDetails
this.$forceUpdate()
})
@ -251,6 +211,8 @@ export default {
} catch (e) {}
this.navBarHeight = navBarHeight
this.navBarHeightRpx = Math.round(navBarHeight * 750 / sysInfo.windowWidth)
this.getAddressList();
},
onUnload() {
//
@ -263,15 +225,15 @@ 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(1)}~${(total * 1.1).toFixed(1)}`
return `${(total * 0.92).toFixed(2)}~${(total * 1.1).toFixed(2)}`
},
canSubmit() {
return this.agreed && this.selectedItems.length > 0 && this.selectedTime && this.displayAddress
},
displayAddress() {
console.log('displayAddress computed:', this.selectedAddress)
if (this.selectedAddress) {
return this.selectedAddress.address
// address addressDetails
return (this.selectedAddress.address || '') + (this.selectedAddress.addressDetails ? ' ' + this.selectedAddress.addressDetails : '')
}
return ''
}
@ -280,7 +242,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()
@ -352,6 +314,21 @@ export default {
},
toggleExpandOrder() {
this.showAllItems = !this.showAllItems
},
async getAddressList() {
const res = await this.$api('getAddressList', {});
if (res && res.code === 200 && res.result && res.result.records) {
const defaultAddr = res.result.records.find(item => item.defaultFlag === 'Y');
if (defaultAddr) {
this.selectedAddress = defaultAddr;
this.address = defaultAddr.address;
// addressDetails
if (defaultAddr.addressDetails) this.selectedAddress.addressDetails = defaultAddr.addressDetails
} else {
this.selectedAddress = null;
this.address = '';
}
}
}
}
}


+ 1
- 1
pages/subcomponent/promo-qrcode.vue View File

@ -60,7 +60,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
navigateBack() {
uni.navigateBack()


+ 1
- 1
pages/subcomponent/promotion.vue View File

@ -166,7 +166,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
navigateBack() {
uni.navigateBack()


+ 1
- 1
pages/subcomponent/promotion_info.vue View File

@ -113,7 +113,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
navigateBack() {
uni.navigateBack()


+ 1
- 1
pages/subcomponent/recycle_rules.vue View File

@ -142,7 +142,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()


+ 64
- 30
pages/subcomponent/select.vue View File

@ -21,7 +21,7 @@
<text class="phone">{{item.phone}}</text>
<text v-if="item.defaultFlag === 'Y'" class="default-tag">默认</text>
</view>
<view class="address-text">{{item.address}}</view>
<view class="address-text">{{item.address}} {{item.addressDetails}}</view>
<view class="dashed-line"></view>
<view class="address-actions">
<view class="action" @tap="setDefault(item.id)">
@ -53,7 +53,7 @@
<view v-if="showAddressModal" class="address-modal">
<view class="modal-header">
<text class="close-btn" @tap="closeAddressModal">关闭</text>
<text class="modal-title">新建地址</text>
<text class="modal-title">{{form.id ? '编辑地址' : '新建地址'}}</text>
</view>
<view class="modal-form">
<view class="form-item">
@ -198,7 +198,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
getAddressList(callback) {
this.$api('getAddressList', {}, res => {
@ -248,13 +248,24 @@ export default {
})
},
editAddress(item) {
uni.navigateTo({
url: '/pages/component/add'
})
this.showAddressModal = true
this.form = {
id: item.id,
name: item.name,
phone: item.phone,
region: [],
address: item.address,
addressDetails: item.addressDetails,
defaultFlag: item.defaultFlag
}
this.regionIndex = [0, 0, 0]
this.cities = this.provinces[0]?.children || []
this.districts = this.cities[0]?.children || []
},
goToAddAddress() {
this.showAddressModal = true
this.form = {
id: undefined,
name: '',
phone: '',
region: [],
@ -270,7 +281,8 @@ export default {
uni.$emit('addressSelected', {
name: address.name,
phone: address.phone,
address: address.address
address: address.address,
addressDetails: address.addressDetails
})
uni.navigateBack()
}
@ -283,18 +295,22 @@ export default {
if (!this.form.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' })
if (!this.form.address) return uni.showToast({ title: '请选择地区', icon: 'none' })
if (!this.form.addressDetails) return uni.showToast({ title: '请输入详细地址', icon: 'none' })
this.$api('saveOrUpdateAddress',{
name:this.form.name,
phone:this.form.phone,
address:this.form.address,
addressDetails:this.form.addressDetails
},(res)=>{
if(res.code == 200){
uni.showToast({ title: '保存成功', icon: 'success' })
this.closeAddressModal()
this.$forceUpdate();
}
})
const params = {
name: this.form.name,
phone: this.form.phone,
address: this.form.address,
addressDetails: this.form.addressDetails,
defaultFlag: this.form.defaultFlag
}
if (this.form.id) params.id = this.form.id
this.$api('saveOrUpdateAddress', params, (res) => {
if(res.code == 200){
uni.showToast({ title: '保存成功', icon: 'success' })
this.closeAddressModal()
//
this.getAddressList()
}
})
},
onRegionChange(e) {
let [pIdx, cIdx, dIdx] = e.detail.value
@ -326,15 +342,24 @@ export default {
this.showRegionPicker = false
},
setDefault(id) {
this.$api('updateDefaultAddress',{id:id},(res)=>{
console.log(res)
if(res.code == 200){
this.$api('getAddressList', {}, res => {
console.log(res,'res');
this.addressList = res.result.records
})
}
})
//
const address = this.addressList.find(item => item.id === id)
//
const defaultFlag = address.defaultFlag === 'Y' ? 'N' : 'Y'
this.$api('saveOrUpdateAddress', {
id: id,
defaultFlag: defaultFlag
}, (res) => {
if(res.code == 200) {
uni.showToast({
title: defaultFlag === 'Y' ? '设置成功' : '已取消默认',
icon: 'success'
})
//
this.getAddressList()
}
})
},
deleteAddress(id) {
uni.showModal({
@ -343,7 +368,14 @@ export default {
success: (res) => {
if (res.confirm) {
this.$api('deleteAddress', {id:id}, res => {
console.log(res);
if(res.code == 200) {
uni.showToast({
title: '删除成功',
icon: 'success'
})
//
this.getAddressList()
}
})
}
}
@ -433,8 +465,10 @@ export default {
.address-list {
padding: 32rpx;
margin-top: calc(88rpx + var(--status-bar-height));
min-height: calc(100vh - 88rpx - var(--status-bar-height) - 140rpx - env(safe-area-inset-bottom));
height: calc(100vh - 88rpx - var(--status-bar-height) - 140rpx - env(safe-area-inset-bottom));
box-sizing: border-box;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
.address-item {
background: #fff;


+ 1
- 1
pages/subcomponent/upgrad.vue View File

@ -106,7 +106,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
navigateBack() {
uni.navigateBack()


+ 1
- 1
pages/subcomponent/wallet.vue View File

@ -110,7 +110,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()


+ 1
- 1
pages/subcomponent/withdraw.vue View File

@ -86,7 +86,7 @@ export default {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
this.stopPullRefresh()
uni.stopPullRefresh()
},
goBack() {
uni.navigateBack()


+ 5
- 6
pages/wxUserInfo.vue View File

@ -14,7 +14,7 @@
头像
</view>
<view class="">
<image :src="userInfo.headImage" v-if="userInfo.headImage" style="width: 60rpx;height: 60rpx;"
<image :src="userInfo.avatarUrl" v-if="userInfo.avatarUrl" style="width: 60rpx;height: 60rpx;"
mode=""></image>
<image src="/static/暂未登录 请先登录.png" v-else style="width: 50rpx;height: 50rpx;" mode=""></image>
@ -41,7 +41,7 @@
data() {
return {
userInfo: {
headImage: '',
avatarUrl: '',
nickName: '',
}
};
@ -54,13 +54,12 @@
self.$Oss.ossUpload(res.target.avatarUrl)
.then(url => {
console.log(url);
self.userInfo.headImage = url
self.userInfo.avatarUrl = url
})
},
submit() {
let self = this
console.log(self.userInfo.headImage,'111');
console.log(self.userInfo.avatarUrl,'111');
uni.createSelectorQuery().in(this)
.select("#nickName")
.fields({
@ -73,7 +72,7 @@
self.userInfo.phone = getApp().globalData.phone
}
if (self.$utils.verificationAll(self.userInfo, {
headImage: '请选择头像',
avatarUrl: '请选择头像',
nickName: '请填写昵称',
})) {
return


+ 2
- 0
utils/router-interception.js View File

@ -11,6 +11,8 @@ const whiteList = [
'/pages/component/my',
'/pages/component/home',
'/pages/wxUserInfo',
'/pages/subcomponent/inspection-report.vue',
'/pages/subcomponent/inspection-detail.vue',
{
pattern: /^\/pages\/index\/*/
}


Loading…
Cancel
Save