index.vue 28 KB

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