company.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view>
  3. <u-navbar title="商家信息" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
  4. <view class="company">该商品由以下商家提供</view>
  5. <view class="detail-description" v-for="(item,index) in merchantInfo" :key="index">
  6. <image :src="item" mode=""></image>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import env from '../../config/env.js'
  12. import $http from '@/utils/request.js'
  13. export default {
  14. data() {
  15. return {
  16. merchantInfo: [],
  17. goodsId:'',
  18. data:[],
  19. }
  20. },
  21. onLoad(opthios) {
  22. this.goodsId = opthios.goodsId
  23. },
  24. onShow() {
  25. this.getDetail()
  26. },
  27. methods: {
  28. toGoodsDetail(){
  29. uni.navigateBack({})
  30. },
  31. getDetail(){
  32. uni.showLoading({
  33. title: '加载中'
  34. });
  35. $http.post('/api/v1/mp/user/exchange/goods/detail', {
  36. goodsId: this.goodsId,
  37. noToken: true
  38. }).then(res => {
  39. uni.hideLoading();
  40. if (res.code == 0) {
  41. let merchantInfos = res.data.merchantInfo.split(',')
  42. merchantInfos.forEach(item => {
  43. this.merchantInfo.push(env.filePublic + item + '?imageView2/2/w/750')
  44. })
  45. }
  46. }).catch(() => {
  47. uni.hideLoading();
  48. })
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .company{
  55. margin: 20rpx 40rpx;
  56. }
  57. .detail-description {
  58. image {
  59. width: 100%;
  60. }
  61. }
  62. </style>