订单接口修改了

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