detail.vue 9.4 KB

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