当前位置: 首页 > news >正文

电子商务以后可以做什么工作沈阳网络优化培训

电子商务以后可以做什么工作,沈阳网络优化培训,乐高设计师网,wordpress 二次开发uniapp因为要兼容小程序等,会重写wx对象,导致引入的jweixin-1.6.0.js中对象不生效。 综合网络资料,有两种解决方案: 一,通过npm工具引入 npm install jweixin-module --save 实际上是借用了wx的另一个对象jWeixin …

uniapp因为要兼容小程序等,会重写wx对象,导致引入的jweixin-1.6.0.js中对象不生效。

综合网络资料,有两种解决方案:

一,通过npm工具引入

npm install jweixin-module --save

 实际上是借用了wx的另一个对象jWeixin

//main.jsimport jWeixin from 'jweixin-module'
Vue.prototype.$wx = jWeixin
// index.jsthis.$wx.config({debug: true,appId,timestamp,nonceStr,signature,jsApiList,
})
this.$wx.ready(()=> {})

 参考文章:uniapp开发h5 调用微信sdk 全网最全指南!!!! 血泪史!!!

二,手动引入

鉴于uniapp会重写wx的特性,在初始化后,可以再手动引入js,覆盖原有的wx对象

// 新增模板 template.html 
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><title><%= htmlWebpackPlugin.options.title %></title><!-- Open Graph data --><!-- <meta property="og:title" content="Title Here" /> --><!-- <meta property="og:url" content="http://www.example.com/" /> --><!-- <meta property="og:image" content="http://example.com/image.jpg" /> --><!-- <meta property="og:description" content="Description Here" /> --><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +(coverSupport ? ', viewport-fit=cover' : '') +'" />')</script><link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" /></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div><!-- built files will be auto injected --></body><!-- <script>window.wx = {}</script><script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> -->
</html>
// manifest.json
"h5" : {"optimization" : {"treeShaking" : {"enable" : true}},"sdkConfigs" : {"maps" : {}},"router" : {// "base" : "/process-client/","mode" : "history"},"devServer" : {"disableHostCheck" : true,"proxy" : {"/api" : {"target" : "http://xxx.xx.xxx.xxx:xxx","changeOrigin" : true,"secure" : false,"logLevel" : "debug","pathRewrite" : {"^/api" : ""}}},"https" : false},"template" : "template.html"}
// utils/wx-sdk.jsexport const createdScript = (callback) => {window.wx = nullconst script1 = document.createElement('script')script1.setAttribute('type', 'text/javascript')script1.setAttribute('src', 'https://res.wx.qq.com/open/js/jweixin-1.2.0.js')document.head.appendChild(script1)script1.onload = function () {window.wx = window.jWeixincallback && callback()}
}
// App.vue<script>
import { createdScript } from '@/utils/wx-sdk.js'
export default {onShow: function () {console.log('App Show')createdScript(() => {api({url: window.location.href}).then(([err, res]) => {if (err) {return}wx.config({debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。appId: res.appId, // 必填,企业微信的corpIDtimestamp: Number(res.timestamp), // 必填,生成签名的时间戳nonceStr: res.nonceStr, // 必填,生成签名的随机串signature: res.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法jsApiList: []})})})},
}
</script>

http://www.ds6.com.cn/news/59217.html

相关文章:

  • 手机qq电脑版登录入口官网seo广告优化多少钱
  • 交易网站建设需要学什么网络推广页面
  • 搭建网站价格销售渠道
  • jquery 显示 wordpress电商seo优化
  • 定制网站开发设计网店推广的方式
  • 政府网站建设 总结seo是什么姓
  • 网络营销推广引流方法厦门seo推广
  • 网站建设 自适应百度小说搜索风云榜
  • 合肥制作网页设计网站关键词推广优化
  • 做ppt用什么软件最好seo建设招商
  • 哈市今天疫情行动轨迹百度搜索关键词排名优化技术
  • 合肥有哪些做网站的公司河南网站优化排名
  • dreamweaver网站建设和维护hyein seo官网
  • 做爰的最好看的视频的网站线下引流推广方法
  • 网站模板做的比较好的重庆森林经典台词
  • 溧阳市住房和城乡建设局网站四种基本营销模式
  • 网站建设策划书olseo小白入门
  • 天津市建设工程信息网专家网搜索引擎优化的具体操作
  • 电商网站开发团队郑州网站建设专业乐云seo
  • 网站怎样做没有病毒人工在线客服系统
  • 重庆网站建设公司有哪些内容萧山市seo关键词排名
  • 网站怎么申请微信认证大一网页设计作业成品免费
  • 图片摄影网站阿里云建站
  • 公司网站开发有哪些关键词优化工具
  • 阿里云虚拟主机网站外链大全
  • 帮别人做钓鱼网站吗东台网络推广
  • 网站推广工具大全专业黑帽seo
  • 辽中网站建设广点通
  • 百度站长平台闭站保护seo排名点击报价
  • 公司做网站的费用计什么科目友情链接实例