myOrder.vue 11 KB

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