shangpinItem.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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(item.id)">
  10. <view class="item_content2">
  11. <view class="buyctT">
  12. <image class="goodimage" src="/static/defimages/324.png" mode="aspectFit"></image>
  13. <view class="msText">
  14. <text class="dianpuming">羊肉串5元/份</text>
  15. <text class="peisongsuoming">新鲜大串</text>
  16. <view class="buyBT">
  17. <text class="youhuixinxi">新客暴抢¥4</text>
  18. <text class="youhuixinxi">低至8.5折</text>
  19. <text class="youhuixinxi">满100减20</text>
  20. </view>
  21. <view class="buyBTSB">
  22. <text class="peisongsuoming">¥15</text>
  23. <text class="peisongsuoming">月销300+</text>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="linesp"></view>
  28. <view class="buyct">
  29. <image class="sjimage" src="/static/defimages/324.png" mode="aspectFit"></image>
  30. <view class="msText">
  31. <text class="dianpuming">拥您烧烤</text>
  32. <view class="buyBT">
  33. <image class="xingxing" src="/static/images/评分、星星.png" mode="aspectFit"></image>
  34. <text class="pingfentext">4.9</text>
  35. <text class="mainyuntishi">5KM免运费</text>
  36. <text class="shijiantishi">约20分钟</text>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </cell>
  42. </list>
  43. </template>
  44. <script>
  45. import uniList from '@/uni_modules/uni-list/uni-list.vue';
  46. import uniListItem from '@/uni_modules/uni-list-item/uni-list-item.vue';
  47. import uniAd from '@/uni_modules/uni-list-ad/uni-list-ad.vue';
  48. import uniChat from '@/uni_modules/uni-list-chat/uni-list-chat.vue';
  49. export default {
  50. components:{
  51. uniList,uniListItem,uniAd,uniChat
  52. },
  53. props: {
  54. pid: {
  55. type: [Number, String],
  56. default: ''
  57. },
  58. parentId: {
  59. type: String,
  60. default: ''
  61. }
  62. },
  63. data() {
  64. return {
  65. scrollable: true,
  66. dataList: [],
  67. refreshing: false,
  68. refreshText: "",
  69. refreshFlag: false,
  70. itemType:2,
  71. }
  72. },
  73. created() {
  74. for (var i = 1; i < 32; i++) {
  75. this.dataList.push({
  76. id: i,
  77. name: i
  78. });
  79. }
  80. },
  81. methods: {
  82. onclick(e) {
  83. console.log(e);
  84. this.$emit('EspItemsel',e);
  85. },
  86. loadData() {
  87. // 首次激活时被调用
  88. },
  89. clear() {
  90. // 释放数据时被调用,参考 swiper-list 缓存配置
  91. this.dataList.length = 0;
  92. },
  93. onrefresh(e) {
  94. this.refreshing = true;
  95. this.refreshText = "刷新中...";
  96. setTimeout(() => {
  97. this.refreshing = false;
  98. this.refreshFlag = false;
  99. this.refreshText = "已刷新";
  100. }, 2000)
  101. },
  102. onpullingdown(e) {
  103. if (this.refreshing) {
  104. return;
  105. }
  106. this.pulling = false;
  107. if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {
  108. this.refreshFlag = true;
  109. this.refreshText = "释放立即刷新";
  110. } else {
  111. this.refreshFlag = false;
  112. this.refreshText = "下拉可以刷新";
  113. }
  114. }
  115. }
  116. }
  117. </script>
  118. <style scoped>
  119. .refresh-view {
  120. width: 750rpx;
  121. height: 80px;
  122. flex-direction: row;
  123. align-items: center;
  124. justify-content: center;
  125. }
  126. .list {
  127. flex: 1;
  128. background-color: #ebebeb;
  129. }
  130. .linesp{
  131. height: 2rpx;
  132. background-color: aliceblue;
  133. }
  134. .item_content2{
  135. background: white;
  136. height: 300rpx;
  137. margin: 10rpx;
  138. box-sizing: border-box;
  139. border-radius: 15rpx;
  140. border: 2rpx solid darkgray;
  141. }
  142. .buyctT{
  143. height: 190rpx;
  144. padding: 14rpx;
  145. display: flex;
  146. flex-direction: row;
  147. }
  148. .buyct{
  149. height: 160rpx;
  150. padding: 14rpx;
  151. display: flex;
  152. flex-direction: row;
  153. }
  154. .goodimage{
  155. width: 160rpx;
  156. height: 160rpx;
  157. }
  158. .sjimage{
  159. width: 80rpx;
  160. height: 80rpx;
  161. }
  162. .buyBTSB{
  163. display: flex;
  164. flex-direction: row;
  165. justify-content:space-between;
  166. align-items: center;
  167. }
  168. .buyBT{
  169. display: flex;
  170. flex-direction: row;
  171. justify-content:left;
  172. align-items: center;
  173. }
  174. .rightjustify{
  175. margin-left: auto;
  176. display: flex;
  177. flex-direction: row;
  178. justify-content:right;
  179. }
  180. .msText{
  181. width: 530rpx;
  182. padding-left: 10rpx;
  183. font-size: 22rpx;
  184. line-height: 32rpx;
  185. }
  186. .dianpuming{
  187. font-size: 30rpx;
  188. line-height: 32rpx;
  189. height: 32rpx;
  190. font-weight: bold;
  191. }
  192. .peisongsuoming{
  193. font-size: 26rpx;
  194. line-height: 38rpx;
  195. height: 38rpx;
  196. color: dimgray;
  197. }
  198. .xiaoliang{
  199. margin-left: auto;
  200. margin-right: 10rpx;
  201. }
  202. .xingxing{
  203. width: 40rpx;
  204. height: 40rpx;
  205. }
  206. .pingfentext{
  207. font-size: 26rpx;
  208. line-height: 40rpx;
  209. height: 40rpx;
  210. color:sandybrown;
  211. }
  212. .mainyuntishi{
  213. margin-left: 30rpx;
  214. padding-left: 8rpx;
  215. padding-right: 8rpx;
  216. font-size: 26rpx;
  217. line-height: 40rpx;
  218. height: 40rpx;
  219. color: dimgray;
  220. background-color: burlywood;
  221. }
  222. .shijiantishi{
  223. margin-left: 30rpx;
  224. font-size: 26rpx;
  225. line-height: 40rpx;
  226. height: 40rpx;
  227. color: dimgray;
  228. }
  229. .youhuixinxi{
  230. margin-right: 10rpx;
  231. font-size: 26rpx;
  232. line-height: 40rpx;
  233. height: 40rpx;
  234. color: lightcoral;
  235. border: 2rpx solid lightcoral;
  236. border-radius: 8rpx;
  237. }
  238. </style>