volunteer.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <view>
  3. <uni-nav-bar
  4. status-bar = true
  5. fixed = true
  6. left-icon="arrowthinleft"
  7. background-color="#ffffff"
  8. color="#c7c7c7"
  9. @clickLeft="navigateBack">
  10. <button @tap="goHome" slot="right" size="mini" style="height: 30px; border-radius: 15px; background-color: #c7c7c7; ">
  11. <uni-icons type="home-filled" size="22" color="#ffffff"></uni-icons>
  12. </button>
  13. </uni-nav-bar>
  14. <view class="state-filter-list" :style="{top: filterTop}">
  15. <view @click="stateFilter(i)" :class="{active: stateIndex == i}" v-for="(item, i) in stateFilterList" :key="i">
  16. <uni-badge class="badge" v-if="i==1 && unconfirmed>0" :text="unconfirmed" size="small" type="error"></uni-badge>
  17. <uni-icons :type="item.icon" size="34" :color="stateIndex == i? '#3ac6c3': '#555555'"></uni-icons>
  18. <text>{{item.title}}</text>
  19. </view>
  20. </view>
  21. <scroll-view scroll-y="true" :style="{'margin-top': filterTop}">
  22. <view class="guest-list" v-for="(_item, _i) in guestTravelInfos" :key="_i">
  23. <view class="left-content">
  24. <image class="guest-photo" :src="_item[0].photoUrl? websiteUrl+_item[0].photoUrl: '../../static/missing-face.png'" mode=""></image>
  25. <view>
  26. <text class="guest-name" :style="{color: colorGroup[_i%4].color}">{{_item[0].applyWay=='zh'?_item[0].name: _item[0].nameEn}}</text>
  27. <uni-icons @click="makePhoneCall(_item[0].contactCellphone)" class="guest-phone" type="phone" size="16" color="#bde4f6"></uni-icons>
  28. </view>
  29. </view>
  30. <view class="right-content">
  31. <view class="guest-item" v-for="(item, i) in _item" :key="i" :style="{background: colorGroup[i%4].bgColor}">
  32. <view class="item-center">
  33. <view class="guest-state" :style="{color: colorGroup[i%4].color}">{{item.travelPointName}}</view>
  34. <!-- travelPointNameDict: 接机2显示到达时间,送机9显示离开时间 -->
  35. <view v-if="item.travelPointNameDict=='2'">
  36. <text class="guest-time">{{moment(item.travelArrivalTime).format("LT")}}</text>
  37. <text class="guest-date">{{moment(item.travelArrivalTime).format("YYYY-MM-DD")}}</text>
  38. </view>
  39. <view v-if="item.travelPointNameDict=='9'">
  40. <text class="guest-time">{{moment(item.travelLeaveTime).format("LT")}}</text>
  41. <text class="guest-date">{{moment(item.travelLeaveTime).format("YYYY-MM-DD")}}</text>
  42. </view>
  43. </view>
  44. <view class="item-right">
  45. <view class="guest-flight" v-if="item.travelPointNameDict=='2'">{{item.travelInfo}}</view>
  46. <view class="guest-flight" v-else-if="item.travelPointNameDict=='9'">{{item.travelInfo}}</view>
  47. <view class="guest-flight" v-else></view>
  48. <view>
  49. <!-- travelPointStatus: 0已完成 1未完成 2待确认 -->
  50. <view class="guest-option" v-if="item.travelPointStatus == '2'">
  51. <view class="option-state" @click="carryOutOption(item.travelPointId, '0', 2)">
  52. <uni-icons type="checkmarkempty" size="30" color="#1eb019"></uni-icons>
  53. </view>
  54. <view class="option-state" @click="carryOutOption(item.travelPointId, '1', 3)">
  55. <uni-icons type="closeempty" size="30" color="#aaaaaa"></uni-icons>
  56. </view>
  57. </view>
  58. <view class="option-state" v-if="item.travelPointStatus == '0'">
  59. <text class="guest-completed">已完成</text>
  60. </view>
  61. <view class="option-state" v-if="item.travelPointStatus == '1'">
  62. <text class="guest-not-completed">未完成</text>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </scroll-view>
  70. </view>
  71. </template>
  72. <script>
  73. import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue";
  74. import uniIcons from "@/components/uni-icons/uni-icons.vue";
  75. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  76. export default {
  77. components: {uniNavBar, uniIcons},
  78. data() {
  79. return {
  80. stateFilterList: [
  81. {title: '全部', icon: 'list'},
  82. {title: '待确认', icon: 'paperclip'},
  83. {title: '已完成', icon: 'checkbox'},
  84. {title: '未完成', icon: 'close'}
  85. ],
  86. stateIndex: 0,
  87. condition: '',
  88. guestTravelInfos: [],
  89. unconfirmed: 0,
  90. isGetUnconfirmed: true,
  91. colorGroup: [
  92. {color: '#0000bf', bgColor: '#bde4f6'},
  93. {color: '#8400ff', bgColor: '#e6d9f3'},
  94. {color: '#f59a23', bgColor: '#f3e7d7'},
  95. {color: '#03b7b4', bgColor: '#d3ecec'},
  96. {color: '#70b603', bgColor: '#e1ebd3'}
  97. ],
  98. filterTop: (statusBarHeight+44)+'px',
  99. Storage_data: null
  100. }
  101. },
  102. mounted(){
  103. this.Storage_data =JSON.parse(uni.getStorageSync('user'));
  104. this.getGuestsByCondition(this.condition);
  105. },
  106. methods: {
  107. async carryOutOption(travelPointId, travelPointStatus, o){
  108. const res = await this.$myRequest({
  109. url: '/meeting/meetingGuestActivitys/volUpdateGuestTravelPointStatus',
  110. method: 'POST',
  111. data: {
  112. "travelPointId": travelPointId,
  113. "travelPointStatus": travelPointStatus
  114. }
  115. });
  116. this.unconfirmed -= 1;
  117. this.stateFilter(o)
  118. },
  119. async getGuestsByCondition(condition){
  120. const res = await this.$myRequest({
  121. url: '/meeting/meetingApplys/getGuestTravelPointInfoByVolLoginAccount',
  122. data: {
  123. "loginAccount": this.Storage_data.umsUser.userPreferredMobile,
  124. "travelPointStatus": condition
  125. }
  126. });
  127. // console.log('guestTravelPointInfos',res.data.guestTravelPointInfos)
  128. this.guestTravelInfos = [];
  129. res.data.guestTravelPointInfos.forEach(item => {
  130. let unitArr = [];
  131. if(this.guestTravelInfos.length){
  132. let hasSameId = false;
  133. let listItemIndex;
  134. for(let l = 0; l < this.guestTravelInfos.length; l++){
  135. if(this.guestTravelInfos[l][0].id == item.id){
  136. hasSameId = true;
  137. listItemIndex = l;
  138. break;
  139. }
  140. }
  141. if(hasSameId){
  142. this.guestTravelInfos[listItemIndex].push(item);
  143. }else{
  144. unitArr.push(item)
  145. this.guestTravelInfos.push(unitArr);
  146. }
  147. }else{
  148. unitArr.push(item)
  149. this.guestTravelInfos.push(unitArr);
  150. }
  151. })
  152. // console.log('guestTravelInfos',this.guestTravelInfos)
  153. if(this.isGetUnconfirmed){
  154. res.data.guestTravelPointInfos.forEach(item=>{
  155. if(item.travelPointStatus=="2") this.unconfirmed += 1;
  156. })
  157. }
  158. // console.log(this.guestTravelInfos)
  159. },
  160. goHome(){
  161. this.$mRouter.reLaunch({ route: '/pages/index/index' });
  162. },
  163. makePhoneCall(phone){
  164. uni.makePhoneCall({
  165. phoneNumber: phone
  166. })
  167. },
  168. stateFilter(i){
  169. this.isGetUnconfirmed = false;
  170. this.stateIndex = i;
  171. switch(i){
  172. case 0:
  173. this.condition = ""
  174. break;
  175. case 1:
  176. this.condition = 2
  177. break;
  178. case 2:
  179. this.condition = 0
  180. break;
  181. case 3:
  182. this.condition = 1
  183. break;
  184. };
  185. this.getGuestsByCondition(this.condition);
  186. },
  187. navigateBack(){
  188. uni.navigateBack();
  189. }
  190. }
  191. }
  192. </script>
  193. <style scoped>
  194. .scroll-box{
  195. }
  196. .uni-icons{
  197. line-height: 30px;
  198. }
  199. .state-filter-list{
  200. width: 100%;
  201. padding: 10px 15px;
  202. display: flex;
  203. justify-content: space-between;
  204. text-align: center;
  205. background: #FFFFFF;
  206. color: #555555;
  207. position: fixed;
  208. left: 0;
  209. z-index: 9;
  210. }
  211. .state-filter-list .active{
  212. color: #3ac6c3;
  213. }
  214. .state-filter-list view{
  215. position: relative;
  216. }
  217. .state-filter-list view .uni-icons{
  218. display: block;
  219. padding-bottom: 4upx;
  220. line-height: 1;
  221. }
  222. .badge{
  223. position: absolute;
  224. top: -8px;
  225. right: -8px;
  226. }
  227. .guest-list{
  228. padding: 30upx 30upx 0 30upx;
  229. display: flex;
  230. }
  231. .guest-item{
  232. border-radius: 30rpx;
  233. padding: 20rpx;
  234. display: flex;
  235. margin-bottom: 30upx;
  236. min-height: 240rpx;
  237. }
  238. .guest-photo{
  239. width: 140upx;
  240. height: 140upx;
  241. border-radius: 50%;
  242. }
  243. .guest-name{
  244. /* color: #0000bf; */
  245. }
  246. .guest-phone{
  247. background: #fff;
  248. border-radius: 10upx;
  249. margin-left: 10upx;
  250. }
  251. .guest-state{
  252. color: #0000bf;
  253. font-size: 18px;
  254. font-weight: bold;
  255. }
  256. .guest-flight{
  257. width: 240rpx;
  258. color: #666;
  259. font-size: 12px;
  260. }
  261. .guest-time{
  262. line-height: 24px;
  263. font-size: 16px;
  264. font-weight: bold;
  265. display: block;
  266. margin-top: 60rpx;
  267. }
  268. .guest-date{
  269. line-height: 14px;
  270. display: block;
  271. font-size: 12px;
  272. font-weight: bold;
  273. color: #AAAAAA;
  274. }
  275. .option-state{
  276. height: 60upx;
  277. line-height: 60upx;
  278. background: #FFFFFF;
  279. text-align: center;
  280. border-radius: 10upx;
  281. width: 240rpx;
  282. }
  283. .guest-option{
  284. width: 240rpx;
  285. display: flex;
  286. justify-content: space-between;
  287. }
  288. .guest-option .option-state{
  289. width: 100upx;
  290. }
  291. .guest-completed{
  292. color: #1eb019;
  293. }
  294. .guest-not-completed{
  295. color: #AAAAAA;
  296. }
  297. .item-center{
  298. flex: 1;
  299. }
  300. .left-content{
  301. text-align: center;
  302. margin-right: 60rpx;
  303. }
  304. .item-right{
  305. margin-left: 40rpx;
  306. display:flex;
  307. flex-direction: column;
  308. justify-content: space-between;
  309. }
  310. .right-content{
  311. flex: 1;
  312. }
  313. </style>