list.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  1. <template>
  2. <view class="content" v-if="isShow">
  3. <view class="navbar">
  4. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  5. :class="{current: tabCurrentIndex === index}" @click="tabClick(index)">
  6. {{item.text}}
  7. </view>
  8. </view>
  9. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
  10. <swiper-item class="tab-content" v-for="(tabItem,tabIndex) in navList" :key="tabIndex">
  11. <scroll-view
  12. v-if="tabItem.loadingState != 'first_loading'&&tabItem.orderList.length == 0 && tabItem.state == 1"
  13. class="list-scroll-content" scroll-y @scrolltolower="loadData">
  14. <view v-if="tabItem.loadingState != 'first_loading'&&tabItem.orderList.length == 0"
  15. class="empty_part flex_column_start_center">
  16. <image :src="imgUrl+'empty_goods.png'" />
  17. <text>{{$L('这里空空如也~快去商品中心加购商品吧')}}!</text>
  18. <button class="flex_row_center_center" @click="goGoodsList"
  19. :plain="true">{{$L('马上去逛逛')}}</button>
  20. </view>
  21. <view
  22. v-if="recommendShow && (navList[tabCurrentIndex].state != 1 || (navList[tabCurrentIndex].state == 1 && navList[tabCurrentIndex].orderList.length == 0))">
  23. <recommendGoods ref='recomment_goods' />
  24. </view>
  25. </scroll-view>
  26. <scroll-view v-else class="list-scroll-content" scroll-y @scrolltolower="loadData" :lower-threshold="150">
  27. <!-- 订单列表 -->
  28. <template v-if="tabItem.orderList.length > 0">
  29. <view v-for="(item,index) in tabItem.orderList" :key="index"
  30. class="order-item flex_column_start_start" @click="goOrderDetail(item.orderSn)">
  31. <view class="i-top">
  32. <!-- <text class="order_sn">订单编号:{{item.orderSn}}</text> -->
  33. <view class="store_name" @click.stop="goShopHome(item.storeId)">
  34. <image class="store_logo" :src="imgUrl+'goods_detail/store_logo.png'"></image>
  35. <text class="store_name_text">{{item.storeName}}</text>
  36. <image class="store_logo_right"
  37. :src="(item.storeId==0?'':imgUrl+'order/store_right.png')"></image>
  38. <!-- <text class="iconfont iconziyuan11"></text> -->
  39. </view>
  40. <text class="state" :style="{color: item.stateTipColor}">{{item.orderStateValue}}</text>
  41. </view>
  42. <view v-if="item.orderProductListVOList" class="goods-box flex_row_between_center"
  43. v-for="(goodsItem, goodsIndex) in item.orderProductListVOList" :key="goodsIndex">
  44. <view class="left flex_row_start_start">
  45. <view class="goods-img"
  46. :style="{backgroundImage: 'url('+goodsItem.productImage+')'}"></view>
  47. <view class='goods_info flex_column_between_start'>
  48. <view class='flex_column_start_start'>
  49. <text class="goods_name">{{goodsItem.goodsName}}</text>
  50. <text class="spec_info"
  51. v-if="goodsItem.specValues">{{goodsItem.specValues}}</text>
  52. </view>
  53. <view class="label_con flex_row_start_start" v-if="item.orderType==103">
  54. <view class="act_label preSale">预售</view>
  55. <view v-if="item.orderType==103&&item.deliverTime"
  56. class="presale_deliver_time">{{item.deliverTime}} 开始发货</view>
  57. </view>
  58. <view class="label_con flex_row_start_start" v-if="item.orderType==102">
  59. <view class="act_label pinGroup">拼团</view>
  60. <view v-if="item.orderType==103&&item.deliverTime"
  61. class="presale_deliver_time">{{item.deliverTime}} 开始发货</view>
  62. </view>
  63. <view class="label_con flex_row_start_start" v-if="item.orderType==105">
  64. <view class="act_label ladder">阶梯团</view>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="right flex_column_center_end">
  69. <view class="price_info flex_row_end_end">
  70. <text class="unit">¥</text>
  71. <text
  72. class="price_int">{{$getPartNumber(goodsItem.productShowPrice,'int')}}</text>
  73. <text
  74. class="price_decimal">{{$getPartNumber(goodsItem.productShowPrice,'decimal')}}</text>
  75. </view>
  76. <text class="goods_num">*{{goodsItem.productNum}}</text>
  77. </view>
  78. <view class="goods_return_status" v-if="goodsItem.afsStateValue">
  79. {{goodsItem.afsStateValue}}</view>
  80. </view>
  81. <view class="price-box">
  82. {{$L('共')}}{{item.goodsNum}}{{$L('件商品')}}
  83. <text class="order_mount">{{$L('合计')}} :</text>
  84. <view class="total_price flex_row_end_end">
  85. <text class="unit">¥</text>
  86. <text class="price_int">{{$getPartNumber(item.orderAmount,'int')}}</text>
  87. <text class="price_decimal">{{$getPartNumber(item.orderAmount,'decimal')}}</text>
  88. </view>
  89. </view>
  90. <view class="action-box" v-if="item.state != 9">
  91. <!-- 待付款、待发货订单可以修改地址 -->
  92. <button v-if="(item.orderState == 10||item.orderState == 20)"
  93. class="action-btn flex_row_center_center"
  94. @click.stop="editAddress(item.orderSn)">{{$L('修改地址')}}</button>
  95. <!-- 待收货、已完成订单可以查看物流 -->
  96. <button v-if="item.orderState == 30||item.orderState == 40"
  97. class="action-btn flex_row_center_center"
  98. @click.stop="lookLogistics(item.orderSn,item.productLeadLittle)">{{$L('查看物流')}}</button>
  99. <!-- 待收货订单可以确认收货 -->
  100. <button v-if="item.orderState == 30" class="action-btn recom flex_row_center_center"
  101. @click.stop="confirmReceipt(item.orderSn)">{{$L('确认收货')}}</button>
  102. <!-- 待评价订单可以评价 -->
  103. <button v-if="item.orderState == 40 && item.evaluateState!=3"
  104. class="action-btn recom flex_row_center_center"
  105. @click.stop="remainEvaluated(item.orderSn)">{{$L('评价')}}</button>
  106. <!-- 待付款订单可以取消订单 -->
  107. <button v-if="item.orderState == 10" class="action-btn flex_row_center_center"
  108. @click.stop="cancelPopup(item)">{{$L('取消订单')}}</button>
  109. <!-- 待付款订单可以立即支付 -->
  110. <button
  111. v-if="item.orderState == 10&&!((item.orderType==105||item.orderType==103)&&item.orderSubState==102&&item.depositRemainTime>0)"
  112. class="action-btn recom flex_row_center_center"
  113. @click.stop="goPay(item)">{{$L('立即支付')}}</button>
  114. <!-- 已取消、全部评价完成订单可以删除订单 -->
  115. <button v-if='item.orderState==0||(item.orderState==40&&item.evaluateState==3)'
  116. class="action-btn flex_row_center_center"
  117. @click.stop="delOrder(item.orderSn)">{{$L("删除订单")}}</button>
  118. </view>
  119. </view>
  120. </template>
  121. <view v-if="tabItem.loadingState != 'first_loading'&&tabItem.orderList.length == 0"
  122. class="empty_part flex_column_start_center">
  123. <image :src="imgUrl+'empty_goods.png'" />
  124. <text>{{$L('这里空空如也~快去商品中心加购商品吧!')}}</text>
  125. <button class="flex_row_center_center" @click="goGoodsList"
  126. :plain="true">{{$L('马上去逛逛')}}</button>
  127. </view>
  128. <block v-if="tabCurrentIndex != 1">
  129. <loadingState
  130. v-if="!recommendShow&&navList[tabCurrentIndex].loadingState != 'no_more_data' && (tabItem.loadingState == 'first_loading'||tabItem.orderList.length > 0)"
  131. :state='tabItem.loadingState' />
  132. </block>
  133. <block v-if="tabCurrentIndex == 1">
  134. <loadingState :state='tabItem.loadingState' />
  135. </block>
  136. <view
  137. v-if="recommendShow && (navList[tabCurrentIndex].state != 1 || (navList[tabCurrentIndex].state == 1 && navList[tabCurrentIndex].orderList.length == 0))">
  138. <recommendGoods ref='recomment_goods' />
  139. </view>
  140. </scroll-view>
  141. </swiper-item>
  142. </swiper>
  143. <!-- <view v-if="recommendShow && (navList[tabCurrentIndex].state != 1 || (navList[tabCurrentIndex].state == 1 && navList[tabCurrentIndex].orderList.length == 0))">
  144. <recommendGoods ref='recomment_goods' />
  145. </view> -->
  146. <!-- 取消订单选择原因弹框 -->
  147. <uni-popup ref="cancelPopup" type="bottom">
  148. <view class="cancel_popup">
  149. <view class="popup_top">
  150. <text>{{$L('取消原因')}}</text>
  151. <image :src="imgUrl+'order-detail/guanbi.png'" mode="" @click="notCancel"></image>
  152. </view>
  153. <scroll-view class="uni-list cancel_list" scroll-x="true">
  154. <radio-group @change="radioChange">
  155. <label class="cancle_pre" v-for="(item,index) in cancelList" :key="index">
  156. <text>{{item.content}}</text>
  157. <radio :value="item.value" :checked="item.value === current" color="#fc1c1c"
  158. style="transform:scale(0.8);margin-right:0;" />
  159. </label>
  160. </radio-group>
  161. </scroll-view>
  162. <view class="cancel_popup_btn">
  163. <text class="" @click="notCancel()">{{$L('暂不取消')}}</text>
  164. <text class="" @click="confirmCancel()">{{$L('确定取消')}}</text>
  165. </view>
  166. </view>
  167. </uni-popup>
  168. <!-- 预售,阶梯团定金取消订单提示 -->
  169. <uni-popup ref="popup" type="dialog">
  170. <uni-popup-dialog type="input" title ="提示" content="取消该订单定金不予退还,确定取消?" :duration="2000" @close="acDialog(false)" @confirm="acDialog(true)"></uni-popup-dialog>
  171. </uni-popup>
  172. </view>
  173. </template>
  174. <script>
  175. import loadingState from "@/components/loading-state.vue";
  176. import selectionGoods from "@/components/selection-goods.vue";
  177. import recommendGoods from "@/components/recommend-goods.vue"
  178. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  179. import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue';
  180. import {
  181. mapState
  182. } from 'vuex';
  183. export default {
  184. components: {
  185. loadingState,
  186. selectionGoods,
  187. recommendGoods,
  188. uniPopup,
  189. uniPopupDialog
  190. },
  191. data() {
  192. return {
  193. imgUrl: getApp().globalData.imgUrl,
  194. tabCurrentIndex: 0,
  195. navList: [{
  196. state: 0,
  197. text: this.$L('全部'),
  198. loadingState: 'first_loading',
  199. orderList: [],
  200. current: 1, //分页
  201. },
  202. {
  203. state: 1,
  204. text: this.$L('待付款'),
  205. loadingState: 'first_loading',
  206. orderList: [],
  207. current: 1, //分页
  208. },
  209. {
  210. state: 2,
  211. text: this.$L('待发货'),
  212. loadingState: 'first_loading',
  213. orderList: [],
  214. current: 1, //分页
  215. },
  216. {
  217. state: 3,
  218. text: this.$L('待收货'),
  219. loadingState: 'first_loading',
  220. orderList: [],
  221. current: 1, //分页
  222. },
  223. {
  224. state: 4,
  225. text: this.$L('待评价'),
  226. loadingState: 'first_loading',
  227. orderList: [],
  228. current: 1, //分页
  229. }
  230. ],
  231. stopPullDownRefresh: false, //是否下拉刷新中
  232. current: '0', //取消原因当前点击的是第0项
  233. reasonId: -1, //取消原因当前点击的原因id
  234. cancelList: [], //取消原因列表
  235. curOrderSn: '', //当前订单的订单号
  236. isHasMore: true,
  237. pn: 1,
  238. recGoodsList: [],
  239. isloading: 'first_loading',
  240. isShow: false,
  241. recommendShow: false, //推荐商品是否显示
  242. ifOnShow: false
  243. };
  244. },
  245. onLoad(options) {
  246. /**
  247. * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
  248. * 替换onLoad下代码即可
  249. */
  250. if (options.state) {
  251. this.tabCurrentIndex = +options.state;
  252. } else {
  253. this.tabCurrentIndex = 0;
  254. }
  255. // // #ifndef MP
  256. // this.loadData()
  257. // // #endif
  258. // #ifdef MP
  259. if (options.state == 0) {
  260. this.loadData()
  261. }
  262. // #endif
  263. uni.showLoading({
  264. title: '加载中',
  265. icon: 'none'
  266. })
  267. },
  268. onShow() {
  269. let index = this.tabCurrentIndex;
  270. let navItem = this.navList[index];
  271. navItem.loadingState = 'first_loading';
  272. navItem.orderList = [];
  273. navItem.current = 1;
  274. this.loadData();
  275. },
  276. computed: {
  277. ...mapState(['userInfo'])
  278. },
  279. //下拉刷新
  280. onPullDownRefresh() {
  281. let index = this.tabCurrentIndex;
  282. let navItem = this.navList[index];
  283. navItem.loadingState = 'first_loading';
  284. navItem.orderList = [];
  285. navItem.current = 1;
  286. this.stopPullDownRefresh = true; //下拉刷新状态
  287. this.loadData();
  288. },
  289. methods: {
  290. //甄选推荐
  291. getData() {
  292. if (this.tabCurrentIndex != 1) {
  293. this.$refs.recomment_goods[this.tabCurrentIndex].getMoreData();
  294. }
  295. },
  296. //获取订单列表
  297. loadData(source) {
  298. // if(this.recommendShow){//如果已经展示甄选推荐的话,上拉加载甄选推荐商品
  299. // this.getData()
  300. // }else{
  301. //将订单挂载到tab列表下,起到缓存的效果,避免多次请求
  302. let index = this.tabCurrentIndex;
  303. let navItem = this.navList.filter(item => item.state == index)[0];
  304. let state = navItem.state;
  305. if (source === 'tabChange' && navItem.loadingState !== 'first_loading') {
  306. //tab切换只有第一次需要加载数据
  307. return;
  308. }
  309. if (navItem.loadingState === 'loading') {
  310. //防止重复加载
  311. return;
  312. }
  313. if (navItem.loadingState == 'no_more_data') {
  314. //已经没有数据,无需再请求
  315. // return;
  316. this.getData();
  317. }
  318. if (navItem.loadingState != 'no_more_data') {
  319. this.getOrderList()
  320. }
  321. // }
  322. },
  323. //此方法只有删除订单,取消订单等需要从列表中删除订单时调用,其余获取订单列表请调用loadData
  324. getOrderList() {
  325. let index = this.tabCurrentIndex;
  326. let navItem = this.navList.filter(item => item.state == index)[0];
  327. let state = navItem.state;
  328. let param = {};
  329. param.url = 'v3/business/front/orderInfo/list';
  330. param.data = {};
  331. param.data.pageSize = 10;
  332. param.data.current = navItem.current;
  333. navItem.loadingState = navItem.loadingState == 'first_loading' ? navItem.loadingState : 'loading';
  334. //状态处理
  335. if (navItem.state == 0) {
  336. param.data.state = ''; //全部订单
  337. } else if (navItem.state == 1) {
  338. param.data.orderState = 10; //待付款
  339. } else if (navItem.state == 2) {
  340. param.data.orderState = 20; //待发货
  341. } else if (navItem.state == 3) {
  342. param.data.orderState = 30; //待收货
  343. } else if (navItem.state == 4) {
  344. //待评价
  345. param.data.orderState = 40;
  346. param.data.evaluateState = 1;
  347. }
  348. this.$request(param).then(res => {
  349. if (res.state == 200) {
  350. if (navItem.current == 1) {
  351. navItem.orderList = res.data.list
  352. } else {
  353. navItem.orderList = navItem.orderList.concat(res.data.list);
  354. }
  355. let hasMore = this.$checkPaginationHasMore(res.data.pagination); //是否还有数据
  356. if (hasMore) {
  357. navItem.current++;
  358. navItem.loadingState = 'allow_loading_more';
  359. } else {
  360. navItem.loadingState = 'no_more_data';
  361. this.recommendShow = true
  362. }
  363. uni.hideLoading();
  364. this.isShow = true;
  365. } else {
  366. this.$api.msg(res.msg);
  367. }
  368. if (this.stopPullDownRefresh) {
  369. this.stopPullDownRefresh = false;
  370. uni.stopPullDownRefresh();
  371. }
  372. }).catch((e) => {
  373. //异常处理
  374. })
  375. },
  376. //刷新当前列表
  377. refreshOrderList() {
  378. let index = this.tabCurrentIndex;
  379. let navItem = this.navList.filter(item => item.state == index)[0];
  380. navItem.current = 1
  381. this.getOrderList()
  382. },
  383. //swiper 切换
  384. changeTab(e) {
  385. this.tabCurrentIndex = e.target.current;
  386. this.isHasMore = true;
  387. this.pn = 1;
  388. this.recGoodsList = [];
  389. this.isloading = 'first_loading';
  390. this.loading = false;
  391. this.loadData('tabChange');
  392. },
  393. //顶部tab点击
  394. tabClick(index) {
  395. this.tabCurrentIndex = index;
  396. this.isHasMore = true;
  397. this.pn = 1;
  398. this.isloading = 'first_loading';
  399. this.loading = false;
  400. this.recGoodsList = [];
  401. },
  402. //马上去逛逛事件
  403. goGoodsList() {
  404. uni.navigateTo({
  405. url: `/pages/product/list`
  406. })
  407. },
  408. //跳转订单详情页
  409. goOrderDetail(orderSn) {
  410. uni.navigateTo({
  411. url: `/pages/order/detail?orderSn=` + orderSn,
  412. })
  413. },
  414. //删除订单操作
  415. delOrder(orderSn) {
  416. let that = this;
  417. uni.showModal({
  418. title: '提示',
  419. content: '确定删除该订单?',
  420. success: function (res) {
  421. if (res.confirm) {
  422. let param = {};
  423. param.url = 'v3/business/front/orderOperate/delete';
  424. param.method = 'POST';
  425. param.data = {};
  426. param.data.orderSn = orderSn;
  427. that.$request(param).then(res => {
  428. if (res.state == 200) {
  429. that.refreshOrderList();
  430. that.$api.msg(res.msg);
  431. } else {
  432. that.$api.msg(res.msg);
  433. }
  434. }).catch((e) => {
  435. //异常处理
  436. })
  437. } else if (res.cancel) {
  438. }
  439. }
  440. })
  441. },
  442. //立即支付
  443. goPay(val) {
  444. let goodsInfo = val.orderProductListVOList[0];
  445. if (val.orderType == 105 && val.orderSubState == 102 && val.depositRemainTime == 0) {
  446. //阶梯团付尾款
  447. uni.navigateTo({
  448. url: `/pages/order/confirmOrder?goodsId=${goodsInfo.goodsId}&productId=${goodsInfo.productId}&numbers=${goodsInfo.productNum}&ifcart=2&orderSn=${val.orderSn}`
  449. })
  450. } else if (val.orderType == 103 && val.orderSubState == 102 && val.depositRemainTime == 0) {
  451. uni.navigateTo({
  452. url: `/pages/order/confirmOrder?goodsId=${goodsInfo.goodsId}&productId=${goodsInfo.productId}&numbers=${goodsInfo.productNum}&ifcart=2&orderSn=${val.orderSn}`
  453. })
  454. } else {
  455. uni.navigateTo({
  456. url: '/pages/order/pay?paySn=' + val.paySn + '&payMethodType=orderList'
  457. })
  458. }
  459. },
  460. //打开取消订单弹框
  461. cancelPopup(item) {
  462. if(!item.isRefundDeposit&&(item.orderType==105||item.orderType==103)){
  463. this.curOrderSn = item.parentSn;
  464. this.$refs.popup.open()
  465. }else{
  466. this.$refs.cancelPopup.open();
  467. this.curOrderSn = item.parentSn;
  468. this.getCancelList();
  469. }
  470. },
  471. // 预售,阶梯团的提示确认
  472. acDialog(type){
  473. if(type==true){
  474. this.$refs.popup.close()
  475. this.$refs.cancelPopup.open();
  476. this.getCancelList();
  477. }else{
  478. this.$refs.popup.close()
  479. }
  480. },
  481. //获取取消订单原因列表
  482. getCancelList() {
  483. let param = {};
  484. param.url = 'v3/system/front/reason/list';
  485. param.method = 'GET';
  486. param.data = {};
  487. param.data.type = 104;
  488. this.$request(param).then(res => {
  489. if (res.state == 200) {
  490. this.cancelList = res.data || [];
  491. this.cancelList && this.cancelList.map((item, index) => item.value = '' + index);
  492. this.reasonId = this.cancelList[0].reasonId;
  493. } else {
  494. this.$api.msg(res.msg);
  495. }
  496. }).catch((e) => {
  497. //异常处理
  498. })
  499. },
  500. //取消原因单选框切换
  501. radioChange(e) {
  502. for (let i = 0; i < this.cancelList.length; i++) {
  503. if (this.cancelList[i].value === e.target.value) {
  504. this.reasonId = this.cancelList[i].reasonId;
  505. break;
  506. }
  507. }
  508. },
  509. //暂不取消订单
  510. notCancel() {
  511. this.$refs.cancelPopup.close();
  512. // this.goRefresh();
  513. },
  514. //确定取消订单
  515. confirmCancel() {
  516. let that = this;
  517. uni.showModal({
  518. title: '提示',
  519. content: '确定取消该订单?',
  520. success: function (res) {
  521. if (res.confirm) {
  522. let param = {};
  523. param.url = 'v3/business/front/orderOperate/cancel';
  524. param.method = 'POST';
  525. param.data = {};
  526. param.data.parentSn = that.curOrderSn;
  527. param.data.reasonId = that.reasonId;
  528. that.$request(param).then(res => {
  529. if (res.state == 200) {
  530. that.refreshOrderList()
  531. that.$api.msg(res.msg);
  532. that.$refs.cancelPopup.close();
  533. } else {
  534. that.$api.msg(res.msg);
  535. }
  536. }).catch((e) => {
  537. //异常处理
  538. })
  539. } else if (res.cancel) {
  540. that.$refs.cancelPopup.close();
  541. }
  542. }
  543. })
  544. },
  545. //更新当前页面方法
  546. goRefresh() {
  547. let pages = getCurrentPages();
  548. let currPage = pages[pages.length - 1]; //当前页面
  549. let index = this.tabCurrentIndex;
  550. let navItem = this.navList[index];
  551. navItem.loadingState = 'first_loading';
  552. navItem.orderList = [];
  553. navItem.current = 1;
  554. currPage.loadData(); //更新当前页面数据
  555. },
  556. //查看物流
  557. lookLogistics(orderSn, productLeadLittle) {
  558. uni.navigateTo({
  559. url: '/pages/order/lookLogistics?orderSn=' + orderSn + '&productLeadLittle=' + productLeadLittle
  560. })
  561. },
  562. //修改地址
  563. editAddress(orderSn) {
  564. uni.navigateTo({
  565. url: '/pages/address/list?source=2' + '&orderSn=' + orderSn
  566. })
  567. },
  568. // 确认收货
  569. confirmReceipt(orderSn) {
  570. let _this = this
  571. uni.showModal({
  572. title: '提示',
  573. content: '确认收货?',
  574. success: function (res) {
  575. if (res.confirm) {
  576. let param = {}
  577. param.url = 'v3/business/front/orderOperate/receive'
  578. param.method = 'POST'
  579. param.data = {
  580. orderSn: orderSn
  581. }
  582. _this.$request(param).then(res => {
  583. if (res.state == 200) {
  584. uni.showToast({
  585. title: '收货成功!',
  586. icon: 'none',
  587. duration: 700
  588. })
  589. _this.refreshOrderList();
  590. }
  591. })
  592. }
  593. }
  594. })
  595. },
  596. // 评价
  597. remainEvaluated(orderSn) {
  598. uni.navigateTo({
  599. url: '/pages/order/publishEvaluation?orderSn=' + orderSn
  600. })
  601. },
  602. //去店铺首页
  603. goShopHome(storeId) {
  604. if (storeId != 0) {
  605. uni.navigateTo({
  606. url: '/pages/store/shopHomePage?vid=' + storeId
  607. })
  608. }
  609. }
  610. },
  611. }
  612. </script>
  613. <style lang="scss">
  614. page,
  615. .content {
  616. background: $bg-color-split;
  617. height: 100%;
  618. width: 750rpx;
  619. margin: 0 auto;
  620. }
  621. .swiper-box {
  622. height: calc(100% - 40px);
  623. }
  624. .list-scroll-content {
  625. height: 100%;
  626. }
  627. .label_con {
  628. position: relative;
  629. left: 0;
  630. .act_label {
  631. height: 36rpx;
  632. border-radius: 15rpx;
  633. line-height: 36rpx;
  634. padding: 0 14rpx;
  635. }
  636. .preSale {
  637. // width: 38px;
  638. // height: 14px;
  639. background: linear-gradient(90deg, #EC0093 0%, #FF085B 100%);
  640. border-radius: 4rpx;
  641. color: #fff;
  642. font-size: 24rpx;
  643. }
  644. .pinGroup{
  645. background: linear-gradient(45deg, #FF6000 0%, #FF9C00 100%);
  646. border-radius: 4rpx;
  647. color: #fff;
  648. font-size: 24rpx;
  649. }
  650. .ladder{
  651. background: linear-gradient(22deg, #FE901E 0%, #FEAD28 100%);
  652. color: #fff;
  653. font-size: 24rpx;
  654. border-radius: 4rpx;
  655. }
  656. }
  657. .navbar {
  658. display: flex;
  659. height: 80rpx;
  660. padding: 0 5px;
  661. background: #fff;
  662. position: relative;
  663. z-index: 10;
  664. .nav-item {
  665. flex: 1;
  666. display: flex;
  667. justify-content: center;
  668. align-items: center;
  669. height: 100%;
  670. font-size: 32rpx;
  671. color: $main-font-color;
  672. position: relative;
  673. &.current {
  674. color: $main-color;
  675. font-size: 32rpx;
  676. font-weight: bold;
  677. &:after {
  678. content: '';
  679. position: absolute;
  680. left: 50%;
  681. bottom: 0;
  682. transform: translateX(-50%);
  683. width: 35rpx;
  684. height: 8rpx;
  685. background-color: $main-color;
  686. border-radius: 4rpx;
  687. }
  688. }
  689. }
  690. }
  691. .uni-swiper-item {
  692. height: auto;
  693. }
  694. .order-item {
  695. width: 100%;
  696. padding-left: 20rpx;
  697. background: #fff;
  698. margin-top: 20rpx;
  699. .i-top {
  700. display: flex;
  701. align-items: center;
  702. padding-right: 20rpx;
  703. position: relative;
  704. width: 100%;
  705. margin-top: 30rpx;
  706. border-bottom: 1rpx solid #f2f2f2;
  707. padding-bottom: 30rpx;
  708. .store_name {
  709. flex: 1;
  710. display: flex;
  711. align-items: center;
  712. image {
  713. width: 34rpx;
  714. height: 32rpx;
  715. transform: scale(0.9);
  716. }
  717. .store_name_text {
  718. font-size: 26rpx;
  719. color: #2d2d2d;
  720. font-weight: bold;
  721. margin-left: 10rpx;
  722. }
  723. .store_logo_right {
  724. width: 13rpx;
  725. height: 22rpx;
  726. margin-left: 10rpx;
  727. }
  728. }
  729. .state {
  730. font-size: 26rpx;
  731. color: $main-color;
  732. }
  733. }
  734. .goods-box {
  735. position: relative;
  736. padding: 20rpx 0;
  737. width: 100%;
  738. border-bottom: 1rpx solid #f2f2f2;
  739. .goods_return_status {
  740. position: absolute;
  741. bottom: 24rpx;
  742. right: 21rpx;
  743. font-size: 22rpx;
  744. color: #FC1C1C;
  745. }
  746. .left {
  747. .goods-img {
  748. background-size: cover;
  749. background-position: center center;
  750. background-repeat: no-repeat;
  751. width: 200rpx;
  752. height: 200rpx;
  753. overflow: hidden;
  754. background-color: #F8F6F7;
  755. border-radius: 14rpx;
  756. flex-shrink: 0;
  757. }
  758. .goods_info {
  759. margin-left: 25rpx;
  760. padding-top: 10rpx;
  761. height: 200rpx;
  762. width: 100%;
  763. .goods_name {
  764. color: #2D2D2D;
  765. font-size: 28rpx;
  766. overflow: hidden;
  767. text-overflow: ellipsis;
  768. display: -webkit-box;
  769. -webkit-line-clamp: 2;
  770. -webkit-box-orient: vertical;
  771. word-break: break-word;
  772. line-height: 38rpx;
  773. }
  774. .spec_info {
  775. color: #949494;
  776. font-size: 24rpx;
  777. line-height: 28rpx;
  778. background-color: #F8F8F8;
  779. padding: 3rpx 7rpx;
  780. border-radius: 6rpx;
  781. margin-top: 10rpx;
  782. overflow: hidden;
  783. text-overflow: ellipsis;
  784. display: -webkit-box;
  785. -webkit-line-clamp: 2;
  786. -webkit-box-orient: vertical;
  787. }
  788. .presale_deliver_time {
  789. padding: 0 6rpx;
  790. border: 2rpx solid #F30303;
  791. font-size: 24rpx;
  792. color: #F30303;
  793. position: absolute;
  794. left: 90rpx;
  795. white-space: nowrap;
  796. }
  797. }
  798. }
  799. .right {
  800. padding: 0 30rpx 0 24rpx;
  801. overflow: hidden;
  802. flex-shrink: 0;
  803. .price_info {
  804. color: $main-font-color;
  805. font-weight: bold;
  806. align-items: baseline;
  807. .unit,
  808. .price_decimal {
  809. font-size: 24rpx;
  810. line-height: 28rpx;
  811. }
  812. .price_int {
  813. font-size: 32rpx;
  814. line-height: 32rpx;
  815. }
  816. }
  817. .goods_num {
  818. color: #2D2D2D;
  819. font-size: 24rpx;
  820. }
  821. .title {
  822. font-size: 24rpx;
  823. color: $font-color-dark;
  824. line-height: 1;
  825. }
  826. .attr-box {
  827. font-size: 22rpx;
  828. color: $font-color-light;
  829. padding: 10rpx 12rpx;
  830. }
  831. }
  832. }
  833. .price-box {
  834. display: flex;
  835. justify-content: flex-end;
  836. align-items: baseline;
  837. padding: 0 18rpx;
  838. font-size: 24rpx;
  839. color: #949494;
  840. width: 100%;
  841. margin-top: 30rpx;
  842. position: relative;
  843. .order_type {
  844. position: absolute;
  845. left: 0;
  846. top: 0;
  847. background: linear-gradient(22deg, #FE901E 0%, #FEAD28 100%);
  848. height: 36rpx;
  849. padding: 0 14rpx;
  850. color: #fff;
  851. border-radius: 18rpx;
  852. font-size: 22rpx;
  853. }
  854. .order_mount {
  855. color: #333333;
  856. font-size: 24rpx;
  857. margin-left: 20rpx;
  858. }
  859. .total_price {
  860. color: #2D2D2D;
  861. font-weight: bold;
  862. align-items: baseline;
  863. margin-left: 15rpx;
  864. .unit,
  865. .price_decimal {
  866. font-size: 24rpx;
  867. }
  868. .price_int {
  869. font-size: 32rpx;
  870. line-height: 32rpx;
  871. margin-left: 5rpx;
  872. }
  873. }
  874. }
  875. .action-box {
  876. display: flex;
  877. justify-content: flex-end;
  878. align-items: flex-start;
  879. height: 70rpx;
  880. position: relative;
  881. padding-right: 20rpx;
  882. width: 100%;
  883. padding-bottom: 20rpx;
  884. margin-top: 30rpx;
  885. }
  886. .action-btn {
  887. width: 125rpx;
  888. height: 50rpx;
  889. margin: 0;
  890. margin-left: 10rpx;
  891. padding: 0;
  892. text-align: center;
  893. line-height: 50rpx;
  894. font-size: 24rpx;
  895. color: $main-font-color;
  896. background: #fff;
  897. border-radius: 25rpx;
  898. border: 1rpx solid #eeeeee;
  899. &:after {
  900. border: none;
  901. }
  902. &.recom {
  903. color: #fff;
  904. background: #F30300;
  905. border: none;
  906. }
  907. }
  908. }
  909. .empty_part {
  910. padding-top: 108rpx;
  911. image {
  912. width: 210rpx;
  913. height: 210rpx;
  914. }
  915. text {
  916. color: $main-third-color;
  917. font-size: 26rpx;
  918. margin-top: 57rpx;
  919. }
  920. button {
  921. width: 245rpx;
  922. height: 66rpx;
  923. background: rgba(252, 28, 28, .05);
  924. border-radius: 33rpx;
  925. color: $main-color;
  926. font-size: 30rpx;
  927. font-weight: bold;
  928. margin-top: 29rpx;
  929. border: none;
  930. }
  931. uni-button:after {
  932. border-radius: 200rpx;
  933. border-color: #fff;
  934. }
  935. }
  936. .cancel_popup {
  937. width: 100%;
  938. height: 700rpx;
  939. background: #FFFFFF;
  940. border-radius: 15rpx 15rpx 0 0;
  941. position: fixed;
  942. width: 100% !important;
  943. z-index: 20;
  944. bottom: 0;
  945. .popup_top {
  946. height: 100rpx;
  947. width: 100%;
  948. display: flex;
  949. padding: 0 39rpx;
  950. align-items: center;
  951. justify-content: space-between;
  952. border-bottom: 1rpx solid #F8F8F8;
  953. text {
  954. font-size: 32rpx;
  955. font-family: PingFang SC;
  956. font-weight: 500;
  957. color: #343434;
  958. line-height: 32rpx;
  959. }
  960. image {
  961. width: 30rpx;
  962. height: 30rpx;
  963. }
  964. }
  965. .cancel_list {
  966. padding-bottom: 128rpx;
  967. box-sizing: border-box;
  968. height: 600rpx;
  969. .cancle_pre {
  970. width: 100%;
  971. padding: 29rpx 40rpx;
  972. box-sizing: border-box;
  973. display: flex;
  974. justify-content: space-between;
  975. text {
  976. font-size: 28rpx;
  977. font-family: PingFang SC;
  978. font-weight: 500;
  979. color: #666666;
  980. line-height: 32rpx;
  981. }
  982. }
  983. }
  984. .cancel_popup_btn {
  985. position: fixed;
  986. bottom: 40rpx;
  987. z-index: 30;
  988. display: flex;
  989. width: 100%;
  990. justify-content: center;
  991. text:nth-child(1) {
  992. width: 334rpx;
  993. height: 70rpx;
  994. background: linear-gradient(45deg, #FF963B 0%, #9A540A 0%, #FF8622 0%);
  995. ;
  996. border-radius: 35rpx 0 0 35rpx;
  997. font-size: 28rpx;
  998. font-family: PingFang SC;
  999. font-weight: 500;
  1000. color: #FFFFFF;
  1001. line-height: 32rpx;
  1002. display: flex;
  1003. align-items: center;
  1004. justify-content: center;
  1005. }
  1006. text:nth-child(2) {
  1007. width: 334rpx;
  1008. height: 70rpx;
  1009. background: #F30300;
  1010. border-radius: 0 35rpx 35rpx 0;
  1011. font-size: 28rpx;
  1012. font-family: PingFang SC;
  1013. font-weight: 500;
  1014. color: #FFFFFF;
  1015. line-height: 32rpx;
  1016. display: flex;
  1017. align-items: center;
  1018. justify-content: center;
  1019. }
  1020. }
  1021. }
  1022. </style>