A. Add interface style: copy the following entire code and put it in the last blank position of info_article.swan (article details page) and info_product.swan (product details page) respectively.
<button style="width:80vw; background-color:#FF7F24;color:#fff;padding:2rpx 0;margin: 0 auto;margin-bottom:30rpx; "Bindtap=" calling ">Telephone consultation</button>
<view style="margin:10rpx auto 30rpx; background-color:#bbb;color:#fff;padding:20rpx 0;text-align:center;width:80vw;border-radius:10rpx; ">
<navigator open type="switchTab" url="/pages/index/index" hover class="other navigator over" style="font size: 36rpx;">Return to the home page</navigator>
</view>
B. Add JS functions: Copy the following codes to info_article.js (article details page) and info_product.js (product details page) respectively, and put them in front of the last}). If there is already a JS function, it is unnecessary to add it again. Pay attention to punctuation,
,calling: function (e) {
let mobile = e.currentTarget.dataset.id;
if (!mobile) {
mobile = app.globaldata.settings.cfg_kefu_tel;
}
swan.makePhoneCall({
phoneNumber: mobile,
success: function () {
Console. log ("Call succeeded!")
},
fail: function () {
Console. log ("Call failed!")
}
})
}
This article is written by Fuwei SEO Special Training Camp Edit and organize.
Search outside and focus SEO training And Saas service solutions around SEO. Over the past 10 years, more than 50000 students have gained technical improvement and contacts here.
SEO courses include mobile search, zero foundation station building, group station SEO thinking, Sowai 6 system, introduction to SEM, etc.
The registration time for Class B 190 is from May 15 to May 31. Please add enrollment customer service Xiaomo WeChat: seowy2021.
WeChat code scanning to add customer service personnel
Our goal is to make it easy for non-technical personnel to learn Internet technology.