康巴易测肤/伤疤uniapp小程序类
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 line
2.4KB

  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 imageCropping from '../../components/xiaogang-crop'
  23. import avatar from "../../components/yq-avatar/yq-avatar.vue";
  24. export default {
  25. data() {
  26. return {
  27. 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',
  28. uurls: ["../../static/logo.png", "../../static/logo.png"],
  29. cropImgPath: '',
  30. isShow: false,
  31. }
  32. },
  33. computed: {
  34. imageUrl() {
  35. return this.$store.state.user.photoPath
  36. }
  37. },
  38. onLoad() {
  39. this.isShow = true
  40. },
  41. methods: {
  42. onMessage(event) {
  43. console.log('收到消息', event.detail.data);
  44. },
  45. cropCompleted(e) {
  46. console.log("e", e.tempFilePath);
  47. this.cropImgPath = e.tempFilePath;
  48. /* this.isShow = false; */
  49. },
  50. cropCancel() {
  51. /* this.imageUrl = ''; */
  52. /* this.isShow = false; */
  53. },
  54. myUpload(rsp) {
  55. this.$set(this.urls, rsp.index, rsp.path);
  56. },
  57. showCrop() {
  58. this.isShow = true;
  59. },
  60. },
  61. components: {
  62. avatar,
  63. imageCropping
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. .main {
  69. .circle-img {
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. }
  74. }
  75. </style>