myOrder.vue 11 KB

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