fuwuleixingList.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view>
  3. <customNav :shownav="true" :title="title" titledetl=""></customNav>
  4. <view class="contentV">
  5. <uni-search-bar class="searchbar" :placeholder="$t('index.searchgoods')" cancelButton="none" locateButton="always" :readonly="true" v-on:searchClick="searchClick"></uni-search-bar>
  6. <listitemB v-on:Efenleixuanze="fenleixuanze"></listitemB>
  7. <text class="textfontB3" style="font-weight: bold;margin-left: 40rpx;margin-top: 20rpx;">{{$t('comp.rementj')}}</text>
  8. <view class="contentColumnC" style="margin-top: 16rpx;">
  9. <view class="item_content" v-for="(item,index) in mendianList" @click="mendianxuanze(item.id)">
  10. <imageconver :isremen="true" :isyouhui="false" :youhuinote="''" class="mainimage" :imagSrc="item.image"></imageconver>
  11. <view class="title textfontB3">
  12. <text>{{item.posName}}</text>
  13. </view>
  14. <view class="contentInRowS price textfontB5">
  15. <text>{{$t('index.manX')}} {{$formPr(item.posPrice)}}{{$t('locale.huobidw')}}</text>
  16. <text class="textfontB5" style="color:#00A6FF;">{{$formPr(item.juli)}}Km</text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import api from "@/pages/api/api.js";
  25. import listitemB from "@/pages/component/listitemB/listitemB.vue";
  26. export default {
  27. components:{
  28. listitemB,
  29. },
  30. data() {
  31. return {
  32. title:'',
  33. latitude:0,
  34. longitude:0,
  35. typeID:'',
  36. serverType:'',
  37. mendianList:[],
  38. juli:0,
  39. pageindex:1,
  40. }
  41. },
  42. onLoad(option) {
  43. this.serverType=option.serverType;
  44. this.latitude = option.latitude;
  45. this.longitude = option.longitude;
  46. },
  47. onShow() {
  48. var tempjuli=uni.getStorageSync('FuWujuli');
  49. if(''==tempjuli||null==tempjuli||undefined==tempjuli){
  50. this.juli=10;
  51. }
  52. else{
  53. this.juli=tempjuli;
  54. }
  55. if(this.serverType.length>0){
  56. this.pageindex=1;
  57. this.getserverlist(this.pageindex);
  58. }
  59. },
  60. methods: {
  61. searchClick(item){
  62. uni.navigateTo({
  63. url:'/pages/shanpinxungou/shangpin/shangpinList/shangpinList'
  64. })
  65. },
  66. fenleixuanze(id){
  67. uni.navigateTo({
  68. url:'/pages/shanpinxungou/shangjia/shangjia?id='+id+'&latitude='+this.latitude+'&longitude='+this.longitude
  69. })
  70. return;
  71. },
  72. mendianxuanze(id){
  73. uni.navigateTo({
  74. url:'/pages/shanpinxungou/shangjia/shangjiaView?id='+id+'&isShangjia=0'
  75. })
  76. },
  77. getserverlist(page){
  78. var data= {
  79. longitude:this.longitude,
  80. latitude:this.latitude,
  81. page:page,
  82. area:'',
  83. serverType:this.serverType,
  84. juli:this.juli
  85. };
  86. //console.log('getserverlist',data);
  87. api('getserverlist',data,
  88. r=>{
  89. console.log(r.data.data);
  90. if(page==1){
  91. this.mendianList=r.data.data;
  92. }
  93. else{
  94. if(r.data.data.length>0){
  95. var temp = this.mendianList;
  96. for(var i=0;i<r.data.data.length;i++){
  97. temp.push(r.data.data[i]);
  98. }
  99. this.mendianList=temp;
  100. }
  101. else{
  102. }
  103. }
  104. },failc=>{
  105. //console.log('getadvertis----',failc)
  106. })
  107. },
  108. },
  109. /**
  110. * 下拉刷新回调函数
  111. */
  112. onPullDownRefresh() {
  113. console.log('onPullDownRefresh')
  114. this.pageindex=1;
  115. },
  116. /**
  117. * 上拉加载回调函数
  118. */
  119. onReachBottom() {
  120. console.log('onReachBottom',this.pageindex)
  121. this.pageindex=this.pageindex+1;
  122. this.getserverlist(this.pageindex);
  123. },
  124. }
  125. </script>
  126. <style lang="scss">
  127. .contentV{
  128. width: 100%;
  129. }
  130. .searchbar{
  131. background-color: #00A6FF;
  132. padding-top: 30rpx;
  133. }
  134. .title{
  135. padding-top: 8rpx;
  136. width: 100%;
  137. text-align: left;
  138. }
  139. .item_content{
  140. background: white;
  141. width: 660rpx;
  142. height: 510rpx;
  143. }
  144. .mainimage{
  145. width: 660rpx;
  146. height: 330rpx;
  147. display: block;
  148. border-radius: 16rpx;
  149. background-color:floralwhite;
  150. border: 1rpx solid lightgray;
  151. }
  152. .Dishes{
  153. width: 100%;
  154. text-align: left;
  155. color: darkgray;
  156. font-size: 26rpx;
  157. }
  158. .price{
  159. width: 100%;
  160. text-align: left;
  161. //line-height: 28rpx;
  162. color: black;
  163. }
  164. </style>