refund.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view class="container">
  3. <form @submit="bindSave" report-submit="true">
  4. <view class="tui-order-item">
  5. <block v-if="orderDetail.orderInfo.cat_id">
  6. <tui-list-cell padding="20rpx 30rpx" :hover="false" :lineLeft="false">
  7. <view class="tui-goods-title">
  8. <view>服务信息</view>
  9. </view>
  10. </tui-list-cell>
  11. <tui-list-cell padding="0">
  12. <view class="tui-goods-item">
  13. <image :src="orderDetail.orderInfo.cateMap.image" class="tui-goods-img"></image>
  14. <view class="tui-goods-center">
  15. <view class="tui-goods-name">{{orderDetail.orderInfo.pay_subject}}</view>
  16. </view>
  17. <view class="tui-price-right">
  18. <view>¥{{orderDetail.orderInfo.total}}</view>
  19. </view>
  20. </view>
  21. </tui-list-cell>
  22. </block>
  23. <block v-else>
  24. <tui-list-cell padding="20rpx 30rpx" :hover="false" :lineLeft="false">
  25. <view class="tui-goods-title">
  26. <view>商品信息</view>
  27. </view>
  28. </tui-list-cell>
  29. <block v-for="(item,index) in orderDetail.goods" :key="index">
  30. <tui-list-cell padding="0">
  31. <view class="tui-goods-item">
  32. <image :src="item.image" class="tui-goods-img"></image>
  33. <view class="tui-goods-center">
  34. <view class="tui-goods-name">{{item.name}}</view>
  35. <view v-if="item.label" class="tui-goods-attr">{{item.label}}</view>
  36. </view>
  37. <view class="tui-price-right">
  38. <view>¥{{item.price}}</view>
  39. <view>x{{item.quantity}}</view>
  40. </view>
  41. </view>
  42. </tui-list-cell>
  43. </block>
  44. </block>
  45. </view>
  46. <view class="tui-refund__form">
  47. <tui-list-cell :hover="false" padding="0">
  48. <view class="tui-line-cell">
  49. <view class="tui-title">
  50. <text class="tui-color__red">*</text>
  51. <text>申请类型</text>
  52. </view>
  53. <input placeholder-class="tui-phcolor" class="tui-input" type="text" value="退货退款" disabled />
  54. </view>
  55. </tui-list-cell>
  56. <tui-list-cell :hover="false" padding="0">
  57. <view class="tui-line-cell">
  58. <view class="tui-title">
  59. <text class="tui-color__red">*</text>
  60. <text>退款金额</text>
  61. </view>
  62. <input placeholder-class="tui-phcolor" class="tui-input" type="text"
  63. :value="'¥'+orderDetail.order_total.sub_total.value" disabled />
  64. </view>
  65. </tui-list-cell>
  66. <tui-list-cell :hover="false" padding="0">
  67. <view class="tui-line-cell">
  68. <view class="tui-title">
  69. <text class="tui-color__red">*</text>
  70. <text>联系人:</text>
  71. </view>
  72. <input name="lianxiren" placeholder-class="tui-phcolor" class="tui-input" type="text"
  73. placeholder="请填写联系人" />
  74. </view>
  75. </tui-list-cell>
  76. <tui-list-cell :hover="false" padding="0">
  77. <view class="tui-line-cell">
  78. <view class="tui-title">
  79. <text class="tui-color__red">*</text>
  80. <text>联系电话:</text>
  81. </view>
  82. <input name="tel" placeholder-class="tui-phcolor" class="tui-input" type="text"
  83. placeholder="请填写系电话" />
  84. </view>
  85. </tui-list-cell>
  86. <tui-list-cell :hover="false" padding="0">
  87. <view class="tui-line-cell">
  88. <view class="tui-title">
  89. <text class="tui-color__red">*</text>
  90. <text>申请原因:</text>
  91. </view>
  92. <input name="refund_desc" placeholder-class="tui-phcolor" class="tui-input" type="text"
  93. placeholder="请填写申请原因" />
  94. </view>
  95. </tui-list-cell>
  96. </view>
  97. <view class="tui-btn__box">
  98. <tui-button form-type="submit" height="88rpx" type="danger" shadow shape="circle">提交申请</tui-button>
  99. </view>
  100. </form>
  101. </view>
  102. </template>
  103. <script>
  104. export default {
  105. data() {
  106. return {
  107. orderDetail: []
  108. };
  109. },
  110. onLoad: function(options) {
  111. let _this = this
  112. var orderid = options.id;
  113. _this.$request.get('order.detail', {
  114. samkey: (new Date()).valueOf(),
  115. id: orderid
  116. }).then(function(res) {
  117. if (res.errno != 0) {
  118. uni.showModal({
  119. title: '错误',
  120. content: res.msg,
  121. showCancel: false
  122. })
  123. return;
  124. }
  125. _this.orderDetail = res.data;
  126. });
  127. },
  128. methods: {
  129. bindSave: function(e) {
  130. var that = this;
  131. const lianxiren = e.detail.value.lianxiren;
  132. const tel = e.detail.value.tel;
  133. const refund_desc = e.detail.value.refund_desc;
  134. if (!lianxiren) {
  135. uni.showToast({
  136. title: '请输入退款联系人',
  137. icon: 'none'
  138. });
  139. return;
  140. }
  141. if (!tel) {
  142. uni.showToast({
  143. title: '请输入电话号码',
  144. icon: 'none'
  145. });
  146. return;
  147. }
  148. that.$request.post('orderrefund.create', {
  149. order_id: that.orderDetail.orderInfo.id,
  150. order_refund_no: that.orderDetail.orderInfo.order_num_alias,
  151. refund_price: that.orderDetail.orderInfo.total,
  152. lianxiren: lianxiren,
  153. tel: tel,
  154. refund_desc: refund_desc
  155. }).then(function(res) {
  156. if (res.errno != 0) {
  157. uni.showToast({
  158. title: res.message,
  159. icon: 'none'
  160. });
  161. return;
  162. } else {
  163. that.$request.post('message.refundorder', {
  164. orderid: that.orderDetail.orderInfo.id
  165. }).then(res => {
  166. });
  167. uni.showModal({
  168. title: '提示',
  169. content: res.message,
  170. showCancel: false,
  171. //是否显示取消按钮
  172. success: function(res) {
  173. if (res.cancel) { //点击取消,默认隐藏弹框
  174. } else {
  175. that.sam.navigateTo("/pagesA/my/myOrder/myOrder?ptype=" + that
  176. .orderDetail.orderInfo.ptype);
  177. }
  178. }
  179. });
  180. }
  181. });
  182. }
  183. },
  184. /**
  185. * 页面相关事件处理函数--监听用户下拉动作
  186. */
  187. onPullDownRefresh: function() {
  188. setTimeout(() => {
  189. uni.stopPullDownRefresh()
  190. }, 200);
  191. },
  192. };
  193. </script>
  194. <style>
  195. .tui-order-list {
  196. margin-top: 80rpx;
  197. }
  198. .tui-order-item {
  199. margin-top: 20rpx;
  200. border-radius: 10rpx;
  201. overflow: hidden;
  202. }
  203. .tui-goods-title {
  204. width: 100%;
  205. font-size: 28rpx;
  206. display: flex;
  207. align-items: center;
  208. justify-content: space-between;
  209. }
  210. .tui-goods-item {
  211. width: 100%;
  212. padding: 20rpx 30rpx;
  213. box-sizing: border-box;
  214. display: flex;
  215. justify-content: space-between;
  216. }
  217. .tui-goods-img {
  218. width: 180rpx;
  219. height: 180rpx;
  220. display: block;
  221. flex-shrink: 0;
  222. }
  223. .tui-goods-center {
  224. flex: 1;
  225. padding: 20rpx 8rpx;
  226. box-sizing: border-box;
  227. }
  228. .tui-goods-name {
  229. max-width: 310rpx;
  230. word-break: break-all;
  231. overflow: hidden;
  232. text-overflow: ellipsis;
  233. display: -webkit-box;
  234. -webkit-box-orient: vertical;
  235. -webkit-line-clamp: 2;
  236. font-size: 26rpx;
  237. line-height: 32rpx;
  238. }
  239. .tui-goods-attr {
  240. font-size: 22rpx;
  241. color: #888888;
  242. line-height: 32rpx;
  243. padding-top: 20rpx;
  244. word-break: break-all;
  245. overflow: hidden;
  246. text-overflow: ellipsis;
  247. display: -webkit-box;
  248. -webkit-box-orient: vertical;
  249. -webkit-line-clamp: 2;
  250. }
  251. .tui-price-right {
  252. text-align: right;
  253. font-size: 24rpx;
  254. color: #888888;
  255. line-height: 30rpx;
  256. padding-top: 20rpx;
  257. }
  258. .tui-refund__form {
  259. margin-top: 20rpx;
  260. }
  261. .tui-line-cell {
  262. width: 100%;
  263. padding: 24rpx 30rpx;
  264. box-sizing: border-box;
  265. display: flex;
  266. align-items: center;
  267. }
  268. .tui-title {
  269. width: 180rpx;
  270. font-size: 28rpx;
  271. color: #666;
  272. }
  273. .tui-color__red {
  274. color: #EB0909;
  275. padding-right: 6rpx;
  276. }
  277. .tui-title-city-text {
  278. width: 180rpx;
  279. height: 40rpx;
  280. display: block;
  281. line-height: 46rpx;
  282. }
  283. .tui-input {
  284. width: 500rpx;
  285. font-size: 28rpx;
  286. }
  287. .tui-phcolor {
  288. color: #ccc;
  289. font-size: 28rpx;
  290. }
  291. .tui-btn__box {
  292. padding: 60rpx 30rpx;
  293. }
  294. </style>