honor.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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 @click="goRecord()">+获奖记录</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 @click="goRecord()">+获奖记录</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. goRecord(){
  142. uni.navigateTo({
  143. url:'./record'
  144. })
  145. }
  146. },
  147. };
  148. </script>
  149. <style lang="scss" scoped>
  150. .content {
  151. .active-title-box {
  152. display: flex;
  153. align-items: center;
  154. margin-top: 10rpx;
  155. font-size: 26rpx;
  156. height: 100rpx;
  157. border-bottom: 1px solid #d7d7d7;
  158. margin-top: 10rpx;
  159. .time-select-box {
  160. width: 32%;
  161. margin-left: 5%;
  162. }
  163. picker {
  164. width: 25%;
  165. border: 1px solid #d7d7d7;
  166. height: 60rpx;
  167. line-height: 60rpx;
  168. border-radius: 10rpx;
  169. margin-left: 20rpx;
  170. padding: 0 10rpx;
  171. position: relative;
  172. image {
  173. width: 20rpx;
  174. height: 20rpx;
  175. position: absolute;
  176. top: 11px;
  177. right: 5px;
  178. }
  179. }
  180. button {
  181. width: 24%;
  182. font-size: 25rpx;
  183. background: #4988fd;
  184. color: #fff;
  185. margin-left: 25rpx;
  186. }
  187. }
  188. .honor-box {
  189. display: flex;
  190. flex-direction: column;
  191. padding: 20rpx 40rpx 20rpx 40rpx;
  192. border-bottom: 1px solid #d7d7d7;
  193. image {
  194. width: 240rpx;
  195. height: 160rpx;
  196. margin: 20rpx auto;
  197. }
  198. .honor-award {
  199. color: #ccc;
  200. font-size: 28rpx;
  201. margin: 20rpx 0 10rpx 0;
  202. }
  203. .honor-info-box {
  204. display: flex;
  205. align-items: center;
  206. font-size: 26rpx;
  207. color: #ccc;
  208. text {
  209. margin-right: 20rpx;
  210. }
  211. }
  212. .edit-icon-box {
  213. position: absolute;
  214. right: 10px;
  215. top: 10px;
  216. image {
  217. width: 35rpx;
  218. height: 35rpx;
  219. margin-right: 10rpx;
  220. }
  221. }
  222. }
  223. }
  224. </style>