xuanzemendian.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view >
  3. <customNav :shownav="true" :title="$t('index.xuanzemendian')" titledetl=""></customNav>
  4. <view style="margin-top: 50rpx;background-color:bisque;" v-for="(item,index) in mendianList">
  5. <view class="buyct" @click="gotomendian(item.id)">
  6. <netImage width="120" height="120" bradius="60" :mysrc="item.logo" mymode="scaleToFill"></netImage>
  7. <view class="msText">
  8. <text class="dianpuming">{{item.posName}}</text>
  9. <view class="buyBT">
  10. <image class="xingxing" src="/static/images/xingxing@3x.png" mode="aspectFit"></image>
  11. <text class="pingfentext">4.9</text>
  12. <text class="mainyuntishi">{{$t('index.manX')}} {{$formPr(item.posPrice)}}{{$t('locale.huobidw')}}</text>
  13. </view>
  14. <view class="buyBT">
  15. <text class="shijiantishi">{{$t('mend.waisongsj')}}</text>
  16. </view>
  17. </view>
  18. </view>
  19. <view @click="gotomendian(item.id)">
  20. <imageconver :isremen="true" :isyouhui="false" :youhuinote="''" class="mainimage" :imagSrc="item.image"></imageconver>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import api from "@/pages/api/api.js"
  27. export default {
  28. components: {},
  29. data() {
  30. return {
  31. // 数据表名
  32. //collection: 'opendb-mall-goods',
  33. // 查询字段,多个字段用 , 分割
  34. //field: 'goods_thumb,name,goods_tip,tag,goods_price,comment_count,month_sell_count,shop_name',
  35. formData: {
  36. status: 'loading', // 加载状态
  37. },
  38. tipShow: false ,// 是否显示顶部提示框
  39. data:[],
  40. mendianList:{},
  41. status:'noMore',
  42. loading:true,
  43. latitude:0,
  44. longitude:0,
  45. typeID:'',
  46. clickable:true,
  47. isLogin:false
  48. };
  49. },
  50. onShow() {
  51. var token = uni.getStorageSync("token");
  52. if(token == '' || token == undefined || token == null){
  53. // uni.navigateTo({
  54. // url:'/pages/UserCenter/LoginView'
  55. // })
  56. this.mendianList=[];
  57. this.isLogin=false;
  58. return;
  59. }
  60. else{
  61. this.isLogin=true;
  62. }
  63. this.getMymendianlist();
  64. this.formData.status = 'loading'
  65. },
  66. methods: {
  67. gotomendian(e){
  68. uni.setStorageSync("mendid",e)
  69. uni.navigateBack();
  70. return;
  71. },
  72. getMymendianlist(){
  73. //this.formData.status = 'more'
  74. this.tipShow = true
  75. api('getMymendianlist',{
  76. },
  77. r=>{
  78. console.log(r);
  79. this.mendianList=r.data.data;
  80. console.log(this.mendianList);
  81. uni.stopPullDownRefresh()
  82. this.tipShow = false
  83. },failc=>{
  84. //console.log('getadvertis----',failc)
  85. uni.stopPullDownRefresh()
  86. this.tipShow = false
  87. });
  88. },
  89. },
  90. /**
  91. * 下拉刷新回调函数
  92. */
  93. onPullDownRefresh() {
  94. this.getmendianlist(1);
  95. this.$refs.udb.loadData({
  96. clear: true
  97. }, () => {
  98. this.tipShow = true
  99. clearTimeout(this.timer)
  100. this.timer = setTimeout(()=>{
  101. this.tipShow = false
  102. },1000)
  103. uni.stopPullDownRefresh()
  104. })
  105. },
  106. };
  107. </script>
  108. <style lang="scss">
  109. @import '@/common/uni-ui.scss';
  110. .buyct{
  111. margin-top: 20rpx;
  112. height: 140rpx;
  113. padding: 14rpx;
  114. display: flex;
  115. flex-direction: row;
  116. background-color:white;
  117. }
  118. .msText{
  119. width: 530rpx;
  120. padding-left: 10rpx;
  121. font-size: 22rpx;
  122. line-height: 32rpx;
  123. }
  124. .dianpuming{
  125. font-size: 30rpx;
  126. line-height: 32rpx;
  127. font-weight: bold;
  128. overflow: hidden;
  129. text-overflow: ellipsis;
  130. display: -webkit-box;
  131. -webkit-line-clamp: 2;
  132. -webkit-box-orient: vertical;
  133. }
  134. .xingxing{
  135. width: 40rpx;
  136. height: 40rpx;
  137. }
  138. .pingfentext{
  139. font-size: 26rpx;
  140. line-height: 40rpx;
  141. height: 40rpx;
  142. color:sandybrown;
  143. }
  144. .mainyuntishi{
  145. margin-left: 30rpx;
  146. padding-left: 8rpx;
  147. padding-right: 8rpx;
  148. font-size: 26rpx;
  149. line-height: 40rpx;
  150. height: 40rpx;
  151. color: dimgray;
  152. background-color: burlywood;
  153. border-radius: 4rpx;
  154. }
  155. .shijiantishi{
  156. margin-left: 30rpx;
  157. font-size: 26rpx;
  158. line-height: 40rpx;
  159. height: 40rpx;
  160. color: dimgray;
  161. }
  162. .mainimage{
  163. width: 100%;
  164. height: 330rpx;
  165. display: block;
  166. border-radius: 0rpx;
  167. }
  168. </style>