detail.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460
  1. <template>
  2. <view class="app-container">
  3. <no-data v-if="isLoading" :showText="'加载中'"></no-data>
  4. <no-data v-if="!isLoading && noData" :showText="'加载失败'"></no-data>
  5. <block v-if="!isLoading && !noData">
  6. <view class="status-container" v-if="detail.orderStatus == 'NOPAY'"
  7. >待付款,30分钟内未付款将会关闭订单</view
  8. >
  9. <view class="status-container" v-if="detail.orderStatus == 'DFH'"
  10. >买家已付款,待卖家发货</view
  11. >
  12. <view class="status-container" v-if="detail.orderStatus == 'YFH'"
  13. >卖家已发货,已签收状态将在签收7日后自动确认</view
  14. >
  15. <view class="status-container" v-if="detail.orderStatus == 'OVER'"
  16. >已确定收货,7日后将关闭退款通道</view
  17. >
  18. <view class="status-container" v-if="detail.orderStatus == 'CLOSE'"
  19. >订单已关闭</view
  20. >
  21. <view class="status-container" v-if="detail.orderStatus == 'REFUND'"
  22. >订单售后中</view
  23. >
  24. <view class="status-container" v-if="detail.orderStatus == 'TIMEOUT'"
  25. >订单超时未支付</view
  26. >
  27. <view class="main-container">
  28. <view
  29. class="logistics-container card"
  30. v-if="detail.orderStatus == 'YFH' || detail.orderStatus == 'OVER'"
  31. @tap="toLogistics"
  32. >
  33. <view class="icon"
  34. ><image src="@/static/icon/logistics.png"></image
  35. ></view>
  36. <view class="main" v-if="hasLogistics">
  37. <view>{{ logisticsData[0].context }}</view>
  38. <view>{{ logisticsData[0].time }}</view>
  39. </view>
  40. <view class="main" v-else>
  41. <view class="noData">暂无物流信息</view>
  42. </view>
  43. <view class="right"
  44. ><image src="@/static/icon/right.png"></image
  45. ></view>
  46. </view>
  47. <view class="address-container card">
  48. <view class="icon"
  49. ><image src="@/static/icon/address.png"></image
  50. ></view>
  51. <view class="right">
  52. <view class="name"
  53. >{{ detail.receUserName
  54. }}<text>{{ detail.recePhone }}</text></view
  55. >
  56. <view class="address ellipsis-2"
  57. >{{ detail.province }}{{ detail.city }}{{ detail.area
  58. }}{{ detail.street }}{{ detail.receAddress
  59. }}{{ detail.houseNo ? detail.houseNo : '' }}</view
  60. >
  61. </view>
  62. </view>
  63. <view class="goods-container card">
  64. <view class="title">商品信息</view>
  65. <block v-for="(item, index) in detail.orderDetails" :key="index">
  66. <view class="item" @tap="toGoodsDetail(item.goodsId)">
  67. <image
  68. v-if="
  69. item.goods &&
  70. item.goods.logo &&
  71. $compareTime(item.goods.logoStartTime, item.goods.logoEndTime) &&
  72. item.goods.mergeImage
  73. "
  74. :src="item.goods.mergeImage"
  75. mode="aspectFill"
  76. ></image>
  77. <image v-else :src="item.imgUrl" mode="aspectFill"></image>
  78. <view class="right">
  79. <view class="top">
  80. <view class="name ellipsis-2">{{ item.goodsName }}</view>
  81. <view class="des">{{ item.goodsSpecValue }}</view>
  82. </view>
  83. <view class="bottom">
  84. <view class="price">¥{{ item.price | numToFixed }}</view>
  85. <view class="num">x{{ item.num }}</view>
  86. </view>
  87. </view>
  88. </view>
  89. </block>
  90. </view>
  91. <view class="peisong-container card">
  92. <view class="top">
  93. <view class="left">配送方式</view>
  94. <view class="right" v-if="detail.freight == 0">快递包邮</view>
  95. <view class="right" v-if="detail.freight != 0">快递自费</view>
  96. </view>
  97. <view class="bottom">
  98. <view class="left">买家留言</view>
  99. <view class="right">{{ detail.buyerMsg }}</view>
  100. </view>
  101. </view>
  102. <view class="total-container card">
  103. <view class="top">
  104. <view class="item">
  105. <view>商品金额</view>
  106. <view>¥{{ detail.totalProductAmount | numToFixed }}</view>
  107. </view>
  108. <view class="item">
  109. <view>运费</view>
  110. <view>¥{{ detail.freight | numToFixed }}</view>
  111. </view>
  112. <view class="item">
  113. <view>优惠券</view>
  114. <view>-¥{{ detail.couponValue | numToFixed }}</view>
  115. </view>
  116. <view class="item" v-if="detail.promotionDiscountRate">
  117. <view>折扣优惠</view>
  118. <view
  119. >-¥{{ detail.promotionDiscountAmount | numToFixed }}({{
  120. detail.promotionDiscountRate * 10
  121. }}折)</view
  122. >
  123. </view>
  124. </view>
  125. <view class="total"
  126. >订单总额:<text>¥{{ detail.payAmount | numToFixed }}</text></view
  127. >
  128. </view>
  129. <view class="order-container card">
  130. <view class="title">订单信息</view>
  131. <view class="item1">
  132. <view class="left">
  133. <view class="label">订单编号</view>
  134. <view class="value">{{ detail.orderId }}</view>
  135. </view>
  136. <view class="copy" @tap="copy(detail.orderId)">复制</view>
  137. </view>
  138. <view class="item2">
  139. <view class="label">创建时间</view>
  140. <view class="value">{{ detail.createTime }}</view>
  141. </view>
  142. <view class="item2" v-if="detail.payTime">
  143. <view class="label">支付时间</view>
  144. <view class="value">{{ detail.payTime }}</view>
  145. </view>
  146. <view class="item2" v-if="detail.payTime">
  147. <view class="label">支付方式</view>
  148. <view class="value">{{ detail.payType }}</view>
  149. </view>
  150. <view class="item2" v-if="detail.deliverTime">
  151. <view class="label">发货时间</view>
  152. <view class="value">{{ detail.deliverTime }}</view>
  153. </view>
  154. <view class="item2" v-if="detail.overTime">
  155. <view class="label">完成时间</view>
  156. <view class="value">{{ detail.overTime }}</view>
  157. </view>
  158. <view class="item2" v-if="detail.exchangeCode">
  159. <view class="label">优惠金额</view>
  160. <view class="value">{{
  161. detail.exchangeSubAmount | numToFixed
  162. }}</view>
  163. </view>
  164. <view class="item2" v-if="detail.exchangeCode">
  165. <view class="label">优惠码</view>
  166. <view class="value">{{ detail.exchangeCode }}</view>
  167. </view>
  168. </view>
  169. <!-- 底部按钮:待付款 -->
  170. <view class="bottom-container" v-if="detail.orderStatus == 'NOPAY'">
  171. <view class="button gray" @tap="isCancelDialog = true">取消订单</view>
  172. <view class="button red" @tap="submitOrder(detail)">立即付款</view>
  173. </view>
  174. <!-- 底部按钮:待发货 -->
  175. <view class="bottom-container" v-if="detail.orderStatus == 'DFH'">
  176. <view class="button white" @tap="remindShipment">提醒发货</view>
  177. <view
  178. class="button white"
  179. v-if="checkCanReturn(detail.orderShareStatus)"
  180. @tap="toApplyReturn"
  181. >申请售后</view
  182. >
  183. </view>
  184. <!-- 底部按钮:待收货 -->
  185. <view class="bottom-container" v-if="detail.orderStatus == 'YFH'">
  186. <view class="button gray" @tap="toLogistics">查看物流</view>
  187. <view class="button red" @tap="isConfirmDialog = true">确认收货</view>
  188. <view
  189. class="button white"
  190. v-if="checkCanReturn(detail.orderShareStatus)"
  191. @tap="toApplyReturn"
  192. >申请售后</view
  193. >
  194. </view>
  195. <!-- 底部按钮:已完成 -->
  196. <view class="bottom-container" v-if="detail.orderStatus == 'OVER'">
  197. <view class="button gray" @tap="toLogistics">查看物流</view>
  198. <view
  199. class="button gray"
  200. v-if="detail.tax && detail.orderTaxId"
  201. @tap="toInvoiceDetail"
  202. >查看发票</view
  203. >
  204. <view class="button white" v-else @tap="isInvoiceDialog = true"
  205. >申请发票</view
  206. >
  207. <view
  208. class="button white"
  209. v-if="checkCanReturn(detail.orderShareStatus)"
  210. @tap="toApplyReturn"
  211. >申请售后</view
  212. >
  213. <view
  214. class="button red"
  215. v-if="!detail.commentService"
  216. @tap="toEvaluate"
  217. >评价</view
  218. >
  219. </view>
  220. <!-- 底部按钮:售后中 -->
  221. <view class="bottom-container" v-if="isReturnOrder">
  222. <view class="button gray" @tap="toReturnDetail">售后详情</view>
  223. </view>
  224. <!-- 取消订单 -->
  225. <modal-dialog
  226. showText="确定要取消订单吗?"
  227. :isShowDialog="isCancelDialog"
  228. @cancel="isCancelDialog = false"
  229. @confirm="confirmCancelOrder"
  230. ></modal-dialog>
  231. <!-- 确认收货 -->
  232. <modal-dialog
  233. showText="确定要确认收货吗?"
  234. :isShowDialog="isConfirmDialog"
  235. @cancel="isConfirmDialog = false"
  236. @confirm="confirmReceipt"
  237. ></modal-dialog>
  238. <!-- 申请发票 -->
  239. <view class="global-mask" v-show="isInvoiceDialog"></view>
  240. <view
  241. class="invoice-dialog"
  242. v-show="isInvoiceDialog"
  243. @tap="isShowCompanyList = false"
  244. >
  245. <view class="type-c">
  246. <view class="top">
  247. <view class="title">发票类型</view>
  248. <image
  249. src="@/static/icon/close.png"
  250. @tap="isInvoiceDialog = false"
  251. ></image>
  252. </view>
  253. <view class="list">
  254. <view
  255. class="item"
  256. :class="taxType === false ? 'current' : ''"
  257. @tap="taxType = false"
  258. >增值税普通发票</view
  259. >
  260. <view
  261. class="item"
  262. :class="taxType === true ? 'current' : ''"
  263. @tap="
  264. taxType = true;
  265. invoiceHeader = 2;
  266. "
  267. >增值税专用发票</view
  268. >
  269. </view>
  270. </view>
  271. <view class="header-c">
  272. <view class="title">
  273. <view>发票抬头</view>
  274. <view class="button" @tap="getWxInvoice()">获取微信发票</view>
  275. </view>
  276. <view class="list">
  277. <view
  278. class="item"
  279. :class="invoiceHeader == 1 ? 'current' : ''"
  280. @tap="invoiceHeader = 1"
  281. v-if="taxType === false"
  282. >个人</view
  283. >
  284. <view
  285. class="item"
  286. :class="invoiceHeader == 2 ? 'current' : ''"
  287. @tap="invoiceHeader = 2"
  288. >公司</view
  289. >
  290. </view>
  291. <view class="form" v-show="invoiceHeader == 1">
  292. <view class="row">
  293. <view class="label">个人名称</view>
  294. <view class="input"
  295. ><input
  296. type="text"
  297. placeholder="请填写“个人”或您的姓名"
  298. v-model="invoiceForm.personName"
  299. /></view>
  300. </view>
  301. </view>
  302. <view class="form" v-show="invoiceHeader == 2">
  303. <view class="row">
  304. <view class="label">单位名称</view>
  305. <view class="input">
  306. <input
  307. type="text"
  308. placeholder="请填写单位名称"
  309. v-model="invoiceForm.companyName"
  310. @focus="companyFocus"
  311. />
  312. <div class="companyList" v-show="isShowCompanyList">
  313. <block v-for="(item, index) in companyList" :key="index">
  314. <div class="item" @tap="chooseCompany(item)">
  315. {{ item.name }}
  316. </div>
  317. </block>
  318. </div>
  319. </view>
  320. </view>
  321. <view class="row">
  322. <view class="label">纳税人识别号</view>
  323. <view class="input"
  324. ><input
  325. type="text"
  326. placeholder="请填写纳税人识别号"
  327. v-model="invoiceForm.payerNum"
  328. /></view>
  329. </view>
  330. <view class="more" v-if="taxType === false">
  331. <view>更多选填项</view>
  332. <view class="right" v-if="isOpen" @tap="isOpen = !isOpen"
  333. >收起<image src="../../../static/icon/arrow_2.png"></image
  334. ></view>
  335. <view class="right" v-else @tap="isOpen = !isOpen"
  336. >展开<image src="../../../static/icon/arrow_1.png"></image
  337. ></view>
  338. </view>
  339. <block v-if="isOpen">
  340. <view class="row">
  341. <view class="label">注册地址</view>
  342. <view class="input"
  343. ><input
  344. type="text"
  345. placeholder="请填写注册地址"
  346. v-model="invoiceForm.regAddress"
  347. /></view>
  348. </view>
  349. <view class="row">
  350. <view class="label">注册电话</view>
  351. <view class="input"
  352. ><input
  353. type="text"
  354. placeholder="请填写注册电话"
  355. v-model="invoiceForm.regPhone"
  356. /></view>
  357. </view>
  358. <view class="row">
  359. <view class="label">开户银行</view>
  360. <view class="input"
  361. ><input
  362. type="text"
  363. placeholder="请填写开户银行"
  364. v-model="invoiceForm.bank"
  365. /></view>
  366. </view>
  367. <view class="row">
  368. <view class="label">银行帐号</view>
  369. <view class="input"
  370. ><input
  371. type="text"
  372. placeholder="请填写银行帐号"
  373. v-model="invoiceForm.account"
  374. /></view>
  375. </view>
  376. </block>
  377. </view>
  378. </view>
  379. <view class="header-c">
  380. <view class="title">收票人信息</view>
  381. <view class="form">
  382. <view class="row" v-if="taxType === true">
  383. <view class="label">收票人姓名</view>
  384. <view class="input"
  385. ><input
  386. type="text"
  387. placeholder="请填写联系姓名"
  388. v-model="invoiceForm.name"
  389. /></view>
  390. </view>
  391. <view class="row" v-if="taxType === true">
  392. <view class="label">收票人手机</view>
  393. <view class="input"
  394. ><input
  395. type="text"
  396. placeholder="请填写联系手机"
  397. v-model="invoiceForm.phone"
  398. /></view>
  399. </view>
  400. <view class="row">
  401. <view class="label">收票人邮箱</view>
  402. <view class="input"
  403. ><input
  404. type="text"
  405. placeholder="请填写收票邮箱"
  406. v-model="invoiceForm.email"
  407. /></view>
  408. </view>
  409. <view class="row" v-if="taxType === true">
  410. <view class="label">收票人地址</view>
  411. <view class="input"
  412. ><input
  413. type="text"
  414. placeholder="请填写收票地址"
  415. v-model="invoiceForm.address"
  416. /></view>
  417. </view>
  418. </view>
  419. </view>
  420. <view class="content-c">
  421. <view class="title"
  422. >发票内容<text
  423. >发票内容选项已根据税法调整,具体请以实际展示为准</text
  424. ></view
  425. >
  426. <view class="list">
  427. <view class="item">商品内容</view>
  428. </view>
  429. <view class="tips"
  430. >发票内容将显示详情商品名称与价格信息,发票金额为实际支付金额</view
  431. >
  432. <view class="button" @tap="submitInvoice">确定</view>
  433. </view>
  434. </view>
  435. </view>
  436. </block>
  437. <zhifutanchuan
  438. v-if="detail_"
  439. :orderInfo="orderInfo"
  440. @PAY_TYPE_STR="PAY_TYPE_STR"
  441. />
  442. </view>
  443. </template>
  444. <script>
  445. import { mapState } from 'vuex';
  446. import modalDialog from '@/components/modalDialog.vue';
  447. import zhifutanchuan from '@/components/zhifutanchuan.vue';
  448. export default {
  449. components: {
  450. modalDialog,
  451. zhifutanchuan,
  452. },
  453. data() {
  454. return {
  455. detail_: null,
  456. orderInfo: null,
  457. isLoading: true,
  458. noData: true,
  459. orderId: null, // 订单id
  460. orderRefundId: null, // 售后订单id
  461. isReturnOrder: false, // 是否售后订单
  462. detail: {}, // 订单详情
  463. isCancelDialog: false, // 是否显示取消订单弹窗
  464. isConfirmDialog: false, // 是否显示确认收货弹窗
  465. isInvoiceDialog: false, // 是否显示申请发票弹窗
  466. taxType: false,
  467. invoiceHeader: 1, // 发票类型:1个人,2公司
  468. isOpen: false, // 是否展开
  469. invoiceForm: {
  470. // 发票表单数据
  471. // 发票抬头
  472. personName: '', // 个人 - 名称
  473. companyName: '', // 公司 - 名称
  474. payerNum: '', // 公司 - 识别号
  475. regAddress: '', // 公司 - 注册地址
  476. regPhone: '', // 公司 - 注册电话
  477. bank: '', // 公司 - 开户银行
  478. account: '', // 公司 - 银行账号
  479. // 收票人信息
  480. name: '', // 姓名
  481. phone: '', // 手机
  482. email: '', // 邮箱
  483. address: '', // 地址
  484. },
  485. canClickSave: true, // 能否点击提交
  486. logisticsData: [], // 物流信息
  487. hasLogistics: true, // 是否有物流信息
  488. canRemindShipment: true, // 能否点击提醒发货
  489. companyList: [],
  490. isShowCompanyList: false,
  491. isChooseCompany: false,
  492. };
  493. },
  494. computed: {
  495. ...mapState(['userInfo', 'isLogin', 'userId']),
  496. },
  497. watch: {
  498. 'invoiceForm.companyName'() {
  499. if (this.isChooseCompany) {
  500. this.isChooseCompany = false;
  501. return false;
  502. }
  503. this.getCompanyList();
  504. },
  505. taxType() {
  506. if (this.taxType === true) {
  507. this.isOpen = true;
  508. } else {
  509. this.isOpen = false;
  510. }
  511. },
  512. },
  513. onLoad({ orderId, orderRefundId }) {
  514. console.log(orderId, '--------------');
  515. this.orderId = orderId;
  516. if (!!orderRefundId) {
  517. this.isReturnOrder = true;
  518. this.orderRefundId = orderRefundId;
  519. }
  520. this.getOrderDetail();
  521. uni.$on('refreshOrderDetail', (data) => {
  522. if (data) {
  523. this.isReturnOrder = true;
  524. this.orderRefundId = data;
  525. } else {
  526. this.isReturnOrder = false;
  527. this.orderRefundId = null;
  528. }
  529. this.getOrderDetail();
  530. });
  531. },
  532. methods: {
  533. getOrderDetail() {
  534. let url = '',
  535. params = {};
  536. if (this.isReturnOrder) {
  537. url = '/order/refund/detail';
  538. params = {
  539. orderRefundId: this.orderRefundId,
  540. };
  541. } else {
  542. url = '/order/detail';
  543. params = {
  544. orderId: this.orderId,
  545. };
  546. }
  547. console.log(params, '------------------------');
  548. this.$axios({
  549. url,
  550. method: 'get',
  551. params,
  552. })
  553. .then((res) => {
  554. this.noData = false;
  555. this.isLoading = false;
  556. this.detail = res.data;
  557. this.getLogisticsData();
  558. })
  559. .catch((res) => {
  560. this.noData = true;
  561. this.isLoading = false;
  562. });
  563. },
  564. // 检查是否可以申请售后(根据orderShareStatus)
  565. checkCanReturn(status) {
  566. if (!status || status === 'OVER' || status === 'CANCEL') {
  567. return false;
  568. } else {
  569. return true;
  570. }
  571. },
  572. // 获取物流信息
  573. getLogisticsData() {
  574. this.$axios({
  575. url: '/common/express',
  576. method: 'get',
  577. params: {
  578. companyCode: this.detail.companyCode
  579. ? this.detail.companyCode
  580. : 'shunfeng',
  581. logisticsNo: this.detail.logisticsNo,
  582. },
  583. }).then((res) => {
  584. if (res.code == 200 && res.data.length >= 1) {
  585. this.logisticsData = res.data;
  586. } else if (res.code == 1100 || res.data.length < 1) {
  587. this.hasLogistics = false;
  588. }
  589. });
  590. },
  591. // 去商品详情
  592. toGoodsDetail(id) {
  593. uni.navigateTo({
  594. url: '/packageGoods/pages/detail?id=' + id,
  595. });
  596. },
  597. // 确认取消订单
  598. confirmCancelOrder() {
  599. this.$axios({
  600. url: '/order/cancel',
  601. method: 'get',
  602. params: {
  603. orderId: this.orderId,
  604. },
  605. }).then((res) => {
  606. this.getOrderDetail();
  607. this.isCancelDialog = false;
  608. this.$successToast('取消订单成功');
  609. uni.$emit('refreshOrderList');
  610. });
  611. },
  612. // 确认收货
  613. confirmReceipt() {
  614. this.$axios({
  615. url: '/order/ack',
  616. params: {
  617. orderId: this.orderId,
  618. },
  619. }).then((res) => {
  620. this.getOrderDetail();
  621. this.isConfirmDialog = false;
  622. this.$successToast('确认收货成功');
  623. uni.$emit('refreshOrderList');
  624. });
  625. },
  626. PAY_TYPE_STR(ewPam) {
  627. this.payOrder(ewPam);
  628. },
  629. submitOrder(item) {
  630. let that = this;
  631. this.orderInfo = item;
  632. this.detail_ = true;
  633. },
  634. // 立即付款
  635. payOrder(ewPam = {}) {
  636. let that = this;
  637. this.$axios({
  638. url: '/order/wait/pay',
  639. params: {
  640. ...ewPam,
  641. userId: this.userId,
  642. orderId: this.orderInfo.orderId,
  643. },
  644. isLoading: 1,
  645. }).then((res) => {
  646. that.orderId = res.data.id;
  647. if (ewPam.payType == '微信支付') {
  648. uni.getProvider({
  649. service: 'payment',
  650. success: (e) => {
  651. uni.requestPayment({
  652. provider: e.provider[0],
  653. orderInfo: res.data,
  654. timeStamp: res.data.timeStamp,
  655. nonceStr: res.data.nonceStr,
  656. package: res.data.payPackage,
  657. signType: 'MD5',
  658. paySign: res.data.paySign,
  659. success: (payRes) => {
  660. this.detail_ = false;
  661. this.orderInfo = null;
  662. that.getOrderDetail();
  663. that.$successToast('支付成功');
  664. uni.$emit('refreshOrderList');
  665. },
  666. fail: (err) => {
  667. this.detail_ = false;
  668. this.orderInfo = null;
  669. that.$toast('支付失败');
  670. that.getOrderDetail();
  671. uni.$emit('refreshOrderList');
  672. },
  673. });
  674. },
  675. });
  676. } else if (
  677. ewPam.payType == '云闪付' &&
  678. res?.data?.umsMiniRep?.miniPayRequest?.cqpMpAppId
  679. ) {
  680. uni.navigateToMiniProgram({
  681. appId: res.data?.umsMiniRep?.miniPayRequest?.cqpMpAppId,
  682. path: res.data?.umsMiniRep?.miniPayRequest?.cqpMpPath,
  683. success(res) {
  684. uni.onAppShow(({ scene }) => {
  685. if (scene == 1038) {
  686. that.$successToast('支付成功');
  687. }
  688. this.detail_ = false;
  689. this.orderInfo = null;
  690. that.getOrderDetail();
  691. uni.reLaunch({
  692. url: '/pages/mine/order/detail?orderId=' + that.orderId,
  693. });
  694. uni.$emit('refreshOrderList');
  695. uni.offAppShow();
  696. });
  697. },
  698. });
  699. }
  700. });
  701. },
  702. // // 立即付款
  703. // payOrder() {
  704. // let that = this;
  705. // this.$axios({
  706. // url: '/order/wait/pay',
  707. // params: {
  708. // userId: this.userId,
  709. // orderId: this.orderId,
  710. // },
  711. // isLoading: 1,
  712. // }).then((res) => {
  713. // uni.getProvider({
  714. // service: 'payment',
  715. // success: (e) => {
  716. // uni.requestPayment({
  717. // provider: e.provider[0],
  718. // orderInfo: res.data,
  719. // timeStamp: res.data.timeStamp,
  720. // nonceStr: res.data.nonceStr,
  721. // package: res.data.payPackage,
  722. // signType: 'MD5',
  723. // paySign: res.data.paySign,
  724. // success: (res) => {
  725. // that.getOrderDetail();
  726. // that.$successToast('支付成功');
  727. // uni.$emit('refreshOrderList');
  728. // },
  729. // fail: (err) => {
  730. // that.$toast('支付失败');
  731. // },
  732. // });
  733. // },
  734. // });
  735. // });
  736. // },
  737. // 复制
  738. copy(val) {
  739. let that = this;
  740. uni.setClipboardData({
  741. data: val,
  742. success: function () {
  743. that.$successToast('复制成功');
  744. },
  745. });
  746. },
  747. // 验证数据
  748. vailateData() {
  749. // 全状态必填
  750. if (this.invoiceHeader == 1 && !this.invoiceForm.personName) {
  751. this.$toast('请填写您的姓名');
  752. return false;
  753. }
  754. if (this.invoiceHeader == 2 && !this.invoiceForm.companyName) {
  755. this.$toast('请填写单位名称');
  756. return false;
  757. }
  758. if (this.invoiceHeader == 2 && !this.invoiceForm.payerNum) {
  759. this.$toast('请填写纳税人识别号');
  760. return false;
  761. }
  762. // 普票
  763. if (this.taxType === false) {
  764. if (!this.invoiceForm.email) {
  765. this.$toast('请填写收票人邮箱');
  766. return false;
  767. }
  768. }
  769. // 专票
  770. else if (this.taxType === true) {
  771. if (!this.invoiceForm.regAddress) {
  772. this.$toast('请填写注册地址');
  773. return false;
  774. }
  775. if (!this.invoiceForm.regPhone) {
  776. this.$toast('请填写注册电话');
  777. return false;
  778. }
  779. if (!this.invoiceForm.bank) {
  780. this.$toast('请填写开户银行');
  781. return false;
  782. }
  783. if (!this.invoiceForm.account) {
  784. this.$toast('请填写银行账号');
  785. return false;
  786. }
  787. if (!this.invoiceForm.name) {
  788. this.$toast('请填写收票人姓名');
  789. return false;
  790. }
  791. if (!this.invoiceForm.phone) {
  792. this.$toast('请填写收票人手机');
  793. return false;
  794. }
  795. if (!this.invoiceForm.email) {
  796. this.$toast('请填写收票人邮箱');
  797. return false;
  798. }
  799. if (!this.invoiceForm.address) {
  800. this.$toast('请填写收票人地址');
  801. return false;
  802. }
  803. }
  804. return true;
  805. },
  806. // 提交发票
  807. submitInvoice() {
  808. if (!this.canClickSave) return false;
  809. this.canClickSave = false;
  810. setTimeout(() => {
  811. this.canClickSave = true;
  812. }, 3000);
  813. if (!this.vailateData()) return;
  814. let params = {};
  815. if (this.invoiceHeader == 1) {
  816. params = {
  817. type: false,
  818. name: this.invoiceForm.personName,
  819. };
  820. } else {
  821. params = {
  822. type: true,
  823. name: this.invoiceForm.companyName,
  824. taxNo: this.invoiceForm.payerNum,
  825. registerAddress: this.invoiceForm.regAddress,
  826. registerPhone: this.invoiceForm.regPhone,
  827. bank: this.invoiceForm.bank,
  828. account: this.invoiceForm.account,
  829. };
  830. }
  831. params.taxType = this.taxType;
  832. params.content = '商品明细';
  833. params.receiverName = this.invoiceForm.name;
  834. params.receiverPhone = this.invoiceForm.phone;
  835. params.receiverEmail = this.invoiceForm.email;
  836. params.receiverAddress = this.invoiceForm.address;
  837. params.userId = this.userId;
  838. params.orderId = this.orderId;
  839. this.$axios({
  840. url: '/user/order/tax/save',
  841. type: 'application/json',
  842. params,
  843. isLoading: 1,
  844. }).then((res) => {
  845. this.getOrderDetail();
  846. this.$successToast('提交成功');
  847. this.isInvoiceDialog = false;
  848. });
  849. },
  850. // 发票详情
  851. toInvoiceDetail() {
  852. uni.navigateTo({
  853. url: '/pages/mine/order/invoice?id=' + this.detail.orderTaxId,
  854. });
  855. },
  856. // 申请退款
  857. toApplyReturn() {
  858. uni.navigateTo({
  859. url: '/pages/mine/order/return/apply?orderId=' + this.orderId,
  860. });
  861. },
  862. // 去售后详情
  863. toReturnDetail() {
  864. uni.navigateTo({
  865. url:
  866. '/pages/mine/order/return/detail?orderRefundId=' + this.orderRefundId,
  867. });
  868. },
  869. // 去查看物流
  870. toLogistics() {
  871. uni.navigateTo({
  872. url:
  873. '/pages/mine/order/logistics?companyCode=' +
  874. this.detail.companyCode +
  875. '&logisticsNo=' +
  876. this.detail.logisticsNo,
  877. });
  878. },
  879. // 提醒发货
  880. remindShipment() {
  881. if (!this.canRemindShipment) {
  882. return this.$toast('请勿频繁操作');
  883. }
  884. this.canRemindShipment = false;
  885. setTimeout(() => {
  886. this.canRemindShipment = true;
  887. }, 3000);
  888. this.$axios({
  889. url: '/order/notice',
  890. params: {
  891. orderId: this.orderId,
  892. userId: this.userId,
  893. },
  894. }).then((res) => {
  895. this.$successToast('提醒发货成功');
  896. });
  897. },
  898. companyFocus() {
  899. this.getCompanyList();
  900. },
  901. getCompanyList() {
  902. this.$axios({
  903. url: '/user/order/tax/title/list',
  904. method: 'get',
  905. params: {
  906. companyName: this.invoiceForm.companyName,
  907. },
  908. }).then((res) => {
  909. this.companyList = res.data || [];
  910. if (this.companyList.length > 0) {
  911. this.isShowCompanyList = true;
  912. } else {
  913. this.isShowCompanyList = false;
  914. }
  915. });
  916. },
  917. chooseCompany(item) {
  918. this.invoiceForm.companyName = item.name;
  919. this.invoiceForm.payerNum = item.taxId;
  920. this.isChooseCompany = true;
  921. this.isShowCompanyList = false;
  922. },
  923. // 去评价
  924. toEvaluate() {
  925. uni.navigateTo({
  926. url: '/pages/mine/order/evaluate?orderId=' + this.orderId,
  927. });
  928. },
  929. // 获取微信发票
  930. getWxInvoice() {
  931. let that = this;
  932. uni.chooseInvoiceTitle({
  933. success(res) {
  934. if (that.taxType == true && res.type == 1) {
  935. return this.$toast('专票只能选择公司类型');
  936. }
  937. // 个人
  938. if (res.type == 1) {
  939. that.invoiceHeader = 1;
  940. that.invoiceForm.personName = res.title;
  941. }
  942. // 公司
  943. if (res.type == 0) {
  944. that.invoiceHeader = 2;
  945. that.invoiceForm.companyName = res.title;
  946. that.invoiceForm.payerNum = res.taxNumber;
  947. that.invoiceForm.regAddress = res.companyAddress;
  948. that.invoiceForm.regPhone = res.telephone;
  949. that.invoiceForm.bank = res.bankName;
  950. that.invoiceForm.account = res.bankAccount;
  951. }
  952. },
  953. });
  954. },
  955. },
  956. };
  957. </script>
  958. <style lang="scss">
  959. .app-container {
  960. background: #f4f2f2;
  961. box-sizing: border-box;
  962. }
  963. .status-container {
  964. background: #fe781f;
  965. line-height: 80rpx;
  966. text-align: center;
  967. font-size: 32rpx;
  968. color: #ffffff;
  969. }
  970. .card {
  971. background: #ffffff;
  972. border-radius: 20rpx;
  973. margin-bottom: 20rpx;
  974. }
  975. .main-container {
  976. padding: 20rpx 20rpx 120rpx;
  977. }
  978. .logistics-container {
  979. display: flex;
  980. justify-content: space-between;
  981. align-items: center;
  982. padding: 20rpx;
  983. .icon {
  984. width: 52rpx;
  985. height: 52rpx;
  986. border-radius: 50%;
  987. background: linear-gradient(-90deg, #ff4042 0%, #fe781f 100%);
  988. display: flex;
  989. flex-shrink: 0;
  990. justify-content: center;
  991. align-items: center;
  992. margin-right: 20rpx;
  993. image {
  994. width: 28rpx;
  995. height: 28rpx;
  996. }
  997. }
  998. .main {
  999. width: 560rpx;
  1000. font-size: 24rpx;
  1001. line-height: 32rpx;
  1002. }
  1003. .noData {
  1004. font-size: 28rpx;
  1005. color: #666666;
  1006. }
  1007. .right {
  1008. margin-left: 20rpx;
  1009. flex-shrink: 0;
  1010. image {
  1011. width: 16rpx;
  1012. height: 28rpx;
  1013. }
  1014. }
  1015. }
  1016. .address-container {
  1017. display: flex;
  1018. justify-content: space-between;
  1019. align-items: center;
  1020. height: 150rpx;
  1021. padding: 0 20rpx;
  1022. .icon {
  1023. width: 52rpx;
  1024. height: 52rpx;
  1025. border-radius: 50%;
  1026. background: linear-gradient(-90deg, #ff4042 0%, #fe781f 100%);
  1027. display: flex;
  1028. flex-shrink: 0;
  1029. justify-content: center;
  1030. align-items: center;
  1031. margin-right: 20rpx;
  1032. image {
  1033. width: 28rpx;
  1034. height: 36rpx;
  1035. }
  1036. }
  1037. .right {
  1038. width: 600rpx;
  1039. .name {
  1040. font-size: 32rpx;
  1041. color: #333333;
  1042. text {
  1043. font-size: 28rpx;
  1044. color: #999999;
  1045. margin-left: 16rpx;
  1046. }
  1047. }
  1048. .address {
  1049. font-size: 28rpx;
  1050. color: #666666;
  1051. line-height: 34rpx;
  1052. margin-top: 10rpx;
  1053. }
  1054. }
  1055. }
  1056. .goods-container {
  1057. padding: 0 20rpx;
  1058. .title {
  1059. font-size: 32rpx;
  1060. color: #333333;
  1061. line-height: 32rpx;
  1062. padding-top: 20rpx;
  1063. }
  1064. .item {
  1065. padding: 20rpx 0;
  1066. border-bottom: 1px solid #eaeaea;
  1067. display: flex;
  1068. justify-content: space-between;
  1069. align-items: center;
  1070. &:last-child {
  1071. border: none;
  1072. }
  1073. image {
  1074. width: 180rpx;
  1075. height: 180rpx;
  1076. flex-shrink: 0;
  1077. margin-right: 20rpx;
  1078. }
  1079. .right {
  1080. width: 470rpx;
  1081. height: 180rpx;
  1082. display: flex;
  1083. flex-direction: column;
  1084. justify-content: space-between;
  1085. .top {
  1086. .name {
  1087. font-size: 28rpx;
  1088. color: #333333;
  1089. line-height: 36rpx;
  1090. }
  1091. .des {
  1092. font-size: 28rpx;
  1093. color: #999999;
  1094. margin-top: 10rpx;
  1095. }
  1096. }
  1097. .bottom {
  1098. display: flex;
  1099. justify-content: space-between;
  1100. align-items: center;
  1101. .price {
  1102. font-size: 28rpx;
  1103. color: #ff3f42;
  1104. line-height: 28rpx;
  1105. }
  1106. .num {
  1107. font-size: 28rpx;
  1108. color: #333333;
  1109. line-height: 28rpx;
  1110. }
  1111. }
  1112. }
  1113. }
  1114. }
  1115. .peisong-container {
  1116. padding: 0 20rpx;
  1117. font-size: 28rpx;
  1118. color: #333333;
  1119. .top {
  1120. display: flex;
  1121. justify-content: space-between;
  1122. align-items: center;
  1123. height: 88rpx;
  1124. border-bottom: 1px solid #eaeaea;
  1125. }
  1126. .bottom {
  1127. display: flex;
  1128. align-items: center;
  1129. min-height: 88rpx;
  1130. .left {
  1131. margin-right: 40rpx;
  1132. flex-shrink: 0;
  1133. }
  1134. .right {
  1135. padding: 10rpx 0;
  1136. line-height: 32rpx;
  1137. }
  1138. }
  1139. }
  1140. .total-container {
  1141. padding: 0 20rpx;
  1142. font-size: 28rpx;
  1143. color: #333333;
  1144. .top {
  1145. padding: 10rpx 0;
  1146. }
  1147. .item {
  1148. display: flex;
  1149. justify-content: space-between;
  1150. align-items: center;
  1151. height: 64rpx;
  1152. }
  1153. .total {
  1154. display: flex;
  1155. justify-content: flex-end;
  1156. height: 80rpx;
  1157. align-items: center;
  1158. border-top: 1px solid #eaeaea;
  1159. text {
  1160. color: #ff3f42;
  1161. }
  1162. }
  1163. }
  1164. .order-container {
  1165. padding: 20rpx;
  1166. .title {
  1167. font-size: 32rpx;
  1168. color: #333333;
  1169. line-height: 32rpx;
  1170. padding-bottom: 20rpx;
  1171. }
  1172. .item1 {
  1173. display: flex;
  1174. justify-content: space-between;
  1175. align-items: center;
  1176. height: 60rpx;
  1177. .left {
  1178. display: flex;
  1179. .label {
  1180. margin-right: 40rpx;
  1181. flex-shrink: 0;
  1182. }
  1183. }
  1184. .copy {
  1185. color: #fe781f;
  1186. }
  1187. }
  1188. .item2 {
  1189. display: flex;
  1190. align-items: center;
  1191. height: 60rpx;
  1192. .label {
  1193. margin-right: 40rpx;
  1194. flex-shrink: 0;
  1195. }
  1196. }
  1197. }
  1198. .bottom-container {
  1199. position: fixed;
  1200. bottom: 0;
  1201. left: 0;
  1202. width: 100%;
  1203. padding: 0 20rpx;
  1204. box-sizing: border-box;
  1205. height: 100rpx;
  1206. display: flex;
  1207. justify-content: flex-end;
  1208. align-items: center;
  1209. background: #ffffff;
  1210. border-top: 1px solid #f4f2f2;
  1211. .button {
  1212. width: 150rpx;
  1213. height: 56rpx;
  1214. border-radius: 56rpx;
  1215. text-align: center;
  1216. line-height: 56rpx;
  1217. font-size: 28rpx;
  1218. margin-left: 15rpx;
  1219. &:first-child {
  1220. margin-left: 0;
  1221. }
  1222. &.gray {
  1223. color: #999999;
  1224. border: 1px solid #999999;
  1225. }
  1226. &.white {
  1227. color: #ff3f42;
  1228. border: 1px solid #ff3f42;
  1229. }
  1230. &.red {
  1231. color: #ffffff;
  1232. border: 1px solid #ff3f42;
  1233. background: #ff3f42;
  1234. }
  1235. }
  1236. }
  1237. .invoice-dialog {
  1238. position: fixed;
  1239. bottom: 0;
  1240. left: 0;
  1241. width: 100%;
  1242. box-sizing: border-box;
  1243. z-index: 999;
  1244. background: #ffffff;
  1245. border-radius: 20rpx 20rpx 0 0;
  1246. padding: 0 20rpx;
  1247. max-height: 100vh;
  1248. overflow-y: scroll;
  1249. .type-c {
  1250. border-bottom: 1px solid #eaeaea;
  1251. padding-bottom: 20rpx;
  1252. .top {
  1253. display: flex;
  1254. justify-content: space-between;
  1255. align-items: center;
  1256. height: 84rpx;
  1257. .title {
  1258. font-size: 32rpx;
  1259. color: #333333;
  1260. font-weight: 600;
  1261. }
  1262. image {
  1263. width: 31rpx;
  1264. height: 31rpx;
  1265. }
  1266. }
  1267. .list {
  1268. display: flex;
  1269. .item {
  1270. padding: 0 16rpx;
  1271. border: 1px solid #c0c0c0;
  1272. font-size: 24rpx;
  1273. color: #666666;
  1274. border-radius: 6rpx;
  1275. line-height: 48rpx;
  1276. margin-right: 20rpx;
  1277. &.current {
  1278. border: 1px solid #fe781f;
  1279. background: rgba($color: #fe781f, $alpha: 0.3);
  1280. color: #fe781f;
  1281. }
  1282. }
  1283. }
  1284. }
  1285. .header-c {
  1286. border-bottom: 1px solid #eaeaea;
  1287. padding-bottom: 20rpx;
  1288. .title {
  1289. font-size: 32rpx;
  1290. color: #333333;
  1291. font-weight: 600;
  1292. line-height: 84rpx;
  1293. display: flex;
  1294. justify-content: space-between;
  1295. align-items: center;
  1296. .button {
  1297. font-size: 24rpx;
  1298. color: #fe781f;
  1299. border: 1px solid #fe781f;
  1300. border-radius: 6rpx;
  1301. line-height: 48rpx;
  1302. height: 48rpx;
  1303. padding: 0 16rpx;
  1304. font-weight: normal;
  1305. }
  1306. }
  1307. .list {
  1308. display: flex;
  1309. padding-bottom: 20rpx;
  1310. .item {
  1311. width: 120rpx;
  1312. height: 48rpx;
  1313. line-height: 48rpx;
  1314. border-radius: 6rpx;
  1315. text-align: center;
  1316. border: 1px solid #c0c0c0;
  1317. font-size: 24rpx;
  1318. color: #666666;
  1319. margin-right: 20rpx;
  1320. &.current {
  1321. border: 1px solid #ff3f42;
  1322. background: #ff3f42;
  1323. color: #ffffff;
  1324. }
  1325. }
  1326. }
  1327. .form {
  1328. .row {
  1329. display: flex;
  1330. height: 60rpx;
  1331. align-items: center;
  1332. .label {
  1333. width: 200rpx;
  1334. }
  1335. .input {
  1336. width: 510rpx;
  1337. position: relative;
  1338. input {
  1339. width: 100%;
  1340. }
  1341. .companyList {
  1342. position: absolute;
  1343. top: 60rpx;
  1344. left: -20rpx;
  1345. background: #ffffff;
  1346. width: 530rpx;
  1347. z-index: 11;
  1348. border: 1px solid #eaeaea;
  1349. max-height: 400rpx;
  1350. overflow-y: scroll;
  1351. box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.2);
  1352. .item {
  1353. color: #666666;
  1354. padding: 16rpx 20rpx;
  1355. }
  1356. }
  1357. }
  1358. }
  1359. .more {
  1360. display: flex;
  1361. justify-content: space-between;
  1362. align-items: center;
  1363. height: 60rpx;
  1364. .right {
  1365. display: flex;
  1366. align-items: center;
  1367. image {
  1368. width: 20rpx;
  1369. height: 20rpx;
  1370. display: block;
  1371. margin-left: 10rpx;
  1372. }
  1373. }
  1374. }
  1375. }
  1376. }
  1377. .content-c {
  1378. padding-bottom: 40rpx;
  1379. .title {
  1380. font-size: 32rpx;
  1381. color: #333333;
  1382. font-weight: 600;
  1383. line-height: 84rpx;
  1384. text {
  1385. font-size: 22rpx;
  1386. color: #999999;
  1387. margin-left: 10rpx;
  1388. font-weight: normal;
  1389. }
  1390. }
  1391. .list {
  1392. display: flex;
  1393. .item {
  1394. padding: 0 16rpx;
  1395. background: rgba($color: #fe781f, $alpha: 0.3);
  1396. font-size: 24rpx;
  1397. color: #fe781f;
  1398. border-radius: 6rpx;
  1399. line-height: 48rpx;
  1400. }
  1401. }
  1402. .tips {
  1403. font-size: 22rpx;
  1404. color: #999999;
  1405. margin-top: 20rpx;
  1406. }
  1407. .button {
  1408. height: 70rpx;
  1409. line-height: 70rpx;
  1410. border-radius: 70rpx;
  1411. background: linear-gradient(-90deg, #ff3f42 0%, #fe781f 100%);
  1412. text-align: center;
  1413. font-size: 28rpx;
  1414. color: #ffffff;
  1415. margin-top: 20rpx;
  1416. }
  1417. }
  1418. }
  1419. </style>