Mini Program retweet function as a public method

clipboard.png

problem description

I want to write a public forwarding method in the util file. That page is called with that page, but it is not successful. How to write it, gods

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Aug.19,2021

if I don't understand your train of thought, I will directly provide you with a way to write it.
follow this method directly. I directly replaced pageUrl with path

.
  • util.js

//

var log = console.log.bind(console)
var commonShareNew = function(e) {
    var that = this;
    
    try{
        var sharetype = e.target.dataset.sharetype
    }catch(e){}
    log('', sharetype)
    
// 
//
    return {
            //title: result.title,
            //path: result.let_path,
            //imageUrl: result.image,
        }
}
module.exports = {
  commonShare: commonShareNew,
}

reference
var shareT = require (".. /.. / utils/share.js") in the page; / / introduce sharing-related copywriting
page.js using
onShareAppMessage: shareT.commonShare,

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d934-2c397.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d934-2c397.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?