订单接口修改了

parent c86d8a32
......@@ -50,7 +50,7 @@
<view class="bootom">
<view class="bootom-top">
<view class="option" @tap="locationFiltering(0)">
<text :class="{ rotate: rotate }">全部烧烤烤肉</text>
<text :class="{ rotate: rotate }">全部{{ categoryNames }}</text>
<wd-icon
:class="{ rotate: rotate }"
name="fill-arrow-down"
......@@ -117,6 +117,7 @@ const isLoadReachBottom = ref(null);
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const business = reactive(['优选商家', '超值半价', '今日可订', '经典单人']);
const active = ref(null);
const categoryNames = ref('');
const categoryData = ref([]);
const rotate = ref(false);
const rotate2 = ref(false);
......@@ -134,8 +135,10 @@ const params = ref({
});
const pics = ref(null);
onLoad((option) => {
const { parentId, pic } = option;
const { parentId, pic, categoryName } = option;
categoryNames.value = categoryName;
categoryId.value = parentId;
params.value.categoryId = [parentId];
pics.value = pic;
query(parentId);
prodSpecialFn();
......@@ -238,7 +241,7 @@ function jumpProductDetails(prodId) {
const prodSpecialFn = () => {
prodSpecial({ categoryId: categoryId.value }).then((res) => {
res.data.data = res.data.data.map((el) => {
if (el.labels) {
if (el.labels && el.labels !== '') {
el.labels = el.labels.split(',');
}
return el;
......@@ -440,10 +443,14 @@ page {
box-sizing: border-box;
margin-left: auto;
margin-right: 20rpx;
display: flex;
justify-content: center;
align-items: center;
.text3 {
font-size: 20rpx;
color: #fa5151;
line-height: 47rpx;
text-align: center;
margin-left: 14rpx;
}
.qiang {
......
......@@ -9,7 +9,7 @@
<view class="classification">
<view class="classification-top">
<view
@tap="jingang(item.categoryId, item.pic)"
@tap="jingang(item.categoryId, item.pic, item.categoryName)"
class="choice"
v-for="(item, index) in classificationT"
:key="index"
......@@ -20,7 +20,7 @@
</view>
<view class="classification-bottom">
<view
@tap="jingang(item.categoryId, item.pic)"
@tap="jingang(item.categoryId, item.pic, item.categoryName)"
class="choice"
v-for="(item, index) in classificationB"
:key="index"
......@@ -376,7 +376,7 @@ const choice = (index, categoryId) => {
getMerchantList();
};
// 金刚区分类选择
const jingang = (id, pic) => {
const jingang = (id, pic, categoryName) => {
// switch (index) {
// case 0:
// xma.navigateTo({
......@@ -390,7 +390,7 @@ const jingang = (id, pic) => {
// xma.navigateTo({});
// }
xma.navigateTo({
url: `/pages/index/foodClassification?parentId=${id}&pic=${pic}&page=index`,
url: `/pages/index/foodClassification?parentId=${id}&pic=${pic}&page=index&categoryName=${categoryName}`,
});
};
const locationFiltering = () => {
......
......@@ -52,11 +52,12 @@
<view v-if="item.numState === 0" class="btn" @click="getCoupon(item)">
立即领取
</view>
<i
<!-- <i
v-else
class="iconfont icon-lianhe40"
style="font-size: 120rpx; color: #efefef"
></i>
></i> -->
<image v-else class="ylq-icon" src="@/static/shop/yl.png"></image>
</view>
</view>
<view class="foot">
......@@ -121,10 +122,16 @@
<view class="yh">
<text class="yh-name">优惠:</text>
<view class="bt-icon">
<image src="@/static/shop/bt-icon.png"></image>
<!-- <image src="@/static/shop/bt-icon.png"></image>
<text class="yh-name lj">
{{ productCoupons[0].thresholdAmount }}{{ productCoupons[0].discountValue }}
</text>
</text> -->
<view class="subsidy">
<image mode="aspectFill" src="@/static/shop/subsidy.png" />
<text class="multi-line">
{{ productCoupons[0].thresholdAmount }}{{ productCoupons[0].discountValue }}
</text>
</view>
</view>
<view class="ylq-icon" @click="showpopup = true">
{{ productCoupons[0].numState === 0 ? '未领取' : '已领取' }}
......@@ -602,7 +609,7 @@ page {
.headbox {
display: flex;
justify-content: space-between;
align-items: end;
align-items: center;
height: 50rpx;
.time {
......@@ -611,6 +618,10 @@ page {
color: #999999;
line-height: 20rpx;
}
.ylq-icon {
width: 64 * 2rpx;
height: 64 * 2rpx;
}
.btn {
padding: 20rpx;
......@@ -634,7 +645,7 @@ page {
gap: 14rpx;
.line {
border-top: 2rpx solid #f2f2f2;
// border-top: 2rpx solid #f2f2f2;
}
.footbox {
......@@ -793,9 +804,34 @@ page {
position: absolute;
right: 14rpx;
height: 11 * 2rpx;
text-align: center;
line-height: 22rpx;
top: calc(50% - 11rpx);
}
.subsidy {
width: 144 * 2rpx;
height: 22 * 2rpx;
position: relative;
image {
position: absolute;
width: 65 * 2rpx;
height: 22 * 2rpx;
top: 0;
left: 0;
}
text {
border: 1rpx solid #fa5151;
right: 14rpx;
height: 20 * 2rpx;
position: absolute;
font-size: 11 * 2rpx;
line-height: 22 * 2rpx;
top: 0;
text-align: center;
left: 65 * 2rpx;
color: #fa5151;
}
}
}
}
.ylq-icon {
......
......@@ -172,28 +172,36 @@ const orderInfo = ref({});
const activeCouponInfo = ref({});
const activeCouponId = ref('');
const outTradeNos = ref(null);
const prodIds = ref(null);
const skuIds = ref(null);
// 商品优惠券
const productCoupons = ref([]);
onLoad((options) => {
const { prodId, skuId } = options;
prodIds.value = prodId;
skuIds.value = skuId;
groupBuyConfirmFn(prodId, skuId);
});
onShow(() => {
if (outTradeNos.value) {
// 查询订单状态决定是否支付
getOrderDetail({ orderNumber: outTradeNos.value }).then((res) => {
switch (res.data.status) {
switch (res.data.baseOrder.substatus) {
case '1':
xma.showToast({
title: '支付失败',
icon: 'error',
duration: 2000,
success() {
groupBuyConfirmFn(prodIds.value, skuIds.value);
},
});
break;
case '2':
xma.redirectTo({
url: `/pages/shop/paymentSuccessful?outTradeNos=${outTradeNos.value}`,
});
break;
case '3':
xma.redirectTo({
url: `/pages/shop/paymentSuccessful?outTradeNos=${outTradeNos.value}`,
......@@ -268,10 +276,24 @@ function submitOrder() {
};
groupBuyCreate(params).then((res) => {
if (res.code === 0) {
let timeout = null;
const start = new Date().getTime();
const { paymentUrl, outTradeNo } = res.data.result;
console.log('merchantNo', outTradeNo);
outTradeNos.value = outTradeNo;
window.location.href = paymentUrl;
timeout = setTimeout(function () {
const end = new Date().getTime();
// 如果超时未打开应用,则假设未安装
if (end - start < 1000) {
xma.showToast({
title: '未安装App',
icon: 'none',
});
}
}, 1500);
// window.open(paymentUrl);
// plus.runtime.openURL(paymentUrl);
}
......
......@@ -86,7 +86,7 @@
<view class="subsidy-content" @click="jumpPage">
<view class="subsidy">
<image mode="aspectFill" src="@/static/shop/subsidy.png" />
<text>{{ merchantCoupons.activityName }}</text>
<text class="multi-line">{{ merchantCoupons.activityName }}</text>
</view>
<view class="more">
<text>更多</text>
......@@ -215,6 +215,19 @@
</view>
</view>
</view>
<view
style="
width: 100%;
text-align: center;
font-size: 24rpx;
margin-top: 10rpx;
color: #888989;
"
v-if="commentList.length === 0"
>
没有更多啦~
</view>
<view @tap="viewAll" v-if="commentList.length < commentTotal" class="u-more">
查看全部{{ commentTotal }}条评价
</view>
......@@ -261,7 +274,7 @@
</view>
</scroll-view>
</view>
<view class="tj-more">
<view class="tj-more" @click="jumpListPage">
<text>查看更多</text>
<wd-icon name="arrow-right" size="16px"></wd-icon>
</view>
......@@ -341,6 +354,11 @@ const handleClick = (e) => {
const imgSrc = shopSwiperList.value[index];
previewImage(imgSrc);
};
function jumpListPage() {
xma.navigateTo({
url: `/pages/index/foodClassification?parentId=${activeId.value}&page=shop&pic=''`,
});
}
const onChange = (e) => {};
function scroll(e) {
old.scrollTop = e.detail.scrollTop;
......@@ -354,7 +372,7 @@ function peripheryRecomFn() {
const lat = currentLatitudeAndLongitude.value.latitude;
// 经度
const lon = currentLatitudeAndLongitude.value.longitude;
peripheryRecom({ lat, lon, distance: 200 }).then((res) => {
peripheryRecom({ lat, lon, distance: 10 }).then((res) => {
if (res.code === 0) {
recommendedTypesOfPeripherals.value = res.data;
const id = recommendedTypesOfPeripherals.value[0].categoryId;
......@@ -370,8 +388,12 @@ function sgyrddShopPageFn(categoryIds, lat, lon) {
lat,
lon,
categoryIds,
distance: 200,
distance: 10,
};
xma.showLoading({
title: '加载中',
mask: true,
});
sgyrddShopPage(params).then((res) => {
if (res.code === 0) {
res.data.content = res.data.content
......@@ -385,6 +407,7 @@ function sgyrddShopPageFn(categoryIds, lat, lon) {
return item !== '';
});
recommendedListOfPeripherals.value = res.data.content;
xma.hideLoading();
}
});
}
......@@ -449,7 +472,9 @@ const getStoreInformationFn = (id) => {
if (res.code === 0) {
shopInfo.value = res.data.shop;
shopSwiperList.value = res.data.imgList.map((item) => imgUrl + item.imgUrl);
shopInfo.value.tagList = res.data.shop.labels.split(',');
if (res.data.shop.labels && res.data.shop.labels !== '') {
shopInfo.value.tagList = res.data.shop.labels.split(',');
}
currentLatitudeAndLongitude.value.latitude = res.data.shop.location.lat;
currentLatitudeAndLongitude.value.longitude = res.data.shop.location.lon;
resolve();
......@@ -853,18 +878,21 @@ page {
position: relative;
image {
position: absolute;
width: 144 * 2rpx;
width: 84 * 2rpx;
height: 54 * 2rpx;
top: calc(50% - 54rpx);
left: 0;
}
text {
border: 1rpx solid #fa5151;
right: 14rpx;
height: 28 * 2rpx;
position: absolute;
font-size: 11 * 2rpx;
line-height: 54 * 2rpx;
height: 54 * 2rpx;
top: calc(50% - 54rpx);
line-height: 28 * 2rpx;
top: calc(50% - 28rpx);
text-align: center;
left: 84 * 2rpx;
color: #fa5151;
}
}
......
src/static/shop/subsidy.png

9.04 KB | W: | H:

src/static/shop/subsidy.png

8.6 KB | W: | H:

src/static/shop/subsidy.png
src/static/shop/subsidy.png
src/static/shop/subsidy.png
src/static/shop/subsidy.png
  • 2-up
  • Swipe
  • Onion skin
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