honor.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view class="content">
  3. <view>
  4. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"
  5. styleType="text" activeColor="#1c9bdc"></uni-segmented-control>
  6. <view class="content">
  7. <view v-show="current == 0">
  8. <view class="active-title-box">
  9. <uni-datetime-picker
  10. class="time-select-box"
  11. type="date"
  12. :value="single"
  13. @change="change"
  14. :clear-icon="false"
  15. />
  16. <picker @change="bindPickerChange" :value="index" :range="array">
  17. <view class="uni-input">{{array[index]}}</view>
  18. <image src="/static/arrow_down.svg" mode="aspectFit"></image>
  19. </picker>
  20. <button>+发布活动</button>
  21. </view>
  22. <view class="honor-box" v-for="(item,index) in honorList" :key="index">
  23. <view class="honor-name">{{item.name}}</view>
  24. <image :src="item.img_url" mode="aspectFit"></image>
  25. <view class="honor-award">获奖人:{{item.award_name}}</view>
  26. <view class="honor-info-box">
  27. <text>{{item.date}}</text>
  28. <text>|</text>
  29. <text>{{item.level}}</text>
  30. <text>|</text>
  31. <text>{{item.honor_type}}</text>
  32. <text>|</text>
  33. <text>{{item.honor_self}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. <view v-show="current == 1">
  38. <view class="active-title-box">
  39. <uni-datetime-picker
  40. class="time-select-box"
  41. type="date"
  42. :value="single"
  43. @change="change"
  44. :clear-icon="false"
  45. />
  46. <picker @change="bindPickerChange" :value="index" :range="array">
  47. <view class="uni-input">{{array[index]}}</view>
  48. <image src="/static/arrow_down.svg" mode="aspectFit"></image>
  49. </picker>
  50. <button>+发布活动</button>
  51. </view>
  52. <view class="honor-box" v-for="(item,index) in myHonorList" :key="index" style="position: relative;">
  53. <view class="honor-name">{{item.name}}</view>
  54. <image :src="item.img_url" mode="aspectFit"></image>
  55. <view class="honor-award">获奖人:{{item.award_name}}</view>
  56. <view class="honor-info-box">
  57. <text>{{item.date}}</text>
  58. <text>|</text>
  59. <text>{{item.level}}</text>
  60. <text>|</text>
  61. <text>{{item.honor_type}}</text>
  62. <text>|</text>
  63. <text>{{item.honor_self}}</text>
  64. </view>
  65. <view class="edit-icon-box">
  66. <image src="/static/edit-icon.png" mode="aspectFit"></image>
  67. <image src="/static/del-icon.png" mode="aspectFit"></image>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import md5 from "@/common/md5.js";
  77. export default {
  78. data() {
  79. return {
  80. id: "",
  81. details: "",
  82. items:['支部/组织荣誉','我的荣誉'],
  83. current:0,
  84. array:['中央','省级','市级','区级','单位'],
  85. index:2,
  86. imageList: [],
  87. time: "",
  88. globalUrl:getApp().globalData.shareUrl,
  89. honorList:[
  90. {
  91. name:'荣誉名称XXXX',
  92. award_name:'王谦 黄华',
  93. date:'2021年12月',
  94. level:'市级',
  95. honor_type:'党内荣誉',
  96. honor_self:'个人荣誉',
  97. img_url:'/static/logo.png',
  98. },
  99. {
  100. name:'荣誉名称XXXX',
  101. award_name:'灞桥区工委 肖亮 尹嗣瑜',
  102. date:'2021年12月',
  103. level:'市级',
  104. honor_type:'党内荣誉',
  105. honor_self:'个人荣誉',
  106. img_url:'/static/logo.png',
  107. }
  108. ],
  109. myHonorList:[
  110. {
  111. name:'荣誉名称XXXX111',
  112. award_name:'王谦 黄华',
  113. date:'2021年12月',
  114. level:'市级',
  115. honor_type:'党内荣誉',
  116. honor_self:'个人荣誉1',
  117. img_url:'/static/logo.png',
  118. },
  119. {
  120. name:'荣誉名称XXXX222',
  121. award_name:'灞桥区工委 肖亮 尹嗣瑜',
  122. date:'2021年12月',
  123. level:'市级',
  124. honor_type:'党内荣誉',
  125. honor_self:'个人荣誉2',
  126. img_url:'/static/logo.png',
  127. }
  128. ]
  129. };
  130. },
  131. onLoad() {
  132. },
  133. methods: {
  134. onClickItem(e){
  135. this.current = e.currentIndex
  136. },
  137. change(e) {
  138. this.single = e;
  139. console.log("-change事件:", e);
  140. },
  141. },
  142. };
  143. </script>
  144. <style lang="scss" scoped>
  145. .content {
  146. .active-title-box {
  147. display: flex;
  148. align-items: center;
  149. margin-top: 10rpx;
  150. font-size: 26rpx;
  151. height: 100rpx;
  152. border-bottom: 1px solid #d7d7d7;
  153. margin-top: 10rpx;
  154. .time-select-box {
  155. width: 32%;
  156. margin-left: 5%;
  157. }
  158. picker {
  159. width: 25%;
  160. border: 1px solid #d7d7d7;
  161. height: 60rpx;
  162. line-height: 60rpx;
  163. border-radius: 10rpx;
  164. margin-left: 20rpx;
  165. padding: 0 10rpx;
  166. position: relative;
  167. image {
  168. width: 20rpx;
  169. height: 20rpx;
  170. position: absolute;
  171. top: 11px;
  172. right: 5px;
  173. }
  174. }
  175. button {
  176. width: 24%;
  177. font-size: 25rpx;
  178. background: #4988fd;
  179. color: #fff;
  180. margin-left: 25rpx;
  181. }
  182. }
  183. .honor-box {
  184. display: flex;
  185. flex-direction: column;
  186. padding: 20rpx 40rpx 20rpx 40rpx;
  187. border-bottom: 1px solid #d7d7d7;
  188. image {
  189. width: 240rpx;
  190. height: 160rpx;
  191. margin: 20rpx auto;
  192. }
  193. .honor-award {
  194. color: #ccc;
  195. font-size: 28rpx;
  196. margin: 20rpx 0 10rpx 0;
  197. }
  198. .honor-info-box {
  199. display: flex;
  200. align-items: center;
  201. font-size: 26rpx;
  202. color: #ccc;
  203. text {
  204. margin-right: 20rpx;
  205. }
  206. }
  207. .edit-icon-box {
  208. position: absolute;
  209. right: 10px;
  210. top: 10px;
  211. image {
  212. width: 35rpx;
  213. height: 35rpx;
  214. margin-right: 10rpx;
  215. }
  216. }
  217. }
  218. }
  219. </style>