cjDetail.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="honour" :class="fromIndex ? '' : 'share'">
  3. <view class="container">
  4. <view class="certificate" @click="previewImage">
  5. <image :src="url" mode="widthFix" style="width: 100%;"></image>
  6. </view>
  7. <view class="share">
  8. <view class="item" @tap="saveImg">
  9. <!-- <image class="icon" src="../../static/icon/share2.png"></image> -->
  10. <view>长按保存图片</view>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. url: ''
  21. };
  22. },
  23. methods: {
  24. previewImage() {
  25. uni.previewImage({
  26. urls: [this.url],
  27. longPressActions: {
  28. itemList: ['保存图片'],
  29. success: function(data) {
  30. },
  31. fail: function(err) {
  32. console.log(err.errMsg);
  33. }
  34. }
  35. });
  36. }
  37. },
  38. async onLoad(options) {
  39. this.url = options.path
  40. }
  41. };
  42. </script>
  43. <style lang="scss">
  44. .container {
  45. padding: 36rpx 54rpx;
  46. .certificate {}
  47. .item {
  48. text-align: center;
  49. // background: linear-gradient(91deg, #F30000 1%, #FE4815 99%);
  50. padding: 10px 0;
  51. border-radius: 6px;
  52. color: #F30000;
  53. font-size: 20px;
  54. }
  55. }
  56. </style>