123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644 |
- <template>
- <view class="container">
- <JHeader title="申请退款" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
- <view class="content" style="padding-bottom:200upx;">
- <view v-for="(item, index) in orderList" :key="index" class="order-list-box">
- <view class="item">
- <view class="order-info-box">
- <view class="order-info">
- <view class="order-info-item">
- <image :src="common.seamingImgUrl(item.image)" class="product-img"></image>
- <view class="info-box">
- <text class="product-name">{{ item.productName }}</text>
- <view class="product-sku">{{ item.sku }} {{ item.value }}</view>
- <view class="price-sku-box">
- <text class="product-price">
- <text class="fuhao">¥</text>
- {{ item.price }}
- </text>
- <text class="product-num">x {{ item.number }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="afterSale-select-box">
- <view class="item" @click="refundType">
- <view class="l">退款类型</view>
- <view v-if="afterType == 1" class="r-box">
- <text>仅退款</text>
- <tui-icon name="arrowright" :size="48" unit="upx" color="#999999" margin="0 0 0 10upx"></tui-icon>
- </view>
- <view v-if="afterType == 2" class="r-box">
- <text>退货退款</text>
- <tui-icon name="arrowright" :size="48" unit="upx" color="#999999" margin="0 0 0 10upx"></tui-icon>
- </view>
- </view>
- <view class="item" @click="openStatusSelect">
- <view class="l">货物状态</view>
- <view v-if="ReturnMoneyQuery.goodsState == 0" class="r-box">
- <text>未收到货</text>
- <tui-icon name="arrowright" :size="48" unit="upx" color="#999999" margin="0 0 0 10upx"></tui-icon>
- </view>
- <view v-if="ReturnMoneyQuery.goodsState == 1" class="r-box">
- <text>已收到货</text>
- <tui-icon name="arrowright" :size="48" unit="upx" color="#999999" margin="0 0 0 10upx"></tui-icon>
- </view>
- </view>
- <view class="item" @click="openReasonSelect">
- <view class="l">退款原因</view>
- <view class="r-box">
- <text>{{ liyoutext }}</text>
- <tui-icon name="arrowright" :size="48" unit="upx" color="#999999" margin="0 0 0 10upx"></tui-icon>
- </view>
- </view>
- </view>
- <view class="afterSale-select-box mt20">
- <view class="item">
- <view class="l">
- 退款金额:
- <text class="order-status">¥ {{ sellPriceitem.toFixed(2) }}</text>
- </view>
- </view>
- <view class="item item-start">
- <view class="l">退款说明:</view>
- <view class="r-box r-box2">
- <input
- v-model="ReturnMoneyQuery.returnDesc" maxlength="200" type="text" placeholder="选填"
- class="r-box-input"
- ></input>
- </view>
- </view>
- </view>
- <view class="afterSale-select-box mt20">
- <view class="upload-title">上传凭证</view>
- <view class="mar-left-10 mar-top-10">
- <ATFMoreUpload :imgs="fileList" @upload="handleSaveImg" @delete="handleDeleteImg"></ATFMoreUpload>
- </view>
- </view>
- <view class="order-flow-box">
- <view class="flow-word">退款流程:</view>
- <view class="flow-word mt25">
- <text>1、退货说明并提交</text>
- <text>2、2天内等待卖家处理,超时默认同意退款</text>
- <text>3、卖家同意,退款金额原路退还</text>
- </view>
- <view class="flow-word mt50">注:退款金额以实际支付价格为准</view>
- </view>
- </view>
- <view
- class="order-confirm-box" style="padding-top:30upx;"
- :style="{ 'padding-bottom': (isIphone == true ? 60 : 0) + 'rpx' }"
- >
- <text class="btn" @click="confirmTap">
- 提交
- </text>
- </view>
- <!-- 货物状态弹框 -->
- <tui-bottom-popup :show="refundTypeShow" @close="refundTypeShow = false">
- <view class="alert-box">
- <view class="afterSale-status-box">
- <view class="status-title">退款类型</view>
- <view class="item-box">
- <view class="item" @click="afterType = 1">
- <text class="status-select-title">仅退款</text>
- <tui-icon
- v-if="afterType == 1" name="circle-fill" :size="40" unit="upx"
- color="#c5aa7b"
- margin="30upx"
- ></tui-icon>
- <tui-icon v-else name="circle" :size="40" unit="upx" color="#cccccc" margin="30upx"></tui-icon>
- </view>
- <view class="item" @click="afterType = 2">
- <text class="status-select-title">退货退款</text>
- <tui-icon
- v-if="afterType == 2" name="circle-fill" :size="40" unit="upx"
- color="#c5aa7b"
- margin="30upx"
- ></tui-icon>
- <tui-icon v-else name="circle" :size="40" unit="upx" color="#cccccc" margin="30upx"></tui-icon>
- </view>
- </view>
- <view class="status-btn" @click="closeAfterSelect">
- 确定
- </view>
- </view>
- </view>
- </tui-bottom-popup>
- <tui-bottom-popup :show="cargoStatusShowFalg" @close="closeStatusSelect">
- <view class="alert-box">
- <view class="afterSale-status-box">
- <view class="status-title">货物状态</view>
- <view class="item-box">
- <view class="item" @click="ReturnMoneyQuery.goodsState = 0">
- <text class="status-select-title">未收到货</text>
- <tui-icon
- v-if="ReturnMoneyQuery.goodsState == 0" name="circle-fill" :size="40" unit="upx"
- color="#c5aa7b"
- margin="30upx"
- ></tui-icon>
- <tui-icon v-else name="circle" :size="40" unit="upx" color="#cccccc" margin="30upx"></tui-icon>
- </view>
- <view class="item" @click="ReturnMoneyQuery.goodsState = 1">
- <text class="status-select-title">已收到货</text>
- <tui-icon
- v-if="ReturnMoneyQuery.goodsState == 1" name="circle-fill" :size="40" unit="upx"
- color="#c5aa7b"
- margin="30upx"
- ></tui-icon>
- <tui-icon v-else name="circle" :size="40" unit="upx" color="#cccccc" margin="30upx"></tui-icon>
- </view>
- </view>
- <view class="status-btn" @click="closeStatusSelect">
- 确定
- </view>
- </view>
- </view>
- </tui-bottom-popup>
- <!-- 退款原因弹框 -->
- <tui-bottom-popup :show="reasonShowFalg" @close="reasonShowFalg = false">
- <view class="alert-box">
- <view class="afterSale-status-box" scroll-y style="height:60%;">
- <view class="status-title">退款原因</view>
- <view class="item-box">
- <view v-for="(item, index) in liyouData" :key="index" class="item" @click="returnReasonTap(item, index)">
- <text class="status-select-title">{{ item }}</text>
- <tui-icon
- v-if="ReturnMoneyQuery.returnReason == index" name="circle-fill" :size="40" unit="upx"
- color="#c5aa7b" margin="30upx"
- ></tui-icon>
- <tui-icon v-else name="circle" :size="40" unit="upx" color="#cccccc" margin="30upx"></tui-icon>
- </view>
- </view>
- <view class="status-btn" @click="closeReasonSelect">
- 确定
- </view>
- </view>
- </view>
- </tui-bottom-popup>
- </view>
- </template>
- <script>
- import { getReturnPriceRefundMoneyApi, getReasonSelectEnumsApi, updateApplyReturnMoneySubmitApi } from '../../../api/anotherTFInterface'
- import { T_REFUND_APPLY_ITEM, T_AFTER_SALE_APPLY_REFUND } from '../../../constant'
- export default {
- name: 'AfterSaleApplyRefund',
- data() {
- return {
- cargoStatusShowFalg: false,
- refundTypeShow: false,
- reasonShowFalg: false,
- orderList: [],
- ReturnMoneyQuery: {
- goodsState: 0,
- orderCode: '',
- orderProductIds: '',
- refundFee: 0,
- returnDesc: '',
- returnImgs: '',
- returnReason: 0
- },
- fileList: [],
- sellPriceitem: 0, // 退款价格
- liyouData: [],
- liyoutext: '',
- orderId: 0,
- isIphone: false,
- commentImgs: '',
- afterType: 1,
- isAllSelect: 0
- }
- },
- onReady() {
- this.isIphone = getApp().globalData.isIphone
- },
- async onLoad(options) {
- if (uni.getStorageSync(T_REFUND_APPLY_ITEM)) {
- this.orderList.push(uni.getStorageSync(T_REFUND_APPLY_ITEM))
- } else if (uni.getStorageSync(T_AFTER_SALE_APPLY_REFUND)) {
- this.orderList = uni.getStorageSync(T_AFTER_SALE_APPLY_REFUND)
- }
- this.orderId = parseInt(options.orderId)
- this.isAllSelect = Number(options.isAllSelect)
- this.orderList.forEach((el) => {
- if (this.isAllSelect) {
- this.sellPriceitem = this.sellPriceitem + (el.number * el.price) + el.logisticsPrice
- } else {
- this.sellPriceitem = this.sellPriceitem + (el.number * el.price)
- }
- })
- this.getReasonEnums()
- uni.removeStorageSync(T_REFUND_APPLY_ITEM)
- uni.removeStorageSync(T_AFTER_SALE_APPLY_REFUND)
- this.sellPriceitem = await this.HandleGetRefundMoney()
- },
- methods: {
- handleSaveImg(imgUrl) {
- this.fileList.push(imgUrl)
- this.$forceUpdate()
- },
- handleDeleteImg(imgUrl) {
- this.fileList.splice(this.fileList.findIndex((item) => item === imgUrl), 1)
- this.$forceUpdate()
- },
- // 算钱
- HandleGetRefundMoney() {
- return new Promise((resolve, reject) => {
- uni.showLoading()
- getReturnPriceRefundMoneyApi({
- orderId: this.orderId,
- isAllSelect: this.isAllSelect,
- skus: this.orderList,
- afterType: 2,
- goodsState: this.ReturnMoneyQuery.goodsState
- }).then((res) => {
- uni.hideLoading()
- resolve(parseFloat(res.json))
- })
- .catch((e) => {
- uni.hideLoading()
- })
- })
- },
- confirmTap() {
- if (this.fileList.length > 0) {
- for (let i = 0; i < this.fileList.length; i++) {
- this.commentImgs += this.fileList[i] + ','
- }
- }
- this.ReturnMoney()
- },
- getReasonEnums() {
- getReasonSelectEnumsApi({}).then((res) => {
- this.liyouData = res.data
- this.liyoutext = this.liyouData[0]
- })
- },
- ReturnMoney() {
- if (this.ReturnMoneyQuery.goodsState === '') {
- uni.showToast({
- title: '请选择货物状态!',
- duration: 2000,
- icon: 'none'
- })
- } else if (this.liyoutext == '') {
- uni.showToast({
- title: '请选择退款原因!',
- duration: 2000,
- icon: 'none'
- })
- } else {
- uni.showLoading({
- mask: true,
- title: '正在提交...'
- })
- const skusobjdata = []
- this.orderList.forEach((i) => {
- const skusobj = {}
- skusobj.skuId = i.skuId
- skusobj.number = i.number
- skusobjdata.push(skusobj)
- })
- updateApplyReturnMoneySubmitApi({
- orderId: this.orderId,
- afterType: this.afterType,
- goodsState: this.ReturnMoneyQuery.goodsState,
- price: this.sellPriceitem,
- returnReason: this.liyoutext,
- explain: this.ReturnMoneyQuery.returnDesc,
- image: this.commentImgs,
- skus: skusobjdata,
- isAllSelect: this.isAllSelect
- }).then((res) => {
- uni.hideLoading()
- uni.showToast({
- title: '提交成功'
- })
- setTimeout(() => {
- uni.redirectTo({
- url: `/another-tf/another-serve/afterSale/index`
- })
- }, 1500)
- })
- .catch((res) => {
- uni.showToast({
- title: '商品已在售后,请勿重新操作!',
- duration: 2000,
- icon: 'none'
- })
- uni.hideLoading()
- })
- }
- },
- // 理由
- returnReasonTap(item, index) {
- this.ReturnMoneyQuery.returnReason = index
- this.liyoutext = item
- },
- openStatusSelect() {
- this.cargoStatusShowFalg = true
- },
- refundType() {
- this.refundTypeShow = true
- },
- openReasonSelect() {
- this.reasonShowFalg = true
- },
- async closeStatusSelect() {
- this.cargoStatusShowFalg = false
- this.sellPriceitem = await this.HandleGetRefundMoney()
- },
- closeAfterSelect() {
- this.refundTypeShow = false
- },
- closeReasonSelect() {
- this.reasonShowFalg = false
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .content {
- padding: 0 0 120upx;
- box-sizing: border-box;
- }
- .order-list-box {
- padding: 20upx 30upx;
- box-sizing: border-box;
- }
- .order-list-box .item {
- /* margin-bottom: 20upx; */
- background: #fff;
- border-radius: 10upx;
- }
- .order-status {
- font-size: 28upx;
- color: #C83732;
- font-weight: 500;
- }
- .order-info-box {
- padding: 0 30upx;
- box-sizing: border-box;
- }
- .order-info-item {
- display: flex;
- flex-direction: row;
- padding: 20upx 0;
- border-bottom: solid 1px #eee;
- }
- .order-info-item:last-child {
- border-bottom: none;
- }
- .product-img {
- width: 180upx;
- height: 180upx;
- border-radius: 10upx;
- margin-right: 30upx;
- }
- .info-box {
- flex: 1;
- display: flex;
- flex-direction: column;
- }
- .product-name {
- font-size: 26upx;
- color: #333;
- height: 68upx;
- line-height: 34upx;
- display: -webkit-box;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
- .price-sku-box {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .product-sku {
- font-size: 24upx;
- color: #999;
- margin-top: 30upx;
- }
- .product-price {
- font-size: 28upx;
- color: #333;
- font-weight: 400;
- }
- .product-price .fuhao {
- font-size: 28upx;
- }
- .product-num {
- font-size: 28upx;
- color: #999;
- }
- .afterSale-select-box {
- width: 100%;
- background: #fff;
- padding: 0 30upx;
- box-sizing: border-box;
- }
- .afterSale-select-box .item {
- height: 100upx;
- border-bottom: 1px solid #e5e5e5;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- font-size: 28upx;
- color: #333;
- }
- .afterSale-select-box .item:last-of-type {
- border-bottom: none;
- }
- .afterSale-select-box .item.item-start {
- justify-content: flex-start;
- }
- .afterSale-select-box .item .l {
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- .afterSale-select-box .item .afterSale-img {
- width: 26upx;
- height: 26upx;
- margin-right: 20upx;
- }
- .afterSale-select-box .item .r-box {
- display: flex;
- flex-direction: row;
- align-items: center;
- color: #999;
- }
- .afterSale-select-box .item .r-box2 {
- width: 100%;
- flex: 1;
- }
- .afterSale-select-box .item .r {
- width: 24upx;
- height: 24upx;
- margin-left: 10upx;
- }
- .mt20 {
- margin-top: 20upx;
- }
- .r-box-input {
- text-align: left;
- flex: 1;
- z-index: 0;
- }
- .upload-title {
- font-size: 28upx;
- color: #333;
- padding: 30upx 0;
- }
- .order-flow-box {
- display: flex;
- flex-direction: column;
- padding: 30upx;
- box-sizing: border-box;
- }
- .flow-word {
- font-size: 24upx;
- color: #999;
- display: flex;
- flex-direction: column;
- }
- .mt25 {
- margin-top: 20upx;
- }
- .mt50 {
- margin-top: 30upx;
- margin-bottom: 20upx;
- }
- .order-confirm-box {
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 180upx;
- background: #fff;
- padding: 0 30upx;
- box-sizing: border-box;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- }
- .order-confirm-box .btn {
- width: 100%;
- height: 100upx;
- line-height: 100upx;
- background: #333333;
- font-size: 28upx;
- color: #fff;
- text-align: center;
- }
- .alert-box {
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.5);
- }
- .afterSale-status-box {
- width: 100%;
- background: #fff;
- border-radius: 15upx 15upx 0upx 0upx;
- }
- .status-title {
- width: 100%;
- height: 140upx;
- background: #fff;
- border-radius: 15upx 15upx 0 0;
- font-size: 34upx;
- color: #333;
- text-align: center;
- line-height: 140upx;
- position: fixed;
- left: 0;
- }
- .afterSale-status-box .item {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- border-bottom: 1px solid #e5e5e5;
- }
- .afterSale-status-box .item:last-of-type {
- border-bottom: none;
- }
- .afterSale-status-box .item-box {
- padding: 140upx 0;
- }
- .afterSale-status-box .status-select-title {
- padding: 0 0 0 30upx;
- box-sizing: border-box;
- font-size: 28upx;
- color: #333;
- }
- .afterSale-status-box .status-btn {
- width: 100%;
- height: 100upx;
- line-height: 100upx;
- background: #333333;
- font-size: 28upx;
- color: #F5DEB2;
- text-align: center;
- position: fixed;
- bottom: 0;
- left: 0;
- }
- </style>
|