康巴易测肤/伤疤uniapp小程序类
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

99 行
3.2KB

  1. <template>
  2. <view>
  3. <!-- ios背景图片不支持wx开头的临时路径,需要上传到服务器再裁剪 -->
  4. <view class="main">
  5. <!-- <view class="circle-img">
  6. <u--image v-if="imageUrl" :src="imageUrl" mode="widthFix" shape="circle" width="400px" border
  7. height="400px"></u--image>
  8. </view>
  9. <view class="small-circle">
  10. <u--image v-if="cropImgPath" :src="cropImgPath" mode="widthFix" shape="circle" width="100px"
  11. height="100px"></u--image>
  12. </view>
  13. <view class="action">
  14. </view> -->
  15. </view>
  16. <image-cropping v-if="isShow" :src="imageUrl" :isFixedSize="true" :ratioGroup="['4:3', '1:1']"
  17. @completed="cropCompleted" @cancel="cropCancel" cropShape="circular">
  18. </image-cropping>
  19. </view>
  20. </template>
  21. <script>
  22. import { onLoad } from 'uview-ui/libs/mixin/mixin';
  23. import imageCropping from '../../components/xiaogang-crop'
  24. import avatar from "../../components/yq-avatar/yq-avatar.vue";
  25. export default {
  26. data() {
  27. return {
  28. webUrl: 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxab7b8b9509e1d137&redirect_uri=https://id.ssjlai.com/telpoaiopsweb?appid=wxab7b8b9509e1d137&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect',
  29. uurls: ["../../static/logo.png", "../../static/logo.png"],
  30. cropImgPath: '',
  31. isShow: false,
  32. }
  33. },
  34. computed: {
  35. imageUrl() {
  36. return 'https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202410/d09e1e9b99cf496aab3422d9f1e766d5.png'
  37. }
  38. },
  39. onLoad() {
  40. this.isShow = true
  41. },
  42. methods: {
  43. onMessage(event) {
  44. console.log('收到消息', event.detail.data);
  45. },
  46. cropCompleted(e) {
  47. console.log("e", e.tempFilePath);
  48. this.cropImgPath = e.tempFilePath;
  49. /* this.isShow = false; */
  50. },
  51. cropCancel() {
  52. /* this.imageUrl = ''; */
  53. /* this.isShow = false; */
  54. },
  55. myUpload(rsp) {
  56. this.$set(this.urls, rsp.index, rsp.path);
  57. },
  58. showCrop() {
  59. this.isShow = true;
  60. },
  61. clk() {
  62. uni.navigateTo({
  63. url: '/pages/skin-assessment/photograph',
  64. })
  65. return
  66. let that = this;
  67. uni.chooseImage({
  68. count: 1,
  69. sizeType: ['original', 'compressed'],
  70. sourceType: ['album', 'camera'],
  71. success: res => {
  72. console.log("res", res.tempFiles[0]);
  73. let tempFilePath = res.tempFilePaths[0];
  74. that.imageUrl = /* tempFilePath */'https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/common/202503/2ce7e67fefbb416788ca1fc82f076fa4.jpg';
  75. that.isShow = true;
  76. },
  77. })
  78. }
  79. },
  80. components: {
  81. avatar,
  82. imageCropping
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .main {
  88. .circle-img {
  89. display: flex;
  90. justify-content: center;
  91. align-items: center;
  92. }
  93. }
  94. </style>