jmszg.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <view class="content">
  3. <scroll-view scroll-y="true" class="scroll-wrapper">
  4. <view class="spgood" v-for="(items, ind) in list" :key="ind">
  5. <view class="left-wrapper"><image :src="items.product_info.image" mode="scaleToFill"></image></view>
  6. <view class="right-wrapper">
  7. <view class="right-title clamp">{{ items.product_info.store_name }}</view>
  8. <!-- <view class="ex-addr">
  9. </view> -->
  10. <view class="right-bottom">
  11. <view class="sp-price">
  12. <view class="now-price">¥{{ items.product_info.price * 1 }}</view>
  13. <view class="old-price">¥{{ items.product_info.ot_price * 1 }}</view>
  14. </view>
  15. <view class="sp-btn">马上购</view>
  16. </view>
  17. </view>
  18. </view>
  19. </scroll-view>
  20. </view>
  21. </template>
  22. <script>
  23. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  24. import { getOrderStock } from '@/api/product.js';
  25. export default {
  26. data() {
  27. return {
  28. list: [],
  29. page: 1,
  30. limit: 10,
  31. loadType: 'more',
  32. loaded: false
  33. };
  34. },
  35. onReady() {
  36. //初始化获取页面宽度
  37. uni.createSelectorQuery().select('.scroll-wrapper')
  38. .fields(
  39. {
  40. size:true
  41. },
  42. data => {
  43. console.log(data);
  44. console.log(Math.floor((data.width /750) * 300));
  45. //保存头部高度
  46. this.maxheight =data.height - Math.floor((data.width / 750) * 570);
  47. console.log(this.maxheight);
  48. }
  49. )
  50. .exec();
  51. },
  52. onLoad() {
  53. this.loadData();
  54. },
  55. methods: {
  56. loadData() {
  57. let obj = this;
  58. if (obj.loadType == 'loading') {
  59. return;
  60. }
  61. if (obj.loadType == 'noMore') {
  62. return;
  63. }
  64. obj.loadType = 'loading';
  65. getOrderStock({
  66. page: obj.page,
  67. limit: obj.limit
  68. }).then(({ data }) => {
  69. // this.list = this.list.concat()
  70. obj.page++;
  71. console.log(data.data.data, 'ddddddddddddddddddddddddddddddd');
  72. this.list = this.list.concat(data.data.data)
  73. });
  74. }
  75. }
  76. };
  77. </script>
  78. <style lang="scss" scoped>
  79. .spgood {
  80. margin: 0 auto;
  81. width: 710rpx;
  82. height: 280rpx;
  83. background: #ffffff;
  84. box-shadow: 0px 0px 20px 0px rgba(50, 50, 52, 0.06);
  85. border-radius: 8rpx;
  86. padding: 40rpx 20rpx;
  87. display: flex;
  88. margin-bottom: 21rpx;
  89. position: relative;
  90. .left-wrapper {
  91. width: 190rpx;
  92. height: 200rpx;
  93. border-radius: 10rpx;
  94. image {
  95. width: 190rpx;
  96. height: 200rpx;
  97. border-radius: 10rpx;
  98. }
  99. }
  100. .right-wrapper {
  101. padding-left: 22rpx;
  102. width: 100%;
  103. height: 200rpx;
  104. // background-color: red;
  105. .right-title {
  106. padding-top: 8rpx;
  107. width: 400rpx;
  108. // height: 29rpx;
  109. font-size: 30rpx;
  110. font-weight: bold;
  111. color: #333333;
  112. }
  113. .right-addr {
  114. margin-top: 18rpx;
  115. display: flex;
  116. .shop-img {
  117. width: 26rpx;
  118. height: 23rpx;
  119. margin: 0 4rpx 0 0;
  120. image {
  121. width: 100%;
  122. height: 100%;
  123. }
  124. }
  125. .shop-name {
  126. // height: 22rpx;
  127. font-size: 22rpx;
  128. font-weight: 500;
  129. color: #dcb876;
  130. }
  131. .point-img {
  132. width: 16rpx;
  133. height: 23rpx;
  134. margin: 0 4rpx 0 14rpx;
  135. image {
  136. width: 100%;
  137. height: 21rpx;
  138. }
  139. }
  140. .point-disc {
  141. font-size: 24rpx;
  142. font-weight: 500;
  143. padding-top: 3rpx;
  144. color: #dcb876;
  145. }
  146. }
  147. .ex-addr {
  148. margin-top: 16rpx;
  149. // padding-left: 22rpx;
  150. height: 24rpx;
  151. font-size: 24rpx;
  152. font-weight: 500;
  153. color: #dcb876;
  154. image {
  155. height: 22rpx;
  156. }
  157. .name-img {
  158. // vertical-align: ;
  159. width: 26rpx;
  160. margin: 0 4rpx -3rpx 0;
  161. }
  162. .point-img {
  163. width: 16rpx;
  164. margin: 0 4rpx -3rpx 14rpx;
  165. }
  166. }
  167. .pepple-num {
  168. // width: 99rpx;
  169. display: inline-block;
  170. padding-right: 15rpx;
  171. height: 36rpx;
  172. // color: #ff3366;
  173. // background: #FC7A0C;
  174. background-color: #fee4ce;
  175. // opacity: 0.2;
  176. border-radius: 18rpx;
  177. font-size: 20rpx;
  178. font-weight: 500;
  179. color: #ff3366;
  180. line-height: 36rpx;
  181. padding-left: 12rpx;
  182. margin-top: 33rpx;
  183. image {
  184. width: 17rpx;
  185. height: 20rpx;
  186. margin-right: 10rpx;
  187. // padding-right: rpx;
  188. }
  189. }
  190. .right-bottom {
  191. margin-top: 2rpx;
  192. // justify-items: flex-end;
  193. display: flex;
  194. justify-content: space-between;
  195. .sp-price {
  196. height: 60rpx;
  197. display: flex;
  198. vertical-align: bottom;
  199. line-height: 60rpx;
  200. .now-price {
  201. font-size: 30rpx;
  202. font-weight: bold;
  203. color: #901b21;
  204. margin-right: 16rpx;
  205. }
  206. .old-price {
  207. font-size: 22rpx;
  208. font-weight: 500;
  209. text-decoration: line-through;
  210. color: #aaaaaa;
  211. }
  212. }
  213. .sp-btn {
  214. width: 160rpx;
  215. height: 60rpx;
  216. border-radius: 30rpx;
  217. font-size: 26rpx;
  218. text-align: center;
  219. line-height: 60rpx;
  220. font-weight: 400;
  221. color: #ffffff;
  222. background-color: #901b21;
  223. position: absolute;
  224. bottom: 40rpx;
  225. right: 20rpx;
  226. }
  227. }
  228. }
  229. }
  230. </style>