index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <view :style="colorStyle">
  3. <form @submit="subRefund">
  4. <view class='apply-return'>
  5. <view class='goodsStyle acea-row row-between' v-for="(item,index) in orderInfo.cart_info" :key="index">
  6. <view class='pictrue'>
  7. <image :src='item.productInfo.attrInfo?item.productInfo.attrInfo.image:item.productInfo.image'></image>
  8. </view>
  9. <view class='text acea-row row-between'>
  10. <view class='name line2'>{{item.productInfo.store_name}}</view>
  11. <view class='money'>
  12. <view>¥{{item.truePrice}}</view>
  13. <view class='num'>x{{item.cart_num}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class='list'>
  18. <view class='item acea-row row-between-wrapper' v-if="expressList.length">
  19. <view>物流公司</view>
  20. <picker class='num' @change="bindPickerChange" :value="seIndex" :range="expressList" range-key="name">
  21. <view class="picker acea-row row-between-wrapper">
  22. <view class='reason'>{{expressList[seIndex].name}}</view>
  23. <text class='iconfont icon-jiantou'></text>
  24. </view>
  25. </picker>
  26. </view>
  27. <view class='item acea-row row-between-wrapper'>
  28. <view>物流单号</view>
  29. <input class="inputs" type="text" placeholder="请填写您的物流单号" placeholder-class='placeholder' v-model="refundInfo.refund_express" />
  30. </view>
  31. <view class='item acea-row row-between-wrapper'>
  32. <view>联系电话</view>
  33. <input class="inputs" type="number" placeholder="请填写您的联系电话" placeholder-class='placeholder' v-model="refundInfo.refund_phone" />
  34. </view>
  35. <view class='item textarea acea-row row-between'>
  36. <view>备注说明</view>
  37. <textarea placeholder='填写备注信息,100字以内' class='num' v-model="refundInfo.refund_explain"></textarea>
  38. </view>
  39. <view class='item acea-row row-between'>
  40. <view class='title acea-row row-between-wrapper'>
  41. <view>上传凭证</view>
  42. <view class='tip'>( 最多可上传3张 )</view>
  43. </view>
  44. <view class='upload acea-row row-middle'>
  45. <view class='pictrue' v-for="(item,index) in refund_reason_wap_img" :key="index">
  46. <image :src='item'></image>
  47. <view class='iconfont icon-guanbi1 font-num' @tap='DelPic(index)'></view>
  48. </view>
  49. <view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic'
  50. v-if="refund_reason_wap_img.length < 3">
  51. <text class='iconfont icon-icon25201'></text>
  52. <view>上传凭证</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <button class='returnBnt bg-color' form-type="submit">提交</button>
  58. </view>
  59. </form>
  60. <!-- #ifdef MP -->
  61. <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
  62. <!-- #endif -->
  63. </view>
  64. </template>
  65. <script>
  66. import { getRefundOrderDetail, refundExpress } from '@/api/order.js';
  67. import {
  68. toLogin
  69. } from '@/libs/login.js';
  70. import {
  71. mapGetters
  72. } from "vuex";
  73. import colors from '@/mixins/color.js';
  74. export default {
  75. mixins: [colors],
  76. data() {
  77. return {
  78. expressList:[],
  79. orderInfo:{},
  80. seIndex: 0,
  81. refund_reason_wap_img: [],
  82. refundInfo:{
  83. refund_express:'',
  84. refund_phone:'',
  85. refund_explain:'',
  86. id:'',
  87. refund_express_name:'',
  88. refund_img:''
  89. },
  90. isShowAuth: false
  91. };
  92. },
  93. computed: mapGetters(['isLogin']),
  94. watch: {
  95. isLogin: {
  96. handler: function(newV, oldV) {
  97. if (newV) {
  98. this.getOrderInfo();
  99. }
  100. },
  101. deep: true
  102. }
  103. },
  104. onLoad(options) {
  105. this.orderId = options.orderId;
  106. if (this.isLogin) {
  107. this.getOrderInfo();
  108. } else {
  109. toLogin();
  110. }
  111. },
  112. onShow() {
  113. uni.removeStorageSync('form_type_cart');
  114. },
  115. methods: {
  116. onLoadFun(){
  117. this.getOrderInfo();
  118. this.isShowAuth = false;
  119. },
  120. // 授权关闭
  121. authColse: function(e) {
  122. this.isShowAuth = e
  123. },
  124. /**
  125. * 申请退货
  126. */
  127. subRefund: function(e) {
  128. let that = this
  129. if (!that.refundInfo.refund_express) return this.$util.Tips({
  130. title: '请输入快递单号'
  131. });
  132. if (!that.refundInfo.refund_phone) return this.$util.Tips({
  133. title: '请输入手机号'
  134. });
  135. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.refundInfo.refund_phone)) return this.$util.Tips({
  136. title: '请输入正确的手机号码'
  137. });
  138. that.refundInfo.refund_express_name = that.expressList[that.seIndex].name;
  139. that.refundInfo.refund_img = that.refund_reason_wap_img.join(',');
  140. refundExpress(that.refundInfo).then(res => {
  141. return this.$util.Tips({
  142. title: res.msg,
  143. icon: 'success'
  144. }, {
  145. tab: 5,
  146. url: '/pages/users/user_return_list/index?isT=1'
  147. });
  148. }).catch(err => {
  149. return this.$util.Tips({
  150. title: err
  151. });
  152. })
  153. },
  154. /**
  155. * 删除图片
  156. *
  157. */
  158. DelPic: function(e) {
  159. let index = e,
  160. that = this,
  161. pic = this.refund_reason_wap_img[index];
  162. that.refund_reason_wap_img.splice(index, 1);
  163. that.$set(that, 'refund_reason_wap_img', that.refund_reason_wap_img);
  164. },
  165. /**
  166. * 上传文件
  167. *
  168. */
  169. uploadpic: function() {
  170. let that = this;
  171. this.$util.uploadImageOne('upload/image', function(res) {
  172. that.refund_reason_wap_img.push(res.data.url);
  173. that.$set(that, 'refund_reason_wap_img', that.refund_reason_wap_img);
  174. });
  175. },
  176. /**
  177. * 获取订单详情
  178. *
  179. */
  180. getOrderInfo: function() {
  181. let that = this;
  182. getRefundOrderDetail(that.orderId).then(res => {
  183. that.$set(that, 'orderInfo', res.data);
  184. that.expressList = res.data.express_list;
  185. that.refundInfo.id = res.data.id;
  186. });
  187. },
  188. bindPickerChange(e) {
  189. this.$set(this, 'seIndex', e.detail.value);
  190. }
  191. }
  192. }
  193. </script>
  194. <style scoped lang="scss">
  195. .apply-return .list {
  196. background-color: #fff;
  197. margin-top: 18rpx;
  198. }
  199. .apply-return .list .item {
  200. margin-left: 30rpx;
  201. padding-right: 30rpx;
  202. min-height: 90rpx;
  203. border-bottom: 1rpx solid #eee;
  204. font-size: 30rpx;
  205. color: #333;
  206. }
  207. .apply-return .list .item .inputs{
  208. text-align: right;
  209. }
  210. .apply-return .list .item .num {
  211. color: #282828;
  212. width: 427rpx;
  213. text-align: right;
  214. }
  215. .apply-return .list .item .num .picker .reason {
  216. width: 385rpx;
  217. }
  218. .apply-return .list .item .num .picker .iconfont {
  219. color: #666;
  220. font-size: 30rpx;
  221. margin-top: 2rpx;
  222. }
  223. .apply-return .list .item.textarea {
  224. padding: 30rpx 30rpx 30rpx 0;
  225. }
  226. .apply-return .list .item textarea {
  227. height: 100rpx;
  228. font-size: 30rpx;
  229. }
  230. .apply-return .list .item .placeholder {
  231. color: #bbb;
  232. font-size: 30rpx;
  233. text-align: right;
  234. }
  235. .apply-return .list .item .title {
  236. height: 95rpx;
  237. width: 100%;
  238. }
  239. .apply-return .list .item .title .tip {
  240. font-size: 30rpx;
  241. color: #bbb;
  242. }
  243. .apply-return .list .item .upload {
  244. padding-bottom: 36rpx;
  245. }
  246. .apply-return .list .item .upload .pictrue {
  247. margin: 22rpx 23rpx 0 0;
  248. width: 156rpx;
  249. height: 156rpx;
  250. position: relative;
  251. font-size: 24rpx;
  252. color: #bbb;
  253. }
  254. .apply-return .list .item .upload .pictrue:nth-of-type(4n) {
  255. margin-right: 0;
  256. }
  257. .apply-return .list .item .upload .pictrue image {
  258. width: 100%;
  259. height: 100%;
  260. border-radius: 3rpx;
  261. }
  262. .apply-return .list .item .upload .pictrue .icon-guanbi1 {
  263. position: absolute;
  264. font-size: 45rpx;
  265. top: -10rpx;
  266. right: -10rpx;
  267. }
  268. .apply-return .list .item .upload .pictrue .icon-icon25201 {
  269. color: #bfbfbf;
  270. font-size: 50rpx;
  271. }
  272. .apply-return .list .item .upload .pictrue:nth-last-child(1) {
  273. border: 1rpx solid #ddd;
  274. box-sizing: border-box;
  275. }
  276. .apply-return .returnBnt {
  277. font-size: 32rpx;
  278. color: #fff;
  279. width: 690rpx;
  280. height: 86rpx;
  281. border-radius: 50rpx;
  282. text-align: center;
  283. line-height: 86rpx;
  284. margin: 43rpx auto;
  285. }
  286. .goodsStyle .text .name {
  287. align-self: flex-start;
  288. }
  289. .list /deep/ .uni-input-input {
  290. text-align: right;
  291. }
  292. </style>