index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view class="content">
  3. <view class="header-box">
  4. <view class="status_bar"></view>
  5. <view class="title"><text>管配件,就用</text>修配一码通</view>
  6. </view>
  7. <view class="body-box">
  8. <!-- 滚动区域 -->
  9. <view class="scroll-list">
  10. <scrollBox :list="list"></scrollBox>
  11. </view>
  12. <!-- 保证金 -->
  13. <view class="notices flex align_center">
  14. <view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 您有一笔保证金待支付 ¥2,000.00</view> <text>立即支付>></text>
  15. </view>
  16. <!-- 名片 -->
  17. <view class="userCard flex align_center justify_between">
  18. <view class="userCard-info flex align_center justify_between">
  19. <view>
  20. <u-image v-if="!hasLogin" src="/static/def_personal_avatar.png" width="90" height="90"></u-image>
  21. <open-data v-else type="userAvatarUrl" class="user-photo"></open-data>
  22. </view>
  23. <view>
  24. <view>王杰</view>
  25. <view>宇博极速汽车维修养护中心</view>
  26. </view>
  27. </view>
  28. <view>
  29. <u-icon name="arrow-right"></u-icon>
  30. </view>
  31. </view>
  32. <!-- 扫描按钮 -->
  33. <view class="scanButton flex align_center" @click="openCamera">
  34. <u-icon name="scan" size="40"></u-icon><text class="ml10">扫描VIN</text>
  35. </view>
  36. <!-- 扫描记录 -->
  37. <u-cell-group :border="false">
  38. <u-cell-item title="扫描记录" @click="toAllRecord" :title-style="{fontSize:'1.1em'}" value="查看全部">
  39. <u-icon slot="icon" size="38" color="#00aaff" style="margin-right: 0.3em;" name="order"></u-icon>
  40. </u-cell-item>
  41. </u-cell-group>
  42. </view>
  43. <!-- 扫描记录 -->
  44. <view class="list-box">
  45. <u-cell-group :border="false">
  46. <u-cell-item v-for="item in 10" title="LBVNU79049SB81489" :title-style="{fontSize:'1em'}" value="宝马 54646d">
  47. <text slot="icon"></text>
  48. </u-cell-item>
  49. </u-cell-group>
  50. <view class="des">仅展示最近10条记录,点击“全部”查看更多</view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import {
  56. mapState,
  57. mapMutations
  58. } from 'vuex'
  59. import scrollBox from '@/components/scrollBox.vue'
  60. export default {
  61. components: {
  62. scrollBox
  63. },
  64. data() {
  65. return {
  66. list:[
  67. {
  68. userName: '一部'
  69. },
  70. {
  71. userName: '夏利我'
  72. },
  73. {
  74. userName: '离散'
  75. },
  76. {
  77. userName: '网络'
  78. },
  79. {
  80. userName: '撒打发'
  81. },
  82. {
  83. userName: 'ipho23'
  84. }
  85. ]
  86. }
  87. },
  88. computed: {
  89. ...mapState(['hasLogin'])
  90. },
  91. onLoad() {
  92. },
  93. methods: {
  94. // 去扫描
  95. openCamera(){
  96. uni.navigateTo({
  97. url: "/pages/scan-frame/scan-frame"
  98. })
  99. },
  100. // 查看扫描记录
  101. toAllRecord(){
  102. uni.navigateTo({
  103. url: "/pages/vinRecord/vinRecord"
  104. })
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="less">
  110. .content {
  111. margin: 0;
  112. padding: 0;
  113. height: 100vh;
  114. display: flex;
  115. flex-direction: column;
  116. background-image: linear-gradient(#86defa 0%,#cdeff9 25%,#ffffff 40%);
  117. .header-box{
  118. padding: 0.3em 1em;
  119. .status_bar {
  120. height: var(--status-bar-height);
  121. width: 100%;
  122. }
  123. .title{
  124. padding-top: 0.4em;
  125. font-size: 1.5em;
  126. color: #000;
  127. text{
  128. color: #0077fd;
  129. }
  130. }
  131. }
  132. .body-box{
  133. flex-grow: 1;
  134. padding: 0.5em 1em;
  135. .notices{
  136. padding: 0.5em 0 1em;
  137. view{
  138. color: #f2a557;
  139. }
  140. text{
  141. color: #0077fd;
  142. margin-left: 1em;
  143. }
  144. }
  145. .userCard{
  146. padding:0.8em;
  147. background: #fff;
  148. border-radius: 1em;
  149. box-shadow: 0.2em 0.3em 0.8em #cdeff9;
  150. .userCard-info{
  151. > view{
  152. &:last-child{
  153. margin-left: 0.5em;
  154. >view{
  155. padding: 0.2em;
  156. }
  157. }
  158. }
  159. }
  160. }
  161. .scanButton{
  162. margin: 0.6em 0;
  163. padding: 0.5em;
  164. background: #1283d4;
  165. color: #fff;
  166. font-size: 1.5em;
  167. border-radius: 5em;
  168. justify-content: center;
  169. &:active{
  170. opacity: 0.8;
  171. }
  172. }
  173. .ml10{
  174. margin-left: 0.2em;
  175. }
  176. }
  177. .list-box{
  178. padding: 0 1em;
  179. overflow: auto;
  180. .des{
  181. text-align: center;
  182. padding: 1em 0;
  183. color: #999;
  184. font-size: 0.8em;
  185. }
  186. }
  187. }
  188. </style>