afterInfo.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="goods">
  5. <view class="url">
  6. <image class="image"
  7. :src="info.goods.goods.file&&info.goods.goods.file.length>0?info.goods.goods.file[0].url:''"
  8. mode=""></image>
  9. </view>
  10. <view class="goodsname">
  11. {{info.goods.goods.name}}
  12. <view class="specs">
  13. {{info.goods.name}}
  14. </view>
  15. </view>
  16. <view class="goodsother">
  17. <view v-if="info.order_detail.type=='0'" class="price">
  18. ¥{{info.goods.sell_money}}
  19. </view>
  20. <view v-else class="price">
  21. ¥{{info.goods.group_config.money}}
  22. </view>
  23. <view class="num">
  24. ×{{info.goods.buy_num}}
  25. </view>
  26. </view>
  27. </view>
  28. <view class="info">
  29. <view class="one">
  30. <view class="left">售后状态</view>
  31. <view class="right">{{info.zhStatus||'暂无'}}</view>
  32. </view>
  33. <view class="one">
  34. <view class="left">售后类型</view>
  35. <view class="right">{{info.zhType||'暂无'}}</view>
  36. </view>
  37. <view class="one">
  38. <view class="left">申请时间</view>
  39. <view class="right">{{info.apply_time||'暂无'}}</view>
  40. </view>
  41. <view class="one">
  42. <view class="left">售后结束时间</view>
  43. <view class="right">{{info.end_time||'暂无'}}</view>
  44. </view>
  45. <view class="one">
  46. <view class="left">售后描述</view>
  47. <view class="right">{{info.desc||'暂无'}}</view>
  48. </view>
  49. <view class="one">
  50. <view class="left">申请理由</view>
  51. <view class="right">{{info.zhReason||'暂无'}}</view>
  52. </view>
  53. <view class="one" v-if="info.type!='3'">
  54. <view class="left">退款金额</view>
  55. <view class="right">¥{{info.money||0}}</view>
  56. </view>
  57. <view class="one" v-if="info.type!='1'">
  58. <view class="left">用户退货单号</view>
  59. <view class="right">{{info.transport.customer_transport_no||'暂无'}}</view>
  60. </view>
  61. <view class="one" v-if="info.type=='3'">
  62. <view class="left">商家退货单号</view>
  63. <view class="right">{{info.transport.shop_transport_no||'暂无'}}</view>
  64. </view>
  65. <view class="one">
  66. <view class="left">售后处理人</view>
  67. <view class="right">{{info.deal_person.name||'暂无'}}</view>
  68. </view>
  69. </view>
  70. </view>
  71. </mobile-frame>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. id: '',
  78. user: {},
  79. info: {},
  80. // 售后状态
  81. statusList: [],
  82. // 售后类型
  83. typeList: [],
  84. // 申请理由
  85. reasonList: [],
  86. };
  87. },
  88. onLoad: async function(e) {
  89. const that = this;
  90. that.$set(that, `id`, e.id || '');
  91. await that.searchOther();
  92. await that.watchLogin();
  93. },
  94. methods: {
  95. // 查询其他信息
  96. async searchOther() {
  97. const that = this;
  98. let res;
  99. res = await that.$api(`/dictData`, 'GET', {
  100. code: "afterSale_status"
  101. });
  102. if (res.errcode == '0') {
  103. that.$set(that, `statusList`, res.data)
  104. }
  105. res = await that.$api(`/dictData`, 'GET', {
  106. code: "afterSale_type"
  107. });
  108. if (res.errcode == '0') {
  109. that.$set(that, `typeList`, res.data)
  110. }
  111. res = await that.$api(`/dictData`, 'GET', {
  112. code: "afterSale_reason"
  113. });
  114. if (res.errcode == '0') {
  115. that.$set(that, `reasonList`, res.data)
  116. }
  117. },
  118. // 监听用户是否登录
  119. watchLogin() {
  120. const that = this;
  121. uni.getStorage({
  122. key: 'token',
  123. success: async function(res) {
  124. let user = that.$jwt(res.data);
  125. if (user) {
  126. that.$set(that, `user`, user);
  127. if (that.id) {
  128. //售后详情
  129. let arr = await that.$api(`/afterSale/${that.id}`, 'GET')
  130. if (arr.errcode == '0') {
  131. let status = that.statusList.find(i => i.value == arr.data.status)
  132. if (status) arr.data.zhStatus = status.label;
  133. let type = that.typeList.find(i => i.value == arr.data.type)
  134. if (type) arr.data.zhType = type.label;
  135. let reason = that.reasonList.find(i => i.value == arr.data.reason)
  136. if (reason) arr.data.zhReason = reason.label;
  137. that.$set(that, `info`, arr.data)
  138. }
  139. }
  140. }
  141. },
  142. fail: function(err) {
  143. uni.navigateTo({
  144. url: `/pages/login/index`
  145. })
  146. }
  147. });
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss">
  153. .main {
  154. display: flex;
  155. flex-direction: column;
  156. width: 100vw;
  157. height: 100vh;
  158. .goods {
  159. display: flex;
  160. border-bottom: 1px dashed #f1f1f1;
  161. padding: 2vw;
  162. width: 96vw;
  163. .url {
  164. width: 20vw;
  165. .image {
  166. width: 100%;
  167. height: 20vw;
  168. border-radius: 5px;
  169. }
  170. }
  171. .goodsname {
  172. display: flex;
  173. flex-direction: column;
  174. width: 60vw;
  175. padding: 0 2vw;
  176. font-size: 16px;
  177. .specs {
  178. color: var(--f85Color);
  179. font-size: var(--font12Size);
  180. }
  181. }
  182. .goodsother {
  183. width: 15vw;
  184. text-align: right;
  185. }
  186. }
  187. .info {
  188. padding: 2vw;
  189. .one {
  190. display: flex;
  191. justify-content: space-between;
  192. padding: 2vw;
  193. .left {
  194. color: #696969;
  195. font-size: var(--font14Size);
  196. }
  197. .right {
  198. width: 60vw;
  199. text-align: right;
  200. color: #A9A9A9;
  201. font-size: var(--font14Size);
  202. }
  203. }
  204. }
  205. }
  206. </style>