customer.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view style="height: 100vh;margin: 32upx;">
  3. <view style="text-align: center;background: #FFFFFF;padding: 40upx;border-radius: 32upx;">
  4. <image @click="saveImg" mode="aspectFit" style="margin-top: 32upx" :src="image"></image>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. image: '',
  13. isWeiXin: false,
  14. weixin: '',
  15. webviewStyles: {
  16. progress: {
  17. color: '#1A1929 '
  18. }
  19. }
  20. };
  21. },
  22. onLoad() {
  23. // #ifdef H5
  24. let ua = navigator.userAgent.toLowerCase();
  25. if (ua.indexOf('micromessenger') !== -1) {
  26. this.isWeiXin = true;
  27. }
  28. // #endif
  29. //获取客服二维码
  30. this.$Request.getT('/app/common/type/1').then(res => {
  31. if (res.code == 0) {
  32. if (res.data && res.data.value) {
  33. console.log(res.data.value)
  34. this.image = res.data.value;
  35. }
  36. }
  37. });
  38. },
  39. onPullDownRefresh: function() {
  40. uni.stopPullDownRefresh(); // 停止刷新
  41. },
  42. methods: {
  43. //邀请码复制
  44. copyHref() {
  45. uni.setClipboardData({
  46. data: this.weixin,
  47. success: r => {
  48. this.$queue.showToast('复制成功');
  49. }
  50. });
  51. },
  52. saveImg() {
  53. let that = this;
  54. let imgArr = []
  55. imgArr.push(that.image);
  56. //预览图片
  57. uni.previewImage({
  58. urls: imgArr,
  59. current: imgArr[0]
  60. });
  61. // uni.saveImageToPhotosAlbum({
  62. // filePath: that.image,
  63. // success(res) {
  64. // that.$queue.showToast('保存成功');
  65. // }
  66. // });
  67. },
  68. rests() {
  69. uni.showToast({
  70. title: '已刷新请再次长按识别',
  71. mask: false,
  72. duration: 1500,
  73. icon: 'none'
  74. });
  75. window.location.reload();
  76. },
  77. // 在线客服
  78. goChat() {
  79. let token = this.$queue.getData('token');
  80. if (token) {
  81. uni.navigateTo({
  82. url: '/my/setting/chat'
  83. });
  84. } else {
  85. this.goLoginInfo();
  86. }
  87. },
  88. //统一登录跳转
  89. goLoginInfo() {
  90. uni.navigateTo({
  91. url: '/pages/public/loginphone'
  92. });
  93. },
  94. }
  95. };
  96. </script>
  97. <style>
  98. /* @import '../../static/css/index.css'; */
  99. page {
  100. background: #F5F5F5;
  101. }
  102. </style>