wdzx.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <view class="">
  3. <view class="zxkjyr">
  4. <view :class="['zxkjyra',Inv==0?'zxkjyrff':'']" @click="changeInv(0)">
  5. <text>咨询中</text>
  6. <view class="zxkjxh"></view>
  7. </view>
  8. <view :class="['zxkjyra',Inv==1?'zxkjyrff':'']" @click="changeInv(1)">
  9. <text>已结束</text>
  10. <view class="zxkjxh"></view>
  11. </view>
  12. </view>
  13. <view style="margin-top: 30rpx;">
  14. <view class="nodata_box" v-if="list.length==0">
  15. <image src="/static/user/no_data_img.png" mode="" style="width: 220rpx; height: 302rpx;"></image>
  16. <text>暂无数据</text>
  17. </view>
  18. <navigator class="fzctob wdlbgt" :url="'../index/zxshi?id=' + item1.course_data.lecturer_id + '&type=0'" hover-class="none" v-for="(item1,index1) in list" :key="index1">
  19. <image :src="item1.course_data.img"
  20. style="width: 148rpx;height: 148rpx;min-width: 148rpx;border-radius:160rpx;" mode=""></image>
  21. <view class="flztoa wdkkjruy">
  22. <view class="fsxto">
  23. <text class="wdtxtut">{{item1.course_data.title}}</text>
  24. <view class="wdtxtut"> 电话:{{item1.lecturer_data.phone}}</view>
  25. <view class="fzctob wdtxtuta">
  26. <text v-for="(item2,index2) in item1.lecturer_data.tag" :key="index2">{{item2}}</text>
  27. </view>
  28. <view class="fzctob wdtxtutb" @click.stop="lookaddress(item1.lecturer_data.lotx,item1.lecturer_data.loty,item1.lecturer_data.address)">
  29. <image src="/static/lecturer/lea2.png"
  30. style="width: 32rpx;height: 32rpx;min-width: 32rpx;" mode=""></image>
  31. <text>{{item1.course_data.city}}</text>
  32. </view>
  33. </view>
  34. <view class="fzddrew">
  35. <view class="fzctob" style="height: 40rpx;margin-top: 76rpx;">
  36. <text class="wdjga">¥</text>
  37. <text class="wdjgb">{{item1.reality_price}}</text>
  38. </view>
  39. </view>
  40. </view>
  41. </navigator>
  42. </view>
  43. <view style="height: 120rpx;"></view>
  44. <view class="dibuboot">
  45. <navigator class="dibubootlb" url="../index/index" open-type="redirect" hover-class="none">
  46. <image src="/static/dibu/boa1.png" style="width: 48rpx;height: 48rpx;"></image>
  47. <text>首页</text>
  48. </navigator>
  49. <!-- <navigator class="dibubootlb" url="../lecturer/wdzx" open-type="redirect" hover-class="none">
  50. <image src="/static/dibu/bob2.png" style="width: 48rpx;height: 48rpx;"></image>
  51. <text style="color: #374B6E">咨询</text>
  52. </navigator>
  53. <navigator class="dibubootlb" url="../index/jiehuo" open-type="redirect" hover-class="none">
  54. <image src="/static/dibu/boa3.png" style="width: 48rpx;height: 48rpx;"></image>
  55. <text>解惑</text>
  56. </navigator> -->
  57. <navigator class="dibubootlb" url="../lecturer/my" open-type="redirect" hover-class="none">
  58. <image src="/static/dibu/boa4.png" style="width: 48rpx;height: 48rpx;"></image>
  59. <text>我的</text>
  60. </navigator>
  61. </view>
  62. </view>
  63. </template>
  64. <style>
  65. page {
  66. background: #FAFAFA;
  67. }
  68. </style>
  69. <script>
  70. export default {
  71. data() {
  72. return {
  73. Inv: 0,
  74. page: 1,
  75. num: 20,
  76. list: [],
  77. total: 0,
  78. user_id: '',
  79. }
  80. },
  81. onLoad() {
  82. this.user_id = uni.getStorageSync('id');
  83. this.getlist();
  84. },
  85. onReachBottom() {
  86. if (this.list.length < this.total) {
  87. this.page = this.page + 1
  88. this.getlist();
  89. } else {
  90. uni.showToast({
  91. title: '没有更多数据了',
  92. icon: 'none'
  93. })
  94. }
  95. },
  96. methods: {
  97. changeInv(indexs) {
  98. let that = this;
  99. that.Inv = indexs;
  100. that.list = [];
  101. that.page = 1;
  102. that.getlist();
  103. },
  104. getlist() {
  105. let that = this;
  106. this.$post({
  107. data: {
  108. do: 'MyCourseOrder',
  109. data: {
  110. page: that.page,
  111. num: that.num,
  112. good_type: '2',
  113. user_id: that.user_id,
  114. type: that.Inv == 0 ? '2' : '3'
  115. }
  116. }
  117. }).then(res => {
  118. that.list = [...that.list,...res.data.list]
  119. that.total = res.data.total
  120. })
  121. },
  122. lookaddress(latitude,longitude,name){
  123. // latitude: 39.947309, // 纬度示例
  124. // longitude: 116.390965, // 经度示例
  125. uni.openLocation({
  126. latitude:latitude/1, // 纬度
  127. longitude:longitude/1, // 经度
  128. name,
  129. success: res=> {
  130. console.log(res,'success');
  131. }
  132. });
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss" scoped>
  138. .nodata_box{
  139. display: flex;
  140. flex-direction: column;
  141. justify-content: center;
  142. align-items: center;
  143. margin: 0 auto;
  144. margin-top: 250rpx;
  145. }
  146. </style>