historyDetail.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view>
  3. <view class="" style="margin-top: 100rpx;">
  4. <back></back>
  5. </view>
  6. <view v-for="(item,index) in image" :key="index" class="flex" >
  7. <!-- <image :src="item" mode="" class="image" @click="showPhoto(index)"></image> -->
  8. <image :src="item" mode="" class="image" @click="showPhoto(index)" v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' "></image>
  9. <video :src="item" controls v-else class="image"></video>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import service from '@/api/index.js'
  15. export default{
  16. data(){
  17. return{
  18. id:0,
  19. image:[],
  20. index:0,
  21. }
  22. },
  23. onLoad(e) {
  24. this.id = e.id;
  25. this.photo()
  26. },
  27. methods:{
  28. photo(){
  29. service.getOrderPhoto({orderId:this.id}).then(res=>{
  30. this.image = res;
  31. })
  32. },
  33. showPhoto(index){
  34. uni.previewImage({
  35. current:index,
  36. urls:this.image,
  37. })
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .image{
  44. margin: 50rpx auto;
  45. width: 330rpx;
  46. height: 230rpx;
  47. }
  48. </style>