金诚优选前端代码
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.

162 lines
3.7 KiB

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