redskinsServiceAdmin.vue 2.8 KB

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