前端-胡立永 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: {
url: '/recycle-admin/applet/index/getQuestionListDetail',
url: '/recycle-admin/applet/order/getQuestionListDetail',
method: 'GET',
auth : false,
},


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

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


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

@ -232,13 +232,13 @@
<text class="brand-popup-title">可回收的品牌</text>
</view>
<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>
<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" @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>
</view>
</view>
@ -286,7 +286,7 @@
<view class="brand-confirm-popup">
<view class="brand-confirm-title">品牌确认提示</view>
<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 class="brand-confirm-name">{{ brandConfirmInfo.name }}</view>
<view class="brand-confirm-desc">请确认所选品牌是否与实物品牌信息一致否则将无法进行回收</view>
@ -306,7 +306,7 @@
</view>
<scroll-view class="brand-reduce-popup-list" scroll-y>
<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>
</view>
</scroll-view>
@ -338,7 +338,7 @@ export default {
showPickupConfirm: false,
showBrandConfirm: false,
brandConfirmInfo: {
image: '',
logo: '',
name: ''
},
brandList: [],
@ -359,6 +359,8 @@ export default {
loadOptions: null, // options
userInfo: null, //
isUserBlacklisted: false, //
currentProductId: null, // ID
searchTimer: null, //
}
},
computed: {
@ -472,7 +474,7 @@ export default {
quantity: quantity,
brandId: brandId,
brandName: brandInfo ? brandInfo.name : '未知品牌',
brandImage: brandInfo ? brandInfo.image : '',
brandImage: brandInfo ? brandInfo.logo : '',
uniqueKey: `${item.id}_${brandId}` //
})
}
@ -488,9 +490,7 @@ export default {
return products
},
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() {
return getApp().globalData.bannerList || []
@ -585,7 +585,7 @@ export default {
brandId,
quantity,
name: brandInfo ? brandInfo.name : '未知品牌',
image: brandInfo ? brandInfo.image : ''
logo: brandInfo ? brandInfo.logo : ''
}
})
this.showBrandReducePopup = true
@ -765,6 +765,13 @@ export default {
//
this.pendingBrandIndex = null;
this.isWaitingForBrandSelection = false;
//
this.brandSearch = ''
this.currentProductId = null
if (this.searchTimer) {
clearTimeout(this.searchTimer)
this.searchTimer = null
}
},
scrollToLetter(letter) {
this.currentLetter = letter
@ -903,7 +910,7 @@ export default {
openBrandConfirm(brand) {
this.brandConfirmInfo = {
id: brand.id,
image: brand.image,
logo: brand.logo,
name: brand.name
}
this.showBrandConfirm = true
@ -936,8 +943,14 @@ export default {
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')
if (res && res.success && res.result && res.result.records) {
this.brandList = res.result.records.map(item => {
@ -973,6 +986,23 @@ export default {
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() {


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

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


Loading…
Cancel
Save