otherGasStationsPhone.vue
3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<template>
<view class="container">
<Navbar title="订气列表" canBack></Navbar>
<view class="usuallyCard margin padding" v-for="(item,index) in phoneList" :key="index">
<view class="flex flex-direction">
<view class="flex">
<view class="">
<u-tag size="mini" bgColor="#5875EB" color="#fff" borderColor="#fff" :text="item.qzlx || ''"></u-tag>
</view>
<view class="text-lg margin-left-sm">
{{item.qzmc || ""}}
</view>
</view>
<view class="flex justify-between align-center margin-top-sm">
<view class="flex" >
<u-tag class="margin-right-xs" v-for="(i,n) in item.psfs" :key="n" bgColor="#FFF6E6" color="#ffa500" borderColor="#fff" :text="i"></u-tag>
</view>
<view class="" @click="callPhone(item.qzdh)">
<u-button shape="circle" color="#EE651F" iconColor="#fff" icon="phone-fill"
:customStyle="{height:'30px'}">电话订气</u-button>
</view>
</view>
<view class="flex margin-top-sm">
<u-icon name="map" class="margin-right-xs"></u-icon>
<view class="text-gray">
{{item.qzdz || ""}}
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {
phoneList: [],
queryParams:{
page: 1,
size: 10,
jd:"",
wd:""
}
};
},
onLoad() {
this.getCzPage();
},
mounted() {
},
onPullDownRefresh() {
this.phoneList = [];
this.queryParams.page = 1;
this.getCzPage()
setTimeout(() => {
//结束下拉刷新
uni.stopPullDownRefresh();
}, 500);
},
onReachBottom() {
// let allTotal = this.pageParams.currentPage * this.pageParams.size
// if (allTotal < this.total) {
// //当前条数小于总条数 则增加请求页数
// this.pageParams.currentPage++;
// this.status = 'loading';
// setTimeout(() => {
// this.getOrderList()
// }, 500)
// } else {
// this.status = 'nomore'
// // console.log('已加载全部数据')
// }
},
methods: {
async getCzPage() {
let fJd = this.$store.state.user.adsJd;
let fWd = this.$store.state.user.adsWd;
if (!fJd || !fWd) {
uni.$u.toast('定位出错');
return;
}
this.queryParams.jd = fJd;
this.queryParams.wd = fWd;
// let query = {
// page: 1,
// size: 10,
// jd: fJd,
// wd: fWd
// }
let result = await this.$api.memberApi.getCzPage(this.queryParams);
let {
code,
value
} = result;
if (code === 200) {
let records = value.records;
if (!records.length) {
uni.$u.toast('未查询到相关气站');
return;
}
this.phoneList = records;
console.log("气站电话列表", this.phoneList);
}
},
callPhone(phone) {
if (!phone) {
uni.$u.toast('未查询到电话')
return
}
uni.makePhoneCall({
phoneNumber: phone, // 电话号码
success: function() {
console.log('拨号成功');
},
fail: function(err) {
console.log('拨号失败:', err);
}
});
}
}
}
</script>
<style lang="scss" scoped>
</style>