|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736 |
- <template>
- <view class="oderPage">
- <view class="addr-box">
- <view class="addr-box-left" v-if="form.consignee">
- <image class="text-image" :src="`${$imgUrl}applyCard/head.png`"></image>
- <view class="content">
- <view class="">
- <text class="item1">{{form.consignee}}</text>
- <text class="item2">{{form.consigneeTel}}</text>
- <text class="item3" v-if="form.defaultAddress ==1">默认</text>
- </view>
- <view class=""> {{form.region +form.address}}</view>
- </view>
- </view>
- <view v-else class="editAddress">请先编辑地址</view>
- <view class="edit" @click="address.show = true">
- <image :src="`${$imgUrl}applyCard/edit.png`" mode=""></image>
- </view>
- </view>
-
- <u-form ref="myForm">
- <view class="from">
- <u-form-item prop="cardState">
- <view class="from_item">
- <text class="left"><text style="color: red">*</text>是否寄回设备:</text>
- <radio-group @change="sendChange" class="radios">
- <block v-for="(item, index) in radiolist1" :key="item.val">
- <view class="radio-box">
- <radio :value="item.val" :checked="form.sendStatus == item.val" color="#42D175"
- style="transform:scale(0.75)" />
- <view>{{item.name}}</view>
- </view>
- </block>
- </radio-group>
- </view>
- </u-form-item>
- <u-form-item prop="logistics" v-if="form.sendStatusName == '寄回'">
- <view class="from_item">
- <text class="left"><text style="color: red">*</text>退货物流公司:</text>
- <view style="display: flex">
- <u-input v-model="form.courierCompany" class="input" @click="showPicker" placeholder="请选择"
- disabled />
- <u-icon name="arrow-right" style="margin-left: 10px;display: flex;"></u-icon>
- </view>
- </view>
- </u-form-item>
- <u-form-item prop="returnNum" v-if="form.sendStatusName == '寄回'">
- <view class="from_item">
- <text class="left"><text style="color: red"></text>退货单号:</text>
- <u-input v-model="form.courierOrderId" class="input" maxlength="32" />
- </view>
- </u-form-item>
- <u-form-item prop="cardState">
- <view class="from_item">
- <text class="left"><text style="color: red">*</text>收货方式:</text>
- <radio-group @change="receiveChange" class="radios">
- <block v-for="(item, index) in radiolist2" :key="item.val">
- <view class="radio-box">
- <radio :value="item.val" :checked="form.receiveMethod == item.val" color="#42D175"
- style="transform:scale(0.75)" />
- <view>{{item.name}}</view>
- </view>
- </block>
- </radio-group>
- </view>
- </u-form-item>
- <u-form-item prop="remark">
- <view class="from_item">
- <text class="left"><text style="color: red"></text>更换原因:</text>
- <view style="display: flex">
- <u-input v-model="form.applyRes" @click="showApplyResPicker()" class="input" disabled
- placeholder="请选择" />
- <u-icon name="arrow-right" style="margin-left: 10px;display: flex;"></u-icon>
- </view>
- </view>
- </u-form-item>
- </view>
- </u-form>
- <view>
- <!-- 物流 -->
- <u-select v-model="show" mode="single-column" :list="list" @confirm="confirm"></u-select>
- <!-- 原因 -->
- <u-select v-model="showApplyRes" mode="single-column" :list="applyResList" @confirm="applyResConfirm">
- </u-select>
- </view>
- <view class="buttonWrap">
- <button class="submit" @click="submit">提交</button>
- </view>
-
- </view>
- <!-- 地址弹窗 -->
- <u-popup mode="bottom" v-model="address.show">
- <view class="address-line">
- <view v-if="address.list" v-for="(item, index) in address.list" :key="index" @click="addressSelected(item)"
- style="margin-bottom: 40rpx" class="flex-bettwen">
- <view class="flex">
- <!-- <view class="xing"> -->
- <image class="xing" :src="`${$imgUrl}applyCard/head.png`"></image>
- <!-- </view> -->
- <view class="content">
- <view class="flex">
- <view class="name">
- {{ item.consignee }}
- </view>
- <view class="phone">
- {{ item.consigneeTel }}
- </view>
- </view>
- <view class="address">
- {{ item.region + item.address }}
- </view>
- </view>
- </view>
- <view @click.stop="editAddress(item)" style="margin-left: 80rpx" class="picture">
- <image :showLoading="true" :src="`${$imgUrl}applyCard/edit.png`"
- style="width: 48rpx; height: 48rpx"></image>
- </view>
- </view>
- <view :style="address.list ? 'margin-top: 60rpx;' : ''" class="action-bottom">
- <button type="default" class="button" @click="goToAddAddress()">
- 添加收货地址
- </button>
- </view>
- </view>
- </u-popup>
- </template>
-
- <script setup lang="ts">
- import {
- reactive,
- ref
- } from "vue";
- import {
- onLoad,
- onShow
- } from "@dcloudio/uni-app";
- import { requestNew} from "@/utils/network/request.js";
- import {
- commQueryCourier,
- addressQueryNew,orderExchange
- } from "@/utils/network/api.js";
- import {
- getItem,
- StorageKeys
- } from "@/utils/storage";
- import {
- wechatPayConfigId,
-
- } from "@/utils/network/api";
- import {
- msg
- } from "@/utils/utils";
- const list = reactive([]); //物流数据
- const apply = reactive({
- data: {
- status: undefined,
- id: ''
- }
-
- });
-
- const address = reactive({
- list: [],
- show: false
- }); //地址list
-
- const form = reactive({
- consignee: '',
- consigneeTel: '',
- address: '',
- region: '',
- sendStatusName: '寄回',
- sendStatus: '1', //0 --- 不邮寄 1 --- 邮寄
- courierCompany: '',
- courierOrderId: '',
- receiveMethod: '1',
- postalCode: '',
- receiveMethodName: '邮寄', //0 --- 不邮寄 1 --- 邮寄
- applyRes: '',
- defaultAddress: 2,
- goodsAddress:""
- });
-
-
- //入参
- const params = reactive({
- orderId: '',
- id: '',
- msg: "",
- cardExpire: "", //1:质保期过了 0:在质保期内
- obuExpire: "", //1:质保期过了 0:在质保期内
- vehicleId:"",
- oldCardId:"",
- oldObuId:"",
- applyType:""
- });
-
- const applyResList = reactive([{
- //原因
- value: "损坏",
- label: "损坏",
- },
- {
- value: "其它",
- label: "其它",
- },
-
- ]);
-
-
- const radiolist2 = reactive([{
- name: "邮寄",
- val: "1",
- }
- ]);
- // 单选数据列表
- const radiolist1 = reactive([
- {
- name: "寄回",
- val: "1",
- },
- {
- name: "不寄回",
- val: "0",
- }
- ]);
- onLoad((option) => {
- console.log("option", option)
- params.orderId = option.orderId
- params.applyType = option.applyType
- params.id = option.id
- params.vehicleId = option.vehicleId
- params.oldCardId = option.oldCardId
- params.oldObuId = option.oldObuId
- params.msg = option.msg == "undefined" ? "" : option.msg
- params.cardExpire = option.cardExpire == "undefined" ? "" : option.cardExpire
- params.obuExpire = option.obuExpire == "undefined" ? "" : option.obuExpire
- // if (option.damageMode == "ARTIFICIAL") {
- // var data = {
- // name: "寄回",
- // val: "1",
- // }
- // var data1 = {
- // name: "不寄回",
- // val: "0",
- // }
- // radiolist1.push(data)
- // radiolist1.push(data1)
- // } else {
- // var data = {
- // name: "寄回",
- // val: "1",
- // }
- // radiolist1.push(data)
- // }
- console.log("radiolist1.value", radiolist1.value)
- getexpresslist();
- getAddressList();
-
- });
- const goToAddAddress = () => {
- uni.navigateTo({
- url: "/subpackage/orders/addAddress",
- });
- };
- const editAddress = (val) => {
- uni.navigateTo({
- url: `/subpackage/orders/editAddress?content=` + JSON.stringify(val),
- });
- };
-
- const addressSelected = (val : any) => {
- console.log(val);
- form.consignee = val.consignee
- form.consigneeTel = val.consigneeTel
- form.address = val.address
- form.region = val.region
- form.postalCode = val.postalCode
- form.defaultAddress = val.defaultAddress
- address.show = false
- console.log("form.address", form.region, form.address)
- };
- // 寄回单选
- const sendChange = (e : any) => {
- console.log(e);
- form.sendStatus = e.detail.value
- };
- // 邮寄单选
- const receiveChange = (e : any) => {
- console.log(e);
- form.receiveMethod = e.detail.value
- };
- let showApplyRes = ref(false);
-
- // 打开物流先择器
- const showApplyResPicker = function () {
- showApplyRes.value = true;
- };
-
- const applyResConfirm = (e) => {
- form.applyRes = e[0].value;
- console.log(e[0].value);
- };
-
- let show = ref(false);
-
- // 打开物流先择器
- const showPicker = function () {
- show.value = true;
- };
-
- const confirm = (e) => {
- form.courierCompany = e[0].value;
- console.log(e[0].value);
- };
-
- onShow(() => {
- getexpresslist();
- getAddressList();
- });
- const getexpresslist = () => {
- //参数说明
- let options = {
- type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
- data: {}, //请求参数
- method: "POST", //提交方式(默认POST)
- showLoading: true, //是否显示加载中(默认显示)
- };
-
- //调用方式
- requestNew(commQueryCourier, options)
- .then((res) => {
- console.log("物流", res)
- res.forEach((item) => {
- list.push({
- value: item,
- label: item,
- });
- });
- })
- .catch((err) => {
- console.log(err);
- });
- };
- const getAddressList = () => {
- var data = {
- openId: getItem(StorageKeys.OpenId),
- };
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
- requestNew(addressQueryNew, options).then((res) => {
- const data = res.result;
- address.list = data;
- if (address.list.length > 0) {
- var defaultAddress = address.list[0]
- form.consignee = defaultAddress.consignee
- form.consigneeTel = defaultAddress.consigneeTel
- form.address = defaultAddress.address
- form.region = defaultAddress.region
- form.postalCode = defaultAddress.postalCode
- form.defaultAddress = defaultAddress.defaultAddress
- }
- console.log("form.address", form.address)
- });
- };
- let isClickable = true;
- const submit = () => {
- if (!isClickable) return;
- isClickable = false;
- queryCckChangejzCardInfo().then(val => {
- msg("申请换货提交成功")
- uni.navigateBack({
- delta:2
- })
- })
- };
- const queryCckChangejzCardInfo = () => {
- if (!form.address) {
- msg("请编辑收货详细地址");
- return;
- }
- var data = {
- id: params.id,
- sendStatus: form.sendStatus,
- configId: wechatPayConfigId,
- courierCompany: form.courierCompany,
- courierOrderId: form.courierOrderId,
- receiveMethod: form.receiveMethod,
- consignee: form.consignee,
- consigneeTel: form.consigneeTel,
- address: form.address,
- region: form.region,
- postalCode: form.postalCode,
- applyRes: form.applyRes,
- cardExpire: params.cardExpire,
- obuExpire: params.obuExpire,
- goodsAddress:form.goodsAddress,
- orderId:params.orderId,
- applyType:params.applyType
- };
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
- console.log("data", data)
- return new Promise(async (resolve, reject) => {
- const res = await requestNew(orderExchange, options);
- resolve(data);
- }).catch((error) => {
- reject(error);
- });
- }
- </script>
-
- <style>
- page {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- }
- </style>
- <style lang="scss" scoped>
- .radios {
- display: flex;
- }
-
- .radio-box {
- display: flex;
- align-items: center;
- padding-left: 20rpx;
- }
-
- .oderPage {
- flex: 1;
- width: 100%;
- padding: 0 20rpx;
- box-sizing: border-box;
-
- .addr-box {
- margin-top: 20rpx;
- display: flex;
- background: #fff;
- padding: 30rpx;
- justify-content: space-between;
- align-items: center;
-
- .addr-box-left {
- display: flex;
-
- .text-image {
- width: 68rpx;
- height: 68rpx;
- background: #00b38b;
- border-radius: 50%;
- text-align: center;
- font-size: 26rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- line-height: 68rpx;
- margin-right: 30rpx;
- }
-
- .content {
- view {
- font-size: 26rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
-
- .item1 {
- font-weight: 400;
- font-size: 32rpx;
- color: #111111;
- font-family: Microsoft YaHei;
- }
-
- .item2 {
- font-family: Microsoft YaHei;
- font-weight: 400;
- margin-left: 10rpx;
- font-size: 26rpx;
- color: #999999;
- }
-
- .item3 {
- width: 71rpx;
- height: 37rpx;
- background: #ffffff;
- border: 1px solid #ff8000;
- border-radius: 6rpx;
- font-size: 22rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ff8000;
- padding: 3rpx 6rpx;
- margin-left: 10rpx;
- }
- }
- }
- }
-
- .edit {
- image {
- width: 50rpx;
- height: 50rpx;
- }
- }
- }
-
- .from {
- background-color: #fff;
- margin-top: 30rpx;
- padding: 0 30rpx;
-
- ::v-deep .u-form-item {
- padding: 0;
- line-height: normal;
-
- .u-form-item__message {
- margin-bottom: 12rpx;
- }
- }
-
- .from_item {
- display: flex;
- flex-wrap: nowrap;
- justify-content: space-between;
- align-items: center;
- height: 80rpx;
- border-bottom: 1rpx solid #dcdcdc;
- .left{
- color: #004576;
- }
- .btn {
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- background: #00b38b;
- border-radius: 10rpx;
- padding: 10rpx 15rpx;
- }
-
- ::v-deep .input {
- text-align: right;
- flex: 1;
- background: transparent;
-
- input {
- text-align: right;
- }
- }
- }
-
- .from_item1 {
- display: flex;
- flex-wrap: nowrap;
- flex-direction: column;
- justify-content: space-between;
- padding: 30rpx 0;
- border-bottom: #dcdcdc 1px solid;
-
- input {
- text-align: right;
- }
-
- .textarea {
- background-color: #f1f1f1;
- width: 100%;
- border-radius: 20rpx;
- margin-top: 10rpx;
- text-indent: 1rem;
- height: 180rpx;
- padding: 20rpx;
- box-sizing: border-box;
-
- }
- }
- }
- }
-
- .address-line {
- padding: 20px;
-
- .flex-bettwen {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
-
- .xing {
- width: 68rpx;
- height: 68rpx;
- background: #00b38b;
- border-radius: 50%;
- text-align: center;
- font-size: 26rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- line-height: 68rpx;
- }
-
- .content {
- margin-left: 20px;
-
- .name {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 500;
- color: #333333;
- }
-
- .phone {
- margin-left: 10rpx;
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 36rpx;
- }
-
- .address {
- margin-top: 10rpx;
- font-size: 26rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- line-height: 36rpx;
- }
-
- .picture {
- width: 48rpx;
- height: 48rpx;
- }
-
- .editIcon {
- width: 48rpx;
- height: 48rpx;
- }
- }
- }
-
- .action {
- padding-bottom: 100rpx;
-
- .button {
- height: 80rpx;
- background: linear-gradient(to right,#01243A,#004576);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-weight: 400;
- color: #ffffff;
- line-height: 80rpx;
- }
- }
-
- .action-bottom {
- padding-bottom: 30rpx;
-
- .button {
- height: 80rpx;
- background: linear-gradient(to right,#01243A,#004576);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-weight: 400;
- color: #ffffff;
- line-height: 80rpx;
- }
- }
-
- .flex {
- display: flex;
- align-items: center;
- }
-
- .submit {
- width: 90%;
- height: 80rpx;
- background: linear-gradient(to right,#01243A,#004576);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- line-height: 80rpx;
- }
-
- .default {
- height: 80rpx;
- background: rgba(0, 179, 139, .1);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-weight: 400;
- color: #00B38B;
- line-height: 80rpx;
- width: 45%;
- border: 1px solid #00B38B;
- }
-
- .button::after {
- border: none;
- }
-
- .buttonWrap {
- display: flex;
- justify-content: space-evenly;
- align-items: center;
- margin-top: 60rpx;
- }
-
- .editAddress {
- font-size: 30rpx;
- }
-
- .attention {
- padding: 20rpx;
- font-size: 30rpx;
- }
- .no_pay{
- font-size: 28rpx;
- padding: 0 20rpx;
- }
- .no_pay>text{
- color: red;
- margin-right: 10rpx;
- }
- </style>
|