index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. <template>
  2. <view :style="colorStyle">
  3. <form @submit="subRefund">
  4. <view class='apply-return'>
  5. <view class="goodsList">
  6. <view class='goodsStyle acea-row row-between' v-for="(item,index) in orderInfo.cart_info" :key="index">
  7. <view class='pictrue'>
  8. <image class="w-136 h-136 rd-16rpx" :src="item.productInfo.image"></image>
  9. </view>
  10. <view class='text'>
  11. <view class="textCon acea-row row-between">
  12. <view class='w-346 fs-28 h-80 lh-40rpx line2'>{{item.productInfo.store_name}}</view>
  13. <view class='money'>
  14. <baseMoney :money="item.truePrice" color='#333333' symbolSize="20" integerSize="32"
  15. decimalSize="24" weight></baseMoney>
  16. <view class='num'>共{{item.cart_num}}件</view>
  17. </view>
  18. </view>
  19. <view class="info line1">{{item.productInfo.attrInfo?item.productInfo.attrInfo.suk:item.productInfo.suk}}</view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="list">
  24. <view class="title acea-row row-between-wrapper">
  25. <view>{{orderInfo.apply_type == 2?'快递退回信息':'到店退货信息'}}</view>
  26. <view class="location" v-if="orderInfo.apply_type == 3" @click="showMaoLocation">查看位置<text class="iconfont icon-ic_rightarrow"></text></view>
  27. </view>
  28. <view class="textInfo">
  29. <view class="acea-row row-middle">
  30. <text class="name">{{orderInfo._status.refund_name}}</text>
  31. <text class="phone">{{orderInfo._status.refund_phone}}</text>
  32. <text class="iconfont icon-ic_phone font-num" @click="goTel"></text>
  33. </view>
  34. <view class="address">地址:{{orderInfo._status.refund_address}}</view>
  35. </view>
  36. </view>
  37. <view class='list' v-if="orderInfo.apply_type == 2">
  38. <view class='item acea-row row-between-wrapper' v-if="expressList.length">
  39. <view>物流公司</view>
  40. <picker class='num' @change="bindPickerChange" :value="seIndex" :range="expressList" range-key="name">
  41. <view class="picker acea-row row-between-wrapper">
  42. <view class='reason'>{{expressList[seIndex].name}}</view>
  43. <text class='iconfont icon-ic_rightarrow'></text>
  44. </view>
  45. </picker>
  46. </view>
  47. <view class='item acea-row row-between-wrapper'>
  48. <view>物流单号</view>
  49. <input class="inputs" type="text" placeholder="请输入退货的物流单号" placeholder-class='placeholder' v-model="refundInfo.refund_express" />
  50. </view>
  51. <!-- <view class='item acea-row row-between-wrapper'>
  52. <view>联系电话</view>
  53. <input class="inputs" type="number" placeholder="请填写您的联系电话" placeholder-class='placeholder' v-model="refundInfo.refund_phone" />
  54. </view> -->
  55. </view>
  56. <view class="list">
  57. <view class='item textarea'>
  58. <view class="acea-row row-between-wrapper">
  59. <view>退货说明</view>
  60. <view class="fontNum">{{fontNum}}/100</view>
  61. </view>
  62. <textarea placeholder='选填,请您详细填写备注说明' v-model="refundInfo.refund_explain" placeholder-class="placeholder" maxlength=100 @input="sumfontnum"></textarea>
  63. </view>
  64. <view class='item acea-row row-between'>
  65. <!-- <view class='title acea-row row-between-wrapper'>
  66. <view>上传凭证</view>
  67. <view class='tip'>( 最多可上传3张 )</view>
  68. </view> -->
  69. <view class='upload acea-row row-middle'>
  70. <view class='pictrue' v-for="(item,index) in refund_reason_wap_img" :key="index">
  71. <image :src='item' mode="aspectFill"></image>
  72. <view class='iconfont icon-ic_close' @tap='DelPic(index)'></view>
  73. </view>
  74. <view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic'
  75. v-if="refund_reason_wap_img.length < 3">
  76. <image class="img" src="../static/ic_camera.png"></image>
  77. <view>上传凭证</view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view style="height: 140rpx;"></view>
  83. <view class="bntCon acea-row row-center-wrapper">
  84. <button class='returnBnt bg-color' form-type="submit">提交</button>
  85. </view>
  86. </view>
  87. </form>
  88. <!-- #ifdef MP -->
  89. <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
  90. <!-- #endif -->
  91. </view>
  92. </template>
  93. <script>
  94. import { getRefundOrderDetail, refundExpress } from '@/api/order.js';
  95. import {
  96. toLogin
  97. } from '@/libs/login.js';
  98. import {
  99. mapGetters
  100. } from "vuex";
  101. import colors from '@/mixins/color.js';
  102. export default {
  103. mixins: [colors],
  104. data() {
  105. return {
  106. expressList:[],
  107. orderInfo:{},
  108. seIndex: 0,
  109. refund_reason_wap_img: [],
  110. refundInfo:{
  111. refund_express:'',
  112. refund_explain:'',
  113. id:'',
  114. refund_express_name:'',
  115. refund_img:''
  116. },
  117. isShowAuth: false,
  118. fontNum:0,
  119. };
  120. },
  121. computed: mapGetters(['isLogin']),
  122. watch: {
  123. isLogin: {
  124. handler: function(newV, oldV) {
  125. if (newV) {
  126. this.getOrderInfo();
  127. }
  128. },
  129. deep: true
  130. }
  131. },
  132. onLoad(options) {
  133. this.orderId = options.orderId;
  134. if (this.isLogin) {
  135. this.getOrderInfo();
  136. } else {
  137. toLogin()
  138. }
  139. },
  140. onShow() {
  141. uni.removeStorageSync('form_type_cart');
  142. },
  143. methods: {
  144. onLoadFun(){
  145. this.getOrderInfo();
  146. this.isShowAuth = false;
  147. },
  148. // 授权关闭
  149. authColse: function(e) {
  150. this.isShowAuth = e
  151. },
  152. // 限制文本框字数
  153. sumfontnum(e) {
  154. this.fontNum = e.detail.value.length
  155. },
  156. /**
  157. * 打电话
  158. */
  159. goTel: function() {
  160. uni.makePhoneCall({
  161. phoneNumber: this.orderInfo._status.refund_phone
  162. })
  163. },
  164. /**
  165. * 打开地图
  166. *
  167. */
  168. showMaoLocation: function() {
  169. let latitude = this.orderInfo._status.latitude;
  170. let longitude = this.orderInfo._status.longitude;
  171. if (!latitude || !longitude) return this.$util.Tips({
  172. title: '缺少经纬度信息无法查看地图!'
  173. });
  174. uni.openLocation({
  175. latitude: parseFloat(latitude),
  176. longitude: parseFloat(longitude),
  177. scale: 8,
  178. name: this.orderInfo._status.refund_name,
  179. address: this.orderInfo._status.refund_address,
  180. success: function() {
  181. },
  182. });
  183. },
  184. /**
  185. * 申请退货
  186. */
  187. subRefund: function(e) {
  188. let that = this
  189. if (!that.refundInfo.refund_express && that.orderInfo.apply_type == 2) return this.$util.Tips({
  190. title: '请输入快递单号'
  191. });
  192. // if (!that.refundInfo.refund_phone) return this.$util.Tips({
  193. // title: '请输入手机号'
  194. // });
  195. // if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.refundInfo.refund_phone)) return this.$util.Tips({
  196. // title: '请输入正确的手机号码'
  197. // });
  198. that.refundInfo.refund_express_name = that.expressList[that.seIndex].name;
  199. that.refundInfo.refund_img = that.refund_reason_wap_img.join(',');
  200. refundExpress(that.refundInfo).then(res => {
  201. return this.$util.Tips({
  202. title: res.msg,
  203. icon: 'success'
  204. }, {
  205. tab: 5,
  206. url: '/pages/users/user_return_list/index?isT=1'
  207. });
  208. }).catch(err => {
  209. return this.$util.Tips({
  210. title: err
  211. });
  212. })
  213. },
  214. /**
  215. * 删除图片
  216. *
  217. */
  218. DelPic: function(e) {
  219. let index = e,
  220. that = this,
  221. pic = this.refund_reason_wap_img[index];
  222. that.refund_reason_wap_img.splice(index, 1);
  223. that.$set(that, 'refund_reason_wap_img', that.refund_reason_wap_img);
  224. },
  225. /**
  226. * 上传文件
  227. *
  228. */
  229. uploadpic: function() {
  230. let that = this;
  231. this.$util.uploadImageOne('upload/image', function(res) {
  232. that.refund_reason_wap_img.push(res.data.url);
  233. that.$set(that, 'refund_reason_wap_img', that.refund_reason_wap_img);
  234. });
  235. },
  236. /**
  237. * 获取订单详情
  238. *
  239. */
  240. getOrderInfo: function() {
  241. let that = this;
  242. getRefundOrderDetail(that.orderId).then(res => {
  243. that.$set(that, 'orderInfo', res.data);
  244. that.expressList = res.data.express_list;
  245. that.refundInfo.id = res.data.id;
  246. });
  247. },
  248. bindPickerChange(e) {
  249. this.$set(this, 'seIndex', e.detail.value);
  250. }
  251. }
  252. }
  253. </script>
  254. <style scoped lang="scss">
  255. .apply-return .list {
  256. background-color: #fff;
  257. width: 710rpx;
  258. border-radius: 24rpx;
  259. margin: 20rpx auto 0 auto;
  260. padding: 32rpx 24rpx;
  261. .title{
  262. width: 100%;
  263. font-weight: 500;
  264. color: #333333;
  265. font-size: 28rpx;
  266. .location{
  267. font-weight: 400;
  268. .iconfont{
  269. font-size: 24rpx;
  270. margin-left: 6rpx;
  271. }
  272. }
  273. }
  274. .textInfo{
  275. font-weight: 400;
  276. color: #333333;
  277. font-size: 28rpx;
  278. margin-top: 32rpx;
  279. .iconfont{
  280. font-size: 26rpx;
  281. margin-left: 10rpx;
  282. }
  283. .phone{
  284. margin-left: 18rpx;
  285. }
  286. .address{
  287. color: #999999;
  288. font-size: 24rpx;
  289. margin-top: 8rpx;
  290. }
  291. }
  292. }
  293. .apply-return .list .item {
  294. font-size: 28rpx;
  295. color: #333;
  296. font-weight: 400;
  297. &~.item{
  298. margin-top: 32rpx;
  299. }
  300. .fontNum{
  301. font-size: 24rpx;
  302. color: #999;
  303. }
  304. .placeholder{
  305. font-size: 26rpx;
  306. color: #CCCCCC;
  307. }
  308. }
  309. .apply-return .list .item .inputs{
  310. text-align: right;
  311. font-size: 28rpx;
  312. }
  313. .apply-return .list .item .num {
  314. color: #282828;
  315. width: 427rpx;
  316. text-align: right;
  317. }
  318. .apply-return .list .item .num .picker .reason {
  319. width: 398rpx;
  320. }
  321. .apply-return .list .item .num .picker .iconfont {
  322. color: #333;
  323. font-size: 24rpx;
  324. margin-top: 1rpx;
  325. }
  326. .apply-return .list .item textarea {
  327. height: 166rpx;
  328. font-size: 26rpx;
  329. margin-top: 24rpx;
  330. }
  331. .apply-return .list .item .placeholder {
  332. color: #bbb;
  333. }
  334. .apply-return .list .item .title {
  335. height: 95rpx;
  336. width: 100%;
  337. }
  338. .apply-return .list .item .title .tip {
  339. font-size: 30rpx;
  340. color: #bbb;
  341. }
  342. .apply-return .list .item .upload .pictrue {
  343. margin: 22rpx 23rpx 0 0;
  344. width: 156rpx;
  345. height: 156rpx;
  346. position: relative;
  347. font-size: 24rpx;
  348. color: #bbb;
  349. border-radius: 16rpx;
  350. .img{
  351. width: 48rpx;
  352. height: 48rpx;
  353. margin-bottom: 8rpx;
  354. }
  355. }
  356. .apply-return .list .item .upload .pictrue:nth-of-type(4n) {
  357. margin-right: 0;
  358. }
  359. .apply-return .list .item .upload .pictrue image {
  360. width: 100%;
  361. height: 100%;
  362. border-radius: 3rpx;
  363. }
  364. .apply-return .list .item .upload .pictrue .icon-ic_close {
  365. position: absolute;
  366. font-size: 24rpx;
  367. top: 0;
  368. right: 0;
  369. width: 32rpx;
  370. height: 32rpx;
  371. background: #999999;
  372. border-radius: 0 16rpx 0 16rpx;
  373. text-align: center;
  374. line-height: 32rpx;
  375. color: #fff;
  376. }
  377. .apply-return .list .item .upload .pictrue .icon-icon25201 {
  378. color: #bfbfbf;
  379. font-size: 50rpx;
  380. }
  381. .apply-return .list .item .upload .pictrue:nth-last-child(1) {
  382. width: 148rpx;
  383. height: 148rpx;
  384. background: #F5F5F5;
  385. font-size: 24rpx;
  386. color: #333;
  387. }
  388. .apply-return .bntCon{
  389. width: 100%;
  390. height: 120rpx;
  391. background: #FFFFFF;
  392. position: fixed;
  393. left:0;
  394. bottom: 0;
  395. bottom: calc(0rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  396. bottom: calc(0rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  397. }
  398. .apply-return .returnBnt {
  399. font-size: 28rpx;
  400. color: #fff;
  401. width: 710rpx;
  402. height: 80rpx;
  403. border-radius: 50rpx;
  404. text-align: center;
  405. line-height: 80rpx;
  406. }
  407. .goodsList{
  408. width: 710rpx;
  409. padding: 32rpx 24rpx;
  410. border-radius: 24rpx;
  411. background-color: #fff;
  412. margin: 20rpx auto 0 auto;
  413. }
  414. .goodsStyle{
  415. margin: 0;
  416. padding: 0;
  417. &~.goodsStyle{
  418. margin-top: 32rpx;
  419. }
  420. .pictrue{
  421. width: 136rpx;
  422. height: 136rpx;
  423. border-radius: 16rpx;
  424. image{
  425. border-radius: 16rpx;
  426. }
  427. }
  428. .text{
  429. color: #333;
  430. width: 506rpx;
  431. font-weight: 400;
  432. .textCon{
  433. height: 100rpx;
  434. }
  435. .info{
  436. color: #999999;
  437. font-size: 24rpx;
  438. width: 360rpx;
  439. }
  440. .money{
  441. .num{
  442. font-size: 24rpx;
  443. color: #999;
  444. margin-top: 8rpx;
  445. }
  446. }
  447. }
  448. }
  449. .goodsStyle .text .name {
  450. align-self: flex-start;
  451. }
  452. .list /deep/ .uni-input-input {
  453. text-align: right;
  454. }
  455. </style>