posList.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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">+新增POS机</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. detail(id,admin_id){
  57. uni.navigateTo({
  58. url:`./hornAdd?id=${id}`
  59. })
  60. },
  61. del(id) {
  62. uni.showModal({
  63. title: '提示',
  64. content: '是否要解除设备?',
  65. showCancel: true,
  66. cancelText: '取消',
  67. confirmText: '确定',
  68. success: res => {
  69. if (res.confirm) {
  70. this.request({
  71. url: 'Smdcshop/ListDelete',
  72. data: {
  73. store_id: uni.getStorageSync("store_id"),
  74. id: id,
  75. },
  76. }).then(res => {
  77. console.log(res, "res")
  78. if (res.code === 200 || res.code === "200") {
  79. uni.showToast({
  80. title: "解除成功",
  81. icon: "none",
  82. })
  83. setTimeout(() => {
  84. this.getData()
  85. }, 2000)
  86. }
  87. }).catch((res) => {
  88. uni.showToast({
  89. title: res.message,
  90. icon: "none",
  91. })
  92. });
  93. }
  94. },
  95. fail: () => {},
  96. complete: () => {}
  97. });
  98. },
  99. getData(page) {
  100. this.request({
  101. url: 'Smdcshop/equipmentList',
  102. data: {
  103. type:2,
  104. admin_id: uni.getStorageSync("admin_id"),
  105. store_id: this.type==1?'':uni.getStorageSync("store_id"),
  106. }
  107. }).then(res => {
  108. if (res.code == 200) {
  109. this.list = res.data
  110. }
  111. })
  112. }
  113. }
  114. }
  115. </script>
  116. <style>
  117. @import url("../../static/css/common.css");
  118. .del {
  119. height: 44rpx;
  120. line-height: 44rpx;
  121. padding: 0 15rpx;
  122. font-size: 24rpx;
  123. background-color: #FF5722;
  124. margin-right: 25rpx;
  125. color: #fff;
  126. border-radius: 4rpx;
  127. }
  128. page {
  129. background-color: #F4F5F7;
  130. }
  131. .list {
  132. padding: 30rpx 25rpx;
  133. }
  134. .list .item {
  135. border-radius: 8rpx;
  136. overflow: hidden;
  137. padding-left: 30rpx;
  138. border-left: 8rpx solid #247EFF;
  139. background-color: #fff;
  140. margin-bottom: 30rpx;
  141. }
  142. .list .item .top {
  143. height: 80rpx;
  144. border-bottom: 1rpx solid #f5f5f5;
  145. }
  146. .list .item .top .name {
  147. font-size: 30rpx;
  148. line-height: 80rpx;
  149. font-weight: bold;
  150. }
  151. .list .item .top .type-btn {
  152. zoom: 0.7;
  153. margin-right: 25rpx;
  154. }
  155. .list .item .content {
  156. padding: 20rpx 0 24rpx;
  157. }
  158. .list .item .content .cell {
  159. flex: none;
  160. /* width: 50%; */
  161. box-sizing: border-box;
  162. padding-right: 30rpx;
  163. font-size: 26rpx;
  164. line-height: 37rpx;
  165. color: #666;
  166. }
  167. .list .item .content .cell .title {
  168. color: #99A0AD;
  169. }
  170. </style>