redskinsServiceAdmin.vue 2.4 KB

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