specialColumn.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view class="container special-column">
  3. <view class="tab-content">
  4. <view class="item" v-for="item in tabList" :key="item.value" @click="tabClickHandler(item)">
  5. {{ item.name }}
  6. <view class="line-active" v-if="tabActive == item.value"> </view>
  7. </view>
  8. </view>
  9. <view class="item-ul" v-if="tabActive == 1">
  10. <view class="item-li">
  11. <view class="item-title"> 专栏名称</view>
  12. <view class="item-name-time">
  13. <view class="name"> 作者昵称作者昵称</view>
  14. <view class="time"> 2023.08.24更新</view>
  15. </view>
  16. <view class="item-content">
  17. 专栏介绍:有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查看,登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查专栏介绍:有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查看,登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才
  18. </view>
  19. </view>
  20. </view>
  21. <view class="set-up-info" v-if="tabActive == 2">
  22. <view class="info-name info-box">
  23. <text class="seting-txt">首次进入我的专栏</text>
  24. <text class="seting-txt">请设置您的专栏信息</text>
  25. <input v-model="columnName" placeholder="请输入专栏名称" />
  26. <input v-model="columnNickname" placeholder="请输入昵称" />
  27. </view>
  28. <view class="set-up-lable info-box">
  29. <view class="top-box">
  30. <view class="lable-txt">
  31. 专栏标签
  32. <text>(选填)</text>
  33. </view>
  34. <view v-if="columnLableList.length < 6" class="new-lable" @click="addlableShow = true">+ 新建标签</view>
  35. </view>
  36. <view class="column-lable">
  37. <view class="lable-item" v-for="(item, index) in columnLableList" :key="index">
  38. <text>{{ item }}</text>
  39. <van-icon name="cross" @click="deleteLablehandle(index)" />
  40. </view>
  41. </view>
  42. </view>
  43. <view class="set-up-info info-box">
  44. <view class="lable-txt"> 专栏介绍 </view>
  45. <u-input v-model="columnIntroduce" type="textarea" :clearable="false" placeholder="请输入专栏介绍 " height="300" class="ipt" />
  46. </view>
  47. <view class="my-btn" @click="infoDetermineHandler"> 进入我的专栏 </view>
  48. </view>
  49. <u-modal
  50. v-model="addlableShow"
  51. :show-title="false"
  52. show-cancel-button
  53. confirm-text="确定"
  54. cancel-text="取消"
  55. :content-style="{ fontSize: '32rpx' }"
  56. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  57. :confirm-style="{ fontWeight: '700' }"
  58. @confirm="confirmModal"
  59. @cancel="cancelModal"
  60. >
  61. <view class="slot-content slot-content-text">
  62. <text class="add-lable-txt">新建标签</text>
  63. <input v-model="addLableName" placeholder="请输入标签名称(最多8个字)" :maxlength="8" />
  64. </view>
  65. </u-modal>
  66. <!-- <info-card /> -->
  67. <!-- <column-list-content /> -->
  68. </view>
  69. </template>
  70. <script>
  71. import ColumnListContent from "../components/columnListContent.vue";
  72. import infoCard from "../components/infoCard.vue";
  73. export default {
  74. components: { infoCard, ColumnListContent },
  75. data() {
  76. return {
  77. tabList: [
  78. { name: "专栏列表", value: "1" },
  79. { name: "我的专栏", value: "2" },
  80. ],
  81. tabActive: "2",
  82. addlableShow: false,
  83. columnName: "",
  84. columnNickname: "",
  85. columnIntroduce: "",
  86. columnLableList: [],
  87. addLableName: "",
  88. };
  89. },
  90. methods: {
  91. // top标签点击事件
  92. tabClickHandler(item) {
  93. this.tabActive = item.value;
  94. },
  95. // 添加标签的确认事件
  96. confirmModal() {
  97. if (!this.addLableName) return this.$util.toast("未添加标签");
  98. this.columnLableList.push(this.addLableName);
  99. this.addLableName = "";
  100. console.log("confirm");
  101. },
  102. // 添加标签的取消事件
  103. cancelModal() {
  104. this.addLableName = "";
  105. console.log("cancel");
  106. },
  107. // 信息填写完成 进入我的专栏
  108. infoDetermineHandler() {
  109. if (this.columnName && this.columnNickname && this.columnIntroduce) {
  110. } else {
  111. let str = !this.columnName ? "专栏名称" : !this.columnNickname ? "专栏昵称" : !this.columnIntroduce ? "专栏介绍" : "";
  112. this.$util.toast("请输入" + str);
  113. }
  114. },
  115. // 删除新建标签
  116. deleteLablehandle(index) {
  117. this.columnLableList.splice(index, 1);
  118. },
  119. },
  120. };
  121. </script>
  122. <style lang="scss" scope>
  123. .special-column {
  124. background-color: #f3f5f9;
  125. input {
  126. height: 72rpx;
  127. background-color: #f0f1f3;
  128. padding-left: 24rpx;
  129. border-radius: 12rpx;
  130. }
  131. .tab-content {
  132. margin-top: 1rpx;
  133. background-color: #fff;
  134. height: 96rpx;
  135. display: flex;
  136. view {
  137. flex: 1;
  138. text-align: center;
  139. line-height: 96rpx;
  140. border-bottom: 2rpx solid #e7e7e7;
  141. }
  142. .item {
  143. position: relative;
  144. .line-active {
  145. position: absolute;
  146. left: 50%;
  147. bottom: 0rpx;
  148. width: 32rpx;
  149. height: 6rpx;
  150. border-radius: 6rpx;
  151. background-color: #376cbb;
  152. transform: translateX(-50%);
  153. }
  154. }
  155. }
  156. .item-ul {
  157. padding: 30rpx;
  158. .item-li {
  159. padding: 0 30rpx 30rpx;
  160. background-color: white;
  161. border-radius: 16rpx;
  162. border-top: 10rpx solid #8fa4c4;
  163. margin-bottom: 20rpx;
  164. .item-title {
  165. font-size: 34rpx;
  166. font-weight: 500;
  167. }
  168. .item-name-time {
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. height: 80rpx;
  173. font-size: 28rpx;
  174. color: #999;
  175. }
  176. .item-content {
  177. text-overflow: -o-ellipsis-lastline;
  178. overflow: hidden;
  179. text-overflow: ellipsis;
  180. display: -webkit-box;
  181. -webkit-line-clamp: 4;
  182. line-clamp: 4;
  183. -webkit-box-orient: vertical;
  184. }
  185. }
  186. }
  187. .set-up-info {
  188. padding: 30rpx;
  189. .info-name {
  190. width: 100%;
  191. padding: 40rpx;
  192. border-radius: 16rpx;
  193. color: #333;
  194. background-color: #fff;
  195. .seting-txt {
  196. text-align: center;
  197. font-size: 36rpx;
  198. font-weight: 500;
  199. line-height: 50rpx;
  200. }
  201. .item-txt {
  202. margin-top: 40rpx;
  203. margin-bottom: 5rpx;
  204. font-size: 28rpx;
  205. font-weight: 500;
  206. line-height: 40rpx;
  207. }
  208. input {
  209. margin-top: 40rpx;
  210. }
  211. }
  212. .set-up-lable {
  213. .top-box {
  214. display: flex;
  215. background-color: #fff;
  216. justify-content: space-between;
  217. .new-lable {
  218. color: #376cbb;
  219. }
  220. }
  221. }
  222. .lable-txt {
  223. font-size: 28rpx;
  224. font-weight: 500;
  225. line-height: 40rpx;
  226. display: flex;
  227. text {
  228. color: #999;
  229. flex-wrap: 400;
  230. }
  231. }
  232. .info-box {
  233. padding: 40rpx;
  234. border-radius: 16rpx;
  235. color: #333;
  236. background-color: #fff;
  237. margin-bottom: 30rpx;
  238. }
  239. }
  240. .u-input {
  241. margin-top: 10rpx;
  242. background-color: #f0f1f3;
  243. }
  244. .u-input__textarea {
  245. padding: 20rpx !important;
  246. }
  247. .my-btn {
  248. margin: 50rpx 0;
  249. width: 100%;
  250. height: 72rpx;
  251. padding: 18rpx 30rpx 18rpx 30rpx;
  252. border-radius: 9rpx;
  253. background: #376cbb;
  254. color: #fff;
  255. display: flex;
  256. align-items: center;
  257. justify-content: center;
  258. }
  259. .add-lable-txt {
  260. color: #000;
  261. font-size: 36rpx;
  262. flex-wrap: 600;
  263. margin-bottom: 20rpx;
  264. width: 100%;
  265. text-align: center;
  266. }
  267. .column-lable {
  268. display: flex;
  269. flex-wrap: wrap;
  270. .lable-item {
  271. display: flex;
  272. color: #fff;
  273. font-size: 28rpx;
  274. padding: 10rpx 24rpx;
  275. background-color: #376cbb;
  276. border-radius: 153px;
  277. margin: 20rpx 20rpx 0 0;
  278. text {
  279. margin-right: 12rpx;
  280. }
  281. }
  282. }
  283. .slot-content-text {
  284. text-align: left;
  285. }
  286. }
  287. </style>