创建
This commit is contained in:
36
template/serviceTel/serviceTel.js
Normal file
36
template/serviceTel/serviceTel.js
Normal file
@@ -0,0 +1,36 @@
|
||||
var t = getApp();
|
||||
|
||||
Component({
|
||||
properties: {},
|
||||
data: {
|
||||
tel: ""
|
||||
},
|
||||
lifetimes: {
|
||||
attached: function() {
|
||||
this.attachedIn();
|
||||
}
|
||||
},
|
||||
attached: function() {
|
||||
this.attachedIn();
|
||||
},
|
||||
methods: {
|
||||
attachedIn: function() {
|
||||
this.getTel();
|
||||
},
|
||||
getTel: function() {
|
||||
var e = this;
|
||||
if (!t.globalData.canGetData) return setTimeout(function() {
|
||||
e.getTel();
|
||||
}, 300), !1;
|
||||
this.setData({
|
||||
tel: t.globalData.servicetel
|
||||
});
|
||||
},
|
||||
callUs: function() {
|
||||
if (!t.globalData.servicetel) return !1;
|
||||
wx.makePhoneCall({
|
||||
phoneNumber: "" + t.globalData.servicetel
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
4
template/serviceTel/serviceTel.json
Normal file
4
template/serviceTel/serviceTel.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
4
template/serviceTel/serviceTel.wxml
Normal file
4
template/serviceTel/serviceTel.wxml
Normal file
@@ -0,0 +1,4 @@
|
||||
<view bindtap="callUs" class="service-tel">
|
||||
<view>=客服电话=</view>
|
||||
<view>{{tel}}</view>
|
||||
</view>
|
||||
9
template/serviceTel/serviceTel.wxss
Normal file
9
template/serviceTel/serviceTel.wxss
Normal file
@@ -0,0 +1,9 @@
|
||||
.service-tel {
|
||||
align-items: center;
|
||||
color: #999;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 26rpx;
|
||||
justify-content: center;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user