index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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. </view>
  61. </template>
  62. <script>
  63. import { getRefundOrderDetail, refundExpress } from '@/api/order.js';
  64. import {
  65. toLogin
  66. } from '@/libs/login.js';
  67. import {
  68. mapGetters
  69. } from "vuex";
  70. import colors from '@/mixins/color.js';
  71. export default {
  72. mixins: [colors],
  73. data() {
  74. return {
  75. expressList:[],
  76. orderInfo:{},
  77. seIndex: 0,
  78. refund_reason_wap_img: [],
  79. refundInfo:{
  80. refund_express:'',
  81. refund_phone:'',
  82. refund_explain:'',
  83. id:'',
  84. refund_express_name:'',
  85. refund_img:''
  86. }
  87. };
  88. },
  89. computed: mapGetters(['isLogin']),
  90. watch: {
  91. isLogin: {
  92. handler: function(newV, oldV) {
  93. if (newV) {
  94. this.getOrderInfo();
  95. }
  96. },
  97. deep: true
  98. }
  99. },
  100. onLoad(options) {
  101. this.orderId = options.orderId;
  102. if (this.isLogin) {
  103. this.getOrderInfo();
  104. } else {
  105. toLogin();
  106. }
  107. },
  108. onShow() {
  109. uni.removeStorageSync('form_type_cart');
  110. },
  111. methods: {
  112. /**
  113. * 申请退货
  114. */
  115. subRefund: function(e) {
  116. let that = this
  117. if (!that.refundInfo.refund_express) return this.$util.Tips({
  118. title: '请输入快递单号'
  119. });
  120. if (!that.refundInfo.refund_phone) return this.$util.Tips({
  121. title: '请输入手机号'
  122. });
  123. if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.refundInfo.refund_phone)) return this.$util.Tips({
  124. title: '请输入正确的手机号码'
  125. });
  126. that.refundInfo.refund_express_name = that.expressList[that.seIndex].name;
  127. that.refundInfo.refund_img = that.refund_reason_wap_img.join(',');
  128. refundExpress(that.refundInfo).then(res => {
  129. return this.$util.Tips({
  130. title: res.msg,
  131. icon: 'success'
  132. }, {
  133. tab: 5,
  134. url: '/pages/users/user_return_list/index?isT=1'
  135. });
  136. }).catch(err => {
  137. return this.$util.Tips({
  138. title: err
  139. });
  140. })
  141. },
  142. /**
  143. * 删除图片
  144. *
  145. */
  146. DelPic: function(e) {
  147. let index = e,
  148. that = this,
  149. pic = this.refund_reason_wap_img[index];
  150. that.refund_reason_wap_img.splice(index, 1);
  151. that.$set(that, 'refund_reason_wap_img', that.refund_reason_wap_img);
  152. },
  153. /**
  154. * 上传文件
  155. *
  156. */
  157. uploadpic: function() {
  158. let that = this;
  159. this.$util.uploadImageOne('upload/image', function(res) {
  160. that.refund_reason_wap_img.push(res.data.url);
  161. that.$set(that, 'refund_reason_wap_img', that.refund_reason_wap_img);
  162. });
  163. },
  164. /**
  165. * 获取订单详情
  166. *
  167. */
  168. getOrderInfo: function() {
  169. let that = this;
  170. getRefundOrderDetail(that.orderId).then(res => {
  171. that.$set(that, 'orderInfo', res.data);
  172. that.expressList = res.data.express_list;
  173. that.refundInfo.id = res.data.id;
  174. });
  175. },
  176. bindPickerChange(e) {
  177. this.$set(this, 'seIndex', e.detail.value);
  178. }
  179. }
  180. }
  181. </script>
  182. <style scoped lang="scss">
  183. .apply-return .list {
  184. background-color: #fff;
  185. margin-top: 18rpx;
  186. }
  187. .apply-return .list .item {
  188. margin-left: 30rpx;
  189. padding-right: 30rpx;
  190. min-height: 90rpx;
  191. border-bottom: 1rpx solid #eee;
  192. font-size: 30rpx;
  193. color: #333;
  194. }
  195. .apply-return .list .item .inputs{
  196. text-align: right;
  197. }
  198. .apply-return .list .item .num {
  199. color: #282828;
  200. width: 427rpx;
  201. text-align: right;
  202. }
  203. .apply-return .list .item .num .picker .reason {
  204. width: 385rpx;
  205. }
  206. .apply-return .list .item .num .picker .iconfont {
  207. color: #666;
  208. font-size: 30rpx;
  209. margin-top: 2rpx;
  210. }
  211. .apply-return .list .item.textarea {
  212. padding: 30rpx 30rpx 30rpx 0;
  213. }
  214. .apply-return .list .item textarea {
  215. height: 100rpx;
  216. font-size: 30rpx;
  217. }
  218. .apply-return .list .item .placeholder {
  219. color: #bbb;
  220. font-size: 30rpx;
  221. text-align: right;
  222. }
  223. .apply-return .list .item .title {
  224. height: 95rpx;
  225. width: 100%;
  226. }
  227. .apply-return .list .item .title .tip {
  228. font-size: 30rpx;
  229. color: #bbb;
  230. }
  231. .apply-return .list .item .upload {
  232. padding-bottom: 36rpx;
  233. }
  234. .apply-return .list .item .upload .pictrue {
  235. margin: 22rpx 23rpx 0 0;
  236. width: 156rpx;
  237. height: 156rpx;
  238. position: relative;
  239. font-size: 24rpx;
  240. color: #bbb;
  241. }
  242. .apply-return .list .item .upload .pictrue:nth-of-type(4n) {
  243. margin-right: 0;
  244. }
  245. .apply-return .list .item .upload .pictrue image {
  246. width: 100%;
  247. height: 100%;
  248. border-radius: 3rpx;
  249. }
  250. .apply-return .list .item .upload .pictrue .icon-guanbi1 {
  251. position: absolute;
  252. font-size: 45rpx;
  253. top: -10rpx;
  254. right: -10rpx;
  255. }
  256. .apply-return .list .item .upload .pictrue .icon-icon25201 {
  257. color: #bfbfbf;
  258. font-size: 50rpx;
  259. }
  260. .apply-return .list .item .upload .pictrue:nth-last-child(1) {
  261. border: 1rpx solid #ddd;
  262. box-sizing: border-box;
  263. }
  264. .apply-return .returnBnt {
  265. font-size: 32rpx;
  266. color: #fff;
  267. width: 690rpx;
  268. height: 86rpx;
  269. border-radius: 50rpx;
  270. text-align: center;
  271. line-height: 86rpx;
  272. margin: 43rpx auto;
  273. }
  274. .goodsStyle .text .name {
  275. align-self: flex-start;
  276. }
  277. .list /deep/ .uni-input-input {
  278. text-align: right;
  279. }
  280. </style>