index.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  1. <template>
  2. <view>
  3. <view class="order-details">
  4. <view class="header" v-if="orderInfo.shippingType === 1">
  5. <view class="picTxt" v-if="orderInfo.status!=6">
  6. <image v-if="!orderInfo.paid" src="@/static/images/shop/daifukuan@2x.png" mode=""></image>
  7. <image v-else-if="orderInfo.status === 0 || orderInfo.status === 1" src="@/static/images/shop/daifahuo@2x.png" mode=""></image>
  8. <image v-else-if="orderInfo.status === 3" src="@/static/images/shop/yiwancheng@2x.png" mode=""></image>
  9. <view class="data">{{ curOrderStepTxt }}</view>
  10. <view class="state">{{ orderInfo.orderStatusMsg }}</view>
  11. </view>
  12. <view class="header-bot">
  13. <image src="@/static/images/shop/dingwei@2x.png" mode=""></image>
  14. <view class="header-bot-right">
  15. <view class="header-bot-address">{{ orderInfo.userAddress }}</view>
  16. <view class="header-bot-name">
  17. <text>{{ orderInfo.realName
  18. }}</text>
  19. <text>{{ orderInfo.userPhone }}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view v-if="!isGoodsReturn">
  25. <view v-if="orderInfo.shippingType == 2 && orderInfo.paid" class="writeOff borRadius14">
  26. <view class="title">核销信息</view>
  27. <view class="grayBg">
  28. <view class="pictrue">
  29. <image :src="codeImg"></image>
  30. </view>
  31. </view>
  32. <view class="gear">
  33. <image src="@/static/images/writeOff.jpg"></image>
  34. </view>
  35. <view class="num">{{ orderInfo.verifyCode }}</view>
  36. <view class="rules" v-if="orderInfo.systemStore">
  37. <view class="item">
  38. <view class="rulesTitle acea-row row-middle">
  39. <text class="iconfont icon-shijian"></text>核销时间
  40. </view>
  41. <view class="info">
  42. 每日:<text class="time">{{
  43. orderInfo.systemStore.dayTime.replace(",", "-")
  44. }}</text>
  45. </view>
  46. </view>
  47. <view class="item">
  48. <view class="rulesTitle acea-row row-middle">
  49. <text class="iconfont icon-shuoming1"></text>使用说明
  50. </view>
  51. <view class="info">可将二维码出示给店员扫描或提供数字核销码</view>
  52. </view>
  53. </view>
  54. </view>
  55. <view v-if="orderInfo.shippingType === 1" class=""></view>
  56. <view v-else class="address" style="margin-top: 15rpx">
  57. <view class="name" @tap="makePhone">{{ orderInfo.systemStore ? orderInfo.systemStore.name : ""
  58. }}<text class="phone">{{
  59. orderInfo.systemStore ? orderInfo.systemStore.phone : ""
  60. }}</text><text class="iconfont icon-tonghua font-color"></text></view>
  61. <view>{{
  62. orderInfo.systemStore ? orderInfo.systemStore.detailedAddress : ""
  63. }}</view>
  64. </view>
  65. </view>
  66. <view class="wrapper">
  67. <orderGoods :mallType="orderInfo.mallType" :evaluate="evaluate" :productType="orderInfo.type"
  68. :orderId="order_id" :ids="id" :uniId="uniId" :cartInfo="cartInfo"
  69. :sbMerchant="orderInfo.sbMerchant"></orderGoods>
  70. <view class="wrapper-return" v-if="
  71. orderInfo.paid === true &&
  72. orderInfo.type !== 1 &&
  73. orderInfo.mallType !== 1 &&
  74. type === 'normal'
  75. ">
  76. <view v-if="orderInfo.status == 3">
  77. <view hover-class="none" @click="changeProduct"
  78. class="cancel" style="margin-right: 10rpx;" v-if="orderInfo.exchangeStatus === 0 && orderInfo.refundStatus === 0 && isGoodsReturn == false">
  79. 申请换货
  80. </view>
  81. <navigator hover-class="none" :url="
  82. '/pages/users/goods_change/index?orderId=' + orderInfo.orderId"
  83. class="cancel" style="margin-right: 10rpx;" v-if="orderInfo.exchangeStatus === 2 && orderInfo.refundStatus === 0 && isGoodsReturn == false">
  84. 退货信息填写
  85. </navigator>
  86. <view hover-class="none"
  87. class="cancel" style="margin-right: 10rpx;" v-if="orderInfo.exchangeStatus === 4 && orderInfo.refundStatus === 0 && isGoodsReturn == false">
  88. 换货中
  89. </view>
  90. <view hover-class="none"
  91. class="cancel" style="margin-right: 10rpx;" v-if="orderInfo.exchangeStatus === 1 && orderInfo.refundStatus === 0 && isGoodsReturn == false">
  92. 换货申请中
  93. </view>
  94. </view>
  95. <navigator hover-class="none" :url="
  96. '/pages/users/goods_return/index?orderId=' + orderInfo.orderId
  97. " class="cancel" v-if="orderInfo.refundStatus === 0 && isGoodsReturn == false && orderInfo.exchangeStatus === 0">
  98. 申请退款
  99. </navigator>
  100. </view>
  101. <view class="wrapper-list">
  102. <view class="item">
  103. <view class="">商品总价</view>
  104. <view class="txt">¥{{ orderInfo.proTotalPrice }}</view>
  105. </view>
  106. <view class="item" v-if="orderInfo.payPostage > 0">
  107. <view class="">运费</view>
  108. <view class="txt">¥{{ orderInfo.payPostage }}</view>
  109. </view>
  110. <view class="item" v-if="orderInfo.payPostage > 0 && orderInfo?.additionalAmount">
  111. <view class="">附加费</view>
  112. <view class="txt">¥{{ orderInfo.additionalAmount }}</view>
  113. </view>
  114. <view class="item" v-if="orderInfo.mallType === 0">
  115. <view class="">会员折扣</view>
  116. <view class="red">-¥{{ orderInfo.vipLevelDis }}</view>
  117. </view>
  118. <view class="item">
  119. <view class="">实付款</view>
  120. <view class="txt">
  121. {{ orderInfo.mallType === 0 ? `¥${orderInfo.payPrice}` : `${ Number(orderInfo.proTotalPrice)}贝币` }}
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="wrapper">
  127. <view class="wrapper-title">订单信息</view>
  128. <view class="item">
  129. <view>订单编号</view>
  130. <view class="conter acea-row row-middle row-right">{{ orderInfo.orderId }}
  131. <!-- #ifndef H5 -->
  132. <text class="copy" @tap="copy">复制</text>
  133. <!-- #endif -->
  134. <!-- #ifdef H5 -->
  135. <text class="copy copy-data" @click="setOrderId">复制</text>
  136. <!-- #endif -->
  137. </view>
  138. </view>
  139. <view class="item">
  140. <view>下单时间</view>
  141. <view class="conter">{{ orderInfo.createTime || 0 }}</view>
  142. </view>
  143. <view class="item">
  144. <view>支付状态</view>
  145. <view class="conter" v-if="orderInfo.paid">已支付</view>
  146. <view class="conter" v-else>未支付</view>
  147. </view>
  148. <view class="item">
  149. <view>支付方式</view>
  150. <view class="conter" v-if="orderInfo.mallType === 0">{{
  151. orderInfo.payTypeStr
  152. }}</view>
  153. <view class="conter" v-else>贝币</view>
  154. </view>
  155. <view class="item" v-if="orderInfo.mark">
  156. <view>买家留言</view>
  157. <view class="conter">{{ orderInfo.mark }}</view>
  158. </view>
  159. </view>
  160. <view class="">
  161. <view class="nav refund" v-if="orderInfo.refundStatus > 0">
  162. <view class="title">
  163. <image src="@/static/images/shuoming.png" mode=""></image>
  164. {{ getRefundStatus() }}
  165. </view>
  166. <view class="con pad30">{{ getRefundReason() }}</view>
  167. </view>
  168. <!-- 退款订单详情 "-->
  169. <view v-if="isGoodsReturn" class="wrapper">
  170. <view class="wrapper-title">退款信息</view>
  171. <view class="item">
  172. <view>收货人</view>
  173. <view class="conter">{{ orderInfo.realName }}</view>
  174. </view>
  175. <view class="item">
  176. <view>联系电话</view>
  177. <view class="conter">{{ orderInfo.userPhone }}</view>
  178. </view>
  179. <view class="item">
  180. <view>收货地址</view>
  181. <view class="conter">{{ orderInfo.userAddress }}</view>
  182. </view>
  183. <view class="item">
  184. <view>退款快递单号</view>
  185. <view class="conter">{{ orderInfo.refundExpressNum }}</view>
  186. </view>
  187. </view>
  188. <view v-if="orderInfo.status > 0">
  189. <view class="wrapper" v-if="orderInfo.deliveryType == 'express'">
  190. <view class="wrapper-title">物流信息</view>
  191. <view class="item">
  192. <view>配送方式</view>
  193. <view class="conter">发货</view>
  194. </view>
  195. <view class="item">
  196. <view>快递公司</view>
  197. <view class="conter">{{ orderInfo.deliveryName || "" }}</view>
  198. </view>
  199. <view class="item">
  200. <view>快递号</view>
  201. <view class="conter">{{ orderInfo.deliveryId || "" }}</view>
  202. </view>
  203. </view>
  204. <view class="wrapper" v-else-if="orderInfo.deliveryType == 'send'">
  205. <view class="item acea-row row-between">
  206. <view>配送方式:</view>
  207. <view class="conter">送货</view>
  208. </view>
  209. <view class="item acea-row row-between">
  210. <view>配送人姓名:</view>
  211. <view class="conter">{{ orderInfo.deliveryName || "" }}</view>
  212. </view>
  213. <view class="item acea-row row-between">
  214. <view>联系电话:</view>
  215. <view class="conter acea-row row-middle row-right">{{ orderInfo.deliveryId || ""
  216. }}<text class="copy" @tap="goTel">拨打</text></view>
  217. </view>
  218. </view>
  219. <view class="wrapper borRadius14" v-else-if="orderInfo.deliveryType == 'fictitious'">
  220. <view class="item acea-row row-between">
  221. <view>虚拟发货:</view>
  222. <view class="conter">已发货,请注意查收</view>
  223. </view>
  224. </view>
  225. </view>
  226. </view>
  227. </view>
  228. <!-- && orderInfo.status != 0 -->
  229. <template v-if="isGoodsReturn == false && orderInfo.status != 0 || orderInfo.status == 0 && !orderInfo.paid">
  230. <view class="kong"></view>
  231. <view class="footer" v-if="orderInfo.status!=6">
  232. <view class="footer-box">
  233. <view class="qs-btn" v-if="!orderInfo.paid" @click.stop="cancelOrder">
  234. <image src="@/static/images/shop/closeOrder@2x.png" mode=""></image>
  235. <view class="">取消订单</view>
  236. </view>
  237. <view class="buyPlay" v-if="!orderInfo.paid" @tap="pay_open(orderInfo.orderId)">
  238. <view class="buyPlay-left">
  239. <view class="buyPlay-left-top">
  240. <text>合计:</text>
  241. <text>{{ orderInfo.mallType === 0 ? `¥${orderInfo.payPrice}` : `${ Number(orderInfo.proTotalPrice)}贝币` }}</text>
  242. </view>
  243. <view class="buyPlay-left-bot" v-if="orderInfo.mallType === 0">共减¥{{ orderInfo.vipLevelDis }}</view>
  244. </view>
  245. <view class="buyPlay-btn">立即付款</view>
  246. </view>
  247. <view class="qs-btn" v-if="orderInfo.status == 3" @tap="delOrder">
  248. <image src="@/static/images/shop/delorder@2x.png" mode=""></image>
  249. <view class="">删除订单</view>
  250. </view>
  251. <navigator class="wuliu align-center" v-if="orderInfo.deliveryType == 'express' && orderInfo.status > 0"
  252. hover-class="none" :url="`/pages/users/goods_logistics/index?orderId=${orderInfo.orderId}`">查看物流
  253. </navigator>
  254. <view class="wuliu align-center buy" v-if="orderInfo.status == 3 && orderInfo.type !== 1" @click="goOrderConfirm">再次购买
  255. </view>
  256. <view class="align-center shouhuo" v-if="orderInfo.status == 1" @tap="confirmOrder" style="width: 100%;">确认收货</view>
  257. </view>
  258. </view>
  259. </template>
  260. <payment :payMode="payMode" :showPopup="showPopup" @payComplete="payComplete" @close="payClose"
  261. :order_id="pay_order_id" :totalPrice="totalPrice" :mallType="orderInfo.mallType"></payment>
  262. <!-- 申请换货弹窗-->
  263. <up-popup :show="changeProductShow" @close="changeProductShow = false" closeable>
  264. <view class="changeProductReasonPopup">
  265. <view class="title">理由</view>
  266. <up-textarea class="text-area" v-model="changeProductReason" placeholder="请输入换货理由" ></up-textarea>
  267. <view class="btnView">
  268. <button class="sure" @click="changeProductSure">确定</button>
  269. <button class="cancel" @click="changeProductShow = false">取消</button>
  270. </view>
  271. </view>
  272. </up-popup>
  273. </view>
  274. </template>
  275. <script setup>
  276. import {
  277. ref,
  278. reactive,
  279. computed
  280. } from "vue";
  281. import {
  282. useAppStore
  283. } from "@/stores/app.js";
  284. import {
  285. onLoad,
  286. onShow,
  287. onHide
  288. } from "@dcloudio/uni-app";
  289. import {
  290. getOrderDetail,
  291. orderTake,
  292. orderDel,
  293. orderCancel,
  294. qrcodeApi,
  295. applyExchange
  296. } from "@/api/order.js";
  297. import {
  298. openOrderRefundSubscribe
  299. } from "@/utils/SubscribeMessage.js";
  300. import payment from "@/components/payment";
  301. import orderGoods from "@/components/orderGoods";
  302. import {
  303. toLogin
  304. } from "@/libs/login.js";
  305. import {
  306. useToast
  307. } from "@/hooks/useToast";
  308. import {
  309. getPreOrder
  310. } from "@/libs/order";
  311. const appStore = useAppStore();
  312. const {
  313. Toast
  314. } = useToast();
  315. const codeImg = ref("");
  316. const order_id = ref("");
  317. const evaluate = ref(0);
  318. const cartInfo = ref([]);
  319. const orderInfo = reactive({
  320. systemStore: {},
  321. pstatus: {},
  322. });
  323. const system_store = ref({});
  324. const isGoodsReturn = ref(false);
  325. const status = ref({});
  326. const isClose = ref(false);
  327. const payMode = ref([
  328. // {
  329. // name: "支付宝支付",
  330. // icon: "icon-zhifubao",
  331. // value: "alipay",
  332. // title: "支付宝快捷支付",
  333. // payChannel: "appAliPay",
  334. // },
  335. // {
  336. // name: "微信支付",
  337. // icon: "icon-wechat",
  338. // value: "weixin",
  339. // title: "微信快捷支付",
  340. // payChannel: "weixinApp",
  341. // },
  342. {
  343. name: "余额支付",
  344. icon: "icon-balance",
  345. value: "yue",
  346. title: "可用余额:",
  347. payChannel: "yue",
  348. number: 0,
  349. },
  350. ]);
  351. const showPopup = ref(false);
  352. const pay_order_id = ref("");
  353. const totalPrice = ref("0");
  354. const id = ref(0);
  355. const uniId = ref("");
  356. const type = ref("normal");
  357. const changeProductShow = ref(false);
  358. const changeProductReason = ref('');
  359. function payComplete() {
  360. showPopup.value = false;
  361. pay_order_id.value = "";
  362. getOrderInfo();
  363. }
  364. function openSubcribe(page) {
  365. uni.showLoading({
  366. title: "正在加载"
  367. });
  368. openOrderRefundSubscribe()
  369. .then(() => {
  370. uni.hideLoading();
  371. uni.navigateTo({
  372. url: page
  373. });
  374. })
  375. .catch(() => {
  376. uni.hideLoading();
  377. });
  378. }
  379. function makePhone() {
  380. uni.makePhoneCall({
  381. phoneNumber: system_store.value.phone,
  382. });
  383. }
  384. function payClose() {
  385. showPopup.value = false;
  386. }
  387. function pay_open() {
  388. showPopup.value = true;
  389. pay_order_id.value = orderInfo.orderId;
  390. totalPrice.value = orderInfo.payPrice;
  391. }
  392. function getRefundStatus() {
  393. const statusMap = {
  394. 1: "商家审核中",
  395. 2: "商家已退款",
  396. 3: "商家退款中",
  397. };
  398. return orderInfo?.refundStatus ? statusMap[orderInfo.refundStatus] : "";
  399. }
  400. function getRefundReason() {
  401. if (orderInfo.refundStatus == 1) {
  402. return "您已成功发起退款申请,请耐心等待商家处理;退款前请与商家协商一致,有助于更好的处理售后问题";
  403. } else if (orderInfo.refundStatus == 2) {
  404. return "退款已成功受理,如商家已寄出商品请尽快退回;感谢您的支持";
  405. } else if (orderInfo?.refundReason) {
  406. return "拒绝原因:" + orderInfo?.refundReason;
  407. }
  408. }
  409. // 订单步骤配置
  410. const orderSteps = ref([{
  411. title: "待付款"
  412. },
  413. {
  414. title: "待发货"
  415. },
  416. {
  417. title: "待收货"
  418. },
  419. {
  420. title: "已完成"
  421. },
  422. ]);
  423. // 当前的订单状态
  424. const curOrderStep = computed(() => {
  425. let step = 0;
  426. if (!orderInfo.paid) {
  427. step = 0; // 待付款
  428. } else if (orderInfo.status === 0) {
  429. step = 1; // 待发货
  430. } else if (orderInfo.status === 1) {
  431. step = 2; // 待收货
  432. } else if (orderInfo.status === 2 || orderInfo.status === 3) {
  433. step = 3; // 已完成
  434. }
  435. return step;
  436. });
  437. // 当前的订单状态
  438. const curOrderStepTxt = computed(() => {
  439. let step = '';
  440. if (!orderInfo.paid) {
  441. step = '待付款'; // 待付款
  442. } else if (orderInfo.status === 0) {
  443. step = '待发货'; // 待发货
  444. } else if (orderInfo.status === 1) {
  445. step = '待收货'; // 待收货
  446. } else if (orderInfo.status === 2 || orderInfo.status === 3) {
  447. step = '已完成'; // 已完成
  448. }
  449. return step;
  450. });
  451. function getOrderInfo() {
  452. uni.showLoading({
  453. title: "正在加载中"
  454. });
  455. getOrderDetail(order_id.value)
  456. .then((res) => {
  457. uni.hideLoading();
  458. Object.assign(orderInfo, res.data);
  459. evaluate.value = res.data.status == 2 ? 2 : 0;
  460. system_store.value = res.data.systemStore;
  461. id.value = res.data.id;
  462. cartInfo.value = res.data.orderInfoList;
  463. if (res.data.refundStatus != 0) isGoodsReturn.value = true;
  464. if (orderInfo.shippingType == 2 && orderInfo.paid)
  465. markCode(res.data.verifyCode);
  466. if (orderInfo.refundStatus > 0) {
  467. // uni.setNavigationBarColor({
  468. // frontColor: "#ffffff",
  469. // backgroundColor: "#666666",
  470. // });
  471. }
  472. })
  473. .catch((err) => {
  474. uni.hideLoading();
  475. Toast({
  476. title: err
  477. }, "/pages/users/order_list/index");
  478. });
  479. }
  480. function markCode(text) {
  481. qrcodeApi({
  482. height: "145",
  483. text: text,
  484. width: "145",
  485. }).then((res) => {
  486. codeImg.value = res.data.code;
  487. });
  488. }
  489. // #ifndef H5
  490. function copy() {
  491. uni.setClipboardData({
  492. data: orderInfo.orderId,
  493. });
  494. }
  495. // #endif
  496. function goTel() {
  497. uni.makePhoneCall({
  498. phoneNumber: orderInfo.deliveryId,
  499. });
  500. }
  501. function getOrderStatus() {
  502. let _orderInfo = orderInfo || {},
  503. _status = _orderInfo.pstatus || {
  504. type: 0
  505. },
  506. _statusObj = {};
  507. let typeVal = parseInt(_status.type),
  508. delivery_type = _orderInfo.deliveryType,
  509. seckill_id = _orderInfo.seckillId ? parseInt(_orderInfo.seckillId) : 0,
  510. bargain_id = _orderInfo.bargainId ? parseInt(_orderInfo.bargainId) : 0,
  511. combination_id = _orderInfo.combinationId ?
  512. parseInt(_orderInfo.combinationId) :
  513. 0;
  514. _statusObj = {
  515. type: typeVal == 9 ? -9 : typeVal,
  516. class_status: 0,
  517. };
  518. if (typeVal == 1 && combination_id > 0) _statusObj.class_status = 1;
  519. if (typeVal == 2 && delivery_type == "express") _statusObj.class_status = 2;
  520. if (typeVal == 2) _statusObj.class_status = 3;
  521. if (typeVal == 4 || typeVal == 0) _statusObj.class_status = 4;
  522. if (
  523. !seckill_id &&
  524. !bargain_id &&
  525. !combination_id &&
  526. (typeVal == 3 || typeVal == 4)
  527. )
  528. _statusObj.class_status = 5;
  529. status.value = _statusObj;
  530. }
  531. function goJoinPink() {
  532. uni.navigateTo({
  533. url: "/pages/activity/goods_combination_status/index?id=" + orderInfo.pinkId,
  534. });
  535. }
  536. function goOrderConfirm() {
  537. const params = {
  538. mallType: orderInfo.mallType,
  539. preOrderType: "again",
  540. orderDetails: [{
  541. orderNo: order_id.value
  542. }],
  543. };
  544. getPreOrder(params);
  545. }
  546. function confirmOrder() {
  547. uni.showModal({
  548. title: "确认收货",
  549. content: "为保障权益,请收到货确认无误后,再确认收货",
  550. success: function(res) {
  551. if (res.confirm) {
  552. orderTake(id.value)
  553. .then(() => {
  554. Toast({
  555. title: "操作成功",
  556. icon: "success"
  557. }, function() {
  558. getOrderInfo();
  559. });
  560. })
  561. .catch((err) => {
  562. Toast({
  563. title: err
  564. });
  565. });
  566. }
  567. },
  568. });
  569. }
  570. function delOrder() {
  571. orderDel(id.value)
  572. .then(() => {
  573. Toast({
  574. title: "删除成功",
  575. icon: "success"
  576. }, {
  577. tab: 3,
  578. url: 1
  579. });
  580. })
  581. .catch((err) => {
  582. Toast({
  583. title: err
  584. });
  585. });
  586. }
  587. function cancelOrder() {
  588. uni.showModal({
  589. title: "提示",
  590. content: "确认取消该订单?",
  591. success: function(res) {
  592. if (res.confirm) {
  593. orderCancel(orderInfo.id)
  594. .then(() => {
  595. Toast({
  596. title: "取消成功"
  597. });
  598. uni.navigateTo({
  599. url: "/pages/order_list/index"
  600. });
  601. })
  602. .catch((err) => {
  603. Toast({
  604. title: err
  605. });
  606. getOrderInfo();
  607. });
  608. }
  609. },
  610. });
  611. }
  612. // 生命周期
  613. onLoad((options) => {
  614. type.value =
  615. options.type == undefined || options.type == null ? "normal" : options.type;
  616. if (!options.order_id && !options.uniId) {
  617. Toast({
  618. title: "缺少参数"
  619. }, {
  620. tab: 3,
  621. url: 1
  622. });
  623. return;
  624. }
  625. order_id.value = options.order_id;
  626. });
  627. onShow(() => {
  628. if (appStore.isLogin) {
  629. getOrderInfo();
  630. payMode.value[0].number = appStore.$userInfo.nowMoney;
  631. payMode.value = [...payMode.value];
  632. } else {
  633. toLogin();
  634. }
  635. });
  636. onHide(() => {
  637. isClose.value = true;
  638. });
  639. const setOrderId = () => {
  640. uni.setClipboardData({
  641. data: orderInfo.orderId,
  642. success: function() {
  643. Toast({
  644. title: "复制成功"
  645. });
  646. },
  647. });
  648. };
  649. // 申请换货
  650. const changeProduct = () => {
  651. changeProductShow.value = true;
  652. changeProductReason.value = '';
  653. }
  654. // 换货申请确认
  655. const changeProductSure = async () => {
  656. if(!changeProductReason.value){
  657. uni.showToast({title:"请输入换货理由",icon:'none'});
  658. return;
  659. }
  660. let obj = {
  661. text:changeProductReason.value,
  662. uni:orderInfo.orderId
  663. }
  664. const res = await applyExchange(obj);
  665. if(res.code == 200){
  666. changeProductShow.value = false;
  667. getOrderInfo();
  668. payMode.value[0].number = appStore.$userInfo.nowMoney;
  669. payMode.value = [...payMode.value];
  670. }
  671. }
  672. </script>
  673. <style>
  674. page {
  675. background: #F9F7F0;
  676. }
  677. </style>
  678. <style scoped lang="scss">
  679. .order-details {
  680. padding: 16rpx;
  681. .header {
  682. padding: 16rpx;
  683. border-radius: 16rpx;
  684. background: #FFFFFF;
  685. .picTxt {
  686. margin-bottom: 16rpx;
  687. display: flex;
  688. font-size: 28rpx;
  689. align-items: center;
  690. image {
  691. width: 40rpx;
  692. height: 40rpx;
  693. }
  694. .data {
  695. margin: 0 8rpx;
  696. color: #F8C008;
  697. font-weight: bold;
  698. }
  699. }
  700. .header-bot {
  701. display: flex;
  702. color: #333333;
  703. font-size: 28rpx;
  704. .header-bot-right {
  705. flex: 1;
  706. }
  707. image {
  708. width: 40rpx;
  709. height: 40rpx;
  710. margin-right: 8rpx;
  711. }
  712. .header-bot-address {
  713. font-weight: bold;
  714. }
  715. .header-bot-name {
  716. text {
  717. &:first-child {
  718. margin-right: 32rpx;
  719. }
  720. }
  721. }
  722. }
  723. }
  724. .nav {
  725. background-color: #fff;
  726. font-size: 26rpx;
  727. color: #282828;
  728. padding: 27rpx 0;
  729. width: 100%;
  730. border-radius: 14rpx;
  731. }
  732. .address {
  733. font-size: 26rpx;
  734. color: #868686;
  735. background-color: #fff;
  736. margin-top: 15rpx;
  737. padding: 30rpx 24rpx;
  738. .name {
  739. font-size: 30rpx;
  740. color: #282828;
  741. margin-bottom: 15rpx;
  742. .phone {
  743. margin-left: 40rpx;
  744. }
  745. .iconfont {
  746. font-size: 34rpx;
  747. margin-left: 10rpx;
  748. }
  749. }
  750. }
  751. .line {
  752. width: 100%;
  753. height: 3rpx;
  754. image {
  755. width: 100%;
  756. height: 100%;
  757. display: block;
  758. }
  759. }
  760. .wrapper {
  761. background-color: #FFFFFF;
  762. margin-top: 16rpx;
  763. padding: 16rpx;
  764. border-radius: 16rpx;
  765. .wrapper-return {
  766. display: flex;
  767. margin-top: 16rpx;
  768. justify-content: flex-end;
  769. .cancel {
  770. color: #333333;
  771. width: 190rpx;
  772. height: 60rpx;
  773. display: flex;
  774. align-items: center;
  775. justify-content: center;
  776. font-size: 28rpx;
  777. background: #F1F3F8;
  778. border-radius: 8rpx;
  779. }
  780. }
  781. .wrapper-title {
  782. color: #333333;
  783. font-size: 32rpx;
  784. font-weight: bold;
  785. }
  786. .item {
  787. font-size: 28rpx;
  788. color: #666666;
  789. display: flex;
  790. margin-top: 16rpx;
  791. justify-content: space-between;
  792. view {
  793. &:last-child {
  794. color: #333333;
  795. }
  796. &.red {
  797. color: #FD5F3C;
  798. font-weight: bold;
  799. }
  800. &.txt {
  801. font-weight: bold;
  802. }
  803. }
  804. .conter {
  805. flex: 1;
  806. text-align:right;
  807. margin-left: 16rpx;
  808. .copy {
  809. font-size: 28rpx;
  810. color: #F8C008;
  811. font-weight: bold;
  812. margin-left: 8rpx;
  813. padding-left: 8rpx;
  814. border-left: 2rpx solid #D8D8D8;
  815. }
  816. }
  817. }
  818. .actualPay {
  819. border-top: 1rpx solid #eee;
  820. margin-top: 30rpx;
  821. padding-top: 30rpx;
  822. .money {
  823. font-weight: bold;
  824. font-size: 30rpx;
  825. }
  826. }
  827. }
  828. .writeOff {
  829. background-color: #fff;
  830. margin-top: 15rpx;
  831. padding-bottom: 50rpx;
  832. .title {
  833. font-size: 30rpx;
  834. color: #282828;
  835. height: 87rpx;
  836. border-bottom: 1px solid #f0f0f0;
  837. padding: 0 24rpx;
  838. line-height: 87rpx;
  839. }
  840. .grayBg {
  841. background-color: #f2f5f7;
  842. width: 590rpx;
  843. height: 384rpx;
  844. border-radius: 20rpx 20rpx 0 0;
  845. margin: 50rpx auto 0 auto;
  846. padding-top: 55rpx;
  847. .pictrue {
  848. width: 290rpx;
  849. height: 290rpx;
  850. margin: 0 auto;
  851. image {
  852. width: 100%;
  853. height: 100%;
  854. display: block;
  855. }
  856. }
  857. }
  858. .gear {
  859. width: 590rpx;
  860. height: 30rpx;
  861. margin: 0 auto;
  862. image {
  863. width: 100%;
  864. height: 100%;
  865. display: block;
  866. }
  867. }
  868. .num {
  869. background-color: #f0c34c;
  870. width: 590rpx;
  871. height: 84rpx;
  872. color: #282828;
  873. font-size: 48rpx;
  874. margin: 0 auto;
  875. border-radius: 0 0 20rpx 20rpx;
  876. text-align: center;
  877. padding-top: 4rpx;
  878. }
  879. .rules {
  880. margin: 46rpx 30rpx 0 30rpx;
  881. border-top: 1px solid #f0f0f0;
  882. padding-top: 10rpx;
  883. .item {
  884. margin-top: 20rpx;
  885. .rulesTitle {
  886. font-size: 28rpx;
  887. color: #282828;
  888. .iconfont {
  889. font-size: 30rpx;
  890. color: #333;
  891. margin-right: 8rpx;
  892. margin-top: 5rpx;
  893. }
  894. }
  895. .info {
  896. font-size: 28rpx;
  897. color: #999;
  898. margin-top: 7rpx;
  899. .time {
  900. margin-left: 20rpx;
  901. }
  902. }
  903. }
  904. }
  905. }
  906. .map {
  907. height: 86rpx;
  908. font-size: 30rpx;
  909. color: #282828;
  910. line-height: 86rpx;
  911. border-bottom: 1px solid #f0f0f0;
  912. margin-top: 15rpx;
  913. background-color: #fff;
  914. padding: 0 24rpx;
  915. .place {
  916. font-size: 26rpx;
  917. width: 176rpx;
  918. height: 50rpx;
  919. border-radius: 25rpx;
  920. line-height: 50rpx;
  921. text-align: center;
  922. .iconfont {
  923. font-size: 27rpx;
  924. height: 27rpx;
  925. line-height: 27rpx;
  926. margin: 2rpx 3rpx 0 0;
  927. }
  928. }
  929. }
  930. .refund {
  931. padding: 0 !important;
  932. margin-top: 15rpx;
  933. background-color: #fff;
  934. .title {
  935. display: flex;
  936. align-items: center;
  937. font-size: 30rpx;
  938. color: #333;
  939. height: 86rpx;
  940. border-bottom: 1px solid #f5f5f5;
  941. font-weight: 400;
  942. padding: 0 24rpx;
  943. image {
  944. width: 32rpx;
  945. height: 32rpx;
  946. margin-right: 10rpx;
  947. }
  948. }
  949. .con {
  950. font-size: 25rpx;
  951. color: #666666;
  952. padding: 30rpx 24rpx;
  953. }
  954. }
  955. }
  956. .goodCall {
  957. color: $theme-color;
  958. text-align: center;
  959. width: 100%;
  960. height: 86rpx;
  961. padding: 0 30rpx;
  962. border-bottom: 1rpx solid #eee;
  963. font-size: 30rpx;
  964. line-height: 86rpx;
  965. background: #fff;
  966. .icon-kefu {
  967. font-size: 36rpx;
  968. margin-right: 15rpx;
  969. }
  970. /* #ifdef MP */
  971. button {
  972. display: flex;
  973. align-items: center;
  974. justify-content: center;
  975. height: 86rpx;
  976. font-size: 30rpx;
  977. color: $theme-color;
  978. }
  979. /* #endif */
  980. }
  981. .kong {
  982. height: calc(132rpx + constant(safe-area-inset-bottom));
  983. height: calc(132rpx + env(safe-area-inset-bottom));
  984. }
  985. .footer {
  986. position: fixed;
  987. bottom: 0;
  988. width: 100%;
  989. padding-bottom: constant(safe-area-inset-bottom);
  990. padding-bottom: env(safe-area-inset-bottom);
  991. z-index: 9;
  992. background: #FFFFFF;
  993. box-shadow: inset 0rpx 1rpx 0rpx 0rpx #F1F3F8;
  994. .footer-box {
  995. display: flex;
  996. align-items: center;
  997. justify-content: space-between;
  998. padding: 22rpx 32rpx;
  999. padding: 22rpx 32rpx;
  1000. }
  1001. .qs-btn {
  1002. display: flex;
  1003. align-items: center;
  1004. justify-content: center;
  1005. flex-direction: column;
  1006. image {
  1007. width: 40rpx;
  1008. height: 40rpx;
  1009. }
  1010. view {
  1011. color: #333333;
  1012. font-size: 20rpx;
  1013. line-height: 36rpx;
  1014. }
  1015. }
  1016. .buyPlay {
  1017. display: flex;
  1018. align-items: center;
  1019. .buyPlay-left {
  1020. text-align: right;
  1021. .buyPlay-left-top {
  1022. text {
  1023. color: #333333;
  1024. font-size: 24rpx;
  1025. font-weight: bold;
  1026. &:last-child {
  1027. color: #FD5F3C;
  1028. }
  1029. }
  1030. }
  1031. .buyPlay-left-bot {
  1032. color: #FD5F3C;
  1033. font-size: 24rpx;
  1034. line-height: 40rpx;
  1035. }
  1036. }
  1037. .buyPlay-btn {
  1038. color: #333333;
  1039. width: 224rpx;
  1040. height: 88rpx;
  1041. display: flex;
  1042. font-size: 32rpx;
  1043. font-weight: bold;
  1044. align-items: center;
  1045. justify-content: center;
  1046. background: #F8C008;
  1047. border-radius: 16rpx;
  1048. margin-left: 16rpx;
  1049. }
  1050. }
  1051. .wuliu {
  1052. width: 252rpx;
  1053. background: rgba(248,192,8,0.1);
  1054. }
  1055. .shouhuo {
  1056. width: 418rpx;
  1057. background: #F8C008;
  1058. }
  1059. .align-center {
  1060. height: 88rpx;
  1061. border-radius: 16rpx;
  1062. color: #333333;
  1063. font-size: 32rpx;
  1064. font-weight: bold;
  1065. display: flex;
  1066. align-items: center;
  1067. justify-content: center;
  1068. }
  1069. .buy {
  1070. background: #F8C008;
  1071. }
  1072. }
  1073. .changeProductReasonPopup{
  1074. padding: 20rpx;
  1075. box-sizing: border-box;
  1076. .title{
  1077. font-size: 28rpx;
  1078. color: #333;
  1079. text-align: center;
  1080. padding: 10rpx 20rpx;
  1081. }
  1082. .text-area{
  1083. border: 2rpx solid #dedede;
  1084. border-radius: 20rpx;
  1085. padding: 20rpx;
  1086. margin-top: 20rpx;
  1087. }
  1088. .btnView{
  1089. display: flex;
  1090. width: 100%;
  1091. gap: 20rpx;
  1092. align-items: center;
  1093. justify-content: center;
  1094. margin-top: 40rpx;
  1095. .sure{
  1096. background: #F8C008;
  1097. color: #fff;
  1098. width: 200rpx;
  1099. height: 60rpx;
  1100. line-height: 60rpx;
  1101. }
  1102. .cancel{
  1103. background-color: #F1F3F8;
  1104. color: #333333;
  1105. width: 200rpx;
  1106. height: 60rpx;
  1107. line-height: 60rpx;
  1108. }
  1109. }
  1110. }
  1111. </style>