productCate.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <view class="container">
  3. <view class="main-title">
  4. <view class="tit">
  5. 规格类型
  6. </view>
  7. <view class="cate-add" @click="addCate">
  8. 新增
  9. </view>
  10. </view>
  11. <view class="cate-list">
  12. <view class="cate-item" v-for="i in 10">
  13. <view class="cate-header">
  14. <view class="cate-name">
  15. <image class="pen" src="@/static/images/edit-pen.png"></image>
  16. <up-input class="cate-name-ipt" v-model="cateDemo.attrName" placeholder="请输入规格类型" inputAlign="left"
  17. border="none" type="text">
  18. </up-input>
  19. </view>
  20. <view class="delete-icon">
  21. <image class="delete" src="/static/images/delete.png"></image>
  22. </view>
  23. </view>
  24. <view class="cate-child">
  25. <view class="children">
  26. <view class="children-item">
  27. <view class="cname">
  28. 金条
  29. </view>
  30. <image class="close" src="@/static/images/close-icon.png" mode=""></image>
  31. </view>
  32. </view>
  33. <view class="cate-child-add">
  34. <image class="plus" src="@/static/images/plus-icon.png" mode=""></image>
  35. <view class="add">
  36. 添加规格项
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="bottom-actions">
  43. <view class="action-btn" @click="ensureClickHandle"> 确定 </view>
  44. </view>
  45. <up-popup :show="showPopUp" :round="20" :duration="150" mode="bottom" @close="showPopUp=false" @open="showPopUp=true">
  46. <view class="pop-container">
  47. <view class="pop-header">
  48. 规格类型
  49. <image class="pop-close" src="/static/images/close-icon.png" mode="" @click="showPopUp=false"></image>
  50. </view>
  51. <view class="pop-ipt">
  52. <textarea class="item-textarea" maxlength="100" v-model="cipt"
  53. placeholder="请输入规格类型" />
  54. </view>
  55. <view class="action-btn" @click="ensureClickHandle"> 确定 </view>
  56. </view>
  57. </up-popup>
  58. </view>
  59. </template>
  60. <script setup>
  61. import {
  62. ref,
  63. computed,
  64. watch,
  65. nextTick
  66. } from 'vue';
  67. import {
  68. onShow,
  69. onLoad
  70. } from "@dcloudio/uni-app";
  71. import {
  72. productCategory,
  73. productSave,
  74. productUpdate,
  75. templatesList,
  76. productInfo
  77. } from "@/api/merchant";
  78. import CategorySelector from '@/components/CategorySelector';
  79. import {
  80. useAppStore
  81. } from "@/stores/app";
  82. import {
  83. useImageUpload
  84. } from "@/hooks/useImageUpload";
  85. import {
  86. useToast
  87. } from "@/hooks/useToast";
  88. const {
  89. Toast
  90. } = useToast();
  91. const {
  92. imageList,
  93. afterRead,
  94. deletePic,
  95. uploadLoading
  96. } = useImageUpload({
  97. pid: 1,
  98. model: "product",
  99. });
  100. const appStore = useAppStore();
  101. const cateDemo = {
  102. "id": 1586,
  103. "productId": 729,
  104. "attrName": "圈号",
  105. "attrValues": "56mm,68mm,78mm",
  106. "type": 0,
  107. "isDel": false
  108. }
  109. const cateList = ref([{}])
  110. const showPopUp = ref(true)
  111. const cipt = ref('')
  112. const addCate = ()=>{
  113. showPopUp.value = true;
  114. }
  115. const ensureClickHandle = ()=>{
  116. console.log("ensure")
  117. showPopUp.value = false;
  118. }
  119. </script>
  120. <style scoped lang="scss">
  121. page {
  122. background-color: #f9f7f0;
  123. height: 100%;
  124. }
  125. .container {
  126. padding: 16rpx;
  127. background-color: #f9f7f0;
  128. padding-bottom: calc(132rpx + constant(safe-area-inset-bottom));
  129. padding-bottom: calc(132rpx + env(safe-area-inset-bottom));
  130. .main-title {
  131. width: 100%;
  132. height: 48rpx;
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. margin-bottom: 16rpx;
  137. .tit {
  138. font-size: 32rpx;
  139. color: #333;
  140. font-weight: bold;
  141. }
  142. .cate-add {
  143. padding: 16rpx 0 16rpx 16rpx;
  144. font-size: 28rpx;
  145. color: #F8C008;
  146. font-weight: bold;
  147. }
  148. }
  149. }
  150. .cate-list{
  151. .cate-item{
  152. width: 100%;
  153. padding: 20rpx;
  154. background-color: #fff;
  155. border-radius: 16rpx;
  156. margin-bottom: 20rpx;
  157. .cate-header{
  158. width: 100%;
  159. height: 64rpx;
  160. display: flex;
  161. justify-content: space-between;
  162. align-items: center;
  163. border-bottom: 1px solid #F1F3F8;
  164. padding-bottom: 20rpx;
  165. .cate-name{
  166. display: flex;
  167. justify-content: flex-start;
  168. align-items: center;
  169. .pen{
  170. width: 32rpx;
  171. height: 32rpx;
  172. margin-right: 16rpx;
  173. }
  174. .cate-name-ipt{
  175. height: 44rpx;
  176. line-height: 44rpx;
  177. font-size: 28rpx;
  178. color:#333;
  179. }
  180. }
  181. .delete-icon{
  182. padding: 10rpx 0 10rpx 10rpx;
  183. display: flex;
  184. justify-content: center;
  185. align-items: center;
  186. .delete{
  187. width: 32rpx;
  188. height: 32rpx;
  189. }
  190. }
  191. }
  192. .children{
  193. width: 100%;
  194. display: flex;
  195. margin-top: 20rpx;
  196. justify-content: flex-start;
  197. align-items: center;
  198. flex-wrap: wrap;
  199. }
  200. .children-item{
  201. min-width: 120rpx;
  202. padding: 8rpx 16rpx;
  203. border-radius: 8rpx;
  204. display: flex;
  205. justify-content: space-between;
  206. align-items: center;
  207. background-color: #F9F7F0;
  208. .cname{
  209. font-size: 28rpx;
  210. color:#333;
  211. margin-right: 16rpx;
  212. line-height: 44rpx;
  213. }
  214. .close{
  215. width: 32rpx;
  216. height: 32rpx;
  217. }
  218. }
  219. .cate-child-add{
  220. padding: 8rpx 16rpx;
  221. width: 220rpx;
  222. background-color: rgba(248, 192, 8, 0.10);
  223. border-radius: 8rpx;
  224. display: flex;
  225. justify-content: flex-start;
  226. align-items: center;
  227. margin-top: 20rpx;
  228. .add{
  229. font-size: 28rpx;
  230. line-height: 44rpx;
  231. color: #F8C008;
  232. }
  233. .plus{
  234. width: 32rpx;
  235. height: 32rpx;
  236. margin-right: 16rpx;
  237. }
  238. }
  239. }
  240. }
  241. .bottom-actions {
  242. position: fixed;
  243. bottom: 0;
  244. left: 0;
  245. right: 0;
  246. width: 100%;
  247. z-index: 8;
  248. background: #FFFFFF;
  249. padding: 22rpx 32rpx calc(22rpx + constant(safe-area-inset-bottom));
  250. padding: 22rpx 32rpx calc(22rpx + env(safe-area-inset-bottom));
  251. }
  252. .action-btn {
  253. font-weight: bold;
  254. line-height: 88rpx;
  255. text-align: center;
  256. border-radius: 16rpx;
  257. font-size: 32rpx;
  258. font-weight: bold;
  259. background: #F8C008;
  260. }
  261. .pop-container{
  262. background-color: #fff;
  263. border-radius: 40rpx 40rpx 0 0;
  264. position: relative;
  265. padding: 22rpx 32rpx calc(22rpx + constant(safe-area-inset-bottom));
  266. padding: 22rpx 32rpx calc(22rpx + env(safe-area-inset-bottom));
  267. .pop-header{
  268. height: 44rpx;
  269. width: 100%;
  270. text-align: center;
  271. line-height: 48rpx;
  272. font-size: 32rpx;
  273. color:#333;
  274. font-weight: bold;
  275. .pop-close{
  276. width: 32rpx;
  277. height: 32rpx;
  278. position: absolute;
  279. right: 32rpx;
  280. top: 32rpx;
  281. }
  282. }
  283. .pop-ipt{
  284. width: 100%;
  285. display: flex;
  286. background-color: #F9F7F0;
  287. border-radius: 16rpx;
  288. margin-top: 32rpx;
  289. margin-bottom: 32rpx;
  290. }
  291. }
  292. .item-textarea {
  293. width: 100rpx;
  294. height: 200rpx;
  295. padding: 16rpx;
  296. flex: 1;
  297. text-align: left;
  298. }
  299. </style>