index.vue 4.3 KB

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