detail.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="about" v-if="!loading">
  3. <view class="shop-info about-content" v-if="title === '商城介绍'">
  4. <rf-image :src="detail.cover || detail.web_logo || ''"></rf-image>
  5. <view v-if="detail.title"
  6. ><text>商城名称: </text><text>{{ detail.title }}</text></view
  7. >
  8. <view v-if="detail.address_name"
  9. ><text>联系地址: </text><text>{{ detail.address_name }}</text></view
  10. >
  11. <view v-if="detail.address_details"
  12. ><text>详细地址: </text><text>{{ detail.address_details }}</text></view
  13. >
  14. <view v-if="detail.mobile"
  15. ><text>手机号码: </text><text>{{ detail.mobile }}</text></view
  16. >
  17. <view v-if="detail.qq"
  18. ><text>QQ: </text><text>{{ detail.qq }}</text></view
  19. >
  20. </view>
  21. <view class="shop-info " v-if="title === '注册协议'">
  22. <view class="about-content" v-if="detail.protocol_register">
  23. <rf-parser lazy-load :html="detail.protocol_register"></rf-parser>
  24. </view>
  25. <rf-empty
  26. :info="`暂无${title}`"
  27. v-if="!detail.protocol_register && !loading"
  28. ></rf-empty>
  29. </view>
  30. <view class="shop-info" v-if="title === '隐私协议'">
  31. <view class="about-content" v-if="detail.protocol_privacy">
  32. <rf-parser lazy-load :html="detail.protocol_privacy"></rf-parser>
  33. </view>
  34. <rf-empty
  35. :info="`暂无${title}`"
  36. v-if="!detail.protocol_privacy && !loading"
  37. ></rf-empty>
  38. </view>
  39. <view class="shop-info" v-if="title === '充值协议'">
  40. <view class="about-content" v-if="detail.protocol_recharge">
  41. <rf-parser lazy-load :html="detail.protocol_recharge"></rf-parser>
  42. </view>
  43. <rf-empty
  44. :info="`暂无${title}`"
  45. v-if="!detail.protocol_recharge && !loading"
  46. ></rf-empty>
  47. </view>
  48. <rf-empty :info="`暂无${title}`" v-if="!detail && !loading"></rf-empty>
  49. <!--加载动画-->
  50. <rfLoading isFullScreen :active="loading"></rfLoading>
  51. </view>
  52. </template>
  53. <script>
  54. /**
  55. * @des 关于商城详情
  56. *
  57. * @author stav stavyan@qq.com
  58. * @date 2019-12-09 10:13
  59. * @copyright 2019
  60. */
  61. import { configList } from '@/api/basic';
  62. import { merchantView } from '@/api/merchant';
  63. export default {
  64. data() {
  65. return {
  66. detail: {},
  67. title: null,
  68. loading: true
  69. };
  70. },
  71. onLoad(options) {
  72. this.initData(options);
  73. },
  74. methods: {
  75. // 数据初始化
  76. initData(options) {
  77. this.title = options.title;
  78. uni.setNavigationBarTitle({
  79. title: options.title
  80. });
  81. this.getConfigList(options.field);
  82. },
  83. // 获取商城详情
  84. async getConfigList(field) {
  85. if (field.indexOf('protocol') !== -1) {
  86. await this.$http
  87. .get(`${configList}`, {
  88. field
  89. })
  90. .then(r => {
  91. this.loading = false;
  92. this.detail = r.data;
  93. })
  94. .catch(() => {
  95. this.loading = false;
  96. });
  97. } else {
  98. const userInfo = uni.getStorageSync('userInfo');
  99. if (!userInfo) return;
  100. await this.$http
  101. .get(`${merchantView}`, {
  102. id: userInfo.merchant_id,
  103. field
  104. })
  105. .then(r => {
  106. this.loading = false;
  107. this.detail = r.data;
  108. })
  109. .catch(() => {
  110. this.loading = false;
  111. });
  112. }
  113. }
  114. }
  115. };
  116. </script>
  117. <style lang="scss">
  118. page {
  119. background-color: $page-color-base;
  120. position: relative;
  121. .about {
  122. .shop-info {
  123. .about-content {
  124. padding: $spacing-lg;
  125. }
  126. text-align: center;
  127. image {
  128. margin-top: 100upx;
  129. width: 240upx;
  130. height: 240upx;
  131. border-radius: 50%;
  132. }
  133. }
  134. }
  135. }
  136. </style>