index.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view class="pages" :style="{'min-height':h+'px','padding-top':(mt)+'px'}">
  3. <c-nav-bar title="我的订单"></c-nav-bar>
  4. <view class="tb">
  5. <view class="tabs">
  6. <view v-for="(item,index) in tabList" :key="index" @tap="changeStatus(index)">
  7. <text :class="index==current?'active':''">{{item.name}}</text>
  8. </view>
  9. </view>
  10. </view>
  11. <view class="mainContain">
  12. <view v-if="dataList.length>0" class="card" v-for="item,index in dataList" :key="index">
  13. <template v-if="merchantType==10">
  14. <view class="header">
  15. <text style="font-weight: bold;">{{item.payTime}}出发/{{item.orderType==3?'拼船':'包船'}}</text>
  16. <text :class="oscConfig[item.status]||'textDcx'">{{FishJialeOcfg[item.status]}}</text>
  17. </view>
  18. <view class="mainContent" @tap="navTo(item)">
  19. <image class="image" :src="item.coverImg||'../../../static/orderEg.png'" mode="aspectFill">
  20. </image>
  21. <view class="middle">
  22. <view class="title" style="display: flex; justify-content: space-between;">
  23. <span> {{item.goodsNameAndType}}</span>
  24. <span> ¥{{item.totalPrice}}</span>
  25. </view>
  26. <span class='info' style="display: flex; justify-content: space-between;">
  27. <span>
  28. <span style="margin-right: 15rpx;">{{item.linkName}}</span>
  29. <span>{{item.linkPhone}}</span>
  30. </span>
  31. <span>x{{item.num}}</span>
  32. </span>
  33. </view>
  34. </view>
  35. <!-- 待使用 -->
  36. <view class="bottom" @click="handleDetail(item)" v-if="item.status==1">
  37. <view class="detail s1">
  38. 核销订单
  39. </view>
  40. </view>
  41. <!-- <view class="bottom" @click="Detail(item)" v-else>
  42. <view class="detail">
  43. 删除订单
  44. </view>
  45. </view> -->
  46. </template>
  47. <template v-if="merchantType==4">
  48. <view class="header">
  49. <text style="font-weight: bold;">{{item.merchantName}}</text>
  50. <text :class="oscConfig2[item.orderStatus]||'textDcx'">{{FishJialeOcfg2[item.orderStatus]}}</text>
  51. </view>
  52. <view class="mainContent" @tap="navTo(item)">
  53. <image class="image" :src="item.productImg||'../../../static/orderEg.png'" mode="aspectFill">
  54. </image>
  55. <view class="middle">
  56. <view class="title" style="display: flex; justify-content: space-between;">
  57. <span> {{item.productName}}</span>
  58. <span> ¥{{item.realityPay}}</span>
  59. </view>
  60. <span class='info' style="display: flex; justify-content: space-between;">
  61. <span>
  62. <span style="margin-right: 15rpx;">{{item.activityStartTime||''}}{{item.activityEndTime}}</span>
  63. </span>
  64. <span>x{{item.num}}</span>
  65. </span>
  66. </view>
  67. </view>
  68. <!-- 待使用 -->
  69. <view class="bottom" @click="handleDetail(item)" v-if="item.state==1">
  70. <view class="detail s1">
  71. 核销订单
  72. </view>
  73. </view>
  74. </template>
  75. </view>
  76. <view class="nodata" v-if='dataList.length==0'>
  77. <NoData></NoData>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import TopTabs from '@/components/TopTabs/topTabs.vue';
  84. // import NoData from '../../components/NoData/index.vue';
  85. export default {
  86. components: {
  87. TopTabs,
  88. // NoData
  89. },
  90. data() {
  91. return {
  92. //渔家乐
  93. FishJialeOcfg: {
  94. 0: '待支付',
  95. 1: '待使用',
  96. 2: '拼船中',
  97. 3: '已使用',
  98. 4: '退款中',
  99. 5: '已退款',
  100. 6: '已取消',
  101. 7: '已完成',
  102. 8: '拼团失败'
  103. },
  104. //餐饮
  105. FishJialeOcfg2: {
  106. 0: '待支付',
  107. 4: '待使用',
  108. 3: '已完成',
  109. '-1': '已取消',
  110. '-2': '退款中',
  111. '-3': '已退款',
  112. },
  113. oscConfig2: {
  114. 0: 'textDzf',
  115. 4: 'textDcx',
  116. 3: 'textQx',
  117. '-1': 'textQx',
  118. '-2': 'textQx',
  119. '-3': 'textQx',
  120. },
  121. oscConfig: {
  122. 0: 'textDzf',
  123. 1: 'textDcx',
  124. 2: 'textDcx',
  125. 3: 'textQx',
  126. 4: 'textQx',
  127. 5: 'textQx',
  128. 6: 'textQx',
  129. 7: 'textQx',
  130. 8: 'textQx',
  131. },
  132. disScroll: false,
  133. pageIndex: 1,
  134. pageCount: 50,
  135. current: 0,
  136. dataList: [],
  137. status: '',
  138. state:'',
  139. merchantId: uni.getStorageSync('merchantId'),
  140. merchantType: uni.getStorageSync('merchantType'),
  141. tabList: [{
  142. name: '全部订单'
  143. },
  144. {
  145. name: '待支付'
  146. },
  147. {
  148. name: '待使用'
  149. },
  150. {
  151. name: '已完成'
  152. },
  153. {
  154. name: '退款/售后'
  155. },
  156. ],
  157. }
  158. },
  159. onLoad(option) {
  160. if (option.type) {
  161. const type = parseInt(option.type);
  162. //其他页面入参
  163. // if (type == 0) {
  164. // this.changeStatus(1)
  165. // } else if (type == 4) {
  166. // this.changeStatus(2)
  167. // } else if (type == 3) {
  168. // this.changeStatus(3)
  169. // } else if (type == -3) {
  170. // this.changeStatus(4)
  171. // }
  172. } else {
  173. if(this.merchantType==10){
  174. this.getOrderList()
  175. }else{
  176. this.getOrderList2()
  177. }
  178. }
  179. },
  180. methods: {
  181. // 去详情
  182. navTo(item) {
  183. uni.navigateTo({
  184. url: '/pagesHouse/Mine/ordersList/details/details?orderCode=' + item.orderCode
  185. })
  186. },
  187. // 核销
  188. handleDetail() {
  189. uni.navigateTo({
  190. url: '/pagesHouse/Verification/index'
  191. })
  192. },
  193. init() {
  194. this.pageIndex = 1;
  195. this.dataList = [];
  196. if(this.merchantType==10){
  197. this.getOrderList()
  198. }else{
  199. this.getOrderList2()
  200. }
  201. },
  202. changeStatus(index) {
  203. this.current=index;
  204. if(this.merchantType==10){
  205. if (index === 0) this.status = '';
  206. else if (index === 1) this.status = '0'
  207. else if (index === 2) this.status = '1';
  208. else if (index === 3) this.status = '3,7';
  209. else if (index === 4) this.status = '4,5';
  210. }else{
  211. if (index === 0) this.state = '';
  212. else if (index === 1) this.state = '0'
  213. else if (index === 2) this.state = '4';
  214. else if (index === 3) this.state = '3';
  215. else if (index === 4) this.state = '-3';
  216. }
  217. this.init();
  218. },
  219. //渔家乐订单
  220. getOrderList() {
  221. let that = this;
  222. this.$api.get('/api/fishering/personCenterPage', {
  223. merchantId: this.merchantId,
  224. status: this.status,
  225. page: this.pageIndex,
  226. limit: this.pageCount,
  227. }).then(res => {
  228. if (res.data.code === 0) {
  229. let {
  230. list,
  231. total
  232. } = res.data.data;
  233. that.dataList = [...that.dataList, ...list];
  234. if (res.data.data.list.length < 10) {
  235. this.disScroll = true;
  236. } else {
  237. that.pageIndex++;
  238. }
  239. } else that.$showToast(res.data.msg);
  240. })
  241. },
  242. getOrderList2() {
  243. let that = this;
  244. this.$api.get('/api/merchant/food/queryPageMerchantOrder', {
  245. merchantId: this.merchantId,
  246. state: this.state,
  247. page: this.pageIndex,
  248. limit: this.pageCount,
  249. }).then(res => {
  250. if (res.data.code === 0) {
  251. let {
  252. list,
  253. total
  254. } = res.data.data;
  255. that.dataList = [...that.dataList, ...list];
  256. if (res.data.data.list.length < 10) {
  257. this.disScroll = true;
  258. } else {
  259. that.pageIndex++;
  260. }
  261. } else that.$showToast(res.data.msg);
  262. })
  263. },
  264. hexiao(item) {
  265. // this.$api.post('/scenic/order/sailWriteOff',{
  266. // orderType:item.orderType,
  267. // touristList:this.data
  268. // }).then(res=>{
  269. // if(res.data.code==0){
  270. // uni.redirectTo({
  271. // url:"/pagesHouse/Verification/success?boatNo="+this.boatNo+'&price='+this.orderInfo.realPrice
  272. // })
  273. // }
  274. // })
  275. }
  276. }
  277. }
  278. </script>
  279. <style lang="scss" scoped>
  280. .textQx {
  281. color: #999;
  282. }
  283. .textDcx {
  284. color: #333333;
  285. }
  286. .textDzf {
  287. color: #FF7D01;
  288. }
  289. .pages {
  290. background: #F9FAFC;
  291. box-sizing: border-box;
  292. padding-bottom: 50rpx;
  293. .tb {
  294. width: 100%;
  295. top: 0;
  296. left: 0;
  297. z-index: 999;
  298. .searchBoxParent {
  299. width: 100%;
  300. background: #fff;
  301. padding: 20rpx 24rpx 6rpx;
  302. box-sizing: border-box;
  303. .searchBox {
  304. width: 100%;
  305. background-color: #fff;
  306. }
  307. }
  308. .tabs {
  309. background: #fff;
  310. padding: 26rpx 0;
  311. display: flex;
  312. align-items: center;
  313. width: 100%;
  314. &>view {
  315. width: 25%;
  316. font-size: 28rpx;
  317. font-family: PingFangSC-Regular, PingFang SC;
  318. font-weight: 400;
  319. color: black;
  320. line-height: 40rpx;
  321. position: relative;
  322. text-align: center;
  323. }
  324. .active {
  325. font-size: 32rpx;
  326. font-family: PingFang-SC-Bold, PingFang-SC;
  327. font-weight: bold;
  328. color: black;
  329. line-height: 45rpx;
  330. }
  331. .active::after {
  332. position: absolute;
  333. content: '';
  334. width: 50rpx;
  335. height: 8rpx;
  336. background: #007A69;
  337. bottom: -26rpx;
  338. left: 60%;
  339. margin-left: -42rpx;
  340. }
  341. }
  342. }
  343. .green {}
  344. .mainContain {
  345. display: flex;
  346. flex-direction: column;
  347. padding: 0 20rpx;
  348. .nodata {
  349. background: white;
  350. }
  351. .card {
  352. background: #fff;
  353. border-radius: 16rpx;
  354. margin: 20rpx 0;
  355. padding: 0 24rpx 30rpx;
  356. .header {
  357. display: flex;
  358. justify-content: space-between;
  359. padding: 34rpx 0;
  360. font-size: 28rpx;
  361. }
  362. .mainContent {
  363. display: flex;
  364. .image {
  365. background-repeat: no-repeat;
  366. background-size: cover;
  367. width: 136rpx;
  368. min-width: 136rpx;
  369. height: 136rpx;
  370. border-radius: 12rpx;
  371. }
  372. .middle {
  373. color: #777777;
  374. margin-left: 20rpx;
  375. width: 100%;
  376. .title {
  377. font-weight: bold;
  378. font-size: 30rpx;
  379. margin: 16rpx 0 30rpx;
  380. }
  381. .info {
  382. font-size: 26rpx;
  383. color: #777777;
  384. }
  385. }
  386. .price {
  387. color: red;
  388. text-align: center;
  389. height: 100%;
  390. align-items: center;
  391. align-self: center;
  392. font-size: 29rpx;
  393. font-weight: 700;
  394. }
  395. }
  396. .bottom {
  397. display: flex;
  398. justify-content: flex-end;
  399. margin-top: 16rpx;
  400. .detail {
  401. border-radius: 16rpx;
  402. color: darkgrey;
  403. padding: 13rpx 34rpx;
  404. background-color: #F6F6F6;
  405. font-size: 26rpx;
  406. color: #333333;
  407. font-weight: Regular;
  408. }
  409. .s1 {
  410. border-radius: 16rpx;
  411. color: darkgrey;
  412. padding: 13rpx 34rpx;
  413. background-color: #007A69;
  414. font-size: 26rpx;
  415. color: #fff;
  416. font-weight: Regular;
  417. }
  418. }
  419. }
  420. }
  421. }
  422. </style>