distriBution.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="container">
  3. <view class="list">
  4. <view 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">松鼠屋配送</view>
  7. <view class="flex-y-center">
  8. <block v-if="item.status==1">
  9. <view class="del">已激活</view>
  10. <view class="del" @click="getActivation(item.id,2)">重新激活</view>
  11. </block>
  12. <block v-else>
  13. <view class="del" @click="getActivation(item.id,1)">激活</view>
  14. </block>
  15. </view>
  16. </view>
  17. <!-- <navigator :url="`/saomaDiancan/editPrinter/editPrinter?id=${item.id}`"
  18. class="content flex flex-y-center" hover-class="nav-hover">
  19. <view class="cell flex flex-y-center">
  20. <view class="title">打印机类型:</view>
  21. <view class="desc">{{item.type==1?'1-365':item.type==2?'易联云(型号:k4)':
  22. item.type==3?'飞鹅(型号:FP-58W)':item.type==4?'喜讯(型号:XP58IIQR)':''}}</view>
  23. </view>
  24. <view class="cell flex flex-y-center arr-r">
  25. <view class="title">打印机位置:</view>
  26. <view class="desc">{{item.location==1?'前台':'后厨'}}</view>
  27. </view>
  28. </navigator> -->
  29. </view>
  30. <view class="no-more">---没有更多内容了---</view>
  31. </view>
  32. <!-- <view class="footer-bar">
  33. <view class="content flex flex-center">
  34. <navigator url="/saomaDiancan/editPrinter/editPrinter" class="btn">+新增设备</navigator>
  35. </view>
  36. </view> -->
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. store_id: "",
  44. list: [],
  45. page: 1,
  46. is_bottom: false
  47. }
  48. },
  49. onLoad(options) {
  50. this.store_id = options.store_id;
  51. this.getData()
  52. },
  53. methods: {
  54. getActivation(id,type) {
  55. if(type==1){
  56. var url= 'Smdcshop/squirrel_wecashier';
  57. }else{
  58. var url= 'Smdcshop/squirrel_update';
  59. }
  60. uni.showModal({
  61. title: '提示',
  62. content:type==1? '是否要激活?':'是否要重新激活?',
  63. showCancel: true,
  64. cancelText: '取消',
  65. confirmText: '确定',
  66. success: res => {
  67. if (res.confirm) {
  68. this.request({
  69. url:url,
  70. data: {
  71. admin_id: uni.getStorageSync('admin_id'),
  72. id:id,
  73. },
  74. }).then(res => {
  75. console.log(res, "res")
  76. if (res.code === 200 || res.code === "200") {
  77. uni.showToast({
  78. title: "激活成功",
  79. icon: "none",
  80. })
  81. setTimeout(() => {
  82. this.getData()
  83. }, 2000)
  84. }
  85. }).catch((res) => {
  86. uni.showToast({
  87. title: res.message,
  88. icon: "none",
  89. })
  90. });
  91. }
  92. },
  93. fail: () => {},
  94. complete: () => {}
  95. });
  96. },
  97. getData() {
  98. this.request({
  99. url: 'Smdcshop/squirrel_index',
  100. data: {
  101. admin_id: uni.getStorageSync('admin_id'),
  102. },
  103. }).then(res => {
  104. if (res.code == 200 && res.data.length) {
  105. this.list =res.data
  106. }
  107. })
  108. }
  109. }
  110. }
  111. </script>
  112. <style>
  113. @import url("./static/css/common.css");
  114. .del {
  115. height: 44rpx;
  116. line-height: 44rpx;
  117. padding: 0 25rpx;
  118. font-size: 24rpx;
  119. background-color: #FF5722;
  120. margin-right: 25rpx;
  121. color: #fff;
  122. border-radius: 20rpx;
  123. }
  124. page {
  125. background-color: #F4F5F7;
  126. }
  127. .list {
  128. padding: 30rpx 25rpx;
  129. }
  130. .list .item {
  131. border-radius: 8rpx;
  132. overflow: hidden;
  133. padding-left: 30rpx;
  134. border-left: 8rpx solid #247EFF;
  135. background-color: #fff;
  136. margin-bottom: 30rpx;
  137. }
  138. .list .item .top {
  139. height: 120rpx;
  140. border-bottom: 1rpx solid #f5f5f5;
  141. }
  142. .list .item .top .name {
  143. font-size: 30rpx;
  144. line-height: 80rpx;
  145. font-weight: bold;
  146. }
  147. .list .item .top .type-btn {
  148. zoom: 0.7;
  149. margin-right: 25rpx;
  150. }
  151. .list .item .content {
  152. padding: 20rpx 0 24rpx;
  153. }
  154. .list .item .content .cell {
  155. flex: none;
  156. width: 50%;
  157. box-sizing: border-box;
  158. padding-right: 30rpx;
  159. font-size: 26rpx;
  160. line-height: 37rpx;
  161. color: #666;
  162. }
  163. .list .item .content .cell .title {
  164. color: #99A0AD;
  165. }
  166. </style>