| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template>
- <view>
- <customNav :shownav="true" :title="title" titledetl=""></customNav>
- <view class="contentV">
- <uni-search-bar class="searchbar" :placeholder="$t('index.searchgoods')" cancelButton="none" locateButton="always" :readonly="true" v-on:searchClick="searchClick"></uni-search-bar>
- <listitemB v-on:Efenleixuanze="fenleixuanze"></listitemB>
- <text class="textfontB3" style="font-weight: bold;margin-left: 40rpx;margin-top: 20rpx;">{{$t('comp.rementj')}}</text>
- <view class="contentColumnC" style="margin-top: 16rpx;">
- <view class="item_content" v-for="(item,index) in mendianList" @click="mendianxuanze(item.id)">
- <imageconver :isremen="true" :isyouhui="false" :youhuinote="''" class="mainimage" :imagSrc="item.image"></imageconver>
- <view class="title textfontB3">
- <text>{{item.posName}}</text>
- </view>
- <view class="contentInRowS price textfontB5">
- <text>{{$t('index.manX')}} {{$formPr(item.posPrice)}}{{$t('locale.huobidw')}}</text>
- <text class="textfontB5" style="color:#00A6FF;">{{$formPr(item.juli)}}Km</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import api from "@/pages/api/api.js";
- import listitemB from "@/pages/component/listitemB/listitemB.vue";
- export default {
- components:{
- listitemB,
- },
- data() {
- return {
- title:'',
- latitude:0,
- longitude:0,
- typeID:'',
- serverType:'',
- mendianList:[],
- juli:0,
- pageindex:1,
- }
- },
- onLoad(option) {
- this.serverType=option.serverType;
- this.latitude = option.latitude;
- this.longitude = option.longitude;
- },
- onShow() {
- var tempjuli=uni.getStorageSync('FuWujuli');
- if(''==tempjuli||null==tempjuli||undefined==tempjuli){
- this.juli=10;
- }
- else{
- this.juli=tempjuli;
- }
- if(this.serverType.length>0){
- this.pageindex=1;
- this.getserverlist(this.pageindex);
- }
-
- },
- methods: {
- searchClick(item){
- uni.navigateTo({
- url:'/pages/shanpinxungou/shangpin/shangpinList/shangpinList'
- })
- },
- fenleixuanze(id){
- uni.navigateTo({
- url:'/pages/shanpinxungou/shangjia/shangjia?id='+id+'&latitude='+this.latitude+'&longitude='+this.longitude
- })
- return;
- },
- mendianxuanze(id){
- uni.navigateTo({
- url:'/pages/shanpinxungou/shangjia/shangjiaView?id='+id+'&isShangjia=0'
- })
- },
- getserverlist(page){
- var data= {
- longitude:this.longitude,
- latitude:this.latitude,
- page:page,
- area:'',
- serverType:this.serverType,
- juli:this.juli
- };
- //console.log('getserverlist',data);
- api('getserverlist',data,
- r=>{
- console.log(r.data.data);
- if(page==1){
- this.mendianList=r.data.data;
- }
- else{
- if(r.data.data.length>0){
- var temp = this.mendianList;
- for(var i=0;i<r.data.data.length;i++){
- temp.push(r.data.data[i]);
- }
- this.mendianList=temp;
- }
- else{
-
- }
- }
- },failc=>{
- //console.log('getadvertis----',failc)
- })
- },
- },
- /**
- * 下拉刷新回调函数
- */
- onPullDownRefresh() {
- console.log('onPullDownRefresh')
- this.pageindex=1;
- },
- /**
- * 上拉加载回调函数
- */
- onReachBottom() {
- console.log('onReachBottom',this.pageindex)
- this.pageindex=this.pageindex+1;
- this.getserverlist(this.pageindex);
- },
- }
- </script>
- <style lang="scss">
- .contentV{
- width: 100%;
- }
- .searchbar{
- background-color: #00A6FF;
- padding-top: 30rpx;
- }
- .title{
- padding-top: 8rpx;
- width: 100%;
- text-align: left;
- }
- .item_content{
- background: white;
- width: 660rpx;
- height: 510rpx;
- }
- .mainimage{
- width: 660rpx;
- height: 330rpx;
- display: block;
- border-radius: 16rpx;
- background-color:floralwhite;
- border: 1rpx solid lightgray;
- }
- .Dishes{
- width: 100%;
- text-align: left;
- color: darkgray;
- font-size: 26rpx;
- }
- .price{
- width: 100%;
- text-align: left;
- //line-height: 28rpx;
- color: black;
- }
- </style>
|