distriRule.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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.name}} </view>
  7. <view class="flex-y-center">
  8. <view class="del" @click.stop="del(item.id)">删除</view>
  9. </view>
  10. </view>
  11. <view 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.start}}</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.end}}</view>
  21. </view>
  22. <view class="cell flex flex-y-center">
  23. <view class="title">配送费:</view>
  24. <view class="desc">{{item.price}}</view>
  25. </view>
  26. </view>
  27. <view class="content flex flex-y-center box-pack-between" hover-class="nav-hover">
  28. <view class="cell flex flex-y-center">
  29. <view class="title">创建时间:</view>
  30. <view class="desc">{{item.create_time}}</view>
  31. </view>
  32. </view>
  33. <view class="content flex flex-y-center box-pack-between" hover-class="nav-hover">
  34. <view class="cell flex flex-y-center">
  35. <view class="title">更新时间:</view>
  36. <view class="desc">{{item.update_time}}</view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="no-more">没有更多内容了~</view>
  41. </view>
  42. <view class="footer-bar">
  43. <view class="content flex flex-center">
  44. <navigator url="./distriRuleDetail" class="btn">+新增规则</navigator>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. store_id: "",
  54. list: [],
  55. page: 1,
  56. is_bottom: false,
  57. type:2,
  58. }
  59. },
  60. onLoad(options) {
  61. this.type=options.type;
  62. this.store_id = options.store_id;
  63. },
  64. onShow() {
  65. this.getData()
  66. },
  67. onReachBottom() {
  68. },
  69. methods: {
  70. detail(id,admin_id){
  71. uni.navigateTo({
  72. url:`./distriRuleDetail?id=${id}`
  73. })
  74. },
  75. del(id) {
  76. uni.showModal({
  77. title: '提示',
  78. content: '是否要删除?',
  79. showCancel: true,
  80. cancelText: '取消',
  81. confirmText: '确定',
  82. success: res => {
  83. if (res.confirm) {
  84. this.request({
  85. url: 'Smdcshop/delivery_rule_delete',
  86. data: {
  87. id: id,
  88. },
  89. }).then(res => {
  90. console.log(res, "res")
  91. if (res.code === 200 || res.code === "200") {
  92. uni.showToast({
  93. title: "删除成功",
  94. icon: "none",
  95. })
  96. setTimeout(() => {
  97. this.getData()
  98. }, 2000)
  99. }
  100. }).catch((res) => {
  101. uni.showToast({
  102. title: res.message,
  103. icon: "none",
  104. })
  105. });
  106. }
  107. },
  108. fail: () => {},
  109. complete: () => {}
  110. });
  111. },
  112. getData() {
  113. this.request({
  114. url: 'Smdcshop/delivery_rule_index',
  115. data: {
  116. admin_id: uni.getStorageSync("admin_id"),
  117. }
  118. }).then(res => {
  119. if (res.code == 200 ) {
  120. this.list = res.data
  121. }
  122. })
  123. }
  124. }
  125. }
  126. </script>
  127. <style>
  128. @import url("./static/css/common.css");
  129. .del {
  130. height: 44rpx;
  131. line-height: 44rpx;
  132. padding: 0 15rpx;
  133. font-size: 24rpx;
  134. background-color: #FF5722;
  135. margin-right: 25rpx;
  136. color: #fff;
  137. border-radius: 4rpx;
  138. }
  139. page {
  140. background-color: #F4F5F7;
  141. }
  142. .list {
  143. padding: 30rpx 25rpx;
  144. }
  145. .list .item {
  146. border-radius: 8rpx;
  147. overflow: hidden;
  148. padding-left: 30rpx;
  149. border-left: 8rpx solid #247EFF;
  150. background-color: #fff;
  151. margin-bottom: 30rpx;
  152. }
  153. .list .item .top {
  154. height: 80rpx;
  155. border-bottom: 1rpx solid #f5f5f5;
  156. }
  157. .list .item .top .name {
  158. font-size: 30rpx;
  159. line-height: 80rpx;
  160. font-weight: bold;
  161. }
  162. .list .item .top .type-btn {
  163. zoom: 0.7;
  164. margin-right: 25rpx;
  165. }
  166. .list .item .content {
  167. padding: 20rpx 0 24rpx;
  168. }
  169. .list .item .content .cell {
  170. flex: none;
  171. /* width: 50%; */
  172. box-sizing: border-box;
  173. padding-right: 30rpx;
  174. font-size: 26rpx;
  175. line-height: 37rpx;
  176. color: #666;
  177. }
  178. .list .item .content .cell .title {
  179. color: #99A0AD;
  180. }
  181. </style>