printer.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="main-block">
  3. <view class="page-block">
  4. <view class="btn-list">
  5. <!-- <navigator :url="`../printerList/printerList?store_id=${store_id}&type=${type}`" class="item flex flex-col flex-center">
  6. <image src="../static/images/icon_14.png" class="icon-img" mode="aspectFit"></image>
  7. <view class="name">打印设备</view>
  8. </navigator>
  9. <navigator :url="`/saomaDiancan/printerLabel/printerLabel?store_id=${store_id}&type=${type}`"
  10. class="item flex flex-col flex-center">
  11. <image src="../static/images/icon_8.png" class="icon-img" mode="aspectFit"></image>
  12. <view class="name">打印标签</view>
  13. </navigator>
  14. <navigator :url="`/saomaDiancan/printersetup/printersetup?store_id=${store_id}&type=${type}`"
  15. class="item flex flex-col flex-center">
  16. <image src="../static/images/icon_7.png" class="icon-img" mode="aspectFit"></image>
  17. <view class="name">打印设置</view>
  18. </navigator> -->
  19. <block v-for="(item,index) in power_list" :key='index'>
  20. <navigator class="item flex flex-col flex-center" :url="`${item.address}?type=${type}`">
  21. <image class="icon-img" :src="item.image"></image>
  22. <view class="name">{{item.name}}</view>
  23. </navigator>
  24. </block>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. store_id:"",
  34. type:2,
  35. power_list:[]
  36. }
  37. },
  38. onLoad(e) {
  39. this.type=e.type||2;
  40. this.store_id = uni.getStorageSync("store_id");
  41. var management_list_store;
  42. if(uni.getStorageSync("is_shop")){
  43. management_list_store = this.$store.state.management_list||[]
  44. }else{
  45. management_list_store = this.$store.state.management_list_store||[]
  46. }
  47. let col = management_list_store
  48. let { list } = getData(col,e.sid,e.id);
  49. this.power_list = list;
  50. function getData(col,sid,id) {
  51. return col.find(it => it.id == sid).list.find(item=> item.id == id)
  52. }
  53. },
  54. }
  55. </script>
  56. <style>
  57. .main-block {
  58. padding: 50rpx 25rpx 0;
  59. }
  60. .btn-list {
  61. display: -webkit-box;
  62. display: -webkit-flex;
  63. display: flex;
  64. -webkit-box-orient: horizontal;
  65. -webkit-box-direction: normal;
  66. -webkit-flex-flow: row wrap;
  67. flex-flow: row wrap;
  68. -webkit-box-pack: start;
  69. -webkit-justify-content: flex-start;
  70. justify-content: flex-start;
  71. -webkit-align-content: flex-start;
  72. align-content: flex-start;
  73. }
  74. .page-block {
  75. width: 700rpx;
  76. background-color: #fff;
  77. box-sizing: border-box;
  78. border-radius: 8rpx;
  79. margin-bottom: 30rpx;
  80. }
  81. .btn-list .item {
  82. width: 33.33%;
  83. height: 145rpx;
  84. }
  85. .btn-list .item .icon-img {
  86. display: block;
  87. width: 48rpx;
  88. height: 48rpx;
  89. }
  90. .btn-list .item .name {
  91. font-size: 24rpx;
  92. line-height: 33rpx;
  93. margin-top: 16rpx;
  94. color: #666;
  95. }
  96. </style>