detail.vue 9.2 KB

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