qualityauthorize.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**
  2. *Created by ZHJY on 2021/03/12.
  3. */
  4. var qualityAuthorize = new Vue({
  5. el:"#qualityAuthorize",
  6. data: {
  7. //是否显示声明对话框
  8. showStatement:false,
  9. //是否为手机屏幕
  10. isPC:window.isPC,
  11. //产品id
  12. productId:'5',
  13. //产品参数对象
  14. parameters:null,
  15. //声明内容
  16. statementContent:'',
  17. //控制授权证书是否弹出
  18. isShowSqBookModal:false,
  19. sqBookModal:'',
  20. cmContent:'',
  21. isCmComtent:false,
  22. message:'',
  23. isLoading:false,
  24. showQrcodeImage:true
  25. },
  26. filters:{
  27. snCode:function (code) {
  28. return code.replace(/^(\w{2})\w+(\w{4})$/,"$1******$2");
  29. }
  30. },
  31. methods: {
  32. //弹窗声明框
  33. showStatementModel:function(){
  34. this.showStatement = true
  35. },
  36. //关闭声明框
  37. closeStatementModel:function(){
  38. this.showStatement = false
  39. },
  40. //获取商品参数对象
  41. initParams:function(){
  42. var _that = this;
  43. ProductApi.GetAuthProductDeatil({productId:_that.productId},function(res){
  44. if(res.code === 0){
  45. _that.parameters = res.data;
  46. console.log(_that.parameters)
  47. _that.isLoading = true;
  48. }else{
  49. _that.message = res.msg;
  50. _that.isLoading = true;
  51. }
  52. // else{
  53. // //如果该产品不存在,跳转到404页面
  54. // window.location.href = '/404.html'
  55. // }
  56. });
  57. },
  58. // 代理声明弹出框
  59. openStatementDialog:function(flag){
  60. if(flag === 1){
  61. //代理声明
  62. this.isCmComtent = false;
  63. this.statementContent = this.parameters.statementContent
  64. }else{
  65. //采美声明
  66. this.isCmComtent = true;
  67. this.cmContent = `
  68. <p>目前,在市面上经常发现不少伪劣医疗美容产品/仪器,让众多的消费者无法辨别产品/仪器的真假,并且给品牌方及品牌代理商造成不少困扰</p>
  69. <p>为了提高消费者对产品/仪器的可信度。由采美信息技术有限公司发起并提供技术支持,且得到各品牌与代理商的认可及授权后,共同打造正品
  70. 联盟平台。将产品/仪器的品牌授牌信息纳入到正品联盟平台。消费者可通过授权牌上二维码扫码得知该产品/仪器的品牌授权信息。通过这些信
  71. 息即可得知产品/仪器的真假,是否为品牌以及品牌代理商授权过的正品,从而解决消费者与品牌/品牌代理商的困扰。</p>
  72. `;
  73. }
  74. this.showStatement = true;
  75. },
  76. //授权证书弹出
  77. showSqBookModal:function(){
  78. this.isShowSqBookModal = true
  79. },
  80. //授权证书影藏
  81. hideSqBookModal:function(){
  82. this.isShowSqBookModal = false;
  83. },
  84. //关闭微信二维码
  85. handleColseQrCodeImage: function(){
  86. this.showQrcodeImage = false
  87. }
  88. },
  89. // created:function() {
  90. // var _that = this;
  91. // Vue.nextTick(function () {
  92. // _that.initParams()
  93. // })
  94. // }
  95. mounted:function () {
  96. setBaseCookie("weChatAutoLogin", 2);
  97. this.sqBookModal = $('#sq-book-modal');
  98. console.log(1);
  99. //根据地址获取产品id
  100. var _that = this;
  101. var pathname = window.location.pathname;
  102. this.productId = pathname.split('-')[1].split('.')[0];
  103. this.initParams();
  104. setTimeout(function () {
  105. _that.isShowSqBookModal = true;
  106. }, 500);
  107. }
  108. });