redskinsServiceAdmin.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view>
  3. <My_listbox ref="listRef" @getlist="getList" bottomHeight="30">
  4. <view class="border-style" v-for="(item, index) in list" :key="item.rowindex">
  5. <view style="padding: 10px">
  6. <view class="content-style">
  7. <u--image :src="item.attinfos[0].url" :width="tovw(355)" :height="tovw(180)" :lazy-load="true">
  8. <template v-slot:loading>
  9. <u-loading-icon color="red"></u-loading-icon>
  10. </template>
  11. </u--image>
  12. </view>
  13. </view>
  14. <view class="button-style">
  15. <view>
  16. <span style="color: #666666;font-size: 14px">状态:</span>
  17. <span :style="{ color: item.isonsale == '1' ? '#E3041F' : '#999999', fontSize: '14px' }">{{ item.isonsale ==
  18. '1' ? '上架' : '下架' }}</span>
  19. </view>
  20. <view style="width: 100px;height: 40px;line-height: 40px;margin-top:5px;vertical-align: middle">
  21. <u-button :text="item.isonsale == '0' ? '上架' : '下架'" :color="item.isonsale == '0' ? '#C30D23' : '#999999'"
  22. @click="clickSale(item, index)" :loading="loading == item.linksid"></u-button>
  23. </view>
  24. </view>
  25. </view>
  26. </My_listbox>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. list: [],
  34. loading: null,
  35. current: 0,
  36. "content": {
  37. "title": ''
  38. },
  39. }
  40. },
  41. onLoad(options) {
  42. this.getList(true)
  43. if (options.title) {
  44. this.title = options.title
  45. }
  46. uni.setNavigationBarTitle({
  47. title: '6C红人服务管理'
  48. })
  49. },
  50. methods: {
  51. getList(init = false) {
  52. this.content.title = this.title ? this.title : "6C红人服务"
  53. if (this.paging(this.content, init)) return;
  54. this.$Http.basic({
  55. "id": 20240511110302,
  56. "content": this.content
  57. }).then(res => {
  58. this.$refs.listRef.RefreshToComplete()
  59. if (this.cutoff(res.msg)) return
  60. this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data)
  61. this.content = this.$refs.listRef.paging(this.content, res)
  62. })
  63. },
  64. clickSale(item) {
  65. this.loading = item.linksid
  66. item.isonsale = item.isonsale == '1' ? '0' : '1'
  67. this.$Http.basic({
  68. "id": 20240511133302,
  69. "content": {
  70. "linksids": [item.linksid],
  71. "isonsale": item.isonsale
  72. },
  73. }).then(res => {
  74. console.log("更改上下架", res)
  75. if (this.cutoff(res.msg)) return
  76. this.loading = null
  77. this.list[index] = item;
  78. // this.getList(true)
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss">
  85. .border-style {
  86. height: 255px;
  87. background: #FFFFFF;
  88. border-radius: 0px 0px 0px 0px;
  89. margin-bottom: 10px;
  90. .content-style {
  91. height: 180px;
  92. border: 0px solid #707070;
  93. }
  94. .button-style {
  95. padding: 0 10px 10px 10px;
  96. height: 45px;
  97. line-height: 45px;
  98. vertical-align: center;
  99. display: flex;
  100. justify-content: space-between;
  101. }
  102. }
  103. </style>