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