index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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" v-if="bondRecord" @click="toPayBondAmount">
  14. <view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 您有一笔保证金待支付 ¥{{bondRecord.bondAmount}}</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="60" height="60"></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. import { shelfBondRecordWaitPayRecord, findStoreShelf } from '@/api/shelf.js'
  66. export default {
  67. components: {
  68. scrollBox
  69. },
  70. data() {
  71. return {
  72. bondRecord: null, // 保证金
  73. list:[
  74. {
  75. userName: '一部'
  76. },
  77. {
  78. userName: '夏利我'
  79. },
  80. {
  81. userName: '离散'
  82. },
  83. {
  84. userName: '网络'
  85. },
  86. {
  87. userName: '撒打发'
  88. },
  89. {
  90. userName: 'ipho23'
  91. }
  92. ]
  93. }
  94. },
  95. computed: {
  96. ...mapState(['hasLogin']),
  97. hasShelf(){
  98. return this.$store.state.vuex_storeShelf
  99. }
  100. },
  101. onLoad() {
  102. this.getStoreShelf()
  103. },
  104. methods: {
  105. // 查询是否支持数字货架
  106. getStoreShelf(){
  107. findStoreShelf().then(res => {
  108. console.log(res)
  109. this.$store.state.vuex_storeShelf = res.data;
  110. if(res.data){
  111. // 保证金查询
  112. this.getShelfBWPayRecord()
  113. }
  114. })
  115. },
  116. // 获取保证金金额
  117. getShelfBWPayRecord(){
  118. const data = this.$store.state.vuex_storeShelf
  119. shelfBondRecordWaitPayRecord({shelfSn: data.shelfSn, storeSn: data.storeSn}).then(res => {
  120. console.log(res,'获取保证金金额')
  121. this.bondRecord = res.data
  122. })
  123. },
  124. // 保证金支付
  125. toPayBondAmount(){
  126. },
  127. // 去扫描
  128. openCamera(){
  129. uni.navigateTo({
  130. url: "/pages/scan-frame/scan-frame"
  131. })
  132. },
  133. // 查看扫描记录
  134. toAllRecord(){
  135. uni.navigateTo({
  136. url: "/pages/vinRecord/vinRecord"
  137. })
  138. },
  139. toUser(){
  140. uni.navigateTo({
  141. url: this.hasLogin ? '/pages/personData/personData' : '/pages/login/login'
  142. })
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="less">
  148. .content {
  149. margin: 0;
  150. padding: 0;
  151. height: 100vh;
  152. display: flex;
  153. flex-direction: column;
  154. background-image: linear-gradient(#86defa 0%,#cdeff9 25%,#ffffff 40%);
  155. .header-box{
  156. padding: 0.3em 1em;
  157. .status_bar {
  158. height: var(--status-bar-height);
  159. width: 100%;
  160. }
  161. .title{
  162. padding-top: 0.4em;
  163. font-size: 1.5em;
  164. color: #000;
  165. text{
  166. color: #0077fd;
  167. }
  168. }
  169. }
  170. .body-box{
  171. flex-grow: 1;
  172. padding: 0.5em 1em;
  173. .notices{
  174. padding: 0.5em 0 0;
  175. view{
  176. color: #f2a557;
  177. }
  178. text{
  179. color: #0077fd;
  180. margin-left: 1em;
  181. }
  182. }
  183. .userCard{
  184. margin-top: 0.8em;
  185. padding:0.8em;
  186. background: #fff;
  187. border-radius: 1em;
  188. box-shadow: 0.2em 0.3em 0.8em #cdeff9;
  189. .userCard-info{
  190. > view{
  191. &:last-child{
  192. margin-left: 0.5em;
  193. >view{
  194. padding: 0.2em;
  195. }
  196. }
  197. }
  198. }
  199. .user-photo{
  200. display: block;
  201. width: 120rpx;
  202. height: 120rpx;
  203. border-radius: 50%;
  204. overflow: hidden;
  205. }
  206. }
  207. .scanButton{
  208. margin: 0.6em 0;
  209. padding: 0.5em;
  210. background: #1283d4;
  211. color: #fff;
  212. font-size: 1.5em;
  213. border-radius: 5em;
  214. justify-content: center;
  215. &:active{
  216. opacity: 0.8;
  217. }
  218. }
  219. .ml10{
  220. margin-left: 0.2em;
  221. }
  222. }
  223. .list-box{
  224. padding: 0 1em;
  225. overflow: auto;
  226. .des{
  227. text-align: center;
  228. padding: 1em 0;
  229. color: #999;
  230. font-size: 0.8em;
  231. }
  232. }
  233. }
  234. </style>