pinglunNSP.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <list class="list" :offset-accuracy="5" :bounce="false" isSwiperList="true">
  3. <refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown"
  4. :display="refreshing ? 'show' : 'hide'">
  5. <div class="refresh-view">
  6. <text class="loading-text">{{refreshText}}</text>
  7. </div>
  8. </refresh>
  9. <cell v-for="(item, index) in dataList" :key="item.id" @click="onclick">
  10. <view class="item_content2" v-if="itemType===2">
  11. <view class="title">
  12. <text>邕蚝烧烤</text>
  13. <image class="xingimage" src="/static/images/listIcon.png" mode="aspectFit"></image>
  14. <text class="stattype">4</text>
  15. </view>
  16. <view class="DishesRow">
  17. <label class="Dishes">海鲜烧烤</label>
  18. <label class="Dishes">待支付,剩余12:23</label>
  19. </view>
  20. <view class="DishesRow">
  21. <label class="Dishes">海鲜烧烤</label>
  22. <label class="Dishes">待支付,剩余12:23</label>
  23. </view>
  24. <view class="buyBT">
  25. <Label class="paybt">点赞</Label>
  26. </view>
  27. </view>
  28. </cell>
  29. </list>
  30. </template>
  31. <script>
  32. export default {
  33. props: {
  34. pid: {
  35. type: [Number, String],
  36. default: ''
  37. },
  38. parentId: {
  39. type: String,
  40. default: ''
  41. }
  42. },
  43. data() {
  44. return {
  45. scrollable: true,
  46. dataList: [],
  47. refreshing: false,
  48. refreshText: "",
  49. refreshFlag: false,
  50. itemType:2,
  51. }
  52. },
  53. created() {
  54. for (var i = 1; i < 32; i++) {
  55. this.dataList.push({
  56. id: i,
  57. name: i
  58. });
  59. }
  60. },
  61. methods: {
  62. onclick(e) {
  63. console.log("onclick");
  64. },
  65. loadData() {
  66. // 首次激活时被调用
  67. },
  68. clear() {
  69. // 释放数据时被调用,参考 swiper-list 缓存配置
  70. this.dataList.length = 0;
  71. },
  72. onrefresh(e) {
  73. this.refreshing = true;
  74. this.refreshText = "刷新中...";
  75. setTimeout(() => {
  76. this.refreshing = false;
  77. this.refreshFlag = false;
  78. this.refreshText = "已刷新";
  79. }, 2000)
  80. },
  81. onpullingdown(e) {
  82. if (this.refreshing) {
  83. return;
  84. }
  85. this.pulling = false;
  86. if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {
  87. this.refreshFlag = true;
  88. this.refreshText = "释放立即刷新";
  89. } else {
  90. this.refreshFlag = false;
  91. this.refreshText = "下拉可以刷新";
  92. }
  93. }
  94. }
  95. }
  96. </script>
  97. <style scoped>
  98. .refresh-view {
  99. width: 750rpx;
  100. height: 80px;
  101. flex-direction: row;
  102. align-items: center;
  103. justify-content: center;
  104. }
  105. .list {
  106. flex: 1;
  107. background-color: #ebebeb;
  108. }
  109. .list-item {
  110. margin-left: 12px;
  111. margin-right: 12px;
  112. margin-top: 12px;
  113. padding: 20rpx;
  114. background-color: #fff;
  115. border-radius: 5px;
  116. }
  117. .item_content{
  118. background: bisque;
  119. width: 100%;
  120. height: 460rpx;
  121. margin: 10rpx 0;
  122. padding: 14rpx;
  123. box-sizing: border-box;
  124. border-radius: 15rpx;
  125. border: 2rpx solid red;
  126. }
  127. .mainimage{
  128. width: 100%;
  129. height: 320rpx;
  130. display: block;
  131. background-color: rebeccapurple;
  132. }
  133. .titleview{
  134. padding-left: 16rpx;
  135. padding-top: 16rpx;
  136. font-size: 40rpx;
  137. line-height: 46rpx;
  138. }
  139. .title{
  140. width: 100%;
  141. text-align: left;
  142. font-size: 36rpx;
  143. line-height: 40rpx;
  144. padding-left: 10rpx;
  145. font-weight:bold;
  146. flex-direction: row;
  147. align-items: center;
  148. }
  149. .DishesRow{
  150. margin-left: 10rpx;
  151. display: flex;
  152. flex-direction: row;
  153. justify-content:right;
  154. }
  155. .Dishes{
  156. text-align: left;
  157. font-size: 30rpx;
  158. line-height: 40rpx;
  159. }
  160. .xiaoliang{
  161. margin-left: auto;
  162. display: flex;
  163. flex-direction: row;
  164. justify-content:right;
  165. margin-right: 10rpx;
  166. word-break:keep-all;
  167. font-size: 32rpx;
  168. color: crimson;
  169. font-weight:bold;
  170. }
  171. .price{
  172. padding-left: 10rpx;
  173. width: 100%;
  174. text-align: left;
  175. font-size: 28rpx;
  176. line-height: 40rpx;
  177. color: crimson;
  178. }
  179. .buttonCt{
  180. margin-left: auto;
  181. display: flex;
  182. flex-direction: row;
  183. justify-content:right;
  184. margin-bottom: 16rpx;
  185. }
  186. .paybt{
  187. margin-right: 20rpx;
  188. padding-left: 8rpx;
  189. padding-right: 8rpx;
  190. height: 48rpx;
  191. line-height: 48rpx;
  192. border-radius: 15rpx;
  193. background-color: yellow;
  194. }
  195. .canceldd{
  196. margin-right: 30rpx;
  197. padding-left: 8rpx;
  198. padding-right: 8rpx;
  199. line-height: 48rpx;
  200. height: 48rpx;
  201. border-radius: 15rpx;
  202. background-color: crimson;
  203. }
  204. .item_content2{
  205. background: bisque;
  206. width: 100%;
  207. height: 200rpx;
  208. margin: 10rpx 0;
  209. padding: 14rpx;
  210. box-sizing: border-box;
  211. border-radius: 15rpx;
  212. border: 2rpx solid red;
  213. }
  214. .buyct{
  215. width: 100%;
  216. height: 120rpx;
  217. padding: 14rpx;
  218. display: flex;
  219. flex-direction: row;
  220. }
  221. .buyimage{
  222. width: 100rpx;
  223. height: 100rpx;
  224. background-color: aquamarine;
  225. }
  226. .buyBT{
  227. margin-left: auto;
  228. display: flex;
  229. flex-direction: row;
  230. justify-content:right;
  231. }
  232. .msText{
  233. padding-left: 10rpx;
  234. text-align: left;
  235. font-size: 22rpx;
  236. line-height: 32rpx;
  237. }
  238. .stattype{
  239. font-size: 22rpx;
  240. line-height: 32rpx;
  241. margin-right: 10rpx;
  242. }
  243. .xingimage{
  244. margin-left: auto;
  245. margin-right: 10rpx;
  246. width: 30rpx;
  247. height: 30rpx;
  248. background-color: aquamarine;
  249. }
  250. </style>