history.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="browseHistory">
  3. <view class="topEditOpar" v-if="browseHistory.length>0">
  4. <view class="text opartxt" @click="delCollection">
  5. 清空足迹
  6. </view>
  7. </view>
  8. <view class="list">
  9. <view class="list_item" v-for="(item, index) in browseHistory" :key="index">
  10. <view class="list_left">
  11. <image :src="item.cover" mode="aspectFit" error-icon="../../static/img/quesheng.png"></image>
  12. </view>
  13. <view class="list_right">
  14. <view class="goods_title shu-elip-2">{{ item.title }}</view>
  15. <view class="goods_titlesm shu-elip-1" v-if="item.publish">{{item.publish}}</view>
  16. </view>
  17. </view>
  18. </view>
  19. <NoData v-if="browseHistory.length<1"></NoData>
  20. </view>
  21. </template>
  22. <script>
  23. var _self;
  24. export default {
  25. data() {
  26. return {
  27. browseHistory:[],
  28. };
  29. },
  30. onLoad(ops) {
  31. _self = this;
  32. this.getBrowseHistory();
  33. },
  34. methods: {
  35. getBrowseHistory(){
  36. const hist = uni.getStorageSync('browseHistory');
  37. console.log('browseHistory>>>',hist)
  38. if(hist){
  39. this.browseHistory = [].concat(hist);
  40. }
  41. },
  42. delCollection(){
  43. uni.showModal({
  44. title: '提示',
  45. content: '清空后不可找回回,确认清空吗?',
  46. success: function(res) {
  47. if (res.confirm) {
  48. _self.browseHistory = [];
  49. uni.removeStorageSync('browseHistory');
  50. }
  51. }
  52. });
  53. },
  54. }
  55. };
  56. </script>
  57. <style lang="scss" scoped>
  58. .browseHistory {
  59. padding: 20rpx;
  60. min-height: 100vh;
  61. box-sizing: border-box;
  62. }
  63. .selcheck{
  64. width: 80rpx;
  65. padding-left: 20rpx;
  66. }
  67. .topEditOpar{
  68. display: flex;
  69. padding: 10rpx 20rpx;
  70. display: flex;
  71. align-items: center;
  72. justify-content: space-between;
  73. text-align: center;
  74. .text{
  75. flex: 1;
  76. text-align: right;
  77. font-weight: bold;
  78. font-size: 32rpx;
  79. }
  80. .opartxt{
  81. color: $app-theme-deep-color;
  82. }
  83. }
  84. .list {
  85. background-color: #fff;
  86. border-radius: 20rpx;
  87. }
  88. .list_item{
  89. display: flex;
  90. align-items: center;
  91. // padding: 24rpx 24rpx 24rpx 24rpx;
  92. padding: 20rpx 10rpx;
  93. border-bottom: 1rpx solid #efefef;
  94. .list_left {
  95. width: 170rpx;
  96. height: 170rpx;
  97. position: relative;
  98. image {
  99. width: 170rpx;
  100. height: 170rpx;
  101. }
  102. .xiajia{
  103. position: absolute;
  104. width: 90rpx;
  105. height: 90rpx;
  106. border-radius: 50%;
  107. color: #fff;
  108. display: flex;
  109. align-items: center;
  110. justify-content: center;
  111. background-color: rgba(0, 0, 0, .5);
  112. top: 40rpx;
  113. left: 40rpx;
  114. transform: rotate(30deg);
  115. font-size: 24rpx;
  116. }
  117. }
  118. .list_right {
  119. margin-left: 24rpx;
  120. width: 100%;
  121. .goods_title {
  122. font-size: 28rpx;
  123. font-weight: 400;
  124. color: #171717;
  125. height: 80rpx;
  126. margin-top: 6rpx;
  127. }
  128. .goods_titlesm{
  129. font-size: 24rpx;
  130. font-weight: 400;
  131. color: #999;
  132. }
  133. .right_bottom {
  134. display: flex;
  135. justify-content: space-between;
  136. align-items: center;
  137. margin-top: 10rpx;
  138. .bottom_left {
  139. display: flex;
  140. align-items: center;
  141. image {
  142. width: 32rpx;
  143. height: 32rpx;
  144. margin-right: 10rpx;
  145. }
  146. span {
  147. font-size: 24rpx;
  148. font-weight: 400;
  149. color: #696969;
  150. line-height: 34rpx;
  151. }
  152. .bottom_num {
  153. font-size: 32rpx;
  154. font-weight: 500;
  155. color: #fd4558;
  156. line-height: 44rpx;
  157. margin-right: 8rpx;
  158. }
  159. }
  160. .bottom_right {
  161. font-size: 40rpx;
  162. font-weight: 400;
  163. text-align: center;
  164. color: $app-theme-color;
  165. // line-height: 56rpx;
  166. // width: 56rpx;
  167. // height: 56rpx;
  168. // background: rgba( $app-theme-color, .6);
  169. // border-radius: 30rpx;
  170. }
  171. }
  172. }
  173. }
  174. .goodsItem {
  175. display: flex;
  176. flex: 1;
  177. }
  178. </style>