detail.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <!-- 售后详情 -->
  2. <template>
  3. <s-layout title="售后详情" :navbar="!isEmpty(state.info) && state.loading ? 'inner' : 'normal'">
  4. <view class="content_box" v-if="!isEmpty(state.info) && state.loading">
  5. <!-- 步骤条 -->
  6. <!-- 这个没找到替换方案 -->
  7. <view class="steps-box ss-flex" :style="[
  8. {
  9. marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
  10. paddingTop: Number(statusBarHeight + 88) + 'rpx',
  11. },
  12. ]">
  13. <!-- <uni-steps :options="state.list" :active="state.active" active-color="#fff" /> -->
  14. <view class="ss-flex">
  15. <view class="steps-item" v-for="(item, index) in state.list" :key="index">
  16. <view class="ss-flex">
  17. <text class="sicon-circleclose" v-if="
  18. (state.list.length - 1 == index && state.info.aftersale_status === -2) ||
  19. (state.list.length - 1 == index && state.info.aftersale_status === -1)
  20. "></text>
  21. <text class="sicon-circlecheck" v-else
  22. :class="state.active >= index ? 'activity-color' : 'info-color'"></text>
  23. <view v-if="state.list.length - 1 != index" class="line"
  24. :class="state.active >= index ? 'activity-bg' : 'info-bg'"></view>
  25. </view>
  26. <view class="steps-item-title" :class="state.active >= index ? 'activity-color' : 'info-color'">
  27. {{ item.title }}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 服务状态 -->
  33. <!-- <view class="status-box ss-flex ss-col-center ss-row-between ss-m-x-20"
  34. @tap="sheep.$router.go('/pages/order/aftersale/log', { id: state.aftersaleId })">
  35. <view class="">
  36. <view class="status-text">{{ state.info.aftersale_status_desc }}</view>
  37. <view class="status-time">{{ state.info.update_time }}</view>
  38. </view>
  39. <text class="ss-iconfont _icon-forward" style="color: #666"></text>
  40. </view> -->
  41. <!-- 退款金额 -->
  42. <view class="aftersale-money ss-flex ss-col-center ss-row-between">
  43. <view class="aftersale-money--title">退款总额</view>
  44. <view class="aftersale-money--num">¥{{ state.info.refundPrice/100 }}</view>
  45. </view>
  46. <!-- 服务商品 -->
  47. <view class="order-shop">
  48. <!-- <s-goods-item :title="state.info.goods_title" :price="state.info.goods_price"
  49. :img="state.info.goods_image" priceColor="#333333" :titleWidth="480"
  50. :skuText="state.info.goods_sku_text" :num="state.info.goods_num"></s-goods-item> -->
  51. <s-goods-item :img=" state.info.picUrl" :title=" state.info.spuName" priceColor="#333333"
  52. :titleWidth="480" :skuText=" state.info.properties.reduce((a,b)=>a+b.valueName+' ','')"
  53. :price=" state.info.refundPrice/100" :num=" state.info.count"></s-goods-item>
  54. </view>
  55. <!-- 服务内容 -->
  56. <view class="aftersale-content">
  57. <view class="aftersale-item ss-flex ss-col-center">
  58. <view class="item-title">服务单号:</view>
  59. <view class="item-content ss-m-r-16">{{ state.info.no }}</view>
  60. <button class="ss-reset-button copy-btn" @tap="onCopy">复制</button>
  61. </view>
  62. <view class="aftersale-item ss-flex ss-col-center">
  63. <view class="item-title">申请时间:</view>
  64. <view class="item-content">
  65. {{ sheep.$helper.timeFormat(state.info.createTime, 'yyyy-mm-dd hh:MM:ss') }}
  66. </view>
  67. </view>
  68. <view class="aftersale-item ss-flex ss-col-center">
  69. <view class="item-title">售后类型:</view>
  70. <view class="item-content">{{ status2[state.info.way] }}</view>
  71. </view>
  72. <view class="aftersale-item ss-flex ss-col-center">
  73. <view class="item-title">申请原因:</view>
  74. <view class="item-content">{{ state.info.applyReason }}</view>
  75. </view>
  76. <view class="aftersale-item ss-flex ss-col-center">
  77. <view class="item-title">相关描述:</view>
  78. <view class="item-content">{{ state.info.applyDescription }}</view>
  79. </view>
  80. </view>
  81. </view>
  82. <s-empty v-if="isEmpty(state.info) && state.loading" icon="/static/order-empty.png" text="暂无该订单售后详情" />
  83. <!-- <su-fixed bottom placeholder bg="bg-white" v-if="!isEmpty(state.info)">
  84. <view class="foot_box">
  85. <button class="ss-reset-button btn" v-if="state.info.btns?.includes('cancel')"
  86. @tap="onApply(state.info.id)">取消申请</button>
  87. <button class="ss-reset-button btn" v-if="state.info.btns?.includes('delete')"
  88. @tap="onDelete(state.info.id)">删除</button>
  89. <button class="ss-reset-button contcat-btn btn"
  90. @tap="sheep.$router.go('/pages/chat/index')">联系客服</button>
  91. </view>
  92. </su-fixed> -->
  93. </s-layout>
  94. </template>
  95. <script setup>
  96. import sheep from '@/sheep';
  97. import {
  98. onLoad
  99. } from '@dcloudio/uni-app';
  100. import {
  101. reactive
  102. } from 'vue';
  103. import {
  104. isEmpty
  105. } from 'lodash';
  106. const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
  107. const headerBg = sheep.$url.css('/static/img/shop/order/order_bg.png');
  108. const state = reactive({
  109. active: 0,
  110. aftersaleId: 0,
  111. info: {},
  112. list: [{
  113. title: '提交申请',
  114. },
  115. {
  116. title: '处理中',
  117. },
  118. ],
  119. loading: false,
  120. });
  121. const status2 = {
  122. 10: '仅退款',
  123. 20: '退货退款'
  124. }
  125. function onApply(orderId) {
  126. uni.showModal({
  127. title: '提示',
  128. content: '确定要取消此申请吗?',
  129. success: async function(res) {
  130. if (res.confirm) {
  131. const {
  132. error
  133. } = await sheep.$api.order.aftersale.cancel(orderId);
  134. if (error === 0) {
  135. getDetail(state.aftersaleId);
  136. }
  137. }
  138. },
  139. });
  140. }
  141. function onDelete(orderId) {
  142. uni.showModal({
  143. title: '提示',
  144. content: '确定要删除吗?',
  145. success: async function(res) {
  146. if (res.confirm) {
  147. const {
  148. error
  149. } = await sheep.$api.order.aftersale.delete(orderId);
  150. if (error === 0) {
  151. sheep.$router.back();
  152. }
  153. }
  154. },
  155. });
  156. }
  157. const onCopy = () => {
  158. sheep.$helper.copyText(state.info.aftersale_sn);
  159. };
  160. async function getDetail(id) {
  161. const {
  162. code,
  163. data
  164. } = await sheep.$api.order.aftersale.detail(id);
  165. state.loading = true;
  166. if (code === 0) {
  167. state.info = data;
  168. if (state.info.aftersale_status === -2 || state.info.aftersale_status === -1) {
  169. state.list.push({
  170. title: state.info.aftersale_status_text
  171. });
  172. state.active = 2;
  173. } else {
  174. state.list.push({
  175. title: '完成'
  176. });
  177. state.active = state.info.aftersale_status;
  178. }
  179. } else {
  180. state.info = null;
  181. }
  182. }
  183. onLoad((options) => {
  184. state.aftersaleId = options.id;
  185. getDetail(options.id);
  186. });
  187. </script>
  188. <style lang="scss" scoped>
  189. // 步骤条
  190. .steps-box {
  191. width: 100%;
  192. height: 190rpx;
  193. background: v-bind(headerBg) no-repeat,
  194. linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  195. background-size: 750rpx 100%;
  196. padding-left: 72rpx;
  197. .steps-item {
  198. .sicon-circleclose {
  199. font-size: 24rpx;
  200. color: #fff;
  201. }
  202. .sicon-circlecheck {
  203. font-size: 24rpx;
  204. }
  205. .steps-item-title {
  206. font-size: 24rpx;
  207. font-weight: 400;
  208. margin-top: 16rpx;
  209. margin-left: -36rpx;
  210. width: 100rpx;
  211. text-align: center;
  212. }
  213. }
  214. }
  215. .activity-color {
  216. color: #fff;
  217. }
  218. .info-color {
  219. color: rgba(#fff, 0.4);
  220. }
  221. .activity-bg {
  222. background: #fff;
  223. }
  224. .info-bg {
  225. background: rgba(#fff, 0.4);
  226. }
  227. .line {
  228. width: 270rpx;
  229. height: 4rpx;
  230. }
  231. // 服务状态
  232. .status-box {
  233. position: relative;
  234. z-index: 3;
  235. background-color: #fff;
  236. border-radius: 20rpx 20rpx 0px 0px;
  237. padding: 20rpx;
  238. margin-top: -20rpx;
  239. .status-text {
  240. font-size: 28rpx;
  241. font-weight: 500;
  242. color: rgba(51, 51, 51, 1);
  243. margin-bottom: 20rpx;
  244. }
  245. .status-time {
  246. font-size: 24rpx;
  247. font-weight: 400;
  248. color: rgba(153, 153, 153, 1);
  249. }
  250. }
  251. // 退款金额
  252. .aftersale-money {
  253. background-color: #fff;
  254. height: 98rpx;
  255. padding: 0 20rpx;
  256. margin: 20rpx;
  257. .aftersale-money--title {
  258. font-size: 28rpx;
  259. font-weight: 500;
  260. color: rgba(51, 51, 51, 1);
  261. }
  262. .aftersale-money--num {
  263. font-size: 28rpx;
  264. font-family: OPPOSANS;
  265. font-weight: 500;
  266. color: #ff3000;
  267. }
  268. }
  269. // order-shop
  270. .order-shop {
  271. padding: 20rpx;
  272. background-color: #fff;
  273. margin: 0 20rpx 20rpx 20rpx;
  274. }
  275. // 服务内容
  276. .aftersale-content {
  277. background-color: #fff;
  278. padding: 20rpx;
  279. margin: 0 20rpx;
  280. .aftersale-item {
  281. height: 60rpx;
  282. .copy-btn {
  283. background: #eeeeee;
  284. color: #333;
  285. border-radius: 20rpx;
  286. width: 75rpx;
  287. height: 40rpx;
  288. font-size: 22rpx;
  289. }
  290. .item-title {
  291. color: #999;
  292. font-size: 28rpx;
  293. }
  294. .item-content {
  295. color: #333;
  296. font-size: 28rpx;
  297. }
  298. }
  299. }
  300. // 底部功能
  301. .foot_box {
  302. height: 100rpx;
  303. background-color: #fff;
  304. display: flex;
  305. align-items: center;
  306. justify-content: flex-end;
  307. .btn {
  308. width: 160rpx;
  309. line-height: 60rpx;
  310. background: rgba(238, 238, 238, 1);
  311. border-radius: 30rpx;
  312. padding: 0;
  313. margin-right: 20rpx;
  314. font-size: 26rpx;
  315. font-weight: 400;
  316. color: rgba(51, 51, 51, 1);
  317. }
  318. }
  319. </style>