afterInfo.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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||0}}</view>
  60. </view>
  61. <view class="one">
  62. <view class="left">售后处理人</view>
  63. <view class="right">{{info.deal_person.name||'暂无'}}</view>
  64. </view>
  65. </view>
  66. </view>
  67. </mobile-frame>
  68. </template>
  69. <script>
  70. export default {
  71. data() {
  72. return {
  73. id: '',
  74. user: {},
  75. info: {},
  76. // 售后状态
  77. statusList: [],
  78. // 售后类型
  79. typeList: [],
  80. // 申请理由
  81. reasonList: [],
  82. };
  83. },
  84. onLoad: async function(e) {
  85. const that = this;
  86. that.$set(that, `id`, e.id || '');
  87. await that.searchOther();
  88. await that.watchLogin();
  89. },
  90. methods: {
  91. // 查询其他信息
  92. async searchOther() {
  93. const that = this;
  94. let res;
  95. res = await that.$api(`/dictData`, 'GET', {
  96. code: "afterSale_status"
  97. });
  98. if (res.errcode == '0') {
  99. that.$set(that, `statusList`, res.data)
  100. }
  101. res = await that.$api(`/dictData`, 'GET', {
  102. code: "afterSale_type"
  103. });
  104. if (res.errcode == '0') {
  105. that.$set(that, `typeList`, res.data)
  106. }
  107. res = await that.$api(`/dictData`, 'GET', {
  108. code: "afterSale_reason"
  109. });
  110. if (res.errcode == '0') {
  111. that.$set(that, `reasonList`, res.data)
  112. }
  113. },
  114. // 监听用户是否登录
  115. watchLogin() {
  116. const that = this;
  117. uni.getStorage({
  118. key: 'token',
  119. success: async function(res) {
  120. let user = that.$jwt(res.data);
  121. if (user) {
  122. that.$set(that, `user`, user);
  123. if (that.id) {
  124. //售后详情
  125. let arr = await that.$api(`/afterSale/${that.id}`, 'GET')
  126. if (arr.errcode == '0') {
  127. let status = that.statusList.find(i => i.value == arr.data.status)
  128. if (status) arr.data.zhStatus = status.label;
  129. let type = that.typeList.find(i => i.value == arr.data.type)
  130. if (type) arr.data.zhType = type.label;
  131. let reason = that.reasonList.find(i => i.value == arr.data.reason)
  132. if (reason) arr.data.zhReason = reason.label;
  133. that.$set(that, `info`, arr.data)
  134. }
  135. }
  136. }
  137. },
  138. fail: function(err) {
  139. uni.navigateTo({
  140. url: `/pages/login/index`
  141. })
  142. }
  143. });
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss">
  149. .main {
  150. display: flex;
  151. flex-direction: column;
  152. width: 100vw;
  153. height: 100vh;
  154. .goods {
  155. display: flex;
  156. border-bottom: 1px dashed #f1f1f1;
  157. padding: 2vw;
  158. width: 96vw;
  159. .url {
  160. width: 20vw;
  161. .image {
  162. width: 100%;
  163. height: 20vw;
  164. border-radius: 5px;
  165. }
  166. }
  167. .goodsname {
  168. display: flex;
  169. flex-direction: column;
  170. width: 60vw;
  171. padding: 0 2vw;
  172. font-size: 16px;
  173. .specs {
  174. color: var(--f85Color);
  175. font-size: var(--font12Size);
  176. }
  177. }
  178. .goodsother {
  179. width: 15vw;
  180. text-align: right;
  181. }
  182. }
  183. .info {
  184. padding: 2vw;
  185. .one {
  186. display: flex;
  187. justify-content: space-between;
  188. padding: 2vw;
  189. .left {
  190. color: #696969;
  191. font-size: var(--font14Size);
  192. }
  193. .right {
  194. color: #A9A9A9;
  195. font-size: var(--font14Size);
  196. }
  197. }
  198. }
  199. }
  200. </style>