index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  3. <tm-menubars title="消息列表" :shadow="0" :showback="true"></tm-menubars>
  4. <div class="zhuti">
  5. <tm-sheet class="kuang" style="padding-bottom: 30px !important;" v-if="listdata.length!=0" >
  6. <view style="width: 94%;margin:0 auto;" class="remen">
  7. <view v-for="(item,index) in listdata" class="round-5 contone black mt-20" :class="index%2==0?'fl':'fr'" @click="goDetail(item.category_id)">
  8. <image class="logo" :src="item.image" mode="widthFix"></image>
  9. <view class="pa-15 text-size-s">
  10. <view class="text-overflow-2">
  11. <text class="text-size-lg">{{item.goods_name}}</text>
  12. <view class="text-gray mt-6">销量:{{item.stock_num}}</view>
  13. </view>
  14. <view class="mt-2 flex-between flex-center">
  15. <view class="touxiang mt-30">
  16. <text class="text-white text-size-m text-weight-b">{{item.sale_price}}</text>
  17. </view>
  18. <view >
  19. <image @click="jiarufuFun(item)" class="remenzan" src="/static/img/86.png" mode="widthFix"></image>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view style="clear: both;"></view>
  25. <view style="clear: both;" class="more ma-40 pt-40" @click="gengmore()" >
  26. <image src="/static/img/30.png" mode="widthFix"></image>
  27. <text class="text-size-s">下拉加载更多~</text>
  28. </view>
  29. </view>
  30. </tm-sheet>
  31. <view style="height:60px"></view>
  32. </div>
  33. <!-- 弹出层消息 -->
  34. <tm-message ref="toast"></tm-message>
  35. </view>
  36. </template>
  37. <script>
  38. import{myRequest} from '@/api/request.js'
  39. export default {
  40. data() {
  41. return {
  42. typeclick:1,
  43. listdata:[],
  44. soId:'',
  45. page:1,
  46. pagesize:8,
  47. };
  48. },
  49. onLoad(op) {
  50. console.log(op);
  51. this.soId=op.id
  52. },
  53. created() {
  54. this.sys = uni.getSystemInfoSync();
  55. // this.randouh()
  56. this.getSort()
  57. },
  58. methods: {
  59. gengmore(){
  60. // this.randouh()
  61. },
  62. jiarufuFun(data){
  63. uni.navigateTo({
  64. url: "/pages/gouwuche/index",
  65. })
  66. // console.log(data)
  67. // this.gouwuche.push(data)
  68. },
  69. getSort(){
  70. let that=this;
  71. myRequest({
  72. url:'/api/ShopGoods/childrenClassificationList',
  73. method:'post',
  74. data:{id:that.soId,page:that.page,pagesize:that.pagesize}
  75. }).then(res=>{
  76. if(res.data.code==200){
  77. if(res.data.data.length!=0){
  78. console.log(res.data.data,'liebiao');
  79. that.listdata=res.data.data.data;
  80. }else{
  81. that.listdata=[]
  82. }
  83. }else{
  84. that.$refs.toast.show({
  85. model: 'error',
  86. label: res.data.msg
  87. })
  88. }
  89. })
  90. },
  91. goindex(){
  92. uni.navigateBack();
  93. },
  94. goDetail(id){
  95. uni.navigateTo({
  96. url:'/pages/shopdetail/index?cartId='+id
  97. })
  98. },
  99. change(e){
  100. console.log(e)
  101. },
  102. sosoFun(){
  103. }
  104. },
  105. }
  106. </script>
  107. <style lang="scss">
  108. /deep/ .tm-menubars .body{
  109. background-color: #1b1b1b !important;
  110. }
  111. /deep/ .zhuti{padding: 10px 10px;}
  112. /deep/ .kuang{margin:0 !important;padding: 0px !important;}
  113. /deep/ .icon-search{
  114. font-size: 23px !important;
  115. color: #8E8E93 !important;
  116. }
  117. /deep/ .tm-search{
  118. width: 66%;
  119. background-color: #414141 !important;
  120. border-radius: 10px;
  121. }
  122. /deep/ .tm-search .grey-darken-5{
  123. background-color: #414141 !important;
  124. }
  125. .dingwei{width: 21%;margin-top:3%;}
  126. .shuruk{width: 77%;}
  127. .sousuo{width:94%;margin:0 auto;}
  128. .quxiao{color: #707070;line-height: 47px;}
  129. .contone{width: 48%;}
  130. .logo{width: 100%;}
  131. .remenzan{width: 18px !important;margin-top: 10px;}
  132. .more{text-align: center;}
  133. .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
  134. </style>