myproduct.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="center">
  3. <view v-for="(item, index) in list" :key="index" class="order-item">
  4. <view class="goods-box-single">
  5. <image class="goods-img" :src="item.image" mode="scaleToFill"></image>
  6. <view class="right">
  7. <view class="flex-start">
  8. <text class="title clamp1">{{ item.name }}</text>
  9. </view>
  10. <view class="create-time">所属场次:{{ item.nickname }}</view>
  11. <view class="price">{{ item.price }}</view>
  12. </view>
  13. </view>
  14. <view class="buy-box">
  15. <view class="buy-info">
  16. <view class="font">挂售价格:{{ item.hanging_price }}</view>
  17. </view>
  18. <view class="buy-info">
  19. <view class="font">挂售时间:{{ item.update_time }}</view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import { user_product } from '@/api/user.js';
  27. import { getTime } from '@/utils/rocessor.js';
  28. export default {
  29. data() {
  30. return {
  31. list: [],
  32. page: 1,
  33. limit: 10,
  34. loadingType: 'more'
  35. };
  36. },
  37. onLoad() {
  38. this.loadData();
  39. },
  40. methods: {
  41. loadData() {
  42. const obj = this;
  43. if (obj.loadingType == 'nomore' || obj.loadingType == 'loading') {
  44. return;
  45. }
  46. obj.loadingType = 'loading';
  47. user_product({
  48. page: obj.page,
  49. limit: obj.limit
  50. }).then(({ data }) => {
  51. console.log(data);
  52. data.forEach(e => {
  53. e.g_time = getTime(e.add_time);
  54. });
  55. obj.list = data;
  56. if (data.length != obj.limit) {
  57. obj.loadingType == 'noMore';
  58. } else {
  59. obj.page++;
  60. obj.loadingType == 'more';
  61. }
  62. });
  63. }
  64. }
  65. };
  66. </script>
  67. <style lang="scss">
  68. .center {
  69. background: #f3f5f4;
  70. }
  71. .order-item {
  72. display: flex;
  73. flex-direction: column;
  74. background: #fff;
  75. margin-top: 20rpx;
  76. .i-top {
  77. display: flex;
  78. align-items: center;
  79. height: 80rpx;
  80. font-size: $font-base;
  81. color: $font-color-dark;
  82. position: relative;
  83. padding: 0 30rpx;
  84. .time {
  85. flex: 1;
  86. }
  87. .state {
  88. color: $base-color;
  89. }
  90. .del-btn {
  91. padding: 10rpx 0 10rpx 36rpx;
  92. font-size: $font-lg;
  93. color: $font-color-light;
  94. position: relative;
  95. &:after {
  96. content: '';
  97. width: 0;
  98. height: 30rpx;
  99. border-left: 1px solid $border-color-dark;
  100. position: absolute;
  101. left: 20rpx;
  102. top: 50%;
  103. transform: translateY(-50%);
  104. }
  105. }
  106. }
  107. /* 多条商品 */
  108. .goods-box {
  109. height: 160rpx;
  110. padding: 20rpx 0;
  111. white-space: nowrap;
  112. .goods-item {
  113. width: 120rpx;
  114. height: 120rpx;
  115. display: inline-block;
  116. margin-right: 24rpx;
  117. }
  118. .goods-img {
  119. display: block;
  120. width: 100%;
  121. height: 100%;
  122. }
  123. }
  124. /* 单条商品 */
  125. .goods-box-single {
  126. display: flex;
  127. padding: 20rpx 30rpx;
  128. background: #ffffff;
  129. .goods-img {
  130. display: block;
  131. width: 160rpx;
  132. height: 160rpx;
  133. }
  134. .right {
  135. flex: 1;
  136. display: flex;
  137. flex-direction: column;
  138. padding: 0 0 0 24rpx;
  139. overflow: hidden;
  140. .price {
  141. margin-top: 30rpx;
  142. display: inline;
  143. font-size: $font-base + 8rpx;
  144. color: #fd3938;
  145. &:before {
  146. content: '¥';
  147. font-size: $font-sm;
  148. }
  149. }
  150. .title {
  151. font-size: $font-base + 6rpx;
  152. color: #4f4f4f;
  153. line-height: 1;
  154. width: 80%;
  155. }
  156. .create-time {
  157. margin-top: 10rpx;
  158. font-size: $font-base;
  159. color: #9d9d9d;
  160. }
  161. }
  162. }
  163. .price-box {
  164. display: flex;
  165. justify-content: flex-end;
  166. align-items: baseline;
  167. padding: 20rpx 30rpx;
  168. font-size: $font-sm + 2rpx;
  169. color: $font-color-light;
  170. .num {
  171. margin: 0 8rpx;
  172. color: $font-color-dark;
  173. }
  174. .price {
  175. font-size: $font-lg;
  176. color: $font-color-dark;
  177. &:before {
  178. content: '¥';
  179. font-size: $font-sm;
  180. margin: 0 2rpx 0 8rpx;
  181. }
  182. }
  183. }
  184. .action-box {
  185. padding: 0 30rpx;
  186. display: flex;
  187. justify-content: flex-end;
  188. align-items: center;
  189. height: 100rpx;
  190. position: relative;
  191. }
  192. .refuse {
  193. margin: 0;
  194. padding: 0;
  195. width: 160rpx;
  196. height: 60rpx;
  197. border: 2rpx solid #ebebeb;
  198. border-radius: 28rpx;
  199. text-align: center;
  200. line-height: 60rpx;
  201. font-size: 26rpx;
  202. font-family: PingFang SC;
  203. font-weight: 500;
  204. color: #999999;
  205. &:after {
  206. border-radius: 100px;
  207. }
  208. &.recom {
  209. color: #999999;
  210. &:after {
  211. border-color: #999999;
  212. }
  213. }
  214. }
  215. .buy-box {
  216. padding: 10rpx 22rpx;
  217. background-color: #ffffff;
  218. .buy-info {
  219. margin-top: 20rpx;
  220. .font {
  221. font-size: 32rpx;
  222. font-family: PingFang SC;
  223. font-weight: 500;
  224. color: #333333;
  225. }
  226. }
  227. }
  228. .action-btn {
  229. width: 160rpx;
  230. height: 60rpx;
  231. margin: 0;
  232. margin-left: 24rpx;
  233. padding: 0;
  234. text-align: center;
  235. line-height: 60rpx;
  236. font-size: $font-sm + 2rpx;
  237. color: $font-color-dark;
  238. background: #fff;
  239. border-radius: 100px;
  240. border: 2rpx solid #fd3b39;
  241. border-radius: 28px;
  242. &:after {
  243. border-radius: 100px;
  244. }
  245. &.recom {
  246. color: $base-color;
  247. &:after {
  248. border-color: $base-color;
  249. }
  250. }
  251. &.evaluate {
  252. color: $color-yellow;
  253. &:after {
  254. border-color: $color-yellow;
  255. }
  256. }
  257. }
  258. }
  259. </style>