posList.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="container">
  3. <view class="list">
  4. <view @click="detail(item.id,item.admin_id)" class="item" v-for="(item,index) in list" :key="index">
  5. <view class="top flex flex-y-center box-pack-between">
  6. <view class="name">{{item.type==1?'如意设备':'随行付POS机A920'}} </view>
  7. <view class="flex-y-center">
  8. <view class="del" @click.stop="del(item.id)">解除设备</view>
  9. </view>
  10. </view>
  11. <view v-if="type==1" class="content flex flex-y-center box-pack-between" hover-class="nav-hover">
  12. <view class="cell flex flex-y-center">
  13. <view class="title">门店:</view>
  14. <view class="desc">{{item.title}}</view>
  15. </view>
  16. </view>
  17. <view class="content flex flex-y-center box-pack-between" hover-class="nav-hover">
  18. <view class="cell flex flex-y-center">
  19. <view class="title">机器终端号:</view>
  20. <view class="desc">{{item.terminal_sn}}</view>
  21. </view>
  22. <view class="cell flex flex-y-center">
  23. <view class="title"></view>
  24. <view class="desc">{{item.addtime}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="no-more">没有更多内容了~</view>
  29. </view>
  30. <view class="footer-bar">
  31. <view class="content flex flex-center">
  32. <navigator :url="`./add?type=${type}`" class="btn">+新增如意设备</navigator>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. store_id: "",
  42. list: [],
  43. page: 1,
  44. is_bottom: false,
  45. type:2,
  46. }
  47. },
  48. onLoad(options) {
  49. this.type=options.type||2;
  50. this.store_id = uni.getStorageSync("store_id");
  51. },
  52. onShow() {
  53. this.getData(1)
  54. },
  55. methods: {
  56. del(id) {
  57. uni.showModal({
  58. title: '提示',
  59. content: '是否要解除设备?',
  60. showCancel: true,
  61. cancelText: '取消',
  62. confirmText: '确定',
  63. success: res => {
  64. if (res.confirm) {
  65. this.request({
  66. url: 'Smdcshop/ListDelete',
  67. data: {
  68. store_id: uni.getStorageSync("store_id"),
  69. id: id,
  70. },
  71. }).then(res => {
  72. console.log(res, "res")
  73. if (res.code === 200 || res.code === "200") {
  74. uni.showToast({
  75. title: "解除成功",
  76. icon: "none",
  77. })
  78. setTimeout(() => {
  79. this.getData()
  80. }, 2000)
  81. }
  82. }).catch((res) => {
  83. uni.showToast({
  84. title: res.message,
  85. icon: "none",
  86. })
  87. });
  88. }
  89. },
  90. fail: () => {},
  91. complete: () => {}
  92. });
  93. },
  94. getData(page) {
  95. this.request({
  96. url: 'Smdcshop/equipmentList',
  97. data: {
  98. type:1,
  99. admin_id: uni.getStorageSync("admin_id"),
  100. store_id: this.type==1?'':uni.getStorageSync("store_id"),
  101. }
  102. }).then(res => {
  103. if (res.code == 200) {
  104. this.list = res.data
  105. }
  106. })
  107. }
  108. }
  109. }
  110. </script>
  111. <style>
  112. @import url("../../static/css/common.css");
  113. .del {
  114. height: 44rpx;
  115. line-height: 44rpx;
  116. padding: 0 15rpx;
  117. font-size: 24rpx;
  118. background-color: #FF5722;
  119. margin-right: 25rpx;
  120. color: #fff;
  121. border-radius: 4rpx;
  122. }
  123. page {
  124. background-color: #F4F5F7;
  125. }
  126. .list {
  127. padding: 30rpx 25rpx;
  128. }
  129. .list .item {
  130. border-radius: 8rpx;
  131. overflow: hidden;
  132. padding-left: 30rpx;
  133. border-left: 8rpx solid #247EFF;
  134. background-color: #fff;
  135. margin-bottom: 30rpx;
  136. }
  137. .list .item .top {
  138. height: 80rpx;
  139. border-bottom: 1rpx solid #f5f5f5;
  140. }
  141. .list .item .top .name {
  142. font-size: 30rpx;
  143. line-height: 80rpx;
  144. font-weight: bold;
  145. }
  146. .list .item .top .type-btn {
  147. zoom: 0.7;
  148. margin-right: 25rpx;
  149. }
  150. .list .item .content {
  151. padding: 20rpx 0 24rpx;
  152. }
  153. .list .item .content .cell {
  154. flex: none;
  155. /* width: 50%; */
  156. box-sizing: border-box;
  157. padding-right: 30rpx;
  158. font-size: 26rpx;
  159. line-height: 37rpx;
  160. color: #666;
  161. }
  162. .list .item .content .cell .title {
  163. color: #99A0AD;
  164. }
  165. </style>