goodsCatDetail.vue 3.7 KB

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