前端-胡立永 4 weeks ago
parent
commit
d767f1647a
4 changed files with 46 additions and 15 deletions
  1. +1
    -1
      api/model/recyclingDestination.js
  2. +1
    -0
      pages/component/home.vue
  3. +43
    -13
      pages/component/recycle.vue
  4. +1
    -1
      pages/mine/questionDetail.vue

+ 1
- 1
api/model/recyclingDestination.js View File

@ -14,7 +14,7 @@ const api = {
}, },
// 联系客服问题相关详情 // 联系客服问题相关详情
getQuestionListDetail: { getQuestionListDetail: {
url: '/recycle-admin/applet/index/getQuestionListDetail',
url: '/recycle-admin/applet/order/getQuestionListDetail',
method: 'GET', method: 'GET',
auth : false, auth : false,
}, },


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

@ -734,6 +734,7 @@
image { image {
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
border-radius: 50%;
} }
.location { .location {


+ 43
- 13
pages/component/recycle.vue View File

@ -232,13 +232,13 @@
<text class="brand-popup-title">可回收的品牌</text> <text class="brand-popup-title">可回收的品牌</text>
</view> </view>
<view class="brand-popup-search"> <view class="brand-popup-search">
<input class="brand-search-input" v-model="brandSearch" placeholder="请输入要查询的内容" />
<input class="brand-search-input" v-model="brandSearch" placeholder="请输入要查询的内容" @input="onBrandSearchInput" />
</view> </view>
<scroll-view class="brand-popup-list" scroll-y :scroll-into-view="scrollToView"> <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 v-for="letter in brandIndexList" :key="letter" :id="'brand-letter-' + letter">
<view class="brand-letter">{{letter}}</view> <view class="brand-letter">{{letter}}</view>
<view v-for="brand in filteredBrandList.filter(b => b.letter === letter)" :key="brand.name" class="brand-item" @click="openBrandConfirm(brand)"> <view v-for="brand in filteredBrandList.filter(b => b.letter === letter)" :key="brand.name" class="brand-item" @click="openBrandConfirm(brand)">
<image :src="brand.image" class="brand-logo" mode="aspectFit" />
<image :src="brand.logo" class="brand-logo" mode="aspectFit" />
<text class="brand-name">{{brand.name}}</text> <text class="brand-name">{{brand.name}}</text>
</view> </view>
</view> </view>
@ -286,7 +286,7 @@
<view class="brand-confirm-popup"> <view class="brand-confirm-popup">
<view class="brand-confirm-title">品牌确认提示</view> <view class="brand-confirm-title">品牌确认提示</view>
<view class="brand-confirm-logo-wrap"> <view class="brand-confirm-logo-wrap">
<image :src="brandConfirmInfo.image" class="brand-confirm-logo" mode="aspectFit" />
<image :src="brandConfirmInfo.logo" class="brand-confirm-logo" mode="aspectFit" />
</view> </view>
<view class="brand-confirm-name">{{ brandConfirmInfo.name }}</view> <view class="brand-confirm-name">{{ brandConfirmInfo.name }}</view>
<view class="brand-confirm-desc">请确认所选品牌是否与实物品牌信息一致否则将无法进行回收</view> <view class="brand-confirm-desc">请确认所选品牌是否与实物品牌信息一致否则将无法进行回收</view>
@ -306,7 +306,7 @@
</view> </view>
<scroll-view class="brand-reduce-popup-list" scroll-y> <scroll-view class="brand-reduce-popup-list" scroll-y>
<view v-for="brand in reduceBrandList" :key="brand.brandId" class="brand-item" @click="selectReduceBrand(brand)"> <view v-for="brand in reduceBrandList" :key="brand.brandId" class="brand-item" @click="selectReduceBrand(brand)">
<image :src="brand.image" class="brand-logo" mode="aspectFit" />
<image :src="brand.logo" class="brand-logo" mode="aspectFit" />
<text class="brand-name">{{brand.name}}</text> <text class="brand-name">{{brand.name}}</text>
</view> </view>
</scroll-view> </scroll-view>
@ -338,7 +338,7 @@ export default {
showPickupConfirm: false, showPickupConfirm: false,
showBrandConfirm: false, showBrandConfirm: false,
brandConfirmInfo: { brandConfirmInfo: {
image: '',
logo: '',
name: '' name: ''
}, },
brandList: [], brandList: [],
@ -359,6 +359,8 @@ export default {
loadOptions: null, // options loadOptions: null, // options
userInfo: null, // userInfo: null, //
isUserBlacklisted: false, // isUserBlacklisted: false, //
currentProductId: null, // ID
searchTimer: null, //
} }
}, },
computed: { computed: {
@ -472,7 +474,7 @@ export default {
quantity: quantity, quantity: quantity,
brandId: brandId, brandId: brandId,
brandName: brandInfo ? brandInfo.name : '未知品牌', brandName: brandInfo ? brandInfo.name : '未知品牌',
brandImage: brandInfo ? brandInfo.image : '',
brandImage: brandInfo ? brandInfo.logo : '',
uniqueKey: `${item.id}_${brandId}` // uniqueKey: `${item.id}_${brandId}` //
}) })
} }
@ -488,9 +490,7 @@ export default {
return products return products
}, },
filteredBrandList() { filteredBrandList() {
if (!this.brandSearch) return this.brandList
const keyword = this.brandSearch.trim().toLowerCase()
return this.brandList.filter(b => b.name.toLowerCase().includes(keyword))
return this.brandList
}, },
bannerList() { bannerList() {
return getApp().globalData.bannerList || [] return getApp().globalData.bannerList || []
@ -585,7 +585,7 @@ export default {
brandId, brandId,
quantity, quantity,
name: brandInfo ? brandInfo.name : '未知品牌', name: brandInfo ? brandInfo.name : '未知品牌',
image: brandInfo ? brandInfo.image : ''
logo: brandInfo ? brandInfo.logo : ''
} }
}) })
this.showBrandReducePopup = true this.showBrandReducePopup = true
@ -765,6 +765,13 @@ export default {
// //
this.pendingBrandIndex = null; this.pendingBrandIndex = null;
this.isWaitingForBrandSelection = false; this.isWaitingForBrandSelection = false;
//
this.brandSearch = ''
this.currentProductId = null
if (this.searchTimer) {
clearTimeout(this.searchTimer)
this.searchTimer = null
}
}, },
scrollToLetter(letter) { scrollToLetter(letter) {
this.currentLetter = letter this.currentLetter = letter
@ -903,7 +910,7 @@ export default {
openBrandConfirm(brand) { openBrandConfirm(brand) {
this.brandConfirmInfo = { this.brandConfirmInfo = {
id: brand.id, id: brand.id,
image: brand.image,
logo: brand.logo,
name: brand.name name: brand.name
} }
this.showBrandConfirm = true this.showBrandConfirm = true
@ -936,8 +943,14 @@ export default {
this.pendingBrandIndex = null this.pendingBrandIndex = null
} }
}, },
getGoodsBrandList(productId) {
this.$api('getGoodsBrandList', { productId }, res => {
getGoodsBrandList(productId, searchName = '') {
this.currentProductId = productId
const params = { productId }
if (searchName.trim()) {
params.name = searchName.trim()
}
this.$api('getGoodsBrandList', params, res => {
// console.log(res,'res') // console.log(res,'res')
if (res && res.success && res.result && res.result.records) { if (res && res.success && res.result && res.result.records) {
this.brandList = res.result.records.map(item => { this.brandList = res.result.records.map(item => {
@ -973,6 +986,23 @@ export default {
return '#' return '#'
}, },
//
onBrandSearchInput(e) {
const searchValue = e.detail.value
//
if (this.searchTimer) {
clearTimeout(this.searchTimer)
}
// 500ms
this.searchTimer = setTimeout(() => {
if (this.currentProductId) {
this.getGoodsBrandList(this.currentProductId, searchValue)
}
}, 500)
},
// //
initializePageData() { initializePageData() {


+ 1
- 1
pages/mine/questionDetail.vue View File

@ -5,7 +5,7 @@
@leftClick="$utils.navigateBack" /> @leftClick="$utils.navigateBack" />
<view class="content"> <view class="content">
<uv-parse :content="detail.content"></uv-parse>
<uv-parse :content="detail.details"></uv-parse>
</view> </view>
</view> </view>


Loading…
Cancel
Save