uniapp
console.log('appid',uni.getAccountInfoSync().miniProgram.appId)
原生
console.log(111,my.getAccountInfoSync().miniProgram.appId)
@FollowLifestyle="FollowLifestyle($event,item)"
js模板字符串的使用
//this.index是变量,this.index = 1
`details${this.index}-title`
//结果为:details1-title
获取对象:在绑定事件的标签添加data-item="{{item}}"
获取索引:在绑定事件的标签添加data-index="{{index}}"
html:
{{item.advertTitle}}
js:
onJumpClick(e) {
let item = e.currentTarget.dataset.item;
let index = e.currentTarget.dataset.index;
},
const id = obj.extend1 //生活号id
my.ap.navigateToAlipayPage({
path: encodeURIComponent(
`https://render.alipay.com/p/s/i/?scheme=alipays%3A%2F%2Fplatformapi%2Fstartapp%3FappId%3D20000042%26publicId%3D${id}`
)
});
https://render.alipay.com/p/s/i/?scheme=alipays://platformapi/startapp?appId=2021003147673053&page=pages/conversionCopy/conversionCopy?advertTitle%3DUSD%E6%8D%A2%E7%AE%97%26hotNav%3Dtrue
let link = `https://render.alipay.com/p/s/i/?scheme=${encodeURIComponent(`alipays://platformapi/startapp?appId=20001003&actionSrc=hometab&keyword=${str}`)}`
let str = '深圳我爱你'
const link = `alipays://platformapi/startapp?appId=20001003&actionSrc=hometab&keyword=${str}`
my.ap.navigateToAlipayPage({
path: encodeURIComponent(
`https://render.alipay.com/p/s/i/?scheme=${encodeURIComponent(link)}`
)
})
my.navigateToMiniProgram({
appId: obj.jumpAppid, //appid
path: obj.jumpPath, //跳转路径
extraData: JSON.parse(obj.jumpExtraData), //扩展字段
success: (res) => {
console.log(res)
},
fail: (res) => {
console.log(res)
}
});
my.ap.navigateToAlipayPage({
// 注意只支持特定前缀的 URL,且需要整体冗余编码
path: encodeURIComponent(
'https://render.alipay.com/p/s/i/?scheme=alipays%3A%2F%2Fplatformapi%2Fstartapp%3FsaId%3D20000067%26url%3D' +
encodeURIComponent(obj.jumpWebviewUrl)), //h5路径
success: (res) => {
console.log('navigateToAlipayPage success', JSON.stringify(res));
},
fail: (res) => {
console.error('navigateToAlipayPage fail', JSON.stringify(res));
}
});
alipays://platformapi/startapp?appId=2021003147673053
&page=pages/webview/webview?
webViewUrl=http://h5.jiekuanzhushou.com/standby/#/
h5跳转支付宝小程序
https://render.alipay.com/p/s/i/?scheme=alipays://platformapi/startapp?appId=2021003147673053&page=pages/conversionCopy/conversionCopy?advertTitle%3DUSD%E6%8D%A2%E7%AE%97%26hotNav%3Dtrue