移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

250 rivejä
7.5 KiB

  1. <template>
  2. <div class="app-container" >
  3. <div class="header">
  4. <div class="font_size">
  5. <span>字体:</span>
  6. <span @click="openSmall">正常</span>
  7. <span @click="openBig">大号</span>
  8. </div>
  9. <van-row style="width: 90%; margin: 0 auto">
  10. <van-col span="7">
  11. <img v-if="user.avatar" :src="'/api'+user.avatar" style="border: 2px solid #FFF;width: 2rem;height: 2rem;border-radius: 50%;">
  12. <img v-else src="../../assets/images/user_tx.png" style="width: 2rem;height: 2rem;border-radius: 50%;">
  13. </van-col>
  14. <van-col span="17">
  15. <p @click="openView = true">
  16. {{phone}}
  17. <span class="activitiStatus">
  18. {{
  19. activitiStatus == '1' ? '待审':
  20. activitiStatus == '2' ? '驳回':
  21. activitiStatus == '3' ? '通过':''
  22. }}
  23. </span>
  24. </p>
  25. <p onclick="window.location='accountSetting'">账户设置</p>
  26. </van-col>
  27. </van-row>
  28. </div>
  29. <div style="width: 96%;transform: translateY(-18%);margin: 0 auto;border-radius: 0.4rem;overflow: hidden;">
  30. <van-cell title="我的报名" is-link icon="balance-list-o" to="application" />
  31. <van-cell title="我的竞价" is-link icon="bar-chart-o" to="bidding" />
  32. <van-cell title="我的咨询" is-link icon="service-o" to="userInteraction" />
  33. <van-cell title="我的供求" is-link icon="bag-o" to="userSupply" />
  34. <van-cell title="合同网签" is-link icon="orders-o" to="/user/signature/signatureList" />
  35. </div>
  36. <van-button class="loginOut" round color="#007E72" @click="loginOut">
  37. 退出登录
  38. </van-button>
  39. <van-dialog v-model="openView" title="审核记录">
  40. <div style="height: 50vh;overflow-y: scroll;padding: 0 5PX;">
  41. <van-cell-group :title="'进度'+(index+1)" v-for="(item,index) in historyList">
  42. <van-cell title="活动名称" v-model="item.activityName" :border="false" />
  43. <van-cell title="办理人ID" v-model="item.assignee" :border="false" />
  44. <van-cell title="办理人" v-model="item.assigneeName" :border="false" />
  45. <van-cell title="审批意见" v-model="item.comment" :border="false" />
  46. <van-cell title="开始时间" v-model="item.startTime" :border="false" />
  47. <van-cell title="结束时间" v-model="item.endTime" :border="false" />
  48. <van-cell title="耗时" v-model="item.durationInMillis" :border="false" />
  49. </van-cell-group>
  50. </div>
  51. </van-dialog>
  52. </div>
  53. </template>
  54. <script>
  55. import { getMember , supplyList , deleteSupply} from "@/api/user/index";
  56. import { logout ,getInfo } from "@/api/login/index";
  57. import Cookies from "js-cookie";
  58. import request from "@/utils/request";
  59. export default {
  60. name: "user",
  61. data() {
  62. return {
  63. phone:'',
  64. user:'',
  65. activitiStatus:'',
  66. instanceId:'',
  67. historyList:[],
  68. openView:false,
  69. memberType:0
  70. };
  71. },
  72. created() {
  73. this.getInfo();
  74. },
  75. methods: {
  76. getHistoryList: function () {
  77. this.loading = true;
  78. var queryParams = {
  79. processInstanceId: this.instanceId
  80. };
  81. return request({
  82. url: "/activiti/process/listHistory",
  83. method: "post",
  84. data: queryParams,
  85. })
  86. .then((response) => {
  87. this.historyList = response.rows;
  88. this.historyList.forEach((row) => {
  89. row.startTime = this.format(row.startTime, "yyyy-MM-dd HH:mm:ss");
  90. row.endTime = this.format(row.endTime, "yyyy-MM-dd HH:mm:ss");
  91. row.durationInMillis = this.formatTotalDateSub(
  92. row.durationInMillis / 1000
  93. );
  94. });
  95. this.total = response.total;
  96. this.loading = false;
  97. })
  98. .then(() => {});
  99. },
  100. loginOut(){
  101. logout().then(response => {
  102. var keys = document.cookie.match(/[^ =;]+(?=\=)/g);
  103. if(keys) {
  104. for(var i = keys.length; i--;)
  105. document.cookie = keys[i] + '=0;expires=' + new Date(0).toUTCString()
  106. }
  107. this.$router.push({name:'indexCJ'})
  108. });
  109. },
  110. getInfo(){
  111. getInfo().then(response => {
  112. console.log(response)
  113. this.user = response.user;
  114. getMember(response.user.userId).then(response => {
  115. console.log(response)
  116. Cookies.set('memberId',response.data.id)
  117. this.phone = response.data.phone;
  118. this.activitiStatus = response.data.activitiStatus;
  119. this.instanceId = response.data.instanceId;
  120. this.memberType = response.data.memberType;
  121. if(this.instanceId !== "" && this.instanceId != null){
  122. this.getHistoryList()
  123. }
  124. });
  125. });
  126. },
  127. format(time, format) {
  128. var t = new Date(time);
  129. var tf = function (i) { return (i < 10 ? '0' : '') + i };
  130. return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (a) {
  131. switch (a) {
  132. case 'yyyy':
  133. return tf(t.getFullYear());
  134. break;
  135. case 'MM':
  136. return tf(t.getMonth() + 1);
  137. break;
  138. case 'mm':
  139. return tf(t.getMinutes());
  140. break;
  141. case 'dd':
  142. return tf(t.getDate());
  143. break;
  144. case 'HH':
  145. return tf(t.getHours());
  146. break;
  147. case 'ss':
  148. return tf(t.getSeconds());
  149. break;
  150. }
  151. })
  152. },
  153. /**
  154. * 计算出相差天数
  155. * @param secondSub
  156. */
  157. formatTotalDateSub (secondSub) {
  158. var days = Math.floor(secondSub / (24 * 3600)); // 计算出小时数
  159. var leave1 = secondSub % (24*3600) ; // 计算天数后剩余的毫秒数
  160. var hours = Math.floor(leave1 / 3600); // 计算相差分钟数
  161. var leave2 = leave1 % (3600); // 计算小时数后剩余的毫秒数
  162. var minutes = Math.floor(leave2 / 60); // 计算相差秒数
  163. var leave3 = leave2 % 60; // 计算分钟数后剩余的毫秒数
  164. var seconds = Math.round(leave3);
  165. return days + "天" + hours + "时" + minutes + "分" + seconds + '秒';
  166. },
  167. openBig(){
  168. this.$parent.isCq = true;
  169. Cookies.set('isCq',true)
  170. },
  171. openSmall(){
  172. this.$parent.isCq = false;
  173. Cookies.remove('isCq')
  174. }
  175. },
  176. };
  177. </script>
  178. <style scoped lang="scss">
  179. .app-container {
  180. }
  181. .font_size{
  182. color: #fff;
  183. font-size: .4rem;
  184. position: absolute;
  185. top: 1vh;
  186. right: 2%;
  187. display: flex;
  188. align-items: center;
  189. span{
  190. display: block;
  191. }
  192. span:nth-child(n+2){
  193. font-size: .3rem;
  194. border: 1px solid #ffffff;
  195. padding: 5px 15px;
  196. margin-right: 10PX;
  197. }
  198. }
  199. .activitiStatus{
  200. color: #FEE1AA;
  201. border: 1px solid #FEE1AA;
  202. display: inline-block;
  203. padding: 2px 10px;
  204. border-radius: 5px;
  205. margin-left: 10px;
  206. cursor: pointer;
  207. font-size: 14Px;
  208. }
  209. .header{
  210. background-color: #007E72;
  211. padding: 1rem 0rem 1.5rem;
  212. width: 100%;
  213. p{
  214. color: #FFF;
  215. font-size: 0.4rem;
  216. margin-top: 0.2rem;
  217. }
  218. p:nth-child(2){
  219. width: 40%;
  220. text-align: center;
  221. padding: 10px;
  222. border-radius: 0.5rem;
  223. margin-top: 0.4rem;
  224. font-size: 12PX;
  225. background: #FEE1AA url("../../assets/images/seting.png") no-repeat left center;
  226. background-size: 0.5rem;
  227. color: #007E72;
  228. padding-left: 7%;
  229. background-position-x: 6%;
  230. line-height: 1;
  231. }
  232. }
  233. .van-icon{
  234. color: #007E72;
  235. }
  236. .loginOut{
  237. width: 94%;
  238. margin-left: 3%;
  239. }
  240. </style>