index.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <view>
  3. <view>
  4. <!-- 头部 -->
  5. <view class="head">
  6. <!-- 定位 -->
  7. <view class="location">
  8. 南昌校区(新校区)<image class="loc" src="../../static/定位.svg" mode=""></image>
  9. </view>
  10. <!-- 公告 -->
  11. <view class="notice">
  12. <view class="notice-content" style="margin-top: 8px;">
  13. <text class="notice-first">公告<image src="../../static/喇叭.svg" mode=""></image>:</text>
  14. <view class="notice-second" selectable space="nbsp" >{{notices}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <!-- 跳转导航 -->
  19. <view class="nav">
  20. <navigator url="../list/list" hover-class="navigator-hover">
  21. <image src="../../static/报修.svg" mode=""></image>
  22. <view>前往报修</view>
  23. </navigator>
  24. </view>
  25. <!-- 报修订单 -->
  26. <view class="content">
  27. <!-- 导航与报修单间的灰色背景 -->
  28. <view class="point"></view>
  29. <view class="list-text">
  30. ----报修订单----
  31. </view>
  32. <!-- 订单 -->
  33. <view class="content-list" v-for="(item,index) in Studentlist" :key="index">
  34. <text class="num">订单号:{{item.orderId}}</text>
  35. <text class="newList">{{item.orderStatus==0?show:''}} </text> <!-- 新订单 -->
  36. <text class="waitList">{{item.orderStatus==1?show2:''}} </text> <!-- 待接单 -->
  37. <text class="readyList">{{item.orderStatus==2?show3:''}} </text> <!-- 已接单 -->
  38. <text class="finishList">{{item.orderStatus==3?show4:''}} </text> <!-- 维修完成 -->
  39. <text class="refuseList">{{item.orderStatus==4?show5:''}} </text> <!-- 已退单 -->
  40. <view class="list">
  41. <view class="">
  42. 故障类型:{{item.repairsFault.faultName}}
  43. </view>
  44. <view class="">
  45. 维修时间:{{item.orderExpectedTime}}
  46. </view>
  47. <view class="">
  48. 维修人员:高××
  49. </view>
  50. </view>
  51. <button @click="appraise();getorderId(item);getorderBack(item.orderBack)" v-if="item.orderStatus == 3 && item.orderBack == null" style="width: 76px; height: 18px; background-color:rgba(42, 130, 228, 1); color: white;font-size: 12px; border-radius: 16px;">修后评价</button>
  52. <view class="sug">{{(item.orderStatus == 3 && item.orderBack == 1 && dialogS == false)?show6:''}}</view>
  53. </view>
  54. <view class="isOver" v-if="flag" >
  55. ----我是有底线的----
  56. </view>
  57. </view>
  58. </view>
  59. <!-- 修改评价遮罩层 -->
  60. <view class="box" v-if="dialogShow">
  61. <view id="dialog">
  62. <view class="replace">
  63. 修改评价
  64. </view>
  65. <view class="uni-textarea">
  66. <textarea @input="onInput" v-model="inputcontent" placeholder-style="color:rgba(229, 229, 229, 0.7)" cols="20" row="2" placeholder="请输入内容"/>
  67. </view>
  68. <view class="cancle" @click="cancle()">
  69. 取消
  70. </view>
  71. <view class="agree" @click="agree()">
  72. 确定
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. data() {
  81. return {
  82. pageNum:1,
  83. dialogShow:false,
  84. dialogS:true,
  85. flag:false,
  86. notices:[],
  87. Studentlist:[],
  88. show:'新订单',
  89. show2:'待接单',
  90. show3:'已接单',
  91. show4:'维修完成',
  92. show5:'已退单',
  93. show6:'已评价',
  94. value:[],
  95. inputcontent:'',
  96. orderId:null,
  97. studentItem:null,
  98. homeUrl:"https://jtishfw.ncjti.edu.cn/baoxiu/repairApi"
  99. }
  100. },
  101. onLoad() {
  102. this.getNotice()
  103. this.getStudentlist()
  104. },
  105. watch:{
  106. dialogshow(a,b){
  107. this.getsuggest()
  108. console.log("====")
  109. }},
  110. methods:{
  111. // 下拉刷新
  112. onPullDownRefresh() {
  113. console.log('refresh');
  114. setTimeout(()=>{
  115. uni.stopPullDownRefresh();
  116. }, 1000);
  117. },
  118. // 上拉加载+结尾语句显示
  119. onReachBottom(){
  120. console.log(this.Studentlist.length)
  121. console.log(this.pageNum*5)
  122. if(this.Studentlist.length<this.pageNum*5)
  123. return this.flag = true
  124. this.pageNum++
  125. this.getStudentlist()
  126. },
  127. // 修改btn按钮
  128. appraise(f){
  129. this.dialogShow = true
  130. },
  131. // 弹窗
  132. agree(){
  133. if(this.inputcontent == ''){
  134. uni.showToast({
  135. title:'请输入内容',
  136. icon:'none',
  137. duration:2000,
  138. })
  139. return this.dialogShow
  140. }else{
  141. this.dialogShow = false
  142. this.dialogS = false
  143. console.log(this.inputcontent)
  144. console.log('======agree====')
  145. this.getsuggest()
  146. this.inputcontent = ''
  147. }
  148. },
  149. cancle(){
  150. this.dialogShow = false
  151. uni.showToast({
  152. title: '你已取消填写',
  153. icon:'none',
  154. duration: 2000
  155. })
  156. },
  157. // 订单状态显示
  158. isEmpty(value){
  159. if (this.value == 1) {
  160. return true;
  161. } else {
  162. return false;
  163. }
  164. },
  165. // 获取学生订单
  166. async getStudentlist(){
  167. this.$https.post(`${this.homeUrl}/order/queryAllOrderByStudentId?pageNum=${1}`)
  168. .then(result=>{
  169. console.log(result.data)
  170. console.log(result.data.list)
  171. this.Studentlist = [this.Studentlist,result.data.list]
  172. },err=>{})
  173. },
  174. // 获取公告
  175. async getNotice(){
  176. const res = await uni.request({
  177. method:'POST',
  178. url:`${this.homeUrl}/notice/releaseNotice`,
  179. success: (res) => {
  180. this.notices = res.data.data.noticeContent
  181. }
  182. })
  183. },
  184. // 获取订单号
  185. getorderId(item){
  186. this.orderId = item.orderId
  187. this.studentItem = item
  188. },
  189. getorderBack(orderBack){
  190. this.orderBack = orderBack
  191. },
  192. // 获取评价内容
  193. onInput(e){
  194. this.inputcontent = e.target.value
  195. console.log(e.target.value)
  196. console.log(this.inputcontent)
  197. },
  198. // 修后评价
  199. async getsuggest(item){
  200. if(this.dialogShow == false){
  201. const res = await uni.request({
  202. method:'POST',
  203. url:`${this.homeUrl}/order/updateOrderAdvice?orderAdvice=${this.inputcontent}&orderId=${this.orderId}`,
  204. success: (res) => {
  205. console.log(this.inputcontent)
  206. this.studentItem.orderBack = 1
  207. console.log(this.orderBack)
  208. }
  209. })
  210. }else{
  211. console.log('失败')
  212. }
  213. }
  214. }
  215. }
  216. </script>
  217. <style>
  218. #dialog{
  219. position: absolute;
  220. top: 0;
  221. right: 0;
  222. bottom: 0;
  223. left: 0;
  224. width: 80%;
  225. height: 25%;
  226. text-align: center;
  227. margin: auto;
  228. background-color: white;
  229. border-radius: 8px;
  230. }
  231. textarea{
  232. height: 100px;
  233. width: 90%;
  234. margin-top: 5px;
  235. margin-left: 5%;
  236. text-align: left;
  237. border: 1px solid rgba(210, 190, 239, 0.65);
  238. font-size: 14px;
  239. }
  240. .box{
  241. position: fixed;
  242. top: 0;
  243. left: 0;
  244. width: 100%;
  245. height: 100%;
  246. background: rgba(0,0,0,0.3);
  247. }
  248. .replace{
  249. margin-top: 4%;
  250. font-size: 14px;
  251. color: rgba(80, 80, 80, 1);
  252. }
  253. .cancle{
  254. position: absolute;
  255. top: 78%;
  256. width: 50%;
  257. height: 22%;
  258. line-height: 2;
  259. background-color: white;
  260. border: 1px solid rgba(229, 229, 229, 0.62);
  261. border-radius: 0 0 0 8px;
  262. }
  263. .agree{
  264. position: absolute;
  265. top: 78%;
  266. width: 50%;
  267. height: 22%;
  268. right:0;
  269. line-height: 2;
  270. background-color: white;
  271. border-radius: 0 0 8px 0;
  272. border: 1px solid rgba(229, 229, 229, 0.62);
  273. }
  274. .head{
  275. position: relative;
  276. height: 175px;
  277. background-color: rgba(42, 130, 228, 1);
  278. border-radius: 0px 0px 10px 10px;
  279. }
  280. .location{
  281. position: absolute;
  282. top: 19px;
  283. left: 114px;
  284. font-size: 12px;
  285. text-align: center;
  286. color:rgba(255, 255, 255, 1) ;
  287. }
  288. .loc{
  289. width: 20px;
  290. height: 20px;
  291. font-size: 12px;
  292. vertical-align: bottom;
  293. }
  294. .notice{
  295. position: absolute;
  296. top: 54px;
  297. left: 9px;
  298. width: 353px;
  299. height: 55px;
  300. font-size: 12px;
  301. background-color: rgba(255, 255, 255, 0.21);
  302. border-radius: 11px 10px 10px 10px;
  303. }
  304. .notice-first {
  305. margin-left: 10px;
  306. color: rgba(255, 255, 255, 1);
  307. }
  308. .notice-first image{
  309. height: 14px;
  310. width: 14px;
  311. font-size: 14px;
  312. vertical-align: bottom;
  313. }
  314. .notice-second {
  315. float: right;
  316. margin-right: 24px;
  317. color: rgba(255, 255, 255, 1);
  318. width: 76%;
  319. height: 35px;
  320. }
  321. .nav{
  322. position: absolute;
  323. top:141px;
  324. width: 359px;
  325. height: 118px;
  326. margin-left: 5px;
  327. background-color: rgba(255, 255, 255, 1);
  328. border-radius: 14px 14px 0px 0px;
  329. }
  330. .nav image{
  331. position: absolute;
  332. left: 164px;
  333. width: 24px;
  334. height: 24px;
  335. font-size: 24px;
  336. }
  337. .nav view{
  338. position: absolute;
  339. left: 154px;
  340. top:68px;
  341. font-size: 12px;
  342. }
  343. .nav navigator{
  344. width: 54px;
  345. height: 60px;
  346. margin-top: 32px;
  347. margin-left: 152px;
  348. }
  349. .nav navigator:hover{
  350. border-radius: 5px;
  351. box-shadow: 1px 1px 2px 2px rgba(0,0,0,0.1);
  352. }
  353. .content{
  354. margin-top: 85px;
  355. height: 600px;
  356. background-color: rgba(255, 255, 255, 1);
  357. }
  358. .point{
  359. height: 7px;
  360. background-color: rgba(229, 229, 229, 0.62);
  361. }
  362. .list-text{
  363. margin-top: 15px;
  364. font-size: 12px;
  365. text-align: center;
  366. color: rgba(80, 80, 80, 0.27);
  367. }
  368. .content-list{
  369. position: relative;
  370. height: 125px;
  371. margin-top: 11px;
  372. font-size: 12px;
  373. border-radius: 14px 14px 0px 0px;
  374. background-color: rgba(229, 229, 229, 0.62);
  375. }
  376. .num{
  377. float: left;
  378. margin-left: 7px;
  379. margin-top: 9px;
  380. font-size: 14px;
  381. font-weight: 700;
  382. color: rgba(42, 130, 228, 1);
  383. }
  384. .newList{
  385. float: right;
  386. margin-top: 10px;
  387. margin-right: 16px;
  388. color: rgba(255, 141, 26, 1);
  389. }
  390. .readyList{
  391. float: right;
  392. margin-top: 10px;
  393. margin-right: 2px;
  394. color: rgba(212, 48, 48, 1);
  395. }
  396. .waitList{
  397. float: right;
  398. margin-top: 10px;
  399. margin-right: 2px;
  400. color: rgba(212, 48, 48, 1);
  401. }
  402. .finishList{
  403. float: right;
  404. margin-top: 10px;
  405. margin-right: 2px;
  406. color: rgba(212, 48, 48, 1);
  407. }
  408. .refuseList{
  409. float: right;
  410. margin-top: 10px;
  411. margin-right: 2px;
  412. color: rgba(212, 48, 48, 1);
  413. }
  414. .list{
  415. float: left;
  416. margin-left: -164px;
  417. margin-top: 36px;
  418. font-size: 14px;
  419. }
  420. .content-list button{
  421. position: absolute;
  422. bottom:10px;
  423. right: 21px;
  424. line-height:18px ;
  425. }
  426. .content-list .sug{
  427. position: absolute;
  428. bottom:15px;
  429. right: 21px;
  430. color: #333333;
  431. }
  432. .isOver{
  433. width: 100%;
  434. height: 50px;
  435. line-height: 50px;
  436. text-align: center;
  437. font-size: 12px;
  438. color: rgba(80, 80, 80, 0.27);
  439. }
  440. </style>