Browse Source

refactor(market): 重构市场线索页面

- 更新数据结构:将列表项的属性从直接使用改为通过 customerResource 属性访问- 调整日期显示:从 follow.follow_up_time 改为 shared_at
- 修改拨打电话功能:使用 customerResource.phone_number 替代 student_phone
- 优化列表数据获取逻辑:添加共享人 ID 并使用新的 API 路由
- 注释和调试代码清理:移除不必要的注释和多余的空行
master
liutong 11 months ago
parent
commit
ae860ab9dc
  1. 46
      pages/market/clue/index.vue

46
pages/market/clue/index.vue

@ -27,14 +27,14 @@
<view> <view>
<image src="@/static/images/index/myk.png" class="card-image"></image> <image src="@/static/images/index/myk.png" class="card-image"></image>
</view> </view>
<view class="card-text">{{ v.student_name }}</view> <view class="card-text">{{ v.customerResource.name }}</view>
<view class="card-label">{{ v.is_status == 1 ? '试听' : '成交' }}</view> <!-- <view class="card-label">{{ v.is_status == 1 ? '试听' : '成交' }}</view>-->
</view> </view>
<view class="card-con"> <view class="card-con">
首联系人{{ v.contact_name }} <span class="card-con-span">{{ v.decision_maker }}</span> 首联系人{{ v.customerResource.name }} <span class="card-con-span">{{ v.customerResource.decision_maker }}</span>
</view> </view>
<view class="card-date"> <view class="card-date">
<view class="card-con">{{ $util.formatToDateTime((v.follow && v.follow.follow_up_time || ''), 'm-d H:i') }} <view class="card-con">{{ $util.formatToDateTime((v.shared_at || ''), 'm-d H:i') }}
跟进 跟进
</view> </view>
<view style="margin-left: 30rpx;"> <view style="margin-left: 30rpx;">
@ -56,7 +56,7 @@
class="drop-image-x" class="drop-image-x"
></image> ></image>
</view> </view>
<view class="title-x">意向{{ v.follow && v.follow.initial_customer_intent || '' }}</view> <view class="title-x">意向{{ v.customerResource && v.customerResource.initial_intent_name || '' }}</view>
</view> </view>
</view> </view>
</view> </view>
@ -65,7 +65,7 @@
<image src="@/static/images/index/message.png" class="image" @click="openViewMyMessage(v)"></image> <image src="@/static/images/index/message.png" class="image" @click="openViewMyMessage(v)"></image>
</view> </view>
<view style="width: 15%;"> <view style="width: 15%;">
<image v-if="v.student_phone" src="@/static/images/index/phone.png" class="image" @click="dialTel(v)"></image> <image v-if="v.customerResource.phone_number" src="@/static/images/index/phone.png" class="image" @click="dialTel(v)"></image>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -266,6 +266,8 @@ export default {
this.userInfo = res.data this.userInfo = res.data
this.filteredData_1.shared_by = this.userInfo.id//ID
//,"" //,""
if(this.userInfo.role_key_arr.includes('manager')){ if(this.userInfo.role_key_arr.includes('manager')){
this.values = [ this.values = [
@ -349,11 +351,13 @@ export default {
return return
} }
this.filteredData_1.shared_by = this.userInfo.id//ID
if(data.page == 1){ if(data.page == 1){
this.tableList_1 = [] this.tableList_1 = []
} }
let res = await marketApi.myClient(data) let res = await apiRoute.xs_resourceSharingIndex(data)
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;
if (res.code != 1){ if (res.code != 1){
@ -366,12 +370,10 @@ export default {
this.tableList_1 = this.tableList_1.concat(res.data.data); // 使 concat this.tableList_1 = this.tableList_1.concat(res.data.data); // 使 concat
console.log('列表',this.tableList_1) console.log('列表1',this.tableList_1)
this.filteredData_1.total = res.data.total this.filteredData_1.total = res.data.total
this.filteredData_1.page++ this.filteredData_1.page++
}, },
//- //-
@ -425,7 +427,7 @@ export default {
this.tableList_2 = this.tableList_2.concat(res.data.data); // 使 concat this.tableList_2 = this.tableList_2.concat(res.data.data); // 使 concat
console.log('列表',this.tableList_2) console.log('列表2',this.tableList_2)
this.filteredData_2.total = res.data.total this.filteredData_2.total = res.data.total
this.filteredData_2.page++ this.filteredData_2.page++
}, },
@ -459,7 +461,7 @@ export default {
// //
async dialTel(item) { async dialTel(item) {
let tel = item.student_phone let tel = item.customerResource.phone_number
if (!tel) { if (!tel) {
uni.showToast({ uni.showToast({
@ -470,16 +472,16 @@ export default {
} }
let param = { let param = {
sales_id: item.id//线id sales_id: item.customerResource.id//线id
} }
let res = await marketApi.setCallUp(param)// // let res = await marketApi.setCallUp(param)//
if (res.code != 1) { // if (res.code != 1) {
uni.showToast({ // uni.showToast({
title: res.msg, // title: res.msg,
icon: 'none' // icon: 'none'
}) // })
return // return
} // }
uni.makePhoneCall({ uni.makePhoneCall({

Loading…
Cancel
Save