Commit 52788c69 authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)

1

parents 64e50e43 9cbbcc39
<script setup> <script setup>
import { getTokenUser } from './api/index'; import { getTokenUser } from './api/index';
import { sgyOrderGetStatus } from './api/order';
import testJson from './static/json/test.json'; import testJson from './static/json/test.json';
import { getToken } from './utils/auth'; import { getToken } from './utils/auth';
import { setOrderDic } from './utils/orderDic';
onLaunch(() => { onLaunch(() => {
if (!getToken()) signIn(); if (!getToken()) signIn();
console.log('App Launch'); sgyOrderGetStatus().then((res) => {
if (res.code === 0) {
setOrderDic(res.data.store);
}
});
}); });
onShow(() => { onShow(() => {
......
<template> <template>
<view @tap="toShop(item.shopId)" class="card" v-for="(item, index) in cardData" :key="index"> <view @tap="toShop(item.shopId)" class="card" v-for="item in cardData" :key="item.shopId">
<image class="img" :src="item.shopLogo" mode="aspectFill" /> <image class="img" :src="item.shopLogo" mode="aspectFill" />
<view class="right"> <view class="right">
<text class="text">{{ item.shopName }}</text> <text class="text">{{ item.shopName }}</text>
......
...@@ -94,6 +94,14 @@ export function receiveCoupon(data) { ...@@ -94,6 +94,14 @@ export function receiveCoupon(data) {
data, data,
}); });
} }
// 列表顶部优惠商品
export function prodSpecial(data) {
return request({
url: `/sgyrdd/prod/special`,
method: 'GET',
data,
});
}
// 领券中心-分类列表 // 领券中心-分类列表
export function getCoupon() { export function getCoupon() {
......
...@@ -3,16 +3,16 @@ import { request } from '../utils/request'; ...@@ -3,16 +3,16 @@ import { request } from '../utils/request';
// 订单列表接口 // 订单列表接口
export function getOrderList(data) { export function getOrderList(data) {
return request({ return request({
url: '/sgyrdd/sgyOrder/groupBuy/page', url: '/sgyrdd/sgyOrder/page',
method: 'GET', method: 'GET',
data, data,
}); });
} }
// 订单列表接口 // 订单详情接口
export function getOrderDetail(data) { export function getOrderDetail(data) {
return request({ return request({
url: '/sgyrdd/sgyOrder/groupBuy/orderInfo', url: '/sgyrdd/sgyOrder/orderInfo',
method: 'GET', method: 'GET',
data, data,
}); });
...@@ -52,3 +52,20 @@ export function getShopDetail(data) { ...@@ -52,3 +52,20 @@ export function getShopDetail(data) {
data, data,
}); });
} }
// 立即支付
export function repaymentApi(data) {
return request({
url: '/sgyrdd/sgyOrder/repayment',
method: 'POST',
data,
});
}
// 查询各类订单状态
export function sgyOrderGetStatus(data) {
return request({
url: '/sgyrdd/sgyOrder/getStatus',
method: 'GET',
data,
});
}
...@@ -100,6 +100,27 @@ ...@@ -100,6 +100,27 @@
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
} }
,
{
"path": "pages/storeEntry/index",
"style": {
"navigationBarTitleText": "我的店铺"
}
}
,
{
"path": "pages/storeEntry/detail",
"style": {
"navigationBarTitleText": "商家入驻"
}
}
,
{
"path": "pages/order/afterSales",
"style": {
"navigationBarTitleText": "售后详情"
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationStyle": "custom" "navigationStyle": "custom"
......
This diff is collapsed.
...@@ -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)" @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)" @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"
...@@ -76,7 +76,12 @@ ...@@ -76,7 +76,12 @@
</view> </view>
</view> </view>
<view class="nearby-bootom"> <view class="nearby-bootom">
<view class="contentBox" v-for="(item, index) in foodNearbyData" :key="index"> <view
@click="jumpProductDetails(item)"
class="contentBox"
v-for="(item, index) in foodNearbyData"
:key="index"
>
<!-- <image class="img" src="../../static/index/eatFood.png" mode="widthFix" /> --> <!-- <image class="img" src="../../static/index/eatFood.png" mode="widthFix" /> -->
<image class="img" :src="item.shopLogo" mode="aspectFill" /> <image class="img" :src="item.shopLogo" mode="aspectFill" />
<text class="one">{{ item.shopName }}</text> <text class="one">{{ item.shopName }}</text>
...@@ -208,6 +213,11 @@ onMounted(() => { ...@@ -208,6 +213,11 @@ onMounted(() => {
getMerchantList(); getMerchantList();
getCouponMainList(); getCouponMainList();
}); });
function jumpProductDetails(item) {
xma.navigateTo({
url: '/pages/shop/shop?shopId=' + item.shopId,
});
}
// 登录 // 登录
// const signIn = () => { // const signIn = () => {
// getTokenUser(testJson).then((res) => { // getTokenUser(testJson).then((res) => {
...@@ -416,7 +426,7 @@ const choice = (index, categoryId) => { ...@@ -416,7 +426,7 @@ const choice = (index, categoryId) => {
getMerchantList(); getMerchantList();
}; };
// 金刚区分类选择 // 金刚区分类选择
const jingang = (id) => { const jingang = (id, pic, categoryName) => {
// switch (index) { // switch (index) {
// case 0: // case 0:
// xma.navigateTo({ // xma.navigateTo({
...@@ -430,7 +440,7 @@ const jingang = (id) => { ...@@ -430,7 +440,7 @@ const jingang = (id) => {
// xma.navigateTo({}); // xma.navigateTo({});
// } // }
xma.navigateTo({ xma.navigateTo({
url: '/pages/index/foodClassification?parentId=' + id, url: `/pages/index/foodClassification?parentId=${id}&pic=${pic}&page=index&categoryName=${categoryName}`,
}); });
}; };
const locationFiltering = () => { const locationFiltering = () => {
......
<template>
<view class="container">
<Header title="售后"></Header>
<view class="content">
111
</view>
</view>
</template>
<script setup>
import Header from '@/pages/order/components/Header/index.vue';
</script>
<style lang="scss" scoped>
page {
background: #f3f3f3;
}
.container {
width: 375 * 2rpx;
margin: 0 auto;
.content {
padding-top: 88rpx;
}
}
</style>
\ No newline at end of file
...@@ -18,25 +18,26 @@ ...@@ -18,25 +18,26 @@
<image src="@/static/shop/wx-icon.png"></image> <image src="@/static/shop/wx-icon.png"></image>
微信 微信
</view> </view>
<radio class="radio" color="#F12A2A" value="'wx'" :checked="'wx' == selectType" /> <radio class="radio" color="#F12A2A" value="TENPAY" :checked="'TENPAY' == selectType" />
</view> </view>
<view class="pay-item"> <view class="pay-item">
<view class="icon"> <view class="icon">
<image src="@/static/shop/yzf-icon.png"></image> <image src="@/static/shop/yzf-icon.png"></image>
翼支付 翼支付
</view> </view>
<radio class="radio" color="#F12A2A" value="'yzf'" :checked="'yzf' == selectType" /> <radio class="radio" color="#F12A2A" value="BESTPAY" :checked="'BESTPAY' == selectType" />
</view> </view>
</radio-group> </radio-group>
<view class="footer"> <view class="footer">
<wd-button type="error">危险按钮</wd-button> <wd-button type="error" @tap="toPay">立即支付</wd-button>
</view> </view>
</view> </view>
</wd-popup> </wd-popup>
</template> </template>
<script setup> <script setup>
const selectType = ref('wx'); const emits = defineEmits(['payment']);
const selectType = ref('TENPAY');
const show = ref(false); const show = ref(false);
function radioChange(evt) { function radioChange(evt) {
...@@ -44,7 +45,14 @@ function radioChange(evt) { ...@@ -44,7 +45,14 @@ function radioChange(evt) {
selectType.value = value; selectType.value = value;
} }
const open = () => { const toPay = () => {
emits('payment', { selectType: selectType.value, orderNumber: orderNumber.value });
show.value = false;
};
const orderNumber = ref('');
const open = (e) => {
orderNumber.value = e;
show.value = true; show.value = true;
}; };
const close = () => { const close = () => {
......
...@@ -5,15 +5,24 @@ ...@@ -5,15 +5,24 @@
<!-- 使用状态 --> <!-- 使用状态 -->
<view class="status"> <view class="status">
<view class="status-box"> <view class="status-box">
<wd-icon name="check-outline" size="26px" color="#333" <wd-icon
v-if="orderDetail.status == 5 || orderDetail.status == 7"></wd-icon> name="check-outline"
<wd-icon name="close-outline" size="26px" color="#333" v-if="orderDetail.status == 6"></wd-icon> size="26px"
<view class="status-text">{{ statusList[orderDetail.status] }}</view> color="#333"
v-if="orderDetail.orderStore.status == 5 || orderDetail.orderStore.status == 7"
></wd-icon>
<wd-icon
name="close-outline"
size="26px"
color="#333"
v-if="orderDetail.orderStore.status == 6"
></wd-icon>
<view class="status-text">{{ statusList[orderDetail.orderStore.status] }}</view>
</view> </view>
<view class="detail" v-if="orderDetail.status == 3"> <view class="detail" v-if="orderDetail.orderStore.subStatus == 3">
请在{{ orderDetail.receiverTime.slice(0, 4) }}{{ 请在{{ orderDetail.orderStore.receiverTime.slice(0, 4) }}{{
orderDetail.receiverTime.slice(5, 7) orderDetail.orderStore.receiverTime.slice(5, 7)
}}{{ orderDetail.receiverTime.slice(8, 10) }}前到店消费 }}{{ orderDetail.orderStore.receiverTime.slice(8, 10) }}前到店消费
</view> </view>
</view> </view>
...@@ -43,27 +52,42 @@ ...@@ -43,27 +52,42 @@
<image :src="qrcode" class="qr"></image> <image :src="qrcode" class="qr"></image>
</view> </view>
<view class="info-box"> <view class="info-box">
<view class="between" v-if="orderDetail.status == 2 || orderDetail.status == 3"> <view
class="between"
v-if="orderDetail.orderStore.subStatus == 2 || orderDetail.orderStore.subStatus == 3"
>
<view class="column"> <view class="column">
<text class="title">券码信息(1张可用)</text> <text class="title">券码信息(1张可用)</text>
<text class="text">{{ orderDetail.receiverTime }} 到期</text> <text class="text">{{ orderDetail.orderStore.receiverTime }} 到期</text>
</view>
<view class="btn" @tap="handleRefund(orderDetail.orderStore.orderNumber)">
申请退款
</view> </view>
<view class="btn" @tap="handleRefund(orderDetail.orderNumber)">申请退款</view>
</view> </view>
<view class="between"> <view class="between">
<view class="column"> <view class="column">
<text class="title1" v-if="orderDetail.status != 2 || orderDetail.status != 3"> <text
class="title1"
v-if="
orderDetail.orderStore.subStatus != 2 || orderDetail.orderStore.subStatus != 3
"
>
券码信息 券码信息
</text> </text>
<text :class="orderDetail.status == 5 || orderDetail.status == 6 || orderDetail.status == 7 <text
? 'linethrough' :class="
: 'phone' orderDetail.orderStore.subStatus == 5 ||
"> orderDetail.orderStore.subStatus == 6 ||
{{ orderDetail.orderNumber.slice(6) }} orderDetail.orderStore.subStatus == 7
? 'linethrough'
: 'phone'
"
>
{{ orderDetail.orderStore.orderNumber.slice(6) }}
</text> </text>
</view> </view>
<text class="text">{{ orderStatusList[orderDetail.status] }}</text> <text class="text">{{ orderStatusList[orderDetail.orderStore.subStatus] }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -141,14 +165,17 @@ ...@@ -141,14 +165,17 @@
<!-- 订单详情 --> <!-- 订单详情 -->
<view class="info"> <view class="info">
<view class="tips padding"> <view class="tips padding">
<text class="title">实付金额:¥{{ orderDetail.actualTotal }}</text> <text class="title">实付金额:¥{{ orderDetail.orderStore.actualTotal }}</text>
<view class="tips-box"> <view class="tips-box">
<view class="row"> <view class="row">
<text class="name">订单号</text> <text class="name">订单号</text>
<text class="colon"></text> <text class="colon"></text>
<view class="copybox"> <view class="copybox">
<text class="text">{{ orderDetail.orderNumber.slice(6) }}</text> <text class="text">{{ orderDetail.orderStore.orderNumber.slice(6) }}</text>
<view class="copy" @tap="copyTextToClipboard(orderDetail.orderNumber.slice(6))"> <view
class="copy"
@tap="copyTextToClipboard(orderDetail.orderStore.orderNumber.slice(6))"
>
复制 复制
</view> </view>
</view> </view>
...@@ -156,17 +183,17 @@ ...@@ -156,17 +183,17 @@
<view class="row"> <view class="row">
<text class="name">手机号</text> <text class="name">手机号</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">{{ maskPhoneNumber(orderDetail.receiverMobile) }}</text> <text class="text">{{ maskPhoneNumber(orderDetail.orderStore.receiverMobile) }}</text>
</view> </view>
<view class="row" v-if="orderDetail.payTime"> <view class="row" v-if="orderDetail.orderStore.payTime">
<text class="name">付款时间</text> <text class="name">付款时间</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">{{ orderDetail.payTime }}</text> <text class="text">{{ orderDetail.orderStore.payTime }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">下单时间</text> <text class="name">下单时间</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">{{ orderDetail.createTime }}</text> <text class="text">{{ orderDetail.orderStore.createTime }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">数量</text> <text class="name">数量</text>
...@@ -176,17 +203,17 @@ ...@@ -176,17 +203,17 @@
<view class="row"> <view class="row">
<text class="name">总价</text> <text class="name">总价</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">{{ orderDetail.total }}</text> <text class="text">{{ orderDetail.orderStore.total }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">优惠明细</text> <text class="name">优惠明细</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">-¥{{ orderDetail.reduceAmount }}</text> <text class="text">-¥{{ orderDetail.orderStore.reduceAmount }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">实付</text> <text class="name">实付</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">{{ orderDetail.actualTotal }}</text> <text class="text">{{ orderDetail.orderStore.actualTotal }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -248,12 +275,11 @@ const orderDetail = ref(); ...@@ -248,12 +275,11 @@ const orderDetail = ref();
const getDetail = async () => { const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value }); const res = await getOrderDetail({ orderNumber: orderNumber.value });
orderDetail.value = res.data; orderDetail.value = res.data;
if (orderDetail.value.status === '2' || orderDetail.value.status === '3') { if (orderDetail.value.orderStore.status === '2' || orderDetail.value.orderStore.status === '3') {
codeDetail(orderDetail.value.orderNumber); codeDetail(orderDetail.value.orderStore.orderNumber);
} }
getProductDetail(orderDetail.value.orderItems[0].prodId); getProductDetail(orderDetail.value.orderItems[0].prodId);
getShopMailDetail(orderDetail.value.shopId); getShopMailDetail(orderDetail.value.baseOrder.shopId);
}; };
/** /**
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
<view class="title">{{ item.shopName }}</view> <view class="title">{{ item.shopName }}</view>
</view> </view>
<view class="right"> <view class="right">
<span class="status">{{ statusList[item.status] }}</span> <span class="status">{{ stateList[item.status].label }}</span>
<wd-count-down <wd-count-down
:time="item.countDown" :time="item.countDown"
:format="format" :format="format"
@finish="onFinish(item.orderNumber)" @finish="onFinish(item.orderNumber)"
v-if="item.status == 1" v-if="item.status === 'not_pay'"
/> />
</view> </view>
</view> </view>
...@@ -36,41 +36,57 @@ ...@@ -36,41 +36,57 @@
<view class="btn"> <view class="btn">
<view <view
class="btn-info" class="btn-info"
v-if="item.status == 5 || item.status == 6" v-if="item.status === 'complete' || item.status == 'cancel'"
@tap="handleDelete(item.orderNumber)" @tap="handleDelete(item.orderNumber)"
> >
删除 删除
</view> </view>
<view <view
class="btn-info" class="btn-info"
v-if="item.status == 3" v-if="item.status === 'receive' || item.status == 'not_use'"
@tap="handleDetail(item.orderNumber)" @tap="handleQrcode(item)"
> >
查看预约 核销码
</view> </view>
<view <view
class="btn-info" class="btn-info"
@tap="handleCancel(item.orderNumber)" @tap="handleCancel(item.orderNumber)"
v-if="item.status == 1" v-if="item.status === 'not_pay'"
> >
取消订单 取消订单
</view> </view>
<view class="btn-info" v-if="item.status == 4" @tap="handleRemark(item)"> <view
class="btn-info"
v-if="item.status === 'not_eval'"
@tap="handleRemark(item)"
>
评价 评价
</view> </view>
<view class="btn-info" @tap="callShopPhone(item.shopTel)">联系商家</view> <view class="btn-info" @tap="callShopPhone(item.shopTel)">联系商家</view>
<view class="btn-error" v-if="item.status == 7">售后详情</view> <view class="btn-error" v-if="item.status == 7">售后详情</view>
<view <view
class="btn-error" class="btn-error"
v-if="item.status == 2 || item.status == 3 || item.status == 4" v-if="
@click="handleRefund(item.orderNumber)" item.status === 'receive' ||
item.status === 'not_use' ||
item.status === 'not_eval'
"
@click="handleRefund(item)"
> >
申请退款 申请退款
</view> </view>
<view class="btn-error" v-if="item.status == 5" @tap="anotherOrder(item)"> <view
class="btn-error"
v-if="item.status === 'complete'"
@tap="anotherOrder(item)"
>
再来一单 再来一单
</view> </view>
<view class="btn-error" v-if="item.status == 1" @tap="payNow(item.orderNumber)"> <view
class="btn-error"
v-if="item.status === 'not_pay'"
@tap="openPayment(item.orderNumber, index)"
>
立即支付 立即支付
</view> </view>
</view> </view>
...@@ -83,51 +99,90 @@ ...@@ -83,51 +99,90 @@
</block> </block>
</wd-tabs> </wd-tabs>
</view> </view>
<Payment ref="PaymentRef"></Payment> <Payment ref="PaymentRef" @payment="payNow"></Payment>
</view> </view>
</template> </template>
<script setup> <script setup>
import Header from './components/Header/index.vue'; import Header from './components/Header/index.vue';
import Payment from './components/Payment/index.vue'; import Payment from './components/Payment/index.vue';
import { getOrderList, deleteOrderApi, cancelOrderApi } from '@/api/order'; import {
getOrderList,
deleteOrderApi,
cancelOrderApi,
repaymentApi,
getOrderDetail,
} from '@/api/order';
import { getOrderDic } from '@/utils/orderDic';
const fileDomain = import.meta.env.VITE_APP_IMG_URL; const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const stateList = ref();
onLoad(() => {
const orderDic = getOrderDic();
stateList.value = orderDic.reduce((obj, item) => {
obj[item.baseStatus] = item;
return obj;
}, {});
getList();
});
const tabs = ref([ const tabs = ref([
{ {
name: '全部', name: '全部',
value: '0', value: 'all',
}, },
{ {
name: '待付款', name: '待付款',
value: '1', value: 'not_pay',
}, },
{ {
name: '待使用', name: '待使用',
value: '3', value: 'not_use',
}, },
{ {
name: '待评价', name: '待评价',
value: '4', value: 'not_eval',
}, },
{ {
name: '已完成', name: '已完成',
value: '5', value: 'complete',
}, },
{ {
name: '退款/售后', name: '退款/售后',
value: '7', value: 'after_sales',
}, },
]); ]);
const tab = ref('0'); const tab = ref('0');
const statusList = ref({ onShow(() => {
1: '待付款', if (pendingPaymentOrder.value) {
3: '待消费', // 查询订单状态决定是否支付
4: '待评价', getOrderDetail({ orderNumber: pendingPaymentOrder.value }).then((res) => {
5: '已完成', console.log(res.data.baseOrder.subStatus);
6: '已取消', switch (res.data.baseOrder.subStatus) {
7: '已退款', case '1':
xma.showToast({
title: '支付失败',
icon: 'error',
duration: 2000,
});
pendingPaymentOrder.value = null;
break;
case '2':
xma.redirectTo({
url: `/pages/shop/paymentSuccessful?outTradeNos=${pendingPaymentOrder.value}`,
});
break;
case '3':
xma.redirectTo({
url: `/pages/shop/paymentSuccessful?outTradeNos=${pendingPaymentOrder.value}`,
});
break;
default:
break;
}
});
}
}); });
// 触底函数 // 触底函数
...@@ -151,11 +206,12 @@ const catalog = reactive({ ...@@ -151,11 +206,12 @@ const catalog = reactive({
startDate: '', startDate: '',
endDate: '', endDate: '',
keyword: '', keyword: '',
status: '', // 订单状态,1-待付款,2-待接单,3-待取货,4-待评价,5-完成,6-取消,7-退款 status: '', // 待付款-not_pay,待使用-not_use,待评价not_eval,退款-after_sales
orderType: 'store', // 团购到店-store,外卖订单-takeaway,筑农物流logistics
}); });
const getList = async () => { const getList = async () => {
catalog.status = tab.value; catalog.status = tab.value;
if (tab.value === '0') { if (tab.value === 'all') {
catalog.status = ''; catalog.status = '';
} }
catalog.current++; catalog.current++;
...@@ -164,7 +220,8 @@ const getList = async () => { ...@@ -164,7 +220,8 @@ const getList = async () => {
if (res.data.records.length > 0) { if (res.data.records.length > 0) {
res.data.records.forEach((item) => { res.data.records.forEach((item) => {
// 待付款倒计时计算 // 待付款倒计时计算
if (item.status === '1') { if (item.status === 'not_pay') {
console.log(item.status);
item.countDown = calculateCountdown(item.createTime); item.countDown = calculateCountdown(item.createTime);
} }
}); });
...@@ -173,7 +230,6 @@ const getList = async () => { ...@@ -173,7 +230,6 @@ const getList = async () => {
} }
state.value = 'finished'; state.value = 'finished';
}; };
getList();
const handleChange = (e) => { const handleChange = (e) => {
tab.value = e.name; tab.value = e.name;
...@@ -190,22 +246,6 @@ const initDataList = () => { ...@@ -190,22 +246,6 @@ const initDataList = () => {
getList(); getList();
}; };
const handleDetail = (id) => {
uni.navigateTo({
url: `/pages/order/detail?orderNumber=${id}`,
});
};
/**
* 拨打商家电话
* @param {*} phoneNumber
*/
function callShopPhone(phoneNumber) {
xma.makePhoneCall({
phoneNumber, // 仅为示例
});
}
/** /**
* 删除订单 * 删除订单
* @param {*} orderNumber * @param {*} orderNumber
...@@ -249,12 +289,33 @@ const handleCancel = (orderNumber) => { ...@@ -249,12 +289,33 @@ const handleCancel = (orderNumber) => {
}; };
/** /**
* 立即支付 * 唤起支付组件
* @param {*} orderNumber * @param {*} orderNumber
*/ */
const changeIndex = ref(0);
const PaymentRef = ref(null); const PaymentRef = ref(null);
const payNow = (orderNumber) => { const openPayment = (orderNumber, idx) => {
PaymentRef.value.open(); changeIndex.value = idx;
PaymentRef.value.open(orderNumber);
};
/**
* 立即支付
* @param {*} orderNumber
*/
const pendingPaymentOrder = ref(null); // 待支付订单
const payNow = async (data) => {
console.log(data);
const param = {
orderNumber: data.orderNumber,
tradeType: data.selectType,
};
const res = await repaymentApi(param);
const { paymentUrl, outTradeNo } = res.data.result;
// 修改列表待付款订单号
dataList.value[changeIndex.value].orderNumber = outTradeNo;
pendingPaymentOrder.value = outTradeNo;
window.location.href = paymentUrl;
}; };
/** /**
...@@ -279,21 +340,60 @@ const onFinish = async (orderNumber) => { ...@@ -279,21 +340,60 @@ const onFinish = async (orderNumber) => {
initDataList(); initDataList();
}; };
const handleDetail = (id) => {
// 清空查询待付款状态
pendingPaymentOrder.value = null;
uni.navigateTo({
url: `/pages/order/detail?orderNumber=${id}`,
});
};
/**
* 拨打商家电话
* @param {*} phoneNumber
*/
function callShopPhone(phoneNumber) {
// 清空查询待付款状态
pendingPaymentOrder.value = null;
xma.makePhoneCall({
phoneNumber, // 仅为示例
});
}
/** /**
* 再来一单 * 再来一单
*/ */
const anotherOrder = (item) => { const anotherOrder = (item) => {
// 清空查询待付款状态
pendingPaymentOrder.value = null;
xma.navigateTo({ xma.navigateTo({
url: `/pages/shop/confirmOrder?prodId=${item.orderItems[0].prodId}&skuId=${item.orderItems[0].skuId}`, url: `/pages/shop/confirmOrder?prodId=${item.orderItems[0].prodId}&skuId=${item.orderItems[0].skuId}`,
}); });
}; };
/**
* 查看核销码
*/
const handleQrcode = (item) => {
// 清空查询待付款状态
pendingPaymentOrder.value = null;
xma.navigateTo({
url: `/pages/order/ticketCode?orderNumber=${item.orderNumber}`,
});
};
/**
* 售后详情
*/
const handleRemark = (item) => { const handleRemark = (item) => {
xma.navigateTo({ xma.navigateTo({
url: `/pages/order/remark?orderNumber=${item.orderNumber}&shopName=${item.shopName}`, url: `/pages/order/remark?orderNumber=${item.orderNumber}&shopName=${item.shopName}`,
}); });
}; };
/**
* 申请退款
*/
const handleRefund = (item) => { const handleRefund = (item) => {
xma.navigateTo({ xma.navigateTo({
url: `/pages/order/refund?orderNumber=${item.orderNumber}`, url: `/pages/order/refund?orderNumber=${item.orderNumber}`,
......
...@@ -7,20 +7,129 @@ ...@@ -7,20 +7,129 @@
<text class="title">单号:1111111111</text> <text class="title">单号:1111111111</text>
</view> </view>
<view class="content-item"> <view class="content-item">
<view class="item-left"> <view class="item-top">
<image class="item-img" mode="aspectFill" src="/static/ticket/logo.png"></image> <image class="item-img" mode="aspectFill" src="/static/ticket/logo.png"></image>
<view class="item-info"> <view class="item-info">
<text>血糯米</text> <text>血糯米</text>
<text>¥0.01</text>
</view> </view>
</view> </view>
<view class="item-buttom" style="padding-top: 60rpx">
<text></text>
<text class="num">1</text>
<text>件商品 实付款</text>
<text class="icon"></text>
<text class="price">0.01</text>
</view>
</view>
<view class="content-item">
<view class="item-buttom">
<text>2024-08-02 10:12:16</text>
</view>
</view>
<view class="content-between">
<text>退款金额</text>
<text class="price">¥0.01</text>
</view>
<view class="content-between">
<text>相关图片</text>
<wd-upload
:file-list="fileList"
image-mode="aspectFill"
:action="action"
@change="handleChange"
></wd-upload>
</view>
<view class="content-between" @tap="showPop = true">
<text>退款原因</text>
<view class="rightbox">
<text>选择退款原因</text>
<wd-icon name="arrow-right" size="22px"></wd-icon>
</view>
</view> </view>
</view> </view>
<view class="btn">提交</view>
</view> </view>
</view> </view>
<wd-popup
v-model="showPop"
position="bottom"
:safe-area-inset-bottom="true"
custom-style="border-radius: 16rpx 16rpx 0 0"
@close="showPop = false"
lockScroll
>
<view class="pop-content">
<view class="header">
<view class="title">退款原因</view>
<wd-icon name="close" size="20" color="#999" @tap="showPop = false"></wd-icon>
</view>
<radio-group style="width: 100%" @change="radioChange">
<view class="resaon" v-for="(item, index) in reasonList" :key="index">
<view class="resaon-item">
<text>{{ item.name }}</text>
<radio
class="radio"
color="#f62828"
:value="item.id"
:checked="item.id == selectType"
/>
</view>
</view>
<textarea
v-if="selectType == 4"
v-model="otherReason"
placeholder="请填写原因"
placeholder-style="font-size:28rpx;color: #c0c4cc;"
></textarea>
</radio-group>
<view class="btn">确认</view>
</view>
</wd-popup>
</template> </template>
<script setup> <script setup>
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
const fileList = ref([]);
const action = ref('');
function handleChange({ fileList: files }) {
console.log(files);
fileList.value = files;
}
const showPop = ref(false);
const selectType = ref(0);
const reasonList = ref([
{
id: '0',
name: '不想要了',
},
{
id: '1',
name: '协商一致退款',
},
{
id: '2',
name: '缺货',
},
{
id: '3',
name: '七天无理由',
},
{
id: '4',
name: '其他',
},
]);
const otherReason = ref('');
function radioChange(evt) {
const { value } = evt.detail;
selectType.value = value;
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -33,10 +142,178 @@ page { ...@@ -33,10 +142,178 @@ page {
margin: 0 auto; margin: 0 auto;
.content { .content {
padding-top: 44px; padding: 108rpx 10rpx 0;
display: flex;
flex-direction: column;
gap: 60rpx;
.content-box {
background-color: #fff;
border-radius: 8rpx;
padding: 0 20rpx;
display: flex;
flex-direction: column;
.content-item {
border-bottom: 1rpx solid #f3f3f3;
padding: 20rpx 0;
.title {
font-size: 28rpx;
color: #333;
}
.item-top {
display: flex;
gap: 20rpx;
.item-img {
width: 120rpx;
height: 120rpx;
border-radius: 6rpx;
}
.item-info {
display: flex;
flex-direction: column;
gap: 20rpx;
text {
font-size: 30rpx;
color: #333;
}
}
}
.item-buttom {
display: flex;
justify-content: flex-end;
align-items: baseline;
text {
font-size: 24rpx;
color: #b5b5b5;
}
.num {
color: #606060;
font-weight: bold;
}
.icon {
color: #606060;
}
.price {
font-size: 30rpx;
color: #606060;
}
}
}
.content-between {
border-bottom: 1rpx solid #f3f3f3;
padding: 20rpx 0;
display: flex;
justify-content: space-between;
text {
color: #747474;
font-size: 30rpx;
}
.price {
color: #e0302f;
}
.rightbox {
display: flex;
font-size: 30rpx;
color: #b4b4b4;
}
}
}
}
.btn {
display: flex;
align-items: center;
justify-content: center;
height: 80rpx;
width: 100%;
background-color: #f8446b;
color: #fff;
font-size: 30rpx;
border-radius: 8rpx;
}
}
.pop-content {
display: flex;
flex-direction: column;
padding: 20rpx;
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 30rpx;
.title {
font-size: 28rpx;
color: #333;
font-weight: bold;
text-align: center;
width: 100%;
}
}
textarea {
width: 100%;
height: 200rpx;
border: 1rpx solid #e0e0e0;
padding: 20rpx;
border-radius: 8rpx;
box-sizing: border-box;
margin-top: 20rpx;
font-size: 28rpx;
}
.resaon {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 20rpx; gap: 20rpx;
.resaon-item {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 10rpx 0;
border-bottom: 1rpx solid #f3f3f3;
text {
font-size: 28rpx;
color: #333;
}
radio {
transform: scale(0.8);
}
}
}
.btn {
margin-top: 100rpx;
display: flex;
align-items: center;
justify-content: center;
height: 58rpx;
color: #fff;
font-size: 28rpx;
background-color: #f62828;
border-radius: 36rpx;
width: 100%;
} }
} }
</style> </style>
...@@ -2,38 +2,50 @@ ...@@ -2,38 +2,50 @@
<view class="container"> <view class="container">
<Header title="评论"></Header> <Header title="评论"></Header>
<view class="content"> <view class="content">
<view class="remake"> <wd-form ref="form" :model="model" :rules="rules" class="remake">
<wd-row> <text class="textarea">老凯里酸汤鱼</text>
<wd-col :span="24" custom-class="text"> <view class="itemPicker">
<h5>老凯里酸汤鱼</h5> <view class="item01">
</wd-col> <text class="label">评分</text>
</wd-row>
<wd-row custom-class="wd-rows">
<wd-col :span="16">
<span>评分</span>
<wd-rate v-model="pinfen" active-color="#ff0000" size="50rpx" space="10px" /> <wd-rate v-model="pinfen" active-color="#ff0000" size="50rpx" space="10px" />
</wd-col> </view>
<wd-col :span="8"> <view class="item02">
<span>非常满意</span> <text>非常满意</text>
</wd-col> </view>
</wd-row> </view>
<wd-divider></wd-divider>
<wd-textarea v-model="pingjia" placeholder="亲,分享您的看法,给其他人一个参考哦!" /> <wd-textarea v-model="pingjia" placeholder="亲,分享您的看法,给其他人一个参考哦!" />
<wd-row>
<wd-col :span="24" custom-class="text"> <text class="textarea">上传图片/视频</text>
<h5>上传图片/视频</h5>
</wd-col> <wd-upload
</wd-row> class="wdUpload"
<wd-upload accept="media" multiple :file-list="fileList" :action="action" @change="handleChange"></wd-upload> accept="media"
multiple
<wd-row> :file-list="fileList"
<wd-col :span="24" custom-class="text"> :action="action"
<h5>我要推荐菜</h5> @change="handleChange"
<h5>查看全部(30)</h5> ></wd-upload>
</wd-col> <view class="tuijian">
</wd-row> <view class="tjTitle">
</view> <text class="textarea">我要推荐菜</text>
<text class="textRight">
查看全部(30)
<i></i>
</text>
</view>
<view class="itemtuijianList">
<wd-button type="success" plain classPrefix="fish" icon="kehuishouwu">
主要按钮
</wd-button>
</view>
</view>
<wd-cell title="开启折扣" title-width="100px" prop="switchVal" center>
<view style="text-align: left">
<wd-switch v-model="mode.switchVal" />
</view>
</wd-cell>
</wd-form>
<wd-button type="error" block>发布</wd-button> <wd-button type="error" block>发布</wd-button>
</view> </view>
...@@ -43,36 +55,37 @@ ...@@ -43,36 +55,37 @@
import Header from './components/Header/index.vue'; import Header from './components/Header/index.vue';
const pinfen = ref<number>(0); const pinfen = ref<number>(0);
const pingjia = ref<string>('');
function changeValue({ pinfen }) { function changeValue({ pinfen }) {
console.log(pinfen); console.log(pinfen);
} }
const fileList = ref<any[]>([ const pingjia = ref<string>('');
{
url: '1',
},
]);
const action: string = ''; const action = ref<string>('/zhTuw2P8c29bc981a741931bdd86eb04dc1e8fd64865cb5/upload');
function handleChange({ fileList: files }) { const fileList = ref([]);
function handleChange({ files }) {
fileList.value = files; fileList.value = files;
} }
const mode = reactive<{
switchVal: boolean;
}>({
switchVal: true,
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
width: 100%; width: 100%;
height: auto; height: auto;
background: #f4f4f4; background: #f4f4f4;
margin-top: 88rpx; min-height: calc(100vh - 1rpx);
min-height: calc(100vh - 88rpx);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.content { .content {
margin: 0 20rpx; margin: 25rpx 20rpx 0;
padding-top: 88rpx;
.remake { .remake {
width: auto; width: auto;
...@@ -83,17 +96,60 @@ function handleChange({ fileList: files }) { ...@@ -83,17 +96,60 @@ function handleChange({ fileList: files }) {
margin-bottom: 172rpx; margin-bottom: 172rpx;
padding: 20rpx; padding: 20rpx;
.wd-rows { .itemPicker {
margin-top: 25rpx; display: flex;
justify-content: space-between;
align-items: center;
margin-top: 32rpx;
padding-bottom: 24rpx;
border-bottom: 1rpx solid #e8e8e8;
.item01 {
display: flex;
align-items: center;
gap: 29rpx;
.label {
width: 64rpx;
height: 32rpx;
font-family:
PingFang SC Bold,
PingFang SC Bold;
font-weight: 400;
font-size: 32rpx;
color: #333333;
line-height: 32rpx;
text-align: left;
font-style: normal;
text-transform: none;
}
}
} }
.text h5 { .textarea {
font-weight: 400; font-weight: 400;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
line-height: 32rpx; line-height: 32rpx;
text-align: left; text-align: left;
} }
.wdUpload {
margin-top: 25rpx;
}
}
.tuijian {
margin-top: 72rpx;
.tjTitle {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 40rpx;
.textRight {
font-size: 24rpx;
}
}
} }
} }
</style> </style>
...@@ -4,21 +4,21 @@ ...@@ -4,21 +4,21 @@
<view class="content"> <view class="content">
<!-- 使用状态 --> <!-- 使用状态 -->
<view class="status"> <view class="status">
<view class="status-text">老凯里酸汤鱼双人餐</view> <view class="status-text">{{ orderDetail.shopName }}</view>
<view class="detail">有效期:2023-07-04 23:59</view> <view class="detail">有效期:{{ orderDetail.receiverTime }}</view>
</view> </view>
<!-- 券码信息 --> <!-- 券码信息 -->
<view class="info"> <view class="info">
<view class="box"> <view class="box">
<text class="title">酸汤鱼双人套餐</text> <text class="title">{{ orderDetail.orderItems[0].prodName }}</text>
<text class="code">0115 8156 9126</text> <text class="code">{{ orderDetail.orderNumber }}</text>
</view> </view>
<view class="rectangle-with-semicircles"></view> <view class="rectangle-with-semicircles"></view>
<view class="qrcode line"> <view class="qrcode line">
<!-- 二维码 --> <!-- 二维码 -->
<view class="qr-box"> <view class="qr-box">
<image src="@/static/order/QR-code.png" class="qr"></image> <image :src="qrcode" class="qr"></image>
<text class="qr-text">请向商家出示此核销码</text> <text class="qr-text">请向商家出示此核销码</text>
</view> </view>
</view> </view>
...@@ -29,6 +29,45 @@ ...@@ -29,6 +29,45 @@
<script setup> <script setup>
import Header from './components/Header/index.vue'; import Header from './components/Header/index.vue';
import { getOrderDetail } from '@/api/order';
import QRCode from 'qrcode';
onLoad((options) => {
console.log(options);
getOrderDetailFn(options.orderNumber);
});
/**
* 获取订单详情
*/
const orderDetail = ref();
function getOrderDetailFn(orderNumber) {
getOrderDetail({ orderNumber }).then((res) => {
orderDetail.value = res.data;
const outTradeNo = res.data.orderNumber;
const indexOfDash = outTradeNo.indexOf('-');
if (indexOfDash !== -1) {
res.data.orderNumber = outTradeNo.substring(indexOfDash + 1);
} else {
console.log(`订单编号 ${outTradeNo} 中没有找到 "-" 符号。`);
}
if (orderDetail.value.status === '2' || orderDetail.value.status === '3') {
codeDetail(orderDetail.value.orderNumber);
}
});
}
const qrcode = ref('');
const codeDetail = (item) => {
const data = {
type: 'write-off',
no: item,
};
QRCode.toDataURL(JSON.stringify(data)).then((img) => {
console.log(img);
qrcode.value = img;
});
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -39,6 +78,7 @@ page { ...@@ -39,6 +78,7 @@ page {
.container { .container {
width: 375 * 2rpx; width: 375 * 2rpx;
margin: 0 auto; margin: 0 auto;
.content { .content {
padding-top: 44px; padding-top: 44px;
display: flex; display: flex;
......
...@@ -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 {
......
...@@ -162,6 +162,7 @@ ...@@ -162,6 +162,7 @@
<script setup> <script setup>
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import { groupBuyConfirm, groupBuyUpdate, groupBuyCreate } from '@/api/confirmOrder'; import { groupBuyConfirm, groupBuyUpdate, groupBuyCreate } from '@/api/confirmOrder';
import { getOrderDetail } from '@/api/order';
const imgUrl = import.meta.env.VITE_APP_IMG_URL; const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const selectType = ref('TENPAY'); const selectType = ref('TENPAY');
const prodId = ref(null); const prodId = ref(null);
...@@ -170,12 +171,48 @@ const showpopup = ref(false); ...@@ -170,12 +171,48 @@ const showpopup = ref(false);
const orderInfo = ref({}); const orderInfo = ref({});
const activeCouponInfo = ref({}); const activeCouponInfo = ref({});
const activeCouponId = ref(''); const activeCouponId = ref('');
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(() => {
if (outTradeNos.value) {
// 查询订单状态决定是否支付
getOrderDetail({ orderNumber: outTradeNos.value }).then((res) => {
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}`,
});
break;
default:
break;
}
});
}
});
function radioChange(evt) { function radioChange(evt) {
const { value } = evt.detail; const { value } = evt.detail;
selectType.value = value; selectType.value = value;
...@@ -239,11 +276,26 @@ function submitOrder() { ...@@ -239,11 +276,26 @@ function submitOrder() {
}; };
groupBuyCreate(params).then((res) => { groupBuyCreate(params).then((res) => {
if (res.code === 0) { if (res.code === 0) {
const { paymentUrl, merchantNo } = res.data.result; let timeout = null;
// window.location.href = paymentUrl; const start = new Date().getTime();
window.open(paymentUrl); 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); // plus.runtime.openURL(paymentUrl);
console.log('merchantNo', merchantNo);
} }
}); });
// xma.redirectTo({ // xma.redirectTo({
......
...@@ -6,20 +6,19 @@ ...@@ -6,20 +6,19 @@
<!-- 使用状态 --> <!-- 使用状态 -->
<view class="status"> <view class="status">
<view class="status-text">购买成功!</view> <view class="status-text">购买成功!</view>
<view class="detail">查看订单详情</view> <view class="detail" @click="jumpPage">查看订单详情</view>
</view> </view>
<!-- 券码信息 --> <!-- 券码信息 -->
<view class="info"> <view class="info">
<view class="box"> <view class="box">
<text class="title">酸汤鱼双人套餐</text> <text class="title">{{ orderDetail.orderItems[0].prodName }}</text>
<text class="code">0115 8156 9126</text> <text class="code">{{ orderDetail.orderNumber }}</text>
</view> </view>
<view class="rectangle-with-semicircles"></view> <view class="rectangle-with-semicircles"></view>
<view class="qrcode line"> <view class="qrcode line">
<!-- 二维码 --> <!-- 二维码 -->
<view class="qr-box"> <view class="qr-box">
<image src="@/static/order/QR-code.png" class="qr"></image> <image :src="qrcode" class="qr"></image>
<text class="qr-text">请向商家出示此核销码</text> <text class="qr-text">请向商家出示此核销码</text>
</view> </view>
</view> </view>
...@@ -30,6 +29,65 @@ ...@@ -30,6 +29,65 @@
<script setup> <script setup>
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import { getOrderDetail, getShopDetail, getProdDetail } from '@/api/order';
import QRCode from 'qrcode';
/**
* 获取订单详情
*/
const orderDetail = ref();
onLoad((options) => {
const { outTradeNos } = options;
getOrderDetailFn('NEONO-2024080509591318964');
});
function getOrderDetailFn(orderNumber) {
getOrderDetail({ orderNumber }).then((res) => {
orderDetail.value = res.data;
const outTradeNo = res.data.orderNumber;
const indexOfDash = outTradeNo.indexOf('-');
if (indexOfDash !== -1) {
res.data.orderNumber = outTradeNo.substring(indexOfDash + 1);
} else {
console.log(`订单编号 ${outTradeNo} 中没有找到 "-" 符号。`);
}
if (orderDetail.value.status === '2' || orderDetail.value.status === '3') {
codeDetail(orderDetail.value.orderNumber);
}
getProductDetail(orderDetail.value.orderItems[0].prodId);
getShopMailDetail(orderDetail.value.shopId);
});
}
const jumpPage = () => {
xma.navigateTo({
url: `/pages/order/detail?orderNumber=${orderDetail.value.orderItems[0].orderNumber}`,
});
};
const qrcode = ref('');
const codeDetail = (item) => {
const data = {
type: 'write-off',
no: item,
};
QRCode.toDataURL(JSON.stringify(data)).then((img) => {
console.log(img);
qrcode.value = img;
});
};
/**
* 获取商品详情
*/
const prodDetail = ref();
const getProductDetail = async (id) => {
const res = await getProdDetail({ prodId: id });
prodDetail.value = res.data.data;
};
/**
* 获取商铺信息
*/
const shopDetail = ref();
const getShopMailDetail = async (id) => {
const res = await getShopDetail({ shopId: id });
shopDetail.value = res.data.shop;
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -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;
} }
} }
......
<template>
<view class="container">
<Header title="商家入驻"></Header>
<view class="content">
<view class="formmain">
<wd-form ref="form" :model="formData" :rules="rules">
<wd-cell-group border>
<wd-picker
label="店铺类型"
placeholder="请选择店铺类型"
label-width="100px"
prop="promotion"
v-model="formData.promotion"
:columns="promotionlist"
/>
<wd-input
label="店铺名称"
label-width="100px"
prop="xm"
clearable
v-model="formData.xm"
placeholder="请输入店铺名称"
/>
<wd-input
label="联系电话"
label-width="100px"
prop="sjh"
clearable
v-model="formData.sjh"
placeholder="请输入联系电话"
/>
<wd-input
label="所在地区"
label-width="100px"
v-model="formData.szdq"
prop="szdq"
readonly
placeholder="请选择所在地区"
@click="getLocationFn"
/>
<wd-input
label="详细地址"
label-width="100px"
prop="xxdz"
clearable
v-model="formData.xm"
placeholder="请输入详细地址"
/>
<wd-input
label="小区/学校"
label-width="100px"
v-model="formData.szdq"
prop="szdq"
readonly
placeholder="请选择"
@click="getLocationFn"
/>
<view class="flex">
<view class="logo">LOGO/门头照</view>
<wd-upload
:file-list="fileList1"
image-mode="aspectFill"
:action="action"
@change="handleChange1"
:limit="1"
class="img1"
></wd-upload>
</view>
<view class="flex">
<view class="logo">营业执照</view>
<wd-upload
:file-list="fileList1"
image-mode="aspectFill"
:action="action"
@change="handleChange1"
:limit="1"
class="img1"
></wd-upload>
</view>
<view class="flex">
<view class="logo">身份证照</view>
<wd-upload
:file-list="fileList1"
image-mode="aspectFill"
:action="action"
@change="handleChange1"
:limit="1"
class="img1"
></wd-upload>
<wd-upload
:file-list="fileList1"
image-mode="aspectFill"
:action="action"
@change="handleChange1"
:limit="1"
class="img1"
></wd-upload>
</view>
<wd-textarea
placeholder="请填写评价"
label="店铺介绍"
label-width="100px"
v-model="formData.szdq"
prop="szdq"
:no-border="false"
/>
<button type="primary" style="width: 80%">提交</button>
</wd-cell-group>
</wd-form>
</view>
</view>
</view>
</template>
<script setup>
import Header from '@/pages/order/components/Header/index.vue';
import { reactive, ref } from 'vue';
const promotionlist = ref([
{
value: '1',
label: '连锁直营',
},
{
value: '2',
label: '连锁加盟',
},
]);
const fileList = ref([
{
url: '1',
},
]);
function chooseImage({ fileList: files }) {
xma.chooseImage({
count: 6, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], // 从相册选择
success: function (res) {
console.log(JSON.stringify(res.tempFilePaths));
},
});
}
const formData = ref({
systemCode: 'one-centre',
promotion: '',
xm: '',
sfz: '',
sjh: '',
szdq: '',
xxdz: '',
});
const form = ref();
const rules = ref({
promotion: [{ required: true, message: '请选择' }],
xm: [{ required: true, message: '请输入店铺名称' }],
sjh: [{ required: true, message: '请输入联系电话' }],
szdq: [{ required: true, message: '请选择' }],
xxdz: [{ required: true, message: '请输入详细地址' }],
});
const shopDetail = ref({
shopAddress: '',
});
const getLocationFn = () => {
xma.chooseLocation({
success: function (res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
},
});
};
</script>
<style lang="scss" scoped>
page {
background: #f3f3f3;
}
.container {
width: 375 * 2rpx;
margin: 0 auto;
height: 100vh;
overflow-y: auto;
padding-bottom: 40rpx;
.content {
padding-top: 88rpx;
}
.formmain {
background: #f3f3f3;
}
.flex {
display: flex;
align-items: flex-start;
padding: var(--wot-input-cell-padding, 10px)
var(--wot-input-padding, var(--wot-size-side-padding, 15px));
background-color: var(--wot-input-cell-bg, var(--wot-color-white, rgb(255, 255, 255)));
.logo {
position: relative;
padding-left: 12px;
color: var(--wot-cell-title-color, rgba(0, 0, 0, 0.85));
display: inline-block;
font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px));
line-height: var(--wot-cell-line-height, 24px);
&::after {
position: absolute;
left: 0;
top: 2px;
content: '*';
font-size: var(--wot-cell-required-size, 18px);
line-height: 1.1;
color: var(--wot-cell-required-color, var(--wot-color-danger, #fa4350));
}
}
.img1 {
margin-left: 16px;
}
}
}
</style>
<template>
<view class="container">
<Header title="我的店铺"></Header>
<view class="content">
111
</view>
</view>
</template>
<script setup>
import Header from '@/pages/order/components/Header/index.vue';
</script>
<style lang="scss" scoped>
page {
background: #f3f3f3;
}
.container {
width: 375 * 2rpx;
margin: 0 auto;
.content {
padding-top: 88rpx;
}
}
</style>
\ No newline at end of file
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
const TokenKey = 'ORDER_DICT';
export function getOrderDic() {
return xma.getStorageSync(TokenKey);
}
export function setOrderDic(token) {
return xma.setStorageSync(TokenKey, token);
}
export function removeOrderDic() {
return xma.removeStorageSync(TokenKey);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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