_id.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div class="community-u-box">
  3. </div>
  4. </template>
  5. <script>
  6. import WxMixin from '@/mixins/wx'
  7. let page = 1
  8. export default {
  9. layout: 'opacity_header',
  10. data() {
  11. return {
  12. title: '开发者资质认证- 程序员客栈',
  13. list: [],
  14. }
  15. },
  16. head() {
  17. return {
  18. title: this.title,
  19. script: [
  20. { src: 'https://res.wx.qq.com/open/js/jweixin-1.2.0.js' },
  21. ],
  22. }
  23. },
  24. mixins: [WxMixin],
  25. mounted() {
  26. this.getList()
  27. },
  28. methods: {
  29. clickLancer({ id }) {
  30. this.$router.push(`/cert/type/${id}`)
  31. },
  32. btnDisabled(item) {
  33. return item.btn_name !== "申请认证" || !item.can_click
  34. },
  35. async getList() {
  36. let res = await this.$post('/api/cert/getList', { page }, { neverLogout: true })
  37. if(res.status) {
  38. let list = res.data.list
  39. this.list = list
  40. }
  41. },
  42. canApply(item) {
  43. return item.end_date && item.is_cert_validate && item.cert_no
  44. },
  45. configWx() {
  46. try {
  47. let conf = this.$store.state.wxConfig
  48. wx.ready(function() { //需在用户可能点击分享按钮前就先调用
  49. wx.config({
  50. debug: true,
  51. appId: conf.appId,
  52. timestamp: conf.timestamp,
  53. nonceStr: conf.nonceStr,
  54. signature: conf.signature,
  55. jsApiList: [
  56. // 所有要调用的 API 都要加到这个列表中
  57. 'onMenuShareTimeline', // 分享到朋友圈接口
  58. 'onMenuShareAppMessage', // 分享到朋友接口
  59. 'onMenuShareQQ', // 分享到QQ接口
  60. 'onMenuShareWeibo' // 分享到微博接口
  61. ],
  62. success: function() {
  63. alert('wx.config ok');
  64. },
  65. error: function(d) {
  66. alert('wx.config err:' + JSON.stringify(d));
  67. }
  68. })
  69. wx.updateAppMessageShareData({
  70. title: '开发者资质认证', // 分享标题
  71. desc: '通过平台审核、认证,将获得更多接单机会', // 分享描述
  72. link: location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  73. imgUrl: 'https://stacdn.proginn.com/favicon.ico', // 分享图标
  74. success: function() {
  75. // 设置成功
  76. alert('微信图标设置成功')
  77. }
  78. })
  79. })
  80. } catch(error) {
  81. alert(error)
  82. }
  83. }
  84. }
  85. }
  86. </script>
  87. <style>
  88. body {
  89. background: url(~@/assets/img/community/u_background.png) 0 0 / 100% auto no-repeat;
  90. }
  91. .community-u {
  92. }
  93. </style>