Commit e45ac04f authored by 彭佳妮(贵阳日报)'s avatar 彭佳妮(贵阳日报)
parents 4ae7ee7a 901e0069
......@@ -2,7 +2,7 @@
VITE_APP_ENV = 'production'
# URL路径
VITE_APP_BASE_URL = 'http://test.rhhzkj.com:8080'
VITE_APP_BASE_URL = 'https://api.rddyz.com'
# 照片url路径
VITE_APP_IMG_URL = 'http://file.rhhzkj.com:8080'
\ No newline at end of file
VITE_APP_IMG_URL = 'https://file.rddyz.com'
\ No newline at end of file
......@@ -9,7 +9,13 @@
<view class="full_list" v-else>
<wd-swipe-action>
<view class="additem" v-for="(item, index) in addressList" :key="index">
<view
@click.stop="selectAddress(item)"
:class="activeAdd === item ? 'acitve-additem' : 'additem'"
class="additem"
v-for="(item, index) in addressList"
:key="index"
>
<view class="additem_l">
<view class="address">{{ item.addr }}</view>
<view class="info">
......@@ -22,7 +28,7 @@
<view class="txt">默认</view>
</view>
<view v-else class="box" @click="deleteAdd(item.addrId)">
<view v-else class="box" @click.stop="deleteAdd(item.addrId)">
<wd-icon name="circle1" size="12px"></wd-icon>
<view class="txt">删除</view>
</view>
......@@ -47,24 +53,35 @@ import { getAddressList, deleteAddress } from '@/api/address';
const isAdressEmpty = ref(false);
const addressList = ref([]);
const activeAdd = ref(null);
const getAddressListData = async () => {
const { data: res } = await getAddressList();
console.log(res);
if (res) {
addressList.value = res;
activeAdd.value = res.filter((item) => {
return item.commonAddr === 1;
})[0];
res.length === 0 ? (isAdressEmpty.value = true) : (isAdressEmpty.value = false);
}
};
onLoad(() => {});
onShow(() => {
  getAddressListData();
getAddressListData();
});
const addNewAddress = () => {
xma.navigateTo({ url: '/pages/address/addressEdit?new=true' });
};
const selectAddress = (item) => {
activeAdd.value = item;
xma.setStorageSync('address', item);
xma.navigateBack({
delta: 1,
});
};
const editAddress = (col) => {
xma.navigateTo({
url: `/pages/address/addressEdit?content=${JSON.stringify(col)}`,
......@@ -104,6 +121,7 @@ page {
margin-top: 20rpx;
padding-bottom: 180rpx;
.acitve-additem,
.additem {
width: 710rpx;
padding: 20rpx;
......@@ -170,7 +188,9 @@ page {
}
}
}
.acitve-additem {
border: 2rpx solid #fa5151;
}
.addBtn {
width: 630rpx;
height: 72rpx;
......
......@@ -161,7 +161,6 @@ const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const textInputs = ref('');
const basketIds = ref([]);
const activeCouponId = ref('');
const changeAddress = ref(false);
const addressParams = ref({});
const showpopup = ref(false);
const outTradeNos = ref(null);
......@@ -177,12 +176,15 @@ onLoad((options) => {
skuIds.value = skuId;
types.value = type;
if (type === 'qg') {
console.log('1111111111111111111');
groupBuyConfirmFn(prodId, skuId).then((res) => {
useraddrDefaultUserAddrFn().then(() => {
groupBuyUpdateFnQg();
});
});
} else {
console.log('22222222222222222222222');
basketIds.value = ids.split(',');
sgyrddBasketConfirmFn(basketIds.value).then(() => {
useraddrDefaultUserAddrFn().then(() => {
......@@ -193,6 +195,7 @@ onLoad((options) => {
});
function groupBuyUpdateFnQg(couponUserId = '') {
const { receiverName, receiverMobile, receiverAddress } = addressParams.value;
groupBuyUpdate({
key: orderInfo.value.key,
couponUserId,
......@@ -206,21 +209,37 @@ function groupBuyUpdateFnQg(couponUserId = '') {
});
}
onShow(() => {
if (changeAddress.value) {
const storgeAddress = xma.getStorageSync('address') || null;
if (storgeAddress) {
addressInfo.value = storgeAddress;
addressParams.value.receiverName = storgeAddress.receiver;
addressParams.value.receiverMobile = storgeAddress.mobile;
addressParams.value.receiverAddress = storgeAddress.addr;
if (types.value === 'qg') {
groupBuyConfirmFn(prodIds.value, skuIds.value).then((res) => {
useraddrDefaultUserAddrFn().then(() => {
groupBuyUpdateFnQg();
});
groupBuyUpdateFnQg();
});
} else {
sgyrddBasketConfirmFn(basketIds.value).then(() => {
useraddrDefaultUserAddrFn().then(() => {
groupBuyUpdateFn();
});
groupBuyUpdateFn();
});
}
}
// else {
// if (types.value === 'qg') {
// groupBuyConfirmFn(prodIds.value, skuIds.value).then((res) => {
// useraddrDefaultUserAddrFn().then(() => {
// groupBuyUpdateFnQg();
// });
// });
// } else {
// sgyrddBasketConfirmFn(basketIds.value).then(() => {
// useraddrDefaultUserAddrFn().then(() => {
// groupBuyUpdateFn();
// });
// });
// }
// }
if (outTradeNos.value) {
// 查询订单状态决定是否支付
......@@ -306,7 +325,6 @@ function selectShopCoupon(item) {
}
}
const jumpToAddressList = () => {
changeAddress.value = true;
wx.navigateTo({
url: '/pages/address/addressList',
});
......@@ -367,6 +385,10 @@ const payNow = async (data) => {
params.value.id = orderInfo.value.key;
params.value.tradeType = data.selectType;
params.value.basketIds = basketIds.value;
xma.showLoading({
title: '正在支付',
mask: true,
});
if (types.value === 'qg') {
const qgParams = {
id: orderInfo.value.key,
......@@ -376,16 +398,22 @@ const payNow = async (data) => {
};
groupBuyCreate(qgParams).then((res) => {
if (res.code === 0) {
xma.hideLoading();
openUrl(res.data.result);
xma.removeStorageSync('address');
} else {
xma.hideLoading();
groupBuyConfirmFn(prodIds.value, skuIds.value);
}
});
} else {
znsgyOrderCreate(params.value).then((res) => {
if (res.code === 0) {
xma.hideLoading();
openUrl(res.data.result);
xma.removeStorageSync('address');
} else {
xma.hideLoading();
sgyrddBasketConfirmFn(basketIds.value);
}
});
......
......@@ -133,6 +133,7 @@
/>
</view>
</view>
<wd-status-tip image="content" tip="暂无数据" v-if="testData.length === 0" />
</view>
<!-- 购物车悬浮按钮 -->
<!--<view class="cart-floating" @tap="toCart">
......@@ -219,12 +220,23 @@ const getGoodSaleProd = () => {
};
// 筑农严选首页-分类查询商品列表
const platformProdList = () => {
xma.showLoading({
title: '加载中',
});
getPlatformProdList({ categoryId: router.query.categoryId }).then((res) => {
xma.hideLoading();
detailList.value = res.data;
choice(0, '3272');
});
};
const choice = (index, item) => {
xma.showLoading({
title: '加载中',
});
getPlatformProdList({ categoryId: router.query.categoryId }).then((res) => {
xma.hideLoading();
detailList.value = res.data;
});
testData.value = detailList.value[index].prodList;
testData.value.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.pic;
......@@ -406,7 +418,7 @@ page {
font-weight: 500;
line-height: 28rpx;
letter-spacing: 0em;
margin-left: 48rpx;
margin-left: 20rpx;
color: #3d3d3d;
width: 190rpx;
white-space: nowrap;
......@@ -420,7 +432,7 @@ page {
font-size: 24rpx;
font-weight: 500;
color: #abaaaa;
margin-left: 40rpx;
margin-left: 20rpx;
}
.price {
font-size: 24rpx;
......
......@@ -117,7 +117,7 @@ const getPresaleCategoryList = () => {
getPresaleCategory().then((res) => {
res.data.forEach((item) => {
item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
item.commodityList = item.prodSimples;
item.commodityList = item.prodSimples.splice(0, 3);
item.commodityList.forEach((item) => {
item.commodityImg = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
......
......@@ -83,6 +83,7 @@
/>
</view>
</view>
<wd-status-tip image="content" tip="暂无数据" v-if="buyList.length === 0" />
</view>
<view class="waterfall">
<view class="wt-left wt-list">
......@@ -213,7 +214,11 @@ const chooseTab = (index, categoryId) => {
});
};
const chooseBTab = (index, categoryId) => {
xma.showLoading({
title: '加载中',
});
getPresaleProdList({ current: 1, size: 10, categoryId }).then((res) => {
xma.hideLoading();
res.data.records.forEach((item) => {
item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
......@@ -233,7 +238,11 @@ const chooseBTab = (index, categoryId) => {
// };
// 二级分类点击事件
const choice = (index, categoryId) => {
xma.showLoading({
title: '加载中',
});
getPresaleProdList({ current: 1, size: 10, categoryId }).then((res) => {
xma.hideLoading();
res.data.records.forEach((item) => {
item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
......@@ -404,14 +413,14 @@ page {
width: 360rpx;
display: flex;
flex-direction: row;
height: 442rpx;
}
.wt-item {
border-radius: 8px 8px 8px 8px;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-bottom: 15rpx;
background-color: #ffffff;
margin-left: 10rpx;
height: max-content;
}
.item-img image {
......
......@@ -7,20 +7,14 @@
<text class="title">退款商品</text>
</view>
<view class="content-item">
<view class="item-top">
<image
class="item-img"
mode="aspectFill"
src="https://img2.baidu.com/it/u=1028011339,1319212411&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=313"
></image>
<view class="item-top itemtop1" v-for="(item2, index) in orderDetail" :key="index">
<image class="item-img" mode="aspectFill" :src="fileDomain + item2.pic"></image>
<view class="item-info">
<text class="text1">
商品名称商品名称商品名称商品名 商品名称商品名称商品名称商品名 商品名称商品名称
</text>
<text class="num">x1</text>
<text class="text2">
商品简介商品简介商品简介商品简介 商品简介商品简介商品简介商品简介
{{ item2.prodName }}
</text>
<text class="num">x{{ item2.prodCount }}</text>
<!-- <rich-text class="text2" :nodes="prodDetail.prod.content"></rich-text> -->
</view>
</view>
<view class="item-buttom1">
......@@ -50,26 +44,11 @@
<text class="icon1">*</text>
</text>
<view class="rightbox">
<text v-if="selectType2">{{ salesList[selectType2].name }}</text>
<text v-if="selectType2">{{ salesList[selectType2 - 1].name }}</text>
<text v-else>请选择售后类型</text>
<wd-icon name="arrow-right" size="22px"></wd-icon>
</view>
</view>
<!-- <view class="content-between">
<text>退款金额</text>
<text class="price">{{ orderDetail.baseOrder.actualTotal }}</text>
</view> -->
<!-- <view class="content-between">
<text>相关图片</text>
<wd-upload
:file-list="fileList"
image-mode="aspectFill"
:action="action"
@change="handleChange"
:header="headers"
accept="image"
></wd-upload>
</view> -->
<view class="content-between" @tap="showPop = true">
<text>
售后原因
......@@ -86,11 +65,8 @@
退款金额
<text class="icon1">*</text>
</text>
<text class="price2">
<wd-input type="text" no-border custom-input-class="text-align:right" v-model="value" />
</text>
<text class="price2">{{ actualTotal }}</text>
</view>
<view class="tishi">可修改,最多商品¥198</view>
</view>
<view class="content-box">
<view class="content-item1">
......@@ -101,6 +77,7 @@
<textarea
placeholder="必填,请您详细填写申请说明"
placeholder-style="font-size:28rpx;color:#000;"
v-model="otherReason"
></textarea>
</wd-cell-group>
<view style="margin-top: 20rpx">
......@@ -132,14 +109,14 @@
<wd-icon name="close" size="20" color="#999" @tap="showGoodPop = false"></wd-icon>
</view>
<radio-group style="width: 100%" @change="radioChange1">
<view class="resaon" v-for="(item, index) in goodsList" :key="index">
<view class="resaon" v-for="(item3, index) in goodsList" :key="index">
<view class="resaon-item">
<text>{{ item.name }}</text>
<text>{{ item3.name }}</text>
<radio
class="radio"
color="#f62828"
:value="item.id"
:checked="item.id == selectType1"
:value="item3.id"
:checked="item3.id == selectType1"
/>
</view>
</view>
......@@ -161,14 +138,14 @@
<wd-icon name="close" size="20" color="#999" @tap="showSalePop = false"></wd-icon>
</view>
<radio-group style="width: 100%" @change="radioChange2">
<view class="resaon" v-for="(item, index) in salesList" :key="index">
<view class="resaon" v-for="(item4, index) in salesList" :key="index">
<view class="resaon-item">
<text>{{ item.name }}</text>
<text>{{ item4.name }}</text>
<radio
class="radio"
color="#f62828"
:value="item.id"
:checked="item.id == selectType2"
:value="item4.id"
:checked="item4.id == selectType2"
/>
</view>
</view>
......@@ -213,7 +190,7 @@ import { applyForARefundApi, getOrderDetail } from '@/api/order';
import { getToken } from '@/utils/auth';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const token = getToken();
const value = ref('198.00');
const actualTotal = ref(0);
// 上传图片地址
const action = ref(import.meta.env.VITE_APP_BASE_URL + '/sgyrdd/file/update');
const headers = ref('');
......@@ -231,7 +208,8 @@ onLoad((options) => {
const orderDetail = ref();
const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value });
orderDetail.value = res.data;
actualTotal.value = res.data.baseOrder.actualTotal;
orderDetail.value = res.data.orderItems;
};
/**
......@@ -254,20 +232,20 @@ const selectType = ref(null);
const goodsList = ref([
{
id: '0',
name: '收到货',
name: '收到货',
},
{
id: '1',
name: '收到货',
name: '收到货',
},
]);
const salesList = ref([
{
id: '0',
id: '1',
name: '仅退款',
},
{
id: '1',
id: '2',
name: '退货退款',
},
]);
......@@ -313,6 +291,7 @@ function radioChange1(evt) {
function radioChange2(evt) {
const { value } = evt.detail;
console.log(evt);
selectType2.value = value;
}
function radioChange(evt) {
......@@ -323,15 +302,27 @@ function radioChange(evt) {
* 提交申请
*/
const submit = async () => {
if (!selectType1.value) {
return xma.showToast({
title: '请选择货物状态',
icon: 'none',
});
}
if (!selectType2.value) {
return xma.showToast({
title: '请选择售后类型',
icon: 'none',
});
}
if (!selectType.value) {
return xma.showToast({
title: '请选择退款原因',
icon: 'none',
});
}
if (selectType.value === '4' && !otherReason.value) {
if (!otherReason.value) {
return xma.showToast({
title: '请输入其他原因',
title: '请输入申请说明',
icon: 'none',
});
}
......@@ -341,8 +332,10 @@ const submit = async () => {
});
await applyForARefundApi({
orderNumber: orderNumber.value,
refundMemo:
selectType.value === '4' ? otherReason.value : reasonList.value[selectType.value].name,
goodsStatus: selectType1.value,
type: selectType2.value,
refundMemo: reasonList.value[selectType.value].name,
illustrate: otherReason.value,
imgs: processingImageAddresses(),
});
setTimeout(() => {
......@@ -391,7 +384,7 @@ const chooseSalessReason = () => {
icon: 'none',
});
}
showGoodPop.value = false;
showSalePop.value = false;
};
/**
* 请选择退款原因
......@@ -411,12 +404,6 @@ const chooseReason = () => {
page {
background: #f3f3f3;
}
:deep(.uni-input-input) {
text-align: right;
font-weight: 700;
font-size: 28rpx;
color: #fa5151;
}
:deep(uni-textarea) {
width: 100%;
background: #f0f0f0;
......@@ -463,7 +450,6 @@ page {
.item-top {
display: flex;
gap: 20rpx;
.item-img {
width: 216rpx;
height: 216rpx;
......@@ -506,6 +492,9 @@ page {
}
}
}
.itemtop1 {
margin-top: 20rpx;
}
.item-buttom1 {
margin-top: 42rpx;
height: 37rpx;
......
......@@ -215,7 +215,7 @@ const cardData2 = ref([]);
const shopCardData = ref({});
const current = ref(0);
const swiperList = ref(['../../static/index/guiyang.png', '../../static/index/guiyang.png']);
const listParams = {
let listParams = {
current: 1,
size: 10,
lon: 106.68650025025502,
......@@ -272,7 +272,10 @@ const getCouponMainList = () => {
const receive = (data) => {
if (data.couponType === 'mch' && data.numState === 0) {
receiveCoupon([data.couponYzfId]).then((res) => {
// console.log('打印', res);
xma.showToast({
title: '领取成功!',
icon: 'none',
});
});
}
};
......@@ -341,7 +344,12 @@ const recommendedClassification = () => {
};
// 重置数据
const reset = () => {
listParams.current = 1;
listParams = {
current: 1,
size: 10,
lon: 106.68650025025502,
lat: 26.567192352601154,
};
shopCardData.value = {};
cardData.value = [];
cardData1.value = [];
......
......@@ -10,8 +10,8 @@ import { getTokenUser } from '../../api/index';
import { getToken } from '../../utils/auth';
onLoad(async (options) => {
await signIn();
// if (!getToken()) await signIn2();
// await signIn();
if (!getToken()) await signIn2();
const { type } = options;
switch (type) {
case '0':
......
......@@ -285,10 +285,15 @@ const submitOrder = debounce(() => {
payWayCode: 5,
tradeType: selectType.value,
};
xma.showLoading({
title:'正在支付',
mask:true,
})
groupBuyCreate(params).then((res) => {
if (res.code === 0) {
const { paymentUrl, outTradeNo } = res.data.result;
outTradeNos.value = outTradeNo;
xma.hideLoading()
window.location.href = paymentUrl;
// 设置一个延时器
const start = Date.now();
......@@ -541,7 +546,7 @@ page {
border-radius: 16 * 2rpx;
margin: 0 auto;
box-sizing: border-box;
margin-top: 108rpx;
margin-top: 20rpx;
background: #ffffff;
display: flex;
flex-direction: column;
......
......@@ -108,7 +108,7 @@ page {
.container {
.content {
padding-top: 44px;
padding-top: 20px;
display: flex;
flex-direction: column;
gap: 20rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment