xcxList.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="">
  3. <no-none v-if='list.length<=0'></no-none>
  4. <view class="list" v-else>
  5. <navigator :url="`./addXcx?id=${item.id}`" class="item" style="border: none;" v-for="(item,index) in list" :key="index">
  6. <view class="box-pack-between">
  7. <view class="name box-pack-between flex-grow-1">
  8. <text>{{item.name}}</text>
  9. <view class="flex-y-center">
  10. <view class="del" @click.stop="del(item.id)">删除</view>
  11. </view>
  12. <!-- <view class="flex-center ft28"
  13. :style="{color:item.type==1?'#07c160':'#1E9FFF'}"
  14. style="padding-right: 20rpx;"
  15. >
  16. {{item.type==1?'微信':item.type==2?'支付宝':''}}
  17. </view> -->
  18. </view>
  19. </view>
  20. <view class="content">
  21. <view class="flex flex-y-center">
  22. <view class="cell flex flex-y-center " style="width:100%">
  23. <view class="title">来源:</view>
  24. <view class="desc" :style="{color:item.type==1?'#07c160':'#1E9FFF'}">
  25. {{item.type==1?'微信':item.type==2?'支付宝':''}}</view>
  26. </view>
  27. </view>
  28. <view class="flex flex-y-center" style="margin-top: 16rpx;">
  29. <view class="cell flex flex-y-center">
  30. <view class="title">介绍:</view>
  31. <view class="desc">{{item.desc}}</view>
  32. </view>
  33. </view>
  34. <view class="flex flex-y-center" style="margin-top: 16rpx;">
  35. <view class="cell flex flex-y-center " style="width:100%">
  36. <view class="title">appid:</view>
  37. <view class="desc">{{item.appid}}</view>
  38. </view>
  39. </view>
  40. <view class="flex flex-y-center" style="margin-top: 16rpx;">
  41. <view class="cell flex flex-y-center " style="width:100%">
  42. <view class="title">跳转路径:</view>
  43. <view class="desc">{{item.pages}}</view>
  44. </view>
  45. </view>
  46. <view class="flex flex-y-center" style="margin-top: 16rpx;">
  47. <view class="cell flex flex-y-center " style="width:100%">
  48. <view class="title">时间:</view>
  49. <view class="desc">{{item.create_time}}</view>
  50. </view>
  51. </view>
  52. </view>
  53. </navigator>
  54. </view>
  55. <view style="height: 150rpx;"></view>
  56. <view class="footer-bar">
  57. <view class="content flex flex-center">
  58. <navigator url="./addXcx" class="btn">添加跳转小程序</navigator>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. data() {
  66. return {
  67. list:[],
  68. admin_id:'',
  69. }
  70. },
  71. onLoad() {
  72. this.admin_id = uni.getStorageSync("admin_id");
  73. },
  74. onShow() {
  75. this.getData();
  76. },
  77. methods:{
  78. getData() {
  79. this.request({
  80. url: 'Smdcshop/applet_data',
  81. data: {
  82. admin_id: this.admin_id,
  83. }
  84. }).then(res => {
  85. if (res.code == 200) {
  86. this.list = res.data;
  87. }
  88. })
  89. },
  90. del(id) {
  91. uni.showModal({
  92. title: '提示',
  93. content: '是否要删除?',
  94. showCancel: true,
  95. cancelText: '取消',
  96. confirmText: '确定',
  97. success: res => {
  98. if (res.confirm) {
  99. this.request({
  100. url: 'Smdcshop/applet_delect',
  101. data: {
  102. id: id,
  103. },
  104. }).then(res => {
  105. console.log(res, "res")
  106. if (res.code === 200 || res.code === "200") {
  107. uni.showToast({
  108. title: "删除成功",
  109. icon: "none",
  110. })
  111. setTimeout(() => {
  112. this.getData()
  113. }, 2000)
  114. }
  115. }).catch((res) => {
  116. uni.showToast({
  117. title: res.message,
  118. icon: "none",
  119. })
  120. });
  121. }
  122. },
  123. fail: () => {},
  124. complete: () => {}
  125. });
  126. },
  127. }
  128. }
  129. </script>
  130. <style>
  131. @import url("../static/css/common.css");
  132. page {
  133. background-color: #F4F5F7;
  134. }
  135. .del {
  136. height: 44rpx;
  137. line-height: 44rpx;
  138. padding: 0 15rpx;
  139. font-size: 24rpx;
  140. background-color: #FF5722;
  141. margin-right: 25rpx;
  142. color: #fff;
  143. border-radius: 4rpx;
  144. }
  145. .list {
  146. padding: 10rpx 25rpx;
  147. }
  148. .list .item {
  149. border-radius: 8rpx;
  150. overflow: hidden;
  151. padding-left: 30rpx;
  152. border-left: 8rpx solid #247EFF;
  153. background-color: #fff;
  154. margin-bottom: 30rpx;
  155. }
  156. .list .item .name {
  157. height: 80rpx;
  158. border-bottom: 1rpx solid #f5f5f5;
  159. font-size: 30rpx;
  160. line-height: 80rpx;
  161. font-weight: bold;
  162. }
  163. .list .item .content {
  164. padding: 20rpx 0 24rpx;
  165. }
  166. .list .item .content .cell {
  167. /* flex: none; */
  168. /* width: 50%; */
  169. box-sizing: border-box;
  170. padding-right: 30rpx;
  171. font-size: 26rpx;
  172. line-height: 37rpx;
  173. color: #666;
  174. }
  175. .list .item .content .cell .title {
  176. color: #99A0AD;
  177. }
  178. </style>