1 line
12 KiB
Plaintext
1 line
12 KiB
Plaintext
{"version":3,"file":"apply.js","sources":["../../../../../../../src/modules/mall/order/aftersale/apply.vue","../../../../../../../uniPage:/bW9kdWxlc1xtYWxsXG9yZGVyXGFmdGVyc2FsZVxhcHBseS52dWU"],"sourcesContent":["<!-- 售后申请 -->\r\n<template>\r\n <s-layout title=\"申请售后\">\r\n <!-- 售后商品 -->\r\n <view class=\"goods-box\">\r\n <s-goods-item\r\n :img=\"state.item.picUrl\"\r\n :title=\"state.item.spuName\"\r\n :skuText=\"state.item.properties?.map((property) => property.valueName).join(' ')\"\r\n :price=\"state.item.price\"\r\n :num=\"state.item.count\"\r\n />\r\n </view>\r\n\r\n <uni-forms ref=\"form\" v-model=\"formData\" :rules=\"rules\" label-position=\"top\">\r\n <!-- 售后类型 -->\r\n <view class=\"refund-item\">\r\n <view class=\"item-title ss-m-b-20\">售后类型</view>\r\n <view class=\"ss-flex-col\">\r\n <radio-group @change=\"onRefundChange\">\r\n <label\r\n class=\"ss-flex ss-col-center ss-p-y-10\"\r\n v-for=\"(item, index) in state.wayList\"\r\n :key=\"index\"\r\n >\r\n <radio\r\n :checked=\"formData.type === item.value\"\r\n color=\"var(--ui-BG-Main)\"\r\n style=\"transform: scale(0.8)\"\r\n :value=\"item.value\"\r\n />\r\n <view class=\"item-value ss-m-l-8\">{{ item.text }}</view>\r\n </label>\r\n </radio-group>\r\n </view>\r\n </view>\r\n <!-- 退款金额 -->\r\n <view class=\"refund-item ss-flex ss-col-center ss-row-between\" @tap=\"state.showModal = true\">\r\n <text class=\"item-title\">退款金额</text>\r\n <view class=\"ss-flex refund-cause ss-col-center\">\r\n <text class=\"ss-m-r-20\">¥{{ fen2yuan(state.item.payPrice) }}</text>\r\n </view>\r\n </view>\r\n <!-- 申请原因 -->\r\n <view class=\"refund-item ss-flex ss-col-center ss-row-between\" @tap=\"state.showModal = true\">\r\n <text class=\"item-title\">申请原因</text>\r\n <view class=\"ss-flex refund-cause ss-col-center\">\r\n <text class=\"ss-m-r-20\" v-if=\"formData.applyReason\">{{ formData.applyReason }}</text>\r\n <text class=\"ss-m-r-20\" v-else>请选择申请原因~</text>\r\n <text class=\"cicon-forward\" style=\"height: 28rpx\"></text>\r\n </view>\r\n </view>\r\n\r\n <!-- 留言 -->\r\n <view class=\"refund-item\">\r\n <view class=\"item-title ss-m-b-20\">相关描述</view>\r\n <view class=\"describe-box\">\r\n <uni-easyinput\r\n :inputBorder=\"false\"\r\n class=\"describe-content\"\r\n type=\"textarea\"\r\n maxlength=\"120\"\r\n autoHeight\r\n v-model=\"formData.applyDescription\"\r\n placeholder=\"客官~请描述您遇到的问题,建议上传照片\"\r\n />\r\n <!-- TODO 芋艿:上传的测试 -->\r\n <view class=\"upload-img\">\r\n <s-uploader\r\n v-model:url=\"formData.images\"\r\n fileMediatype=\"image\"\r\n limit=\"9\"\r\n mode=\"grid\"\r\n :imageStyles=\"{ width: '168rpx', height: '168rpx' }\"\r\n />\r\n </view>\r\n </view>\r\n </view>\r\n </uni-forms>\r\n\r\n <!-- 底部按钮 -->\r\n <su-fixed bottom placeholder>\r\n <view class=\"foot-wrap\">\r\n <view class=\"foot_box ss-flex ss-col-center ss-row-between ss-p-x-30\">\r\n <button\r\n class=\"ss-reset-button contcat-btn\"\r\n @tap=\"sheep.$router.go('/modules/mall/chat/index')\"\r\n >\r\n 联系客服\r\n </button>\r\n <button class=\"ss-reset-button ui-BG-Main-Gradient sub-btn\" @tap=\"submit\">提交</button>\r\n </view>\r\n </view>\r\n </su-fixed>\r\n\r\n <!-- 申请原因弹窗 -->\r\n <su-popup :show=\"state.showModal\" round=\"10\" :showClose=\"true\" @close=\"state.showModal = false\">\r\n <view class=\"modal-box page_box\">\r\n <view class=\"modal-head item-title head_box ss-flex ss-row-center ss-col-center\">\r\n 申请原因\r\n </view>\r\n <view class=\"modal-content content_box\">\r\n <radio-group @change=\"onChange\">\r\n <label class=\"radio ss-flex ss-col-center\" v-for=\"item in state.reasonList\" :key=\"item\">\r\n <view class=\"ss-flex-1 ss-p-20\">{{ item }}</view>\r\n <radio\r\n :value=\"item\"\r\n color=\"var(--ui-BG-Main)\"\r\n :checked=\"item === state.currentValue\"\r\n />\r\n </label>\r\n </radio-group>\r\n </view>\r\n <view class=\"modal-foot foot_box ss-flex ss-row-center ss-col-center\">\r\n <button class=\"ss-reset-button close-btn ui-BG-Main-Gradient\" @tap=\"onReason\">\r\n 确定\r\n </button>\r\n </view>\r\n </view>\r\n </su-popup>\r\n </s-layout>\r\n</template>\r\n\r\n<script setup>\r\nimport sheep from '@/sheep'\r\nimport { onLoad } from '@dcloudio/uni-app'\r\nimport { reactive, ref } from 'vue'\r\nimport OrderApi from '@/sheep/api/trade/order'\r\nimport TradeConfigApi from '@/sheep/api/trade/config'\r\nimport { fen2yuan } from '@/sheep/hooks/useGoods'\r\nimport AfterSaleApi from '@/sheep/api/trade/afterSale'\r\nimport { WxaSubscribeTemplate } from '@/sheep/util/const'\r\n\r\nconst form = ref(null)\r\nconst state = reactive({\r\n orderId: 0, // 订单编号\r\n itemId: 0, // 订单项编号\r\n order: {}, // 订单\r\n item: {}, // 订单项\r\n config: {}, // 交易配置\r\n\r\n // 售后类型\r\n wayList: [\r\n {\r\n text: '仅退款',\r\n value: '10',\r\n },\r\n {\r\n text: '退款退货',\r\n value: '20',\r\n },\r\n ],\r\n reasonList: [], // 可选的申请原因数组\r\n showModal: false, // 是否显示申请原因弹窗\r\n currentValue: '', // 当前选择的售后原因\r\n})\r\nconst formData = reactive({\r\n way: '',\r\n applyReason: '',\r\n applyDescription: '',\r\n images: [],\r\n})\r\nconst rules = reactive({})\r\n\r\n// 提交表单\r\nasync function submit() {\r\n const data = {\r\n orderItemId: state.itemId,\r\n refundPrice: state.item.payPrice,\r\n ...formData,\r\n }\r\n const { code } = await AfterSaleApi.createAfterSale(data)\r\n if (code === 0) {\r\n uni.showToast({\r\n title: '申请成功',\r\n })\r\n sheep.$router.go('/modules/mall/order/aftersale/list')\r\n }\r\n}\r\n\r\n// 选择售后类型\r\nfunction onRefundChange(e) {\r\n formData.way = e.detail.value\r\n // 清理理由\r\n state.reasonList =\r\n formData.way === '10'\r\n ? state.config.afterSaleRefundReasons || []\r\n : state.config.afterSaleReturnReasons || []\r\n formData.applyReason = ''\r\n state.currentValue = ''\r\n}\r\n\r\n// 选择申请原因\r\nfunction onChange(e) {\r\n state.currentValue = e.detail.value\r\n}\r\n\r\n// 确定\r\nfunction onReason() {\r\n formData.applyReason = state.currentValue\r\n state.showModal = false\r\n}\r\n\r\nonLoad(async (options) => {\r\n // 解析参数\r\n if (!options.orderId || !options.itemId) {\r\n sheep.$helper.toast(`缺少订单信息,请检查`)\r\n return\r\n }\r\n state.orderId = options.orderId\r\n state.itemId = parseInt(options.itemId)\r\n\r\n // 读取订单信息\r\n const { code, data } = await OrderApi.getOrder(state.orderId)\r\n if (code !== 0) {\r\n return\r\n }\r\n state.order = data\r\n state.item = data.items.find((item) => item.id === state.itemId) || {}\r\n\r\n // 设置选项\r\n if (state.order.status === 10) {\r\n state.wayList.splice(1, 1)\r\n }\r\n\r\n // 读取配置\r\n state.config = (await TradeConfigApi.getTradeConfig()).data\r\n})\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n.item-title {\r\n font-size: 30rpx;\r\n font-weight: bold;\r\n color: rgba(51, 51, 51, 1);\r\n // margin-bottom: 20rpx;\r\n}\r\n\r\n// 售后项目\r\n.refund-item {\r\n padding: 30rpx;\r\n background-color: #fff;\r\n border-bottom: 1rpx solid #f5f5f5;\r\n\r\n &:last-child {\r\n border: none;\r\n }\r\n\r\n // 留言\r\n .describe-box {\r\n box-sizing: border-box;\r\n width: 690rpx;\r\n padding: 30rpx;\r\n background: rgba(249, 250, 251, 1);\r\n border-radius: 20rpx;\r\n\r\n .describe-content {\r\n height: 200rpx;\r\n font-size: 24rpx;\r\n font-weight: 400;\r\n color: #333;\r\n }\r\n }\r\n\r\n // 联系方式\r\n .input-box {\r\n height: 84rpx;\r\n background: rgba(249, 250, 251, 1);\r\n border-radius: 20rpx;\r\n }\r\n}\r\n\r\n.goods-box {\r\n padding: 20rpx;\r\n margin-bottom: 20rpx;\r\n background: #fff;\r\n}\r\n\r\n.foot-wrap {\r\n width: 100%;\r\n height: 100rpx;\r\n}\r\n\r\n.foot_box {\r\n height: 100rpx;\r\n background-color: #fff;\r\n\r\n .sub-btn {\r\n width: 336rpx;\r\n font-size: 28rpx;\r\n line-height: 74rpx;\r\n color: rgba(#fff, 0.9);\r\n border-radius: 38rpx;\r\n }\r\n\r\n .contcat-btn {\r\n width: 336rpx;\r\n font-size: 28rpx;\r\n font-weight: 400;\r\n line-height: 74rpx;\r\n color: rgba(51, 51, 51, 1);\r\n background: rgba(238, 238, 238, 1);\r\n border-radius: 38rpx;\r\n }\r\n}\r\n\r\n.modal-box {\r\n width: 750rpx;\r\n background: #fff;\r\n // height: 680rpx;\r\n border-radius: 30rpx 30rpx 0 0;\r\n\r\n .modal-head {\r\n height: 100rpx;\r\n font-size: 30rpx;\r\n }\r\n\r\n .modal-content {\r\n font-size: 28rpx;\r\n }\r\n\r\n .modal-foot {\r\n .close-btn {\r\n width: 710rpx;\r\n line-height: 80rpx;\r\n color: rgba(#fff, 0.9);\r\n border-radius: 40rpx;\r\n }\r\n }\r\n}\r\n\r\n.success-box {\r\n width: 600rpx;\r\n padding: 90rpx 0 64rpx 0;\r\n\r\n .cicon-check-round {\r\n font-size: 96rpx;\r\n color: #04b750;\r\n }\r\n\r\n .success-title {\r\n font-size: 32rpx;\r\n font-weight: 500;\r\n color: #333333;\r\n }\r\n\r\n .success-btn {\r\n width: 492rpx;\r\n height: 70rpx;\r\n background: linear-gradient(90deg, var(--ui-BG-Main-gradient), var(--ui-BG-Main));\r\n border-radius: 35rpx;\r\n }\r\n}\r\n</style>\r\n","import MiniProgramPage from 'D:/App/Work/addr/acdr-ui/src/modules/mall/order/aftersale/apply.vue'\nwx.createPage(MiniProgramPage)"],"names":["ref","reactive","AfterSaleApi","uni","sheep","onLo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