about.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="about" v-if="!loading">
  3. <view
  4. class="list-cell b-b"
  5. v-for="item in navList"
  6. :key="item.title"
  7. @tap="
  8. navTo(`/pages/set/about/detail?field=${item.url}&title=${item.title}`)
  9. "
  10. hover-class="cell-hover"
  11. :hover-stay-time="50"
  12. >
  13. <text class="cell-tit">{{ item.title }}</text>
  14. <text class="cell-tip">{{ item.content }}</text>
  15. <text class="cell-more iconfont iconyou"></text>
  16. </view>
  17. <view class="history-section icon">
  18. <view class="sec-header">
  19. <i class="iconfont iconshare"></i>
  20. <text>分享二维码给好友</text>
  21. </view>
  22. <view class="qrcode-wrapper">
  23. <view class="qrcode-img-wrapper">
  24. <rf-qrcode class="qrcode" cid="qrcode2229" makeOnLoad :text="hostUrl" v-if="merchantId === '0'"></rf-qrcode>
  25. <rf-image class="qrcode-img" :src="aboutInfo.qrcode || ''" v-else></rf-image>
  26. </view>
  27. <text class="info">二维码</text>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. /**
  34. * @des 关于商城
  35. *
  36. * @author stav stavyan@qq.com
  37. * @date 2019-12-09 10:13
  38. * @copyright 2019
  39. */
  40. import { merchantView } from '@/api/merchant';
  41. import rfQrcode from '@/components/rf-qrcode';
  42. export default {
  43. components: { rfQrcode },
  44. data() {
  45. return {
  46. aboutInfo: {},
  47. navList: [
  48. { title: '商城介绍', url: '' },
  49. // { title: '版权信息', url: 'copyright_companyname,copyright_desc,copyright_url' },
  50. // { title: '证照信息', url: '' },
  51. { title: '注册协议', url: 'protocol_register' },
  52. { title: '充值协议', url: 'protocol_recharge' },
  53. { title: '隐私协议', url: 'protocol_privacy' }
  54. ],
  55. appName: this.$mSettingConfig.appName,
  56. loading: true,
  57. hostUrl: this.$mConfig.hostUrl,
  58. merchantId: ''
  59. };
  60. },
  61. onLoad() {
  62. this.initData();
  63. },
  64. methods: {
  65. // 初始化数据
  66. initData() {
  67. uni.setNavigationBarTitle({ title: `关于${this.appName}` });
  68. const userInfo = uni.getStorageSync('userInfo') || {};
  69. this.merchantId = userInfo.merchant_id;
  70. if (this.merchantId === '0') {
  71. this.navList.shift();
  72. this.loading = false;
  73. } else {
  74. this.getConfigList();
  75. }
  76. },
  77. // 获取商城信息
  78. async getConfigList() {
  79. await this.$http
  80. .get(`${merchantView}`, {
  81. id: this.merchantId,
  82. field: 'web_qrcode'
  83. })
  84. .then(r => {
  85. this.loading = false;
  86. this.aboutInfo = r.data;
  87. }).catch(() => {
  88. this.loading = false;
  89. });
  90. },
  91. // 统一跳转接口
  92. navTo(route) {
  93. this.$mRouter.push({ route });
  94. }
  95. }
  96. };
  97. </script>
  98. <style lang="scss">
  99. page {
  100. position: relative;
  101. background-color: #f5f5f5;
  102. }
  103. /*关于商城*/
  104. .about {
  105. padding: 20upx 0;
  106. .history-section {
  107. padding: 30upx 0 0;
  108. margin-top: 20upx;
  109. background: #fff;
  110. border-radius: 10upx;
  111. .sec-header {
  112. display: flex;
  113. align-items: center;
  114. font-size: $font-base;
  115. color: $font-color-dark;
  116. line-height: 40upx;
  117. margin-left: 30upx;
  118. .iconfont {
  119. font-size: 44upx;
  120. color: #5eba8f;
  121. margin-right: 16upx;
  122. line-height: 40upx;
  123. }
  124. }
  125. .qrcode-wrapper {
  126. padding: $spacing-lg 0;
  127. text-align: center;
  128. .qrcode-img-wrapper {
  129. display: flex;
  130. justify-content: center;
  131. align-items: center;
  132. }
  133. .qrcode {
  134. height: 280upx;
  135. }
  136. .qrcode-img {
  137. width: 300upx;
  138. height: 300upx;
  139. image {
  140. width: 300upx;
  141. height: 300upx;
  142. }
  143. }
  144. .info {
  145. display: block;
  146. }
  147. }
  148. }
  149. }
  150. </style>