How to add one touch dialing and return home buttons to the article details and product details pages?

251847 readings

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!")

            }

        })

    }

 0.png

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.

  • SEO exchange group of search members (free)

    WeChat code scanning to add customer service personnel
  • Applet operation communication group (free)

    WeChat code scanning to add customer service personnel
  • SEM bidding exchange group of search members (free)

    WeChat code scanning to add customer service personnel
  • Fuwei Student SEO Exchange Group (VIP)

    WeChat code scanning to add customer service personnel

Scan code to obtain resources

WeChat code scanning to add customer service personnel
  • SEO technology practice WeChat group

    WeChat code scanning to add customer service personnel
  • Major station traffic director group (review identity)

    WeChat code scanning to add customer service personnel
  • Google independent station English SEO group

    WeChat code scanning to add customer service personnel
  • SEO Team KPI Management Form

    WeChat code scanning to add customer service personnel
  • Friendly link group of industrial products website

    WeChat code scanning to add customer service personnel
  • Local life service industry friend chain group

    WeChat code scanning to add customer service personnel

Follow Mr. Fu Wei System learning group station SEO
become Internet operation and promotion masters

Master SEO skills, build the front end of the site, dominate the screen by groups of sites, get started with SEM, promote news sources
Processed in 0.191274 Second ,  50 querys.