listItem.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="merchantItem">
  3. <view class="itemHeader">
  4. <image :src="common.seamingImgUrl(datas.shopLogo)" mode="" class="avatar"></image>
  5. <text class="topTitle">{{ datas.shopName }}</text>
  6. <view class="openMerchanDetail" @click="gotoMerchan">
  7. <text class="gotoUse">立即使用</text><image class="useMoney" src="@/static/images/entryOfMerchants/youjiantou.png"></image>
  8. </view>
  9. </view>
  10. <view class="numberTitle">
  11. <text class="titlesItem">
  12. 余额: {{ datas.balance }}元
  13. </text>
  14. <text class="titlesItem">
  15. 赠送金额: {{ datas.giveBalance }}元
  16. </text>
  17. </view>
  18. <view class="newTimer">
  19. <view class="newMarkers">
  20. 最近
  21. </view>
  22. <text class="timeText">充值时间:2022-11-08 28:55:39</text>
  23. <button class="upBtn" @click="gotoUpMoney">
  24. 充值
  25. </button>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'listItem',
  32. props: {
  33. datas: {
  34. type: Object,
  35. default: {}
  36. }
  37. },
  38. data() {
  39. return {
  40. }
  41. },
  42. methods: {
  43. gotoMerchan() {
  44. uni.navigateTo({
  45. url: `/another-tf/another-user/shop/shop-detail?shopId=${this.datas.shopId}`
  46. });
  47. },
  48. gotoUpMoney() {
  49. if (this.datas.switchRecharge !== 1) {
  50. return uni.showToast({
  51. title: '该商家未开通充值',
  52. icon: 'none'
  53. });
  54. }
  55. uni.navigateTo({
  56. url: `/another-tf/another-user/shop-recharge/shop-recharge?shopInfo=${JSON.stringify(this.datas)}`
  57. })
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .numberTitle {
  64. margin-top: 10rpx;
  65. width: 100%;
  66. display: flex;
  67. align-items: center;
  68. height: 60rpx;
  69. justify-content: space-between;
  70. box-sizing: border-box;
  71. padding-right: 60rpx;
  72. .titlesItem {
  73. letter-spacing: 2rpx;
  74. /* margin-right: 90rpx; */
  75. font-family: Source Han Sans;
  76. font-size: 32rpx;
  77. font-weight: normal;
  78. line-height: 32rpx;
  79. font-feature-settings: "kern" on;
  80. color: #222229;
  81. }
  82. }
  83. .merchantItem {
  84. position: relative;
  85. overflow: hidden;
  86. width: 100%;
  87. /* height: 281rpx; */
  88. background-color: #fff;
  89. border-radius: 24rpx;
  90. box-sizing: border-box;
  91. padding: 32rpx;
  92. margin: 20rpx 0rpx;
  93. .itemHeader {
  94. position: relative;
  95. width: 100%;
  96. display: flex;
  97. align-items: center;
  98. ::before {
  99. content: '';
  100. width: 100%;
  101. height: 2rpx;
  102. position: absolute;
  103. bottom: -10rpx;
  104. left: 0;
  105. background-color: #F3F3F3;
  106. }
  107. .avatar {
  108. width: 60rpx;
  109. height: 60rpx;
  110. border-radius: 50%;
  111. }
  112. .topTitle {
  113. margin-left: 12rpx;
  114. justify-self: flex-start;
  115. width: 353rpx;
  116. overflow: hidden;
  117. white-space: nowrap;
  118. text-overflow: ellipsis;
  119. font-size: 32rpx;
  120. font-weight: 600;
  121. line-height: 40rpx;
  122. color: #262F40;
  123. }
  124. .openMerchanDetail {
  125. position: absolute;
  126. right: 0;
  127. .gotoUse {
  128. font-size: 26rpx;
  129. font-weight: normal;
  130. line-height: 32rpx;
  131. color: #888889;
  132. margin-right: 10rpx;
  133. }
  134. .useMoney {
  135. width: 18rpx;
  136. height: 24rpx;
  137. }
  138. }
  139. }
  140. .newTimer {
  141. margin-top: 20rpx;
  142. position: relative;
  143. width: 100%;
  144. height: 66rpx;
  145. border-radius: 12rpx;
  146. background: #FFF0EA;
  147. box-sizing: border-box;
  148. padding: 12rpx 46rpx;
  149. display: flex;
  150. align-items: center;
  151. .newMarkers {
  152. position: absolute;
  153. top: -10rpx;
  154. left: -30rpx;
  155. width: 64rpx;
  156. height: 36rpx;
  157. transform: scale(0.8);
  158. border-radius: 24rpx 0px 24rpx 0px;
  159. padding: 4rpx 12rpx;
  160. text-align: center;
  161. background: #49CE8B;
  162. font-family: Source Han Sans;
  163. font-size: 20rpx;
  164. font-weight: normal;
  165. line-height: 36rpx;
  166. color: #FFFFFF;
  167. }
  168. .timeText {
  169. font-family: Source Han Sans;
  170. font-size: 24rpx;
  171. font-weight: normal;
  172. line-height: 32rpx;
  173. font-feature-settings: "kern" on;
  174. color: #888889;
  175. }
  176. .upBtn {
  177. position: absolute;
  178. right: 0;
  179. bottom: 0;
  180. width: 116rpx;
  181. height: 66rpx;
  182. border-radius: 12rpx;
  183. background: #EF530E;
  184. font-size: 26rpx;
  185. line-height: 66rpx;
  186. color: #FFFFFF;
  187. }
  188. }
  189. }
  190. </style>