金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
3.4 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="会员服务" :showIcon="true"></lf-nav>
  4. <view class="content">
  5. <view class="head">
  6. <image mode="aspectFill" src="https://picsum.photos/seed/picsum/200/300"></image>
  7. </view>
  8. <view class="main">
  9. <view class="item" v-for="(item, index) in serviceList" :key="index">
  10. <image class="img" :src="item.image" mode="aspectFill"></image>
  11. <view class="title">{{item.name}}</view>
  12. <view class="desc">{{item.remark}}</view>
  13. </view>
  14. </view>
  15. <view style="height: 120rpx;"></view>
  16. <view class="fixed">
  17. <view class="btn1 lf-m-r-25" hover-class="lf-opacity" @click="$url('/pages/user/my/chatonline')">在线客服</view>
  18. <view class="btn2" hover-class="lf-opacity">拨打客服电话</view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data(){
  26. return {
  27. serviceList: []
  28. }
  29. },
  30. onLoad(){
  31. this.getService()
  32. },
  33. methods: {
  34. getService() {
  35. this.$http
  36. .get({
  37. api: 'api/service'
  38. })
  39. .then(res => {
  40. if (res.data.code == 200) {
  41. if (res.data.status) {
  42. this.serviceList = res.data.data
  43. console.log('数组列表',this.serviceList)
  44. } else {
  45. wx.showModal({
  46. content: res.message || '请下拉页面刷新重试',
  47. showCancel: false
  48. });
  49. }
  50. } else {
  51. wx.showModal({
  52. content: '请下拉页面刷新重试',
  53. showCancel: false
  54. });
  55. }
  56. wx.hideLoading();
  57. })
  58. .catch(() => {
  59. wx.hideLoading();
  60. wx.showModal({
  61. content: '请求失败',
  62. showCancel: false
  63. });
  64. });
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped="scoped">
  70. .content{
  71. padding: 30rpx 32rpx;
  72. .head{
  73. width: 686rpx;
  74. height: 300rpx;
  75. border-radius: 20rpx;
  76. overflow: hidden;
  77. &>image{
  78. width: 100%;
  79. height: 100%;
  80. }
  81. }
  82. .main{
  83. width: 100%;
  84. display: flex;
  85. flex-wrap: wrap;
  86. .item{
  87. width: 200rpx;
  88. height: max-content;
  89. display: flex;
  90. flex-direction: column;
  91. justify-content: center;
  92. align-items: center;
  93. margin-top: 40rpx;
  94. margin-right: 43rpx;
  95. &:nth-child(3n){
  96. margin-right: 0rpx;
  97. }
  98. .img{
  99. width: 200rpx;
  100. height: 200rpx;
  101. background-color: #D8D8D8;
  102. border-radius: 20rpx;
  103. }
  104. .title{
  105. font-size: 28rpx;
  106. color: #222222;
  107. margin-top: 20rpx;
  108. }
  109. .desc{
  110. font-size: 24rpx;
  111. color: #777777;
  112. margin-top: 10rpx;
  113. }
  114. }
  115. }
  116. .fixed{
  117. height: 120rpx;
  118. width: 750rpx;
  119. position: fixed;
  120. bottom: 0;
  121. left: 0;
  122. z-index: 2;
  123. background-color: #FFFFFF;
  124. border-top: 1rpx solid #e5e5e5;
  125. box-sizing: border-box;
  126. padding: 0 32rpx;
  127. display: flex;
  128. justify-content: space-between;
  129. align-items: center;
  130. .btn1{
  131. width: 243rpx;
  132. height: 100rpx;
  133. border-radius: 50rpx;
  134. border: 2rpx solid #15716E;
  135. display: flex;
  136. justify-content: center;
  137. align-items: center;
  138. color: #15716E;
  139. font-size: 32rpx;
  140. }
  141. .btn2{
  142. // width: 423rpx;
  143. width: 686rpx;
  144. height: 100rpx;
  145. background: #15716E;
  146. border-radius: 50rpx;
  147. color: #FFFFFF;
  148. display: flex;
  149. justify-content: center;
  150. align-items: center;
  151. }
  152. }
  153. }
  154. </style>