myOrder.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. <template>
  2. <view class="box">
  3. <homenav :iStatusBarHeight="iStatusBarHeight" :title="'我的订单'" :cj="3"></homenav>
  4. <view class="tab">
  5. <view class="tabLine" :class="{tabActive:tabIndex==0}" @click="tabClick(0)">全部</view>
  6. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">待付款</view>
  7. <view class="tabLine" :class="{tabActive:tabIndex==5}" @click="tabClick(5)">待成团</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 class="tabLine" :class="{tabActive:tabIndex==6}" @click="tabClick(6)">售后</view>
  11. </view>
  12. <view class="main">
  13. <view class="itemBg" v-for="(item,index) in items" @click="goDetail(item)">
  14. <view class="itemTop">
  15. <view class="orderCodeBox">
  16. <view class="itemType" v-if="item.SheetType==1">商城-商品订单</view>
  17. <view class="itemType" v-if="item.SheetType==2">商城-项目订单</view>
  18. <view class="itemType" v-if="item.SheetType==3">商城-套餐订单</view>
  19. <view class="itemType" v-if="item.SheetType==4">救援订单</view>
  20. <view class="itemType" v-if="item.SheetType==5">钣喷订单</view>
  21. <view class="itemType" v-if="item.SheetType==6">集客订单</view>
  22. <view class="itemType" v-if="item.SheetType==7">保养订单</view>
  23. <view class="itemType" v-else></view>
  24. <view class="orderCode">:{{item.Code}}</view>
  25. </view>
  26. <view class="itemSheetState redColor" v-if="item.SheetState==5">待成团</view>
  27. <view class="itemSheetState redColor" v-if="item.SheetState==1">待付款</view>
  28. <!-- <view v-if="item.SheetType==7">
  29. <view class="itemSheetState orangeColor" v-if="item.SheetState==2">已完成</view>
  30. </view> -->
  31. <view class="itemSheetState orangeColor" v-if="item.SheetState==2">待服务</view>
  32. <view class="itemSheetState greenColor" v-if="item.SheetState==3">已完成</view>
  33. <view class="itemSheetState" v-if="item.SheetState==4">已取消</view>
  34. </view>
  35. <view class="itemShopBg">
  36. <view class="shopName">{{item.SheetContent}}</view>
  37. <view style="color: #333333;font-size: 22rpx;">¥<span class="price">{{item.PayType==1?item.RealMoney:0}}</span></view>
  38. </view>
  39. <view class="renBox" v-if="item.SheetType==6">
  40. <image src="../../../static/timg/icon_ren.png" mode="" class="renimg"></image>
  41. <view class="renMobilePhone">{{item.MobilePhone}}</view>
  42. <view class="renNickName">{{item.NickName?item.NickName:''}}</view>
  43. </view>
  44. <view class="itemName">{{item.CreateTime}}</view>
  45. <view class="itemName" style="padding-top: 2rpx;padding-bottom: 0;">{{item.ShopName}}</view>
  46. <view class="package" v-if="item.SheetType==7" style="display: flex;">
  47. <view class="packageName" v-if="item.packageName">{{item.packageName}}</view>
  48. <view class="packageQty" v-if="item.packageQty" style="padding-left: 10rpx;">共{{item.packageQty}}件</view>
  49. </view>
  50. <view class="bottom" v-if="item.SheetState == 1">
  51. <view class="cancel" @click.stop="cancelBespeak(item)">取消订单</view>
  52. <view class="defer" @click.stop="pay(item)">立即支付</view>
  53. </view>
  54. </view>
  55. <view v-if="tabIndex==6" class="afterSales">
  56. <view class="afterSalesLine">
  57. <view class="afterSalesLineTop">
  58. <view class="" style="display: flex;">
  59. <view class="afterSalesShop">欧洲维修(云岭西路店)</view>
  60. <image class="afterSalesLineJt" src="/static/img2/jt1.png" mode=""></image>
  61. </view>
  62. <view class="afterSalesLineState">退款</view>
  63. </view>
  64. <view class="afterSalesLineCont">
  65. <image src="../../../static/timg/noimg.png" class="afterSalesLineImg" mode=""></image>
  66. <view class="shCont">
  67. <view class="shCOntName">最新普通洗车|全车型|20分钟</view>
  68. <view class="shContMS">共 1 件商品</view>
  69. <view class="shContMS">退款:¥18</view>
  70. </view>
  71. </view>
  72. <view class="tkStateBox">
  73. <span style="font-weight: 500;color: #222222;">退款成功</span>
  74. <span style="padding-left: 24rpx;">请查看详情</span>
  75. </view>
  76. <view class="tkBottom">
  77. <view class="tkBottomBtn">查看详情</view>
  78. </view>
  79. </view>
  80. </view>
  81. <nodata v-show="items==''&&isload"></nodata>
  82. </view>
  83. <!-- 手机号授权 -->
  84. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  85. <view class="authorizCont" @click.stop="">
  86. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  87. <view class="authorizMs">未注册的手机号登录后将自动创建会员账号,如果您不同意授权获取手机号,会影响您使用我们的产品和服务。</view>
  88. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  89. </view>
  90. <view style="text-align: center;padding-top: 56rpx;">
  91. <image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <script>
  97. import nodata from '@/components/nodata/nodata.vue'
  98. import homenav from "@/components/homenav/nav.vue"
  99. export default {
  100. components: {
  101. nodata,homenav
  102. },
  103. data() {
  104. return {
  105. page: 1,
  106. tabIndex: '',
  107. items: [],
  108. isload: false,
  109. iStatusBarHeight:'',
  110. userInfo:'',
  111. ext:'',
  112. wxOpenData:'',
  113. themeColor:'',
  114. authorizShow:false,
  115. code:'',
  116. }
  117. },
  118. onLoad(opt) {
  119. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  120. this.tabIndex = opt.num;
  121. this.userInfo=this.$store.state.userInfo;
  122. this.ext=this.$common.getExtStoreId();
  123. this.themeColor = uni.getStorageSync("themeColor");
  124. if(this.userInfo){
  125. this.getData()
  126. }else{
  127. this.$common.automaticlogin().then(val => {
  128. this.userInfo=this.$store.state.userInfo;
  129. this.wxOpenData=this.$store.state.wxOpenData;
  130. this.themeColor = uni.getStorageSync("themeColor");
  131. this.getData();
  132. if(!this.userInfo){
  133. this.authorizShow=true
  134. }
  135. })
  136. }
  137. },
  138. onShow() {
  139. console.log(this.tabIndex)
  140. this.getData()
  141. },
  142. methods: {
  143. pay(item){
  144. this.$http('openMallOrder/unifiedPay', {
  145. sheetId:item.ID
  146. },'POST').then(res => {
  147. if(res.code==0){
  148. this.requestPayment(res.data)
  149. }else{
  150. uni.showToast({
  151. title: res.msg,
  152. icon: 'none',
  153. duration: 3000
  154. });
  155. }
  156. })
  157. },
  158. requestPayment(res){
  159. var payInfo=res;
  160. //console.log(payInfo)
  161. //console.log(String(Date.now()))
  162. var that=this;
  163. uni.requestPayment({
  164. provider: 'wxpay',
  165. //timeStamp: String(Date.now()),
  166. timeStamp: payInfo.timeStamp,
  167. nonceStr: payInfo.nonceStr,
  168. package:payInfo.package,
  169. signType: payInfo.signType,
  170. paySign: payInfo.paySign,
  171. appid:payInfo.appId,
  172. success: function (res) {
  173. console.log('success:' + JSON.stringify(res));
  174. uni.showToast({
  175. title: '支付成功',
  176. icon:'none',
  177. duration: 2000
  178. });
  179. that.tabIndex=0
  180. that.page = 1;
  181. that.getData()
  182. },
  183. fail: function (err) {
  184. console.log(err)
  185. uni.showToast({
  186. title: '支付失败',
  187. icon:'none',
  188. duration: 2000
  189. });
  190. }
  191. });
  192. },
  193. cancelBespeak(item){
  194. var that = this
  195. uni.showModal({
  196. title: '提示',
  197. content: '是否取消该订单',
  198. cancelText:'否',
  199. confirmText:'是',
  200. success: function (res) {
  201. if (res.confirm) {
  202. uni.showLoading({
  203. title: '加载中'
  204. })
  205. that.$http('openOrderManagement/updateSheetState', {
  206. id: item.ID,
  207. }, 'POST').then(res => {
  208. uni.hideLoading();
  209. // var list = res.data.Items
  210. if(res.code==0){
  211. uni.showToast({
  212. title: '取消成功',
  213. icon: 'none',
  214. duration: 2000
  215. });
  216. setTimeout(function() {
  217. that.page = 1;
  218. that.getData();
  219. }, 100);
  220. }else{
  221. uni.showToast({
  222. title: res.msg,
  223. icon: 'none',
  224. duration: 3000
  225. });
  226. }
  227. })
  228. } else if (res.cancel) {
  229. }
  230. }
  231. });
  232. },
  233. decryptPhoneNumber: function(e) {
  234. console.log(e);
  235. this.code=e.detail.code
  236. this.wxPhoneLogin()
  237. this.authorizShow=false;
  238. },
  239. wxPhoneLogin(){
  240. var that=this;
  241. this.$http('miniApp2/sys/wxPhoneLogin', {
  242. appId:this.ext.appId,
  243. unionId:this.ext.unionId,
  244. code:this.code,
  245. openId:this.wxOpenData.openid
  246. },'POST').then(res => {
  247. var data = res.data;
  248. if(data.loginInfo){
  249. this.userInfo=data.loginInfo.openUser;
  250. this.wxOpenData=data.loginInfo;
  251. this.$store.commit('mutationswxOpenData', data)
  252. this.$store.commit('mutationsuserInfo', this.userInfo)
  253. this.getData()
  254. }
  255. })
  256. },
  257. tabClick(num) {
  258. this.tabIndex = num;
  259. this.page = 1;
  260. this.getData()
  261. },
  262. goDetail(item) {
  263. //SheetType 1 商品2项目3套餐4救援5钣喷6集客
  264. if((item.SheetType==1)||(item.SheetType==2)||(item.SheetType==3)){
  265. uni.navigateTo({
  266. url: "mallOrderDetail?id=" + item.ID +"&SheetType=" + item.SheetType
  267. })
  268. }
  269. else if (item.SheetType==5){
  270. uni.navigateTo({
  271. url: "paintOrderDetail?id=" + item.ID
  272. })
  273. }
  274. else if (item.SheetType==6){
  275. uni.navigateTo({
  276. url: "activityOrderDetail?id=" + item.ID//+'&sx=1'
  277. })
  278. }
  279. },
  280. getData() {
  281. uni.showLoading({
  282. title: '加载中'
  283. });
  284. this.isload = false;
  285. var padata = {
  286. page: this.page,
  287. limit: 10,
  288. sheetState: this.tabIndex > 0 ? this.tabIndex : ''
  289. }
  290. this.$http('openOrderManagement/getOpenSheetList', padata, 'GET').then(res => {
  291. uni.hideLoading();
  292. this.isload = true;
  293. var list = res.data.Items;
  294. if (this.page == 1) {
  295. this.items = list
  296. } else {
  297. this.items = this.items.concat(list)
  298. }
  299. })
  300. },
  301. },
  302. onReachBottom() {
  303. this.page++;
  304. this.getData()
  305. },
  306. onPullDownRefresh() {
  307. this.page = 1;
  308. this.getData()
  309. setTimeout(function() {
  310. uni.stopPullDownRefresh();
  311. }, 1000);
  312. }
  313. }
  314. </script>
  315. <style scoped>
  316. .box {
  317. min-height: 100vh;
  318. background: #F4F5F7;
  319. }
  320. .renBox{
  321. color: #1A1A1A;
  322. background: #F7F7F7;
  323. border-radius: 10rpx;
  324. display: flex;
  325. padding: 20rpx;font-size: 24rpx;
  326. line-height: 30rpx;
  327. margin-top: 16rpx;
  328. }
  329. .renimg{
  330. width: 30rpx;height: 30rpx;
  331. }
  332. .renMobilePhone{
  333. padding-left: 13rpx;
  334. }
  335. .renNickName{
  336. padding-left: 20rpx;
  337. }
  338. .tab {
  339. background: #FFFFFF;
  340. display: flex;
  341. justify-content: space-between;
  342. line-height: 92rpx;
  343. position: fixed;
  344. width: calc(100vw - 100rpx);
  345. padding-left: 50rpx;
  346. padding-right: 50rpx;
  347. height: 92rpx;
  348. z-index: 11;
  349. }
  350. .tabLine {
  351. font-size: 28rpx;
  352. color: #333333;
  353. text-align: center;
  354. }
  355. .tabActive {
  356. color: #EC0F0A;
  357. font-weight: bold;
  358. border-bottom: 4rpx solid #EC0F0A;
  359. }
  360. .main {
  361. padding-top: 92rpx;
  362. padding-bottom: 20rpx;
  363. background-color: #F4F5F7;
  364. }
  365. .itemBg {
  366. margin: 20rpx 24rpx;
  367. background-color: #FFFFFF;
  368. border-radius: 10rpx;
  369. padding: 20rpx;
  370. }
  371. .itemTop {
  372. display: flex;
  373. justify-content: space-between;
  374. }
  375. .itemType {
  376. color: #999999;
  377. font-size: 24rpx;
  378. }
  379. .itemSheetState {
  380. font-size: 24rpx;
  381. color: #999999
  382. }
  383. .redColor {
  384. color: #EC0F0A;
  385. }
  386. .orangeColor {
  387. color: #F19D01;
  388. }
  389. .greenColor {
  390. color: #00A040;
  391. }
  392. .itemShopBg {
  393. display: flex;
  394. justify-content: space-between;
  395. margin-top: 20rpx;
  396. }
  397. .shopName {
  398. color: #333333;
  399. font-size: 30rpx;
  400. font-weight: bold;
  401. /* 隐藏文字显示 ...不换行 */
  402. overflow: hidden;
  403. text-overflow: ellipsis;
  404. white-space: nowrap;
  405. }
  406. .price {
  407. color: #333333;
  408. font-weight: bold;
  409. font-size: 32rpx;
  410. }
  411. .itemName {
  412. color: #666666;
  413. font-size: 24rpx;
  414. padding: 16rpx 0;
  415. height: 30rpx;
  416. overflow: hidden;
  417. text-overflow: ellipsis;
  418. white-space: nowrap;
  419. }
  420. .plateBg {
  421. display: flex;
  422. justify-content: space-between;
  423. align-items: center;
  424. }
  425. .plateNumber {
  426. color: #666666;
  427. font-size: 24rpx;
  428. margin-bottom: 20rpx;
  429. display: flex;
  430. }
  431. .itemLineBottom {
  432. display: flex;
  433. justify-content: flex-end;
  434. }
  435. .itemBtn1 {
  436. width: 150rpx;
  437. height: 56rpx;
  438. border-radius: 36rpx;
  439. border: 2rpx solid #DDDDDD;
  440. text-align: center;
  441. line-height: 56rpx;
  442. font-size: 28rpx;
  443. color: #3C3C3C;
  444. margin-left: 40rpx;
  445. }
  446. .itemBtn2 {
  447. width: 150rpx;
  448. height: 56rpx;
  449. border-radius: 36rpx;
  450. border: 2rpx solid #FF4F00;
  451. text-align: center;
  452. line-height: 56rpx;
  453. font-size: 28rpx;
  454. color: #FF4F00;
  455. margin-left: 40rpx;
  456. }
  457. .orderState {
  458. color: #F19D01;
  459. font-size: 24rpx;
  460. padding-left: 20rpx;
  461. }
  462. .authorizBox{
  463. width: 100vw;
  464. height: 100vh;
  465. background: rgba(0, 0, 0, 0.5);
  466. position: fixed;
  467. top: 0;
  468. left: 0;
  469. }
  470. .authorizCont{
  471. margin-top: 30vh;
  472. width: 564rpx;
  473. height: 408rpx;
  474. background: #FFFFFF;
  475. border-radius: 24rpx;
  476. margin-left: 93rpx;
  477. position: relative;
  478. }
  479. .authorizCloseImg{
  480. width: 62rpx;
  481. height: 62rpx;
  482. }
  483. .sqLogoBox{
  484. width: 180rpx;
  485. height: 180rpx;
  486. background: #FFFFFF;
  487. border-radius: 90rpx;
  488. text-align: center;
  489. position: absolute;
  490. top: -50rpx;
  491. left: 192rpx;
  492. }
  493. .authorizName{
  494. color: #333333;
  495. line-height: 42rpx;
  496. font-size: 30rpx;
  497. text-align: center;
  498. padding-top: 58rpx;
  499. }
  500. .authorizMs{
  501. color: #999999;
  502. line-height: 36rpx;
  503. font-size: 26rpx;
  504. width: 452rpx;
  505. padding-top: 24rpx;
  506. text-align: center;
  507. margin-left: 56rpx;
  508. }
  509. .authorizContbutton{
  510. width: 422rpx;
  511. height: 88rpx;
  512. background: #EC0F0A;
  513. border-radius: 44rpx;
  514. line-height: 88rpx;
  515. text-align: center;
  516. font-size:30rpx;
  517. color: #FFFFFF;
  518. margin-top: 62rpx;
  519. margin-left:71rpx;
  520. }
  521. .shopBoxpt{
  522. margin-top: 20rpx;
  523. }
  524. button::after{
  525. border: none;
  526. }
  527. button{
  528. position: relative;
  529. display: block;
  530. margin-left: 0;
  531. margin-right: 0;
  532. padding-left: 0px;
  533. padding-right: 0px;
  534. box-sizing: border-box;
  535. // font-size: 18px;
  536. text-align: center;
  537. text-decoration: none;
  538. // line-height: 1;
  539. line-height: 1.35;
  540. // border-radius: 5px;
  541. -webkit-tap-highlight-color: transparent;
  542. overflow: hidden;
  543. color: #000000;
  544. background-color: #fff;
  545. height: 100%;
  546. }
  547. .orderCodeBox{
  548. display: flex;
  549. }
  550. .orderCode{
  551. color: #999999; font-size: 24rpx;
  552. }
  553. .cancel {
  554. color: #3C3C3C;
  555. font-size: 24rpx;
  556. width: 130rpx;
  557. height: 56rpx;
  558. border-radius: 8rpx;
  559. border: 1rpx solid #DDDDDD;
  560. text-align: center;
  561. line-height: 56rpx;
  562. margin-right: 20rpx;
  563. }
  564. .defer {
  565. color: #EC0F0A;
  566. font-size: 24rpx;
  567. width: 130rpx;
  568. height: 56rpx;
  569. border-radius: 8rpx;
  570. border: 1rpx solid #EC0F0A;
  571. text-align: center;
  572. line-height: 56rpx;
  573. }
  574. .bottom{
  575. display: flex;
  576. justify-content: flex-end;
  577. }
  578. .packageName{
  579. font-size: 22rpx;
  580. color: #FF0035;
  581. border-radius: 5rpx;
  582. border: 1px solid #FF0035;
  583. padding: 2rpx 8rpx;
  584. }
  585. .package{
  586. justify-content: space-between;
  587. padding-top: 10rpx;padding-bottom: 10rpx;
  588. }
  589. .packageQty{
  590. font-size: 26rpx;
  591. color: #666666;
  592. }
  593. .afterSalesLineJt{
  594. width: 10rpx;height: 20rpx;
  595. margin-top: 12rpx;
  596. }
  597. .afterSales{
  598. padding: 0 24rpx;
  599. }
  600. .afterSalesLine{
  601. background: #FFFFFF;
  602. margin-top: 20rpx;
  603. padding: 30rpx 20rpx;border-radius: 16rpx;
  604. }
  605. .afterSalesLineTop{
  606. display: flex;
  607. justify-content: space-between;
  608. }
  609. .afterSalesShop{
  610. font-size: 30rpx;
  611. color: #222222;
  612. line-height: 42rpx;
  613. }
  614. .afterSalesLineState{
  615. font-size: 26rpx;line-height: 42rpx;
  616. color: #666666;
  617. }
  618. .afterSalesLineImg{
  619. width: 144rpx;
  620. height: 144rpx;
  621. border-radius: 10rpx;
  622. }
  623. .afterSalesLineCont{
  624. display: flex;padding: 24rpx 0;
  625. }
  626. .shCont{
  627. color: #222222;padding-left: 20rpx;
  628. }
  629. .shCOntName{
  630. font-size: 26rpx;line-height: 37rpx;
  631. }
  632. .shContMS{
  633. font-size: 22rpx;
  634. color: #222222;
  635. line-height: 30rpx;
  636. padding-top: 8rpx;
  637. }
  638. .tkStateBox{
  639. height: 60rpx;padding-left: 16rpx;
  640. background: #F9F9F9;color: #666666;
  641. border-radius: 10rpx;
  642. line-height: 60rpx;font-size: 26rpx;
  643. }
  644. .tkBottomBtn{
  645. font-size: 24rpx;
  646. color: #222222;
  647. width: 137rpx;
  648. height: 56rpx;
  649. line-height: 56rpx;
  650. font-size: 24rpx;
  651. color: #222222;
  652. border-radius: 8rpx;
  653. border: 1rpx solid #DDDDDD;
  654. margin-top: 24rpx;
  655. text-align: center;
  656. }
  657. .tkBottom{
  658. display: flex;justify-content: flex-end;
  659. }
  660. </style>