wodemendian.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view >
  3. <customNav :shownav="true" showfanhui="1" :title="$t('index.wodemendian')" titledetl="" addBT='1' v-on:Enavbarsel="addmendian"></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. addmendian(){
  68. if(!this.isLogin){
  69. uni.navigateTo({
  70. url:'/pages/UserCenter/LoginView'
  71. })
  72. return;
  73. }
  74. uni.navigateTo({
  75. url:'/pages/UserCenter/mendian/addmendian'
  76. })
  77. },
  78. gotomendian(e){
  79. uni.navigateTo({
  80. url:'/pages/shanpinxungou/shangjia/merchantdetail?id='+e
  81. })
  82. },
  83. getMymendianlist(){
  84. //this.formData.status = 'more'
  85. this.tipShow = true
  86. api('getMymendianlist',{
  87. },
  88. r=>{
  89. console.log(r);
  90. this.mendianList=r.data.data;
  91. console.log(this.mendianList);
  92. uni.stopPullDownRefresh()
  93. this.tipShow = false
  94. },failc=>{
  95. //console.log('getadvertis----',failc)
  96. uni.stopPullDownRefresh()
  97. this.tipShow = false
  98. });
  99. },
  100. // changeState(medObj){
  101. // var strMsg='';
  102. // var state=0;
  103. // if(medObj.state==1){
  104. // strMsg=this.$t('mend.kaishiyy');
  105. // state=0;
  106. // }
  107. // else{
  108. // strMsg=this.$t('mend.dayang');
  109. // state=1;
  110. // }
  111. // var that = this;
  112. // uni.showModal({
  113. // title: this.$t('api.message'),
  114. // content: strMsg,
  115. // cancelText: that.$t('order.quxiao'), // 取消按钮的文字
  116. // confirmText: that.$t('comp.queren'), // 确认按钮的文字
  117. // success: function (res) {
  118. // if (res.confirm) { //这里是点击了确定以后
  119. // that.$http.post(`${addmendian}`, {
  120. // "id":medObj.id,
  121. // "state":state
  122. // },false)
  123. // .then(r => {
  124. // console.log(r)
  125. // that.getMymendianlist();
  126. // })
  127. // .catch(err => {
  128. // console.log(err)
  129. // })
  130. // } else { //这里是点击了取消以后
  131. // console.log('用户点击取消')
  132. // }
  133. // }
  134. // })
  135. // },
  136. },
  137. /**
  138. * 下拉刷新回调函数
  139. */
  140. onPullDownRefresh() {
  141. this.getmendianlist(1);
  142. this.$refs.udb.loadData({
  143. clear: true
  144. }, () => {
  145. this.tipShow = true
  146. clearTimeout(this.timer)
  147. this.timer = setTimeout(()=>{
  148. this.tipShow = false
  149. },1000)
  150. uni.stopPullDownRefresh()
  151. })
  152. },
  153. };
  154. </script>
  155. <style lang="scss">
  156. @import '@/common/uni-ui.scss';
  157. .buyct{
  158. margin-top: 20rpx;
  159. height: 140rpx;
  160. padding: 14rpx;
  161. display: flex;
  162. flex-direction: row;
  163. background-color:white;
  164. }
  165. .msText{
  166. width: 530rpx;
  167. padding-left: 10rpx;
  168. font-size: 22rpx;
  169. line-height: 32rpx;
  170. }
  171. .dianpuming{
  172. font-size: 30rpx;
  173. line-height: 32rpx;
  174. font-weight: bold;
  175. overflow: hidden;
  176. text-overflow: ellipsis;
  177. display: -webkit-box;
  178. -webkit-line-clamp: 2;
  179. -webkit-box-orient: vertical;
  180. }
  181. .xingxing{
  182. width: 40rpx;
  183. height: 40rpx;
  184. }
  185. .pingfentext{
  186. font-size: 26rpx;
  187. line-height: 40rpx;
  188. height: 40rpx;
  189. color:sandybrown;
  190. }
  191. .mainyuntishi{
  192. margin-left: 30rpx;
  193. padding-left: 8rpx;
  194. padding-right: 8rpx;
  195. font-size: 26rpx;
  196. line-height: 40rpx;
  197. height: 40rpx;
  198. color: dimgray;
  199. background-color: burlywood;
  200. border-radius: 4rpx;
  201. }
  202. .shijiantishi{
  203. margin-left: 30rpx;
  204. font-size: 26rpx;
  205. line-height: 40rpx;
  206. height: 40rpx;
  207. color: dimgray;
  208. }
  209. .mainimage{
  210. width: 100%;
  211. height: 330rpx;
  212. display: block;
  213. border-radius: 0rpx;
  214. }
  215. </style>