goodsCatDetail.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="container">
  3. <view class="page-block">
  4. <view class="page-title-block">
  5. <view class="title">分类信息</view>
  6. </view>
  7. <view class="content">
  8. <view class="cell flex flex-y-center">
  9. <view class="title-block">
  10. <text>分类名称</text>
  11. </view>
  12. <view class="desc">
  13. <view class="input-box">{{info.name}}</view>
  14. </view>
  15. </view>
  16. <!-- <view class="cell flex flex-y-center">
  17. <view class="title-block">
  18. <text>分类描述</text>
  19. </view>
  20. <view class="desc">
  21. <view class="desc-info">{{info.keywords}}</view>
  22. </view>
  23. </view> -->
  24. </view>
  25. </view>
  26. <!-- -->
  27. <view class="info-car">
  28. <view class="title-block">
  29. <view class="title">分类图标</view>
  30. </view>
  31. <view class="content">
  32. <image :src="URL+info.thumb" class="logo-img"></image>
  33. </view>
  34. </view>
  35. <view style="height:30rpx;"></view>
  36. <view class="footer-bar" style="height: 100rpx;">
  37. <view class="content flex flex-center" style="height: 100rpx;">
  38. <view @click="del" class="detail-btn flex flex-center" style="border-right: 2rpx solid #F4F5F7;">
  39. <image src="../static/images/icon_16.png" mode="aspectFit" class="btn-icon"></image>
  40. <view style="color:#999999">删除分类</view>
  41. </view>
  42. <view @click="enit" class="detail-btn flex flex-center">
  43. <image src="../static/images/icon_17.png" mode="aspectFit" class="btn-icon"></image>
  44. <view style="color:#3387FF">重新编辑</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. URL: getApp().globalData.URL,
  55. info:{}
  56. }
  57. },
  58. onLoad(e) {
  59. if(e.id){
  60. this.info=uni.getStorageSync("category_info");
  61. }
  62. },
  63. methods: {
  64. enit(){
  65. let info=this.info;
  66. uni.navigateTo({
  67. url:`./editGoodsCat?id=${info.id}`
  68. })
  69. },
  70. del() {
  71. uni.showModal({
  72. title: '提示',
  73. content: '是否要删除?',
  74. showCancel: true,
  75. cancelText: '取消',
  76. confirmText: '确定',
  77. success: res => {
  78. if (res.confirm) {
  79. this.request({
  80. url: 'Smdcshop/jftype_delect',
  81. data: {
  82. id: this.info.id,
  83. },
  84. }).then(res => {
  85. console.log(res, "res")
  86. if (res.code === 200 || res.code === "200") {
  87. uni.showToast({
  88. title: "删除成功",
  89. icon: "none",
  90. })
  91. setTimeout(()=>{
  92. uni.navigateBack()
  93. },2000)
  94. }
  95. }).catch((res) => {
  96. uni.showToast({
  97. title: res.message,
  98. icon: "none",
  99. })
  100. });
  101. }
  102. },
  103. fail: () => {},
  104. complete: () => {}
  105. });
  106. },
  107. },
  108. }
  109. </script>
  110. <style>
  111. @import url("../static/css/common.css");
  112. page {
  113. background-color: #F4F5F7;
  114. }
  115. .info-car {
  116. margin-top: 25rpx;
  117. background-color: #fff;
  118. padding: 0 25rpx;
  119. }
  120. .info-car .title-block {
  121. border-bottom: 1rpx solid #f5f5f5;
  122. }
  123. .info-car .title {
  124. height: 100rpx;
  125. line-height: 100rpx;
  126. font-size: 30rpx;
  127. color: #333;
  128. font-weight: 600;
  129. }
  130. .info-car .content {
  131. padding: 30rpx 0;
  132. }
  133. .info-car .input-box {
  134. font-size: 28rpx;
  135. color: #333;
  136. }
  137. .info-car .logo-img {
  138. display: block;
  139. width: 120rpx;
  140. height: 120rpx;
  141. }
  142. </style>