activity.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <template>
  2. <view class="content">
  3. <view class="self-inf">
  4. <view class="antu-box" v-if="isAuth">
  5. <view class="img-name-box">
  6. <image :src="userHeadImg" class="heade-img" mode="aspectFill"></image>
  7. <p class="nickname">{{ userNickName }}</p>
  8. <p class="nickname">136****0648</p>
  9. </view>
  10. <view class="org-info-box">
  11. <view class="org-info">浐灞一支部</view>
  12. <view class="org-line"></view>
  13. <view class="org-info">宣传委员</view>
  14. </view>
  15. </view>
  16. <view class="img-name-box" v-if="!isAuth" style="height: 180rpx;">
  17. <image src="/static/auth-icon.png" class="heade-img" mode="aspectFill" style="margin-left: 80rpx;"></image>
  18. <button @click="goAuthPage()" class="auth-btn">授权登录</button>
  19. </view>
  20. </view>
  21. <view>
  22. <view class="active-title-box">
  23. <uni-datetime-picker
  24. class="time-select-box"
  25. type="date"
  26. :value="single"
  27. @change="change"
  28. :clear-icon="false"
  29. />
  30. <picker @change="bindPickerChange" :value="index" :range="array">
  31. <view class="uni-input">{{array[index]}}</view>
  32. <image src="/static/arrow_down.svg" mode="aspectFit"></image>
  33. </picker>
  34. <button @click="publish()">+发布活动</button>
  35. </view>
  36. <view class="active-box" v-for="(item,index) in activiList" :key="index" @click="goList()">
  37. <view class="active-type" :class="{'bg-yellow':item.typeNum == '1' ,'bg-red':item.typeNum == '2','bg-blue':item.typeNum == '3',}" >
  38. {{item.type}}
  39. </view>
  40. <view class="active-content-box">
  41. <view class="active-content">
  42. <view class="active-name">{{item.activi_name}}</view>
  43. <view class="active-date">{{item.date}}</view>
  44. </view>
  45. <view class="active-content">
  46. <view style="margin-right:10rpx;">{{item.department}} | </view>
  47. <view>{{item.name}} | </view>
  48. <view style="margin-left:10rpx;">记录数:({{item.record_num}}/{{item.num}})</view>
  49. </view>
  50. </view>
  51. <view class="edit-icon-box">
  52. <image src="/static/edit-icon.png" mode="aspectFit"></image>
  53. <image src="/static/del-icon.png" mode="aspectFit"></image>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import md5 from "@/common/md5.js";
  61. export default {
  62. components: {
  63. },
  64. data() {
  65. return {
  66. isAuth:getApp().globalData.globalAuth,
  67. userHeadImg: getApp().globalData.user_headUrl,
  68. userNickName:getApp().globalData.user_name,
  69. array: ['全部', '浐灞一支部', '浐灞二支部'],
  70. index: 0,
  71. activiList:[
  72. {
  73. type:'组织建设',
  74. typeNum:'1',
  75. activi_name:'活动名称XXX',
  76. date:'2022.01.22',
  77. name:'路小路',
  78. department:'浐灞一支部',
  79. record_num:'22',
  80. num:'9'
  81. },
  82. {
  83. type:'学习培训',
  84. typeNum:'2',
  85. activi_name:'活动名称XXX',
  86. date:'2022.01.15',
  87. name:'陈伟',
  88. department:'浐灞二支部',
  89. record_num:'22',
  90. num:'9'
  91. },
  92. {
  93. type:'参政议政',
  94. typeNum:'3',
  95. activi_name:'活动名称XXX',
  96. date:'2022.01.15',
  97. name:'陈伟',
  98. department:'浐灞二支部',
  99. record_num:'22',
  100. num:'9'
  101. },
  102. ]
  103. };
  104. },
  105. onShow() {
  106. },
  107. methods: {
  108. bindPickerChange: function(e) {
  109. console.log('picker发送选择改变,携带值为', e.target.value)
  110. this.index = e.target.value
  111. },
  112. change(e) {
  113. this.single = e;
  114. console.log("-change事件:", e);
  115. },
  116. publish(){
  117. uni.navigateTo({
  118. url:'./create1'
  119. })
  120. },
  121. goList(){
  122. uni.navigateTo({
  123. url:'./list'
  124. })
  125. }
  126. },
  127. };
  128. </script>
  129. <style lang="scss" scoped>
  130. .content {
  131. display: flex;
  132. flex-direction: column;
  133. .self-inf {
  134. // border-radius: 0rpx 0rpx 100% 100%;
  135. .img-name-box {
  136. height: 150rpx;
  137. margin-top: 20rpx;
  138. margin-bottom: 20rpx;
  139. display: flex;
  140. align-items: center;
  141. width: 85%;
  142. .auth-btn {
  143. margin-left: 30rpx;
  144. margin-top: 20rpx;
  145. font-size: 28rpx;
  146. background-color: #02a7f0;
  147. color: #fff;
  148. }
  149. .heade-img {
  150. z-index: 1;
  151. width: 100rpx;
  152. height: 100rpx;
  153. border-radius: 50%;
  154. // margin-left: 80rpx;
  155. }
  156. }
  157. .nickname {
  158. font-weight: 600;
  159. font-size: 28rpx;
  160. margin-left: 30rpx;
  161. margin-top: 20rpx;
  162. color: #555;
  163. letter-spacing: 1rpx;
  164. }
  165. }
  166. }
  167. .antu-box {
  168. display: flex;
  169. flex-direction: column;
  170. align-items: center;
  171. background: #fff;
  172. margin-left: 5%;
  173. margin-top: 50rpx;
  174. border-radius: 10rpx;
  175. width: 90%;
  176. color: #555;
  177. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.2);
  178. }
  179. .org-info-box {
  180. display: flex;
  181. justify-content: space-evenly;
  182. height: 80rpx;
  183. align-items: center;
  184. width: 100%;
  185. border-top: 1px solid #d4d4d4;
  186. color: #555;
  187. font-size: 28rpx;
  188. background: #fff;
  189. }
  190. .org-line {
  191. width: 1px;
  192. height: 82rpx;
  193. background: #d4d4d4;
  194. }
  195. .active-title-box {
  196. display: flex;
  197. align-items: center;
  198. margin-top: 10rpx;
  199. font-size: 26rpx;
  200. height: 100rpx;
  201. border-bottom: 1px solid #d7d7d7;
  202. margin-top: 10rpx;
  203. .time-select-box {
  204. width: 32%;
  205. margin-left: 5%;
  206. }
  207. picker {
  208. width: 25%;
  209. border: 1px solid #d7d7d7;
  210. height: 60rpx;
  211. line-height: 60rpx;
  212. border-radius: 10rpx;
  213. margin-left: 20rpx;
  214. padding: 0 10rpx;
  215. position: relative;
  216. image {
  217. width: 20rpx;
  218. height: 20rpx;
  219. position: absolute;
  220. top: 11px;
  221. right: 5px;
  222. }
  223. }
  224. button {
  225. width: 24%;
  226. font-size: 25rpx;
  227. background: #4988fd;
  228. color: #fff;
  229. margin-left: 25rpx;
  230. }
  231. }
  232. .active-box {
  233. display: flex;
  234. align-items: center;
  235. position: relative;
  236. font-size: 28rpx;
  237. padding: 30rpx;
  238. border-bottom: 1px solid #d7d7d7;
  239. .active-type {
  240. width: 100rpx;
  241. height: 100rpx;
  242. border-radius: 50%;
  243. background-color: yellow;
  244. text-align: center;
  245. display: flex;
  246. align-items: center;
  247. font-size: 26rpx;
  248. color: #fff;
  249. }
  250. .active-content-box {
  251. display: flex;
  252. flex-direction: column;
  253. margin-left: 20rpx;
  254. }
  255. .active-content {
  256. display: flex;
  257. align-items: center;
  258. height: 45rpx;
  259. font-size: 26rpx;
  260. .active-name {
  261. font-size: 30rpx;
  262. margin-right: 10rpx;
  263. }
  264. .active-date {
  265. color: #ccc;
  266. }
  267. }
  268. .edit-icon-box {
  269. position: absolute;
  270. right: 10px;
  271. top: 10px;
  272. image {
  273. width: 35rpx;
  274. height: 35rpx;
  275. margin-right: 10rpx;
  276. }
  277. }
  278. .bg-yellow {
  279. background-color: #ffdd40;
  280. }
  281. .bg-red {
  282. background-color: #ec808d;
  283. }
  284. .bg-blue {
  285. background-color: #81d3f8;
  286. }
  287. }
  288. </style>