workphoto.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="padding" style="width: 100%;">
  3. <view class="flex flex-wrap" style="width: 100%;">
  4. <view style="width: 220rpx;height: 160rpx;margin-right: 10rpx;" v-for="(item,index) in order.workImg" :key="index">
  5. <image :src="item" style="width: 100%;height: 100%;" @click="saveImg(item)"></image>
  6. </view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. id: '',
  15. order:[]
  16. }
  17. },
  18. onLoad(e) {
  19. console.log(e)
  20. this.id = e.id
  21. this.getDet()
  22. },
  23. methods: {
  24. // 详情
  25. getDet() {
  26. uni.showLoading({
  27. title: '加载中...'
  28. });
  29. this.$Request.get("/app/orderTaking/queryTakingDetails", {
  30. id: this.id,
  31. }).then(res => {
  32. uni.hideLoading();
  33. if (res.code == 0) {
  34. this.order = res.data
  35. this.order.workImg = this.order.workImg.split(",");
  36. }
  37. this.loading = false;
  38. });
  39. },
  40. saveImg(imgs) {
  41. console.log(imgs)
  42. let that = this;
  43. let imgArr = []
  44. imgArr.push(imgs);
  45. // //预览图片
  46. uni.previewImage({
  47. urls: imgArr,
  48. current: imgArr[0]
  49. });
  50. },
  51. }
  52. }
  53. </script>
  54. <style>
  55. </style>