weiChat.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <!-- 临时卡领取页面 -->
  3. <view class="content">
  4. <image :src="'data:image/jpeg;base64,' + imgUrl" mode="aspectFit" />
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. imgUrl: "",
  12. };
  13. },
  14. created() {
  15. this.getWeiChat();
  16. },
  17. methods: {
  18. getWeiChat() {
  19. uni.request({
  20. url: "https://jtishfw.ncjti.edu.cn/yinxin/ncjtSecurityManagement/getWeichat",
  21. data: "",
  22. header: {
  23. Accept: "text/plain",
  24. },
  25. method: "POST",
  26. sslVerify: true,
  27. success: ({ data, statusCode, header }) => {
  28. if (statusCode == 200) {
  29. // console.log(data);
  30. // console.log(data.replace(/[\r\n]/g, ""));
  31. var url = JSON.parse(data.replace(/[\r\n]/g, ""));
  32. // console.log(url);
  33. this.imgUrl = url.weichat;
  34. // console.log(this.imgUrl);
  35. }
  36. },
  37. fail: (error) => {},
  38. });
  39. },
  40. },
  41. };
  42. </script>
  43. <style lang="scss" scoped>
  44. .content {
  45. width: 100%;
  46. height: 100%;
  47. image {
  48. width: 750rpx;
  49. height: 1207rpx;
  50. }
  51. }
  52. </style>