rescueOrder.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <view class="box">
  3. <homenav :iStatusBarHeight="iStatusBarHeight" :title="'救援订单'" :cj="4"></homenav>
  4. <view class="tab">
  5. <view class="tabLine" :class="{tabActive:tabIndex==-1}" @click="tabClick(-1)">全部</view>
  6. <view class="tabLine" :class="{tabActive:tabIndex==0}" @click="tabClick(0)">待确认</view>
  7. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">已接单</view>
  8. <view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">已出发</view>
  9. <view class="tabLine" :class="{tabActive:tabIndex==3}" @click="tabClick(3)">已完成</view>
  10. </view>
  11. <view class="main">
  12. <view class="itemBg" v-for="(item,index) in items" @click="goDetail(item)">
  13. <view class="itemTop">
  14. <view class="itemType">救援订单</view>
  15. <view class="itemSheetState redColor" v-if="item.SheetState==0">待确认</view>
  16. <view class="itemSheetState redColor" v-if="item.SheetState==1">已接单</view>
  17. <view class="itemSheetState orangeColor" v-if="item.SheetState==2">已出发</view>
  18. <view class="itemSheetState greenColor" v-if="item.SheetState==3">已完成</view>
  19. <view class="itemSheetState" v-if="item.SheetState==4">已取消</view>
  20. <view class="itemSheetState greenColor" v-if="item.SheetState==5">已评价</view>
  21. </view>
  22. <view class="itemShopBg">
  23. <view class="shopName">
  24. <span v-if="item.HelpType==1">搭电</span>
  25. <span v-if="item.HelpType==2">拖车</span>
  26. <span v-if="item.HelpType==3">换胎</span>
  27. <span v-if="item.HelpType==4">未知原因</span>
  28. -
  29. <span v-if="item.Hscene==1">地面</span>
  30. <span v-if="item.Hscene==2">车库</span>
  31. <span v-if="item.Hscene==3">其他</span>
  32. </view>
  33. <!-- <view style="color: #333333;font-size: 22rpx;">¥<span class="price">{{item.PayType==1?item.RealMoney:0}}</span></view> -->
  34. </view>
  35. <!-- <view class="renBox" v-if="item.SheetType==6">
  36. <image src="../../../static/timg/icon_ren.png" mode="" class="renimg"></image>
  37. <view class="renMobilePhone">{{item.MobilePhone}}</view>
  38. <view class="renNickName">{{item.NickName?item.NickName:''}}</view>
  39. </view> -->
  40. <view class="itemName" v-if="item.orderType==1">立刻</view>
  41. <view class="itemName" v-else>{{item.HTime}}</view>
  42. <view class="itemName" style="padding-top: 2rpx;padding-bottom: 0;">{{item.ShopName}}</view>
  43. </view>
  44. <nodata v-show="items==''&&isload"></nodata>
  45. </view>
  46. <!-- 手机号授权 -->
  47. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  48. <view class="authorizCont" @click.stop="">
  49. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  50. <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
  51. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  52. </view>
  53. <view style="text-align: center;padding-top: 56rpx;">
  54. <image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import nodata from '@/components/nodata/nodata.vue'
  61. import homenav from "@/components/homenav/nav.vue"
  62. export default {
  63. components: {
  64. nodata,homenav
  65. },
  66. data() {
  67. return {
  68. page: 1,
  69. tabIndex: -1,
  70. items: [],
  71. isload: false,
  72. iStatusBarHeight:'',
  73. userInfo:'',
  74. ext:'',
  75. wxOpenData:'',
  76. themeColor:'',
  77. authorizShow:false,
  78. code:'',
  79. }
  80. },
  81. onLoad(opt) {
  82. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  83. this.tabIndex = opt.num;
  84. this.userInfo=this.$store.state.userInfo;
  85. this.ext=this.$common.getExtStoreId();
  86. this.themeColor = uni.getStorageSync("themeColor");
  87. if(this.userInfo){
  88. this.getData()
  89. }else{
  90. this.$common.automaticlogin().then(val => {
  91. this.userInfo=this.$store.state.userInfo;
  92. this.wxOpenData=this.$store.state.wxOpenData;
  93. this.themeColor = uni.getStorageSync("themeColor");
  94. this.getData();
  95. if(!this.userInfo){
  96. this.authorizShow=true
  97. }
  98. })
  99. }
  100. //this.getData()
  101. },
  102. onShow() {
  103. console.log(this.tabIndex)
  104. this.getData()
  105. },
  106. methods: {
  107. decryptPhoneNumber: function(e) {
  108. console.log(e);
  109. this.code=e.detail.code
  110. this.wxPhoneLogin()
  111. this.authorizShow=false;
  112. },
  113. wxPhoneLogin(){
  114. var that=this;
  115. this.$http('miniApp2/sys/wxPhoneLogin', {
  116. appId:this.ext.appId,
  117. unionId:this.ext.unionId,
  118. code:this.code,
  119. openId:this.wxOpenData.openid
  120. },'POST').then(res => {
  121. var data = res.data;
  122. if(data.loginInfo){
  123. this.userInfo=data.loginInfo.openUser;
  124. this.wxOpenData=data.loginInfo;
  125. this.$store.commit('mutationswxOpenData', data)
  126. this.$store.commit('mutationsuserInfo', this.userInfo)
  127. this.getData()
  128. }
  129. })
  130. },
  131. tabClick(num) {
  132. this.tabIndex = num;
  133. this.page = 1;
  134. this.getData()
  135. },
  136. goDetail(item) {
  137. //SheetType 1 商品2项目3套餐4救援5钣喷6集客
  138. uni.navigateTo({
  139. url: "rescueOrderOrderDetail?id=" + item.ID
  140. })
  141. },
  142. getData() {
  143. uni.showLoading({
  144. title: '加载中'
  145. });
  146. this.isload = false;
  147. var padata = {
  148. page: this.page,
  149. limit: 10,
  150. sheetState: this.tabIndex > -1 ? this.tabIndex : ''
  151. }
  152. this.$http('/openShopHelpSheetOrder/getOpenShopHelpSheetOrderList', padata, 'GET').then(res => {
  153. uni.hideLoading();
  154. this.isload = true;
  155. var list = res.data.Items;
  156. if (this.page == 1) {
  157. this.items = list
  158. } else {
  159. this.items = this.items.concat(list)
  160. }
  161. })
  162. },
  163. },
  164. onReachBottom() {
  165. this.page++;
  166. this.getData()
  167. },
  168. onPullDownRefresh() {
  169. this.page = 1;
  170. this.getData()
  171. setTimeout(function() {
  172. uni.stopPullDownRefresh();
  173. }, 1000);
  174. }
  175. }
  176. </script>
  177. <style scoped>
  178. .box {
  179. min-height: 100vh;
  180. background: #F4F5F7;
  181. }
  182. .renBox{
  183. color: #1A1A1A;
  184. background: #F7F7F7;
  185. border-radius: 10rpx;
  186. display: flex;
  187. padding: 20rpx;font-size: 24rpx;
  188. line-height: 30rpx;
  189. margin-top: 16rpx;
  190. }
  191. .renimg{
  192. width: 30rpx;height: 30rpx;
  193. }
  194. .renMobilePhone{
  195. padding-left: 13rpx;
  196. }
  197. .renNickName{
  198. padding-left: 20rpx;
  199. }
  200. .tab {
  201. background: #FFFFFF;
  202. display: flex;
  203. justify-content: space-between;
  204. line-height: 92rpx;
  205. position: fixed;
  206. width: calc(100vw - 100rpx);
  207. padding-left: 50rpx;
  208. padding-right: 50rpx;
  209. height: 92rpx;
  210. z-index: 11;
  211. }
  212. .tabLine {
  213. font-size: 28rpx;
  214. color: #333333;
  215. text-align: center;
  216. }
  217. .tabActive {
  218. color: #FF0000;
  219. font-weight: bold;
  220. border-bottom: 4rpx solid #FF0000;
  221. }
  222. .main {
  223. padding-top: 92rpx;
  224. padding-bottom: 20rpx;
  225. background-color: #F4F5F7;
  226. }
  227. .itemBg {
  228. margin: 20rpx 24rpx;
  229. background-color: #FFFFFF;
  230. border-radius: 10rpx;
  231. padding: 20rpx;
  232. }
  233. .itemTop {
  234. display: flex;
  235. justify-content: space-between;
  236. }
  237. .itemType {
  238. color: #999999;
  239. font-size: 24rpx;
  240. }
  241. .itemSheetState {
  242. font-size: 24rpx;
  243. color: #999999
  244. }
  245. .redColor {
  246. color: #FF0000;
  247. }
  248. .orangeColor {
  249. color: #F19D01;
  250. }
  251. .greenColor {
  252. color: #00A040;
  253. }
  254. .itemShopBg {
  255. display: flex;
  256. justify-content: space-between;
  257. margin-top: 20rpx;
  258. }
  259. .shopName {
  260. color: #333333;
  261. font-size: 30rpx;
  262. font-weight: bold;
  263. /* 隐藏文字显示 ...不换行 */
  264. overflow: hidden;
  265. text-overflow: ellipsis;
  266. white-space: nowrap;
  267. }
  268. .price {
  269. color: #333333;
  270. font-weight: bold;
  271. font-size: 32rpx;
  272. }
  273. .itemName {
  274. color: #666666;
  275. font-size: 24rpx;
  276. padding: 16rpx 0;
  277. height: 30rpx;
  278. overflow: hidden;
  279. text-overflow: ellipsis;
  280. white-space: nowrap;
  281. }
  282. .plateBg {
  283. display: flex;
  284. justify-content: space-between;
  285. align-items: center;
  286. }
  287. .plateNumber {
  288. color: #666666;
  289. font-size: 24rpx;
  290. margin-bottom: 20rpx;
  291. display: flex;
  292. }
  293. .itemLineBottom {
  294. display: flex;
  295. justify-content: flex-end;
  296. }
  297. .itemBtn1 {
  298. width: 150rpx;
  299. height: 56rpx;
  300. border-radius: 36rpx;
  301. border: 2rpx solid #DDDDDD;
  302. text-align: center;
  303. line-height: 56rpx;
  304. font-size: 28rpx;
  305. color: #3C3C3C;
  306. margin-left: 40rpx;
  307. }
  308. .itemBtn2 {
  309. width: 150rpx;
  310. height: 56rpx;
  311. border-radius: 36rpx;
  312. border: 2rpx solid #FF4F00;
  313. text-align: center;
  314. line-height: 56rpx;
  315. font-size: 28rpx;
  316. color: #FF4F00;
  317. margin-left: 40rpx;
  318. }
  319. .orderState {
  320. color: #F19D01;
  321. font-size: 24rpx;
  322. padding-left: 20rpx;
  323. }
  324. .authorizBox{
  325. width: 100vw;
  326. height: 100vh;
  327. background: rgba(0, 0, 0, 0.5);
  328. position: fixed;
  329. top: 0;
  330. left: 0;
  331. }
  332. .authorizCont{
  333. margin-top: 30vh;
  334. width: 564rpx;
  335. height: 408rpx;
  336. background: #FFFFFF;
  337. border-radius: 24rpx;
  338. margin-left: 93rpx;
  339. position: relative;
  340. }
  341. .authorizCloseImg{
  342. width: 62rpx;
  343. height: 62rpx;
  344. }
  345. .sqLogoBox{
  346. width: 180rpx;
  347. height: 180rpx;
  348. background: #FFFFFF;
  349. border-radius: 90rpx;
  350. text-align: center;
  351. position: absolute;
  352. top: -50rpx;
  353. left: 192rpx;
  354. }
  355. .authorizName{
  356. color: #333333;
  357. line-height: 42rpx;
  358. font-size: 30rpx;
  359. text-align: center;
  360. padding-top: 58rpx;
  361. }
  362. .authorizMs{
  363. color: #999999;
  364. line-height: 36rpx;
  365. font-size: 26rpx;
  366. width: 452rpx;
  367. padding-top: 24rpx;
  368. text-align: center;
  369. margin-left: 56rpx;
  370. }
  371. .authorizContbutton{
  372. width: 422rpx;
  373. height: 88rpx;
  374. background: #D53533;
  375. border-radius: 44rpx;
  376. line-height: 88rpx;
  377. text-align: center;
  378. font-size:30rpx;
  379. color: #FFFFFF;
  380. margin-top: 62rpx;
  381. margin-left:71rpx;
  382. }
  383. .shopBoxpt{
  384. margin-top: 20rpx;
  385. }
  386. button::after{
  387. border: none;
  388. }
  389. button{
  390. position: relative;
  391. display: block;
  392. margin-left: 0;
  393. margin-right: 0;
  394. padding-left: 0px;
  395. padding-right: 0px;
  396. box-sizing: border-box;
  397. // font-size: 18px;
  398. text-align: center;
  399. text-decoration: none;
  400. // line-height: 1;
  401. line-height: 1.35;
  402. // border-radius: 5px;
  403. -webkit-tap-highlight-color: transparent;
  404. overflow: hidden;
  405. color: #000000;
  406. background-color: #fff;
  407. height: 100%;
  408. }
  409. </style>