This commit is contained in:
1154079537 2024-06-05 18:45:30 +08:00
parent 1db31e0ed7
commit 91fb79033b
27 changed files with 3899 additions and 1379 deletions

View File

@ -29,5 +29,5 @@ export const frequentlyPurchaseApi = (data) => {
//购物车-零售购物车预检
export const checkOrderApi = (data) => {
return request.post('/order/RetailOrder/checkOrder', data);
return request.post('/order/order/checkOrder', data);
}

View File

@ -2,40 +2,56 @@ import request from '@/utils/request';
//提交零售订单(支付一起)
export const createOrderApi = (data) => {
return request.post('/order/RetailOrder/createOrder', data);
return request.post('/order/order/createOrder', data);
}
//订单列表
export const orderListApi = (data) => {
return request.get('/order/retailOrder/order_list', data);
return request.get('/order/order/order_list', data);
}
//订单详情
export const orderDetailApi = (data) => {
return request.get('/order/RetailOrder/detail', data);
return request.get('/order/order/detail', data);
}
//重新发起支付
export const rePaymentApi = (data) => {
return request.post('/order/RetailOrder/Repayment', data);
return request.post('/order/order/Repayment', data);
}
//订单数量统计
export const orderCountApi = (data) => {
return request.post('/order/RetailOrder/order_count', data);
return request.post('/order/order/order_count', data);
}
//取消订单
export const cancelOrderApi = (data) => {
return request.post('/order/RetailOrder/cancel_order', data);
return request.post('/order/order/cancel_order', data);
}
//订单确认收货
export const confirmReceiptApi = (data) => {
return request.post('/order/RetailOrder/confirm_receipt', data);
return request.post('/order/order/confirm_receipt', data);
}
//订单再次购买
export const purchaseAgainApi = (data) => {
return request.get('/order/RetailOrder/purchase_again', data);
return request.get('/order/order/purchase_again', data);
}
// 核销
// 核销订单列表
export const writeListApi = (data) => {
return request.post('/order/order/write_list', data);
}
// 单个订单核销
export const writeOrderApi = (data) => {
return request.post('/order/order/writeoff_order', data);
}
// 核销数量统计
export const writeCountApi = (data) => {
return request.post('/order/order/write_count', data);
}

View File

@ -55,3 +55,9 @@ export const addressDetailApi = (data)=>{
export const merchantListApi = (data) => {
return request.get('/merchant/merchant/lists', data);
}
// 充值
export const rechargeApi = (data) => {
return request.post('/user/user/recharge', data);
}

View File

@ -1,19 +1,10 @@
let BASE_URL
import store from "@/store/user.js"
// 环境
// let env = "dev"
// let env = "test"
// let env = "prod"
// let env = "local"
let env = "liu";
let env = "dev"
// let env = "liu";
switch (env) {
case 'prod':
BASE_URL = 'https://erp.lihaink.cn';
break;
case 'test':
BASE_URL = 'https://ceshi-erp.lihaink.cn';
break;
case 'liu':
BASE_URL = 'http://192.168.1.201:8545';
break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,3 +1,188 @@
<template>
<view class="multiple">
<view class="multiple-search">
<u-search v-model="queryParams.name" :animation="true" :showAction="false" bgColor="#f6f6f6"
placeholder="请输入门店"></u-search>
<view class="multiple-search-txt" @click.native="handleSearch">搜索</view>
</view>
<view class="multiple-card">
<scroll-view :scroll-y="true" style="height:100%;" @scrolltolower="onReachBottom">
<view class="multiple-card-wrap" style="padding-top: 12rpx;">
<block v-for="(item,indx) in shopList" :key="indx">
<view class="multiple-card-item" :class="{active:currShop == item.id}"
@click="onChooseShop(item.id)">
<view class="multiple-card-item-left">
<view class="multiple-card-item-left-title">{{item.name}}</view>
<view class="multiple-card-item-left-tag">
<text class="yellow" v-if="item.is_store == 1">可自提</text>
<text class="green" v-if="item.is_send == 1">可配送</text>
</view>
<view class="multiple-card-item-left-info">
<u-image src="../../multipleShop/images/location_small.webp" width="24rpx"
height="24rpx" />
<text>{{item.detailed_address || '-'}}</text>
</view>
<view class="multiple-card-item-left-info">
<u-image src="../../multipleShop/images/time.webp" width="24rpx" height="24rpx" />
<text
v-if="item.day_start && item.day_end">{{item.day_start + '-' + item.day_end}}</text>
<text v-else>9:00-18:00</text>
</view>
</view>
<view class="multiple-card-item-right">
<view class="multiple-card-item-right-distance">距离{{parseDistance(item.distance)}}
</view>
<view class="multiple-card-item-right-icon">
<view style="margin-right: 30rpx;" @click.stop="onPhoneCall(item.phone)">
<u-image src="../../multipleShop/images/phone.webp" width="48rpx"
height="48rpx" />
</view>
<view @click.stop="onNavgation(item)">
<u-image src="../../multipleShop/images/location.webp" width="48rpx"
height="48rpx" />
</view>
</view>
</view>
</view>
</block>
</view>
<u-loadmore :status="status" iconColor="#666" />
</scroll-view>
</view>
</view>
</template>
<script setup>
import {
reactive,
ref,
} from "vue";
import {
shopListApi
} from "@/api/multipleShop.js";
import {
onLoad,
onShow
} from "@dcloudio/uni-app";
const currShop = ref(''); //
const shopList = ref([]); //
const status = ref(''); //
//
const queryParams = reactive({
longitude: '',
latitude: '',
phone: '',
name: '',
page_no: 1,
page_size: 6
})
//
onLoad(() => {
//
getLocation();
});
//
const onChooseShop = (id) => {
currShop.value = id;
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index?id=' + id,
fail(err) {
console.log(err);
}
})
}, 300)
}
//
const onReachBottom = () => {
getShopList();
}
//
const handleSearch = () => {
shopList.value = [];
queryParams.page_no = 1;
status.value = '';
getShopList();
}
//
const getShopList = () => {
if (status.value == 'nomore') return;
if (status.value == 'loading') return;
status.value == 'loading';
shopListApi(queryParams).then(res => {
let len = res.data.lists;
status.value = queryParams.page_size > len ? 'nomore' : 'loadmore';
shopList.value = shopList.value.concat(res.data.lists);
if (status.value == 'loadmore') queryParams.page_no += 1;
})
}
//
const parseDistance = (e) => {
if (!e) return '-';
if (e > 1) {
return (e.toFixed(1)) + 'km';
} else {
return (e * 1000).toFixed(0) + 'm';
}
}
//
const onPhoneCall = (phone) => {
if (!phone) return;
uni.makePhoneCall({
phoneNumber: phone
})
}
//
const onNavgation = (item) => {
uni.openLocation({
latitude: Number(item.latitude),
longitude: Number(item.longitude),
})
}
//
const getLocation = () => {
let location = uni.getStorageSync('location');
if (location) {
let [lng, lat] = location.split(',');
queryParams.longitude = lng;
queryParams.latitude = lat;
//
getShopList();
} else {
uni.getLocation({
type: "gcj02",
success(res) {
queryParams.latitude = res.latitude;
queryParams.longitude = res.longitude;
//
getShopList();
//
uni.setStorageSync('location', `${res.longitude},${res.latitude}`)
}
})
}
}
</script>
<style lang="scss">
page {
background: #FAFAFA;
@ -20,6 +205,7 @@
position: absolute;
right: 28rpx;
top: 50%;
z-index: 11;
transform: translateY(-50%);
width: 110rpx;
height: 52rpx;
@ -33,7 +219,12 @@
}
.multiple-card {
padding-top: 24rpx;
height: calc(100vh - 90rpx);
padding-bottom: 12rpx;
.u-loadmore {
padding-bottom: 40rpx;
}
.multiple-card-item {
display: flex;
@ -52,6 +243,9 @@
font-weight: bold;
font-size: 28rpx;
color: #444444;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.multiple-card-item-left-tag {
@ -84,9 +278,10 @@
.multiple-card-item-left-info {
display: flex;
padding-right: 10rpx;
&:nth-child(1) {
margin-bottom: 10rpx;
margin-bottom: 16rpx;
}
text {
@ -104,6 +299,7 @@
justify-content: center;
align-items: center;
width: 30%;
flex-shrink: 0;
.multiple-card-item-right-distance {
margin-bottom: 20rpx;
@ -151,64 +347,3 @@
}
}
</style>
<template>
<view class="multiple">
<view class="multiple-search">
<u-search :animation="true" :showAction="false" bgColor="#f6f6f6" placeholder="请输入门店"></u-search>
<view class="multiple-search-txt">搜索</view>
</view>
<view class="multiple-card">
<view class="multiple-card-item active" v-for="item in 10">
<view class="multiple-card-item-left">
<view class="multiple-card-item-left-title">泸州春雨路自提中转中心</view>
<view class="multiple-card-item-left-tag">
<text class="yellow">可自提</text>
<text class="green">可配送</text>
</view>
<view class="multiple-card-item-left-info">
<u-image src="../images/location_small.webp" width="24rpx" height="24rpx" />
<text>四川省泸州市龙马潭区一环春雨路一段107号一环路117号</text>
</view>
<view class="multiple-card-item-left-info">
<u-image src="../images/time.webp" width="24rpx" height="24rpx" />
<text>09:00-20:00</text>
</view>
</view>
<view class="multiple-card-item-right">
<view class="multiple-card-item-right-distance">距离1km</view>
<view class="multiple-card-item-right-icon">
<view style="margin-right: 30rpx;">
<u-image src="../images/phone.webp" width="48rpx" height="48rpx" />
</view>
<u-image src="../images/location.webp" width="48rpx" height="48rpx" />
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
shopListApi
} from "@/api/multipleShop.js";
import {
onLoad
} from "@dcloudio/uni-app"
//
const getShopList = () => {
shopListApi().then(res => {
console.log(res);
})
}
onLoad(() => {
getShopList();
})
</script>

View File

@ -1,3 +1,124 @@
<template>
<view class="orderVerification">
<!-- 输入核销码 -->
<view class="verification">
<view class="num">1</view>
<view class="verification-title">核销券码</view>
<u-input v-model="writeCode" inputAlign="center" :customStyle="{'border-color':'#38BE41 !important'}"
placeholder="请输入核销券码"></u-input>
<view class="verification-btn" :style="{opacity:writeCode?1:'.6'}" @click="onConfirmWrite">确认核销</view>
</view>
<!-- 二维码 -->
<view class="verification">
<view class="num">2</view>
<view class="verification-title" style="margin-bottom: 48rpx;">二维码核销</view>
<view class="scan">
<view class="scan1" @click="onScanToWrite">
<u-image width="84rpx" height="84rpx" src="../images/scan.png"></u-image>
</view>
</view>
</view>
<!-- 弹框 -->
<u-popup :show="show" @close="close" @open="open" mode="center">
<view class="popup">
<view class="popup-wrap">
<view class="popup-title">请确认核销订单</view>
<view class="popup-order_num">订单编号:wxo1709797879549583601</view>
<view class="popup-goods">
<view class="popup-goods-left">
<u-image width="100rpx" height="100rpx" radius="8rpx" />
</view>
<view class="popup-goods-right">
<view class="popup-goods-right-info">
<text class='goods_name'>黄牛牛肉</text>
<text class="goods_price">10.00</text>
</view>
<view class="popup-goods-num">x5</view>
<view class="popup-goods-total">
<text class="popup-goods-total-num">共5件商品总金额</text>
<text class="popup-goods-total-price">50.00</text>
</view>
</view>
</view>
<view class="verification-btn">确认核销</view>
</view>
</view>
</u-popup>
</view>
</template>
<script setup>
import {
ref
} from "vue";
import {
writeOrderApi
} from "@/api/order.js";
const show = ref(false);
const writeCode = ref('');
//
const onConfirmWrite = () => {
if (!writeCode) return;
writeOrderApi({
verify_code: writeCode.value
}).then(res => {
if (res.code == 1) {
uni.showToast({
title: '核销成功',
icon: 'none',
success() {
uni.$u.sleep(1500).then(rrr => {
uni.navigateBack();
})
}
})
} else {
uni.showToast({
title: '核销失败',
icon: 'none',
success() {
writeCode.value = '';
}
})
}
})
}
//
const onScanToWrite = () => {
uni.scanCode({
success(resp) {
writeOrderApi({
verify_code: resp.result
}).then(res => {
if (res.code == 1) {
uni.showToast({
title: '核销成功',
icon: 'none',
success() {
uni.$u.sleep(1500).then(rrr => {
uni.navigateBack();
})
}
})
} else {
uni.showToast({
title: '核销失败',
icon: 'none'
})
}
})
}
})
}
</script>
<style lang="scss" scoped>
.orderVerification {
padding-top: 68rpx;
@ -36,8 +157,6 @@
text-align: center;
}
.scan {
display: flex;
align-items: center;
@ -72,6 +191,7 @@
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
transition: opacity .3;
}
::v-deep .u-popup__content {
@ -150,7 +270,6 @@
.popup-goods-total-num {
font-size: 24rpx;
color: #666666;
}
.popup-goods-total-price {
@ -164,63 +283,3 @@
}
}
</style>
<template>
<view class="orderVerification">
<!-- 输入核销码 -->
<view class="verification">
<view class="num">1</view>
<view class="verification-title">核销券码</view>
<u-input inputAlign="center" :customStyle="{'border-color':'#38BE41 !important'}"
placeholder="请输入核销券码"></u-input>
<view class="verification-btn">确认核销</view>
</view>
<!-- 二维码 -->
<view class="verification">
<view class="num">2</view>
<view class="verification-title" style="margin-bottom: 48rpx;">二维码核销</view>
<view class="scan">
<view class="scan1">
<u-image width="54rpx" height="50rpx" src="../images/scan.png"></u-image>
</view>
</view>
</view>
<!-- 弹框 -->
<u-popup :show="show" @close="close" @open="open" mode="center">
<view class="popup">
<view class="popup-wrap">
<view class="popup-title">请确认核销订单</view>
<view class="popup-order_num">订单编号:wxo1709797879549583601</view>
<view class="popup-goods">
<view class="popup-goods-left">
<u-image width="100rpx" height="100rpx" radius="8rpx" />
</view>
<view class="popup-goods-right">
<view class="popup-goods-right-info">
<text class='goods_name'>黄牛牛肉</text>
<text class="goods_price">10.00</text>
</view>
<view class="popup-goods-num">x5</view>
<view class="popup-goods-total">
<text class="popup-goods-total-num">共5件商品总金额</text>
<text class="popup-goods-total-price">50.00</text>
</view>
</view>
</view>
<view class="verification-btn">确认核销</view>
</view>
</view>
</u-popup>
</view>
</template>
<script setup>
import {
ref
} from "vue";
const show = ref(true);
</script>

127
multipleShop/test.vue Normal file
View File

@ -0,0 +1,127 @@
<style lang="scss">
.detail {
width: 710rpx;
background: #FFFFFF;
border-radius: 12rpx;
margin: 24rpx auto 0;
padding: 0 30rpx 24rpx;
box-sizing: border-box;
.detail-order_num {
height: 78rpx;
line-height: 78rpx;
margin-bottom: 24rpx;
font-weight: 600;
font-size: 26rpx;
color: #333333;
border-bottom: 2rpx solid #f1f1f1;
}
.detail-form {
border-bottom: 2rpx solid #f1f1f1;
margin-bottom: 24rpx;
.detail-form-item {
margin-bottom: 16rpx;
font-size: 26rpx;
color: #333333;
}
}
.popup-goods {
display: flex;
justify-content: space-between;
width: 630rpx;
border-radius: 16rpx;
margin-bottom: 20rpx;
padding-bottom: 1rpx;
box-sizing: border-box;
border-bottom: 2rpx solid #f1f1f1;
.popup-goods-left {
margin-right: 24rpx;
}
.popup-goods-right {
flex-grow: 1;
.popup-goods-right-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
.goods_name {
font-size: 24rpx;
color: #333333;
}
.goods_price {
font-weight: bold;
font-size: 24rpx;
color: #060606;
}
}
.popup-goods-num {
margin-bottom: 20rpx;
font-size: 24rpx;
color: #777777;
text-align: right;
}
}
}
.popup-goods-total {
text-align: right;
.popup-goods-total-num {
font-size: 24rpx;
color: #666666;
}
.popup-goods-total-price {
font-size: 26rpx;
color: #333;
}
}
}
</style>
<template>
<view class="detail">
<view class="detail-order_num">订单编号:123123123</view>
<view class="detail-form">
<view class="detail-form-item">收货人</view>
<view class="detail-form-item">核销码</view>
<view class="detail-form-item">联系电话</view>
<view class="detail-form-item">核销门店</view>
<view class="detail-form-item">核销时间</view>
</view>
<view class="popup-goods">
<view class="popup-goods-left">
<u-image width="100rpx" height="100rpx" radius="8rpx" />
</view>
<view class="popup-goods-right">
<view class="popup-goods-right-info">
<text class='goods_name'>黄牛牛肉</text>
<text class="goods_price">10.00</text>
</view>
<view class="popup-goods-num">x5</view>
</view>
</view>
<view class="popup-goods-total">
<text class="popup-goods-total-num">共5件商品总金额</text>
<text class="popup-goods-total-price">50.00</text>
</view>
</view>
</template>
<script setup>
uni.login({
success(res) {
console.log(res);
}
})
</script>

View File

@ -1,3 +1,87 @@
<template>
<view class="detail">
<view class="detail-order_num">订单编号:{{shopInfo.order_id}}</view>
<view class="detail-form">
<view class="detail-form-item">收货人{{shopInfo.real_name || '-'}}</view>
<view class="detail-form-item">核销码{{shopInfo.verify_code || '-'}}</view>
<view class="detail-form-item">核销门店{{shopInfo.store_name || '-'}}</view>
<view class="detail-form-item">核销时间{{shopInfo?.goods_list[0]?.writeoff_time || ''}}
</view>
</view>
<view class="popup-goods">
<view class="popup-goods-left">
<u-image width="100rpx" height="100rpx" radius="8rpx" :src="shopInfo.goods_list[0].image" />
</view>
<view class="popup-goods-right">
<view class="popup-goods-right-info">
<text class='goods_name'>{{shopInfo?.goods_list[0]?.store_name || ''}}</text>
<text class="goods_price">{{shopInfo?.goods_list[0]?.price || '0.00'}}</text>
</view>
<view class="popup-goods-num">x{{shopInfo?.goods_list[0]?.cart_num || 0}}</view>
</view>
</view>
<view class="popup-goods-total">
<text class="popup-goods-total-num">共计{{shopInfo.total_num || 0}}</text>
</view>
<view class="batch-write" @click="onClickToWrite">
<up-image width="36rpx" height="36rpx" src="@/multipleShop/images/scan.png" />
<view>扫码核销</view>
</view>
</view>
</template>
<script setup>
import {
onLoad
} from "@dcloudio/uni-app";
import {
ref,
getCurrentInstance
} from "vue";
import {
writeOrderApi
} from "@/api/order.js";
const instance = getCurrentInstance().proxy;
//
const shopInfo = ref({});
onLoad(() => {
const eventChannel = instance.getOpenerEventChannel();
eventChannel.on('transferDataToDetail', function(data) {
shopInfo.value = data;
})
})
//
const onClickToWrite = () => {
uni.scanCode({
success(resp) {
writeOrderApi({
verify_code: resp.result
}).then(res => {
if (res.code == 1) {
uni.showToast({
title: '核销成功',
icon: 'none',
success() {
uni.$u.sleep(1500).then(rrr => {
uni.navigateBack();
})
}
})
} else {
uni.showToast({
title: '核销失败',
icon: 'none'
})
}
})
}
})
}
</script>
<style lang="scss">
.detail {
width: 710rpx;
@ -74,46 +158,29 @@
.popup-goods-total {
text-align: right;
margin-bottom: 50rpx;
.popup-goods-total-num {
font-size: 24rpx;
color: #666666;
color: #20B128;
font-weight: 600;
}
}
.popup-goods-total-price {
font-size: 26rpx;
color: #333;
.batch-write {
display: flex;
justify-content: center;
align-items: center;
width: 670rpx;
height: 90rpx;
background: #20B128;
border-radius: 20rpx;
&>view {
font-size: 32rpx;
color: #FFFFFF;
margin-left: 8rpx;
}
}
}
</style>
<template>
<view class="detail">
<view class="detail-order_num">订单编号:123123123</view>
<view class="detail-form">
<view class="detail-form-item">收货人</view>
<view class="detail-form-item">核销码</view>
<view class="detail-form-item">核销门店</view>
<view class="detail-form-item">核销时间</view>
</view>
<view class="popup-goods">
<view class="popup-goods-left">
<u-image width="100rpx" height="100rpx" radius="8rpx" />
</view>
<view class="popup-goods-right">
<view class="popup-goods-right-info">
<text class='goods_name'>黄牛牛肉</text>
<text class="goods_price">10.00</text>
</view>
<view class="popup-goods-num">x5</view>
</view>
</view>
<view class="popup-goods-total">
<text class="popup-goods-total-num">共5件商品总金额</text>
<text class="popup-goods-total-price">50.00</text>
</view>
</view>
</template>

View File

@ -1,3 +1,208 @@
<template>
<view class="order">
<view class="order-search">
<u-search v-model="queryParams.name" :animation="true" :showAction="false" bgColor="#f6f6f6"
placeholder="请输入门店" @confirm="onSearch"></u-search>
<view class="order-search-txt" @click.native="onSearch">搜索</view>
</view>
<view class="order-tab">
<view class="order-tab-item" @click="onTabChange(1)" :class="{'order-tab-active':queryParams.status==1}">
待配送({{wCount.no_send}})</view>
<view class="order-tab-item" @click="onTabChange(2)" :class="{'order-tab-active':queryParams.status==2}">
已配送({{wCount.send}})</view>
</view>
<view class="order-list">
<scroll-view style="height: 100%;" :scroll-y="true" @scrolltolower="onScrollToLower">
<view class="order-list-wrap">
<block v-for="(item,indx) in wiriteList" :key="indx">
<view class="order-list-item" @click="onClickToDetail(item)" v-if="queryParams.status == 1">
<view class="order-list-item-order_num">订单编号:{{item.order_id}}</view>
<view class="order-list-item-trans">
<view class="order-list-item-trans-right">
<view class="order-type">{{item.shipping_type == 1?'配送订单':'自提订单'}} </view>
<view class="order-reciver">收货人{{item.real_name}}</view>
<view class="order-verification-time">商品信息{{item.goods_list[0].store_name}}</view>
</view>
<view class="order-list-item-trans-left" @click.stop="onClickToWrite(item)">
<up-image width="76rpx" height="76rpx" src="@/multipleShop/images/scan.png" />
</view>
</view>
</view>
<!-- 已经核销 -->
<view class="order-list-item" @click="onClickToDetail(item)" v-if="queryParams.status == 2">
<view class="order-list-item-order_num">订单编号:{{item.order_id}}</view>
<view class="order-list-item-trans">
<view class="order-list-item-trans-left" @click.stop="onClickToWrite(item)">
<up-image width="76rpx" height="76rpx" src="@/multipleShop/images/write_done.png" />
</view>
<view class="order-list-item-trans-right">
<view class="order-type">{{item.shipping_type == 1?'配送订单':'自提订单'}} </view>
<view class="order-reciver">收货人{{item.real_name}}</view>
<view class="order-verification-time">商品信息{{item.goods_list[0].store_name}}</view>
</view>
</view>
</view>
</block>
</view>
<view class="load-wrap">
<up-loadmore :status="status" />
</view>
</scroll-view>
<view class="batch-write" @click="onPatchWrite">
<up-image width="36rpx" height="36rpx" src="@/multipleShop/images/scan.png" />
<view>扫码核销</view>
</view>
</view>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
} from "@dcloudio/uni-app";
import {
reactive,
ref
} from "vue";
import {
writeListApi,
writeOrderApi,
writeCountApi
} from "@/api/order.js";
//
const onSearch = () => {
queryParams.value.page_no = 1;
status.value = '';
wiriteList.value = [];
getList();
}
// tab
const onTabChange = (e) => {
queryParams.value.status = e;
queryParams.value.page_no = 1;
status.value = '';
wiriteList.value = [];
getList();
}
//
const onClickToDetail = (item) => {
uni.navigateTo({
url: "/multipleShop/verificationOrder/detail",
success(res) {
res.eventChannel.emit('transferDataToDetail', item)
}
})
}
//
const onClickToWrite = (item) => {
uni.scanCode({
success(resp) {
writeOrderApi({
verify_code: resp.result
}).then(res => {
if (res.code == 1) {
uni.showToast({
title: '核销成功',
icon: 'none',
success() {
uni.$u.sleep(1500).then(rrr => {
status.value = '';
queryParams.value.page_no = 1;
wiriteList.value = [];
getList();
})
}
})
} else {
uni.showToast({
title: '核销失败',
icon: 'none'
})
}
})
}
})
// uni.navigateTo({
// url: "/multipleShop/verification/detail?id=" + item.id
// })
}
//
const onPatchWrite = () => {
uni.navigateTo({
url: "/multipleShop/orderVerification/index"
})
}
//
const onScrollToLower = (e) => {
getList();
}
//
const wCount = ref({
no_send: 0,
send: 0
});
const writeCount = () => {
writeCountApi(queryParams.value).then(res => {
let {
no_send,
send
} = res.data;
wCount.value.no_send = no_send;
wCount.value.send = send;
})
}
//
const status = ref('');
const wiriteList = ref([]);
//
const queryParams = ref({
status: 1,
name: '', //
page_no: 1,
page_size: 10
})
const getList = () => {
if (status.value == 'loading') return;
if (status.value == 'nomore') return;
status.value = 'loading';
writeListApi(queryParams.value).then(res => {
let len = res.data.list;
status.value = queryParams.value.page_size > len.length ? 'nomore' : 'loadmore';
wiriteList.value = wiriteList.value.concat(len);
if (status.value == 'loadmore') queryParams.value.page_no += 1;
});
//
writeCount();
}
onShow(() => {
//
onSearch();
getList();
})
</script>
<style lang="scss">
page {
background: #FAFAFA;
@ -20,6 +225,7 @@
position: absolute;
right: 28rpx;
top: 50%;
z-index: 10;
transform: translateY(-50%);
width: 110rpx;
height: 52rpx;
@ -33,6 +239,7 @@
}
.order-list {
position: relative;
padding-top: 24rpx;
height: calc(100vh - 90rpx - 24rpx - 30rpx);
@ -90,8 +297,34 @@
}
}
}
.load-wrap {
padding: 20rpx 0 400rpx 0;
}
.batch-write {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
bottom: 100rpx;
left: 50%;
transform: translateX(-50%);
width: 670rpx;
height: 90rpx;
background: #20B128;
border-radius: 20rpx;
&>view {
font-size: 32rpx;
color: #FFFFFF;
margin-left: 8rpx;
}
}
}
.order-tab {
display: flex;
align-items: center;
@ -127,65 +360,3 @@
}
}
</style>
<template>
<view class="order">
<view class="order-search">
<u-search :animation="true" :showAction="false" bgColor="#f6f6f6" placeholder="请输入门店"></u-search>
<view class="order-search-txt">搜索</view>
</view>
<view class="order-tab">
<view class="order-tab-item" @click="onTabChange(1)" :class="{'order-tab-active':orderTab==1}">待配送(0)</view>
<view class="order-tab-item" @click="onTabChange(2)" :class="{'order-tab-active':orderTab==2}">已配送(0)</view>
</view>
<view class="order-list">
<scroll-view style="height: 100%;" :scroll-y="true" @scroll="onScroll">
<view class="order-list-wrap">
<view class="order-list-item" v-for="item in 10">
<view class="order-list-item-order_num">订单编号:123123123123</view>
<view class="order-list-item-trans">
<view class="order-list-item-trans-right">
<view class="order-type">配送订单</view>
<view class="order-reciver">收货人李斯</view>
<view class="order-verification-time">商品信息黄牛牛腩块2kg*5</view>
</view>
<view class="order-list-item-trans-left">
<u-image width="76rpx" height="76rpx" src="../../multipleShop/images/scan.png" />
</view>
</view>
</view>
</view>
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
</scroll-view>
</view>
</view>
</template>
<script setup>
import {
onLoad
} from "@dcloudio/uni-app";
import {
ref
} from "vue";
// tab
const orderTab = ref(1);
const onTabChange = (e) => {
orderTab.value = e;
}
uni.login({
success(res) {
console.log(res);
}
})
const onScroll = (e) => {
console.log(e);
}
</script>

View File

@ -9,6 +9,13 @@
}
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/member/member",
"style": {
"navigationBarTitleText": "会员充值",
"enablePullDownRefresh": false,
}
},
{
"path": "pages/index/index",
"style": {
@ -21,51 +28,34 @@
"bounce": "none"
}
}
},
{
"path": "pages/index/test",
"style": {
"navigationBarTitleText": "购物",
"disableScroll": true,
"enablePullDownRefresh": false,
"app-plus": {
//
"bounce": "none"
}
}
},
{
}, {
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
"navigationBarTitleText": "",
"enablePullDownRefresh": false
// "navigationStyle": "custom"
}
},
{
}, {
"path": "pages/cart/cart",
"style": {
"navigationBarTitleText": "购物车",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
}, {
"path": "pages/code/code",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/my/my",
"style": {
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/code/code",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"subPackages": [{
"root": "multipleShop",
@ -80,7 +70,8 @@
"path": "verificationOrder/index",
"style": {
"navigationBarTitleText": "核销订单",
"enablePullDownRefresh": false
"enablePullDownRefresh": false,
"disableScroll": true
}
}, {
"path": "verificationOrder/detail",
@ -194,10 +185,7 @@
}
]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",

View File

@ -2,9 +2,10 @@
<view class="wrap">
<up-navbar placeholder :autoBack="true">
<template #center>
<view style="display: flex;align-items: center;width: 100%;justify-content: flex-start;margin-left: 100rpx;">
<view class="tabs" :class="{'tabs-active': tabsActive==index}" v-for="(item, index) in list" :key="index"
@click="changeTab(index)">
<view
style="display: flex;align-items: center;width: 100%;justify-content: flex-start;margin-left: 100rpx;">
<view class="tabs" :class="{'tabs-active': tabsActive==index}" v-for="(item, index) in list"
:key="index" @click="changeTab(index)">
{{item}}
</view>
</view>
@ -13,7 +14,8 @@
<swiper class="swiper-box" :current="swiperCurrent" @animationfinish="animationfinish">
<swiper-item class="swiper-item">
<scroll-view scroll-y @refresherrefresh="refresherrefresh(1)" :refresher-triggered="triggered" refresher-enabled refresher-background="#F6F6F6" style="height: 100%;width: 100%;">
<scroll-view scroll-y @refresherrefresh="refresherrefresh(1)" :refresher-triggered="triggered"
refresher-enabled refresher-background="#F6F6F6" style="height: 100%;width: 100%;">
<view class="page-box1" style="padding-top: 60rpx;">
<view class="total">
<view>共计<text style="color: #20B128;">{{cartList.length}}</text></view>
@ -21,7 +23,8 @@
<view v-else @click="isAdmin=false;">完成</view>
</view>
<view v-if="cartList.length>0" class="list">
<view class="shop-item" v-for="(item, index) in cartList" :key="index" @click="openGoodPopup(item)">
<view class="shop-item" v-for="(item, index) in cartList" :key="index"
@click="openGoodPopup(item)">
<view class="shop-check" @click.stop="checkItem(item, !item.check)">
<image v-if="!item.check" src="@/static/icon/n-check.png"></image>
<image v-else src="@/static/icon/check.png"></image>
@ -52,10 +55,12 @@
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y @refresherrefresh="refresherrefresh(2)" :refresher-triggered="triggered" refresher-enabled refresher-background="#F6F6F6" style="height: 100%;width: 100%;">
<scroll-view scroll-y @refresherrefresh="refresherrefresh(2)" :refresher-triggered="triggered"
refresher-enabled refresher-background="#F6F6F6" style="height: 100%;width: 100%;">
<view class="page-box1">
<view v-if="frequentlyList.length>0" class="list">
<view class="shop-item" v-for="(item, index) in frequentlyList" :key="index" @click="openGoodPopup(item)">
<view class="shop-item" v-for="(item, index) in frequentlyList" :key="index"
@click="openGoodPopup(item)">
<image class="shop-img" :src="item.imgs"></image>
<view class="shop-content" style="width: 490rpx;">
<view class="title">
@ -66,7 +71,8 @@
<view class="price-btn">
<view class="price">{{item.sell}}</view>
<view class="btn">
<up-button size="small" plain color="#20b128" shape="circle">加入购物车</up-button>
<up-button size="small" plain color="#20b128"
shape="circle">加入购物车</up-button>
</view>
</view>
</view>
@ -162,7 +168,7 @@
const settleAccounts = () => {
let list = [];
cartList.value.forEach(item => {
if (item.check) list.push(item.cart_id);
if (item.check) list.push(item.id);
})
cartStore.setCartList(list);
uni.navigateTo({
@ -172,7 +178,10 @@
//
const deleteCartList = () => {
let list = [];
if(!cartList.value.length) return uni.showToast({ title: '请选择商品', icon: 'none' });
if (!cartList.value.length) return uni.showToast({
title: '请选择商品',
icon: 'none'
});
cartList.value.forEach(item => {
if (item.check) list.push(item.cart_id);
})

276
pages/charge/charge.vue Normal file
View File

@ -0,0 +1,276 @@
<!-- 会员充值 -->
<style lang="scss">
.member {
// padding-top: 40rpx;
padding: 40rpx 0 300rpx 0;
.card {
background: linear-gradient(to right, #F7EED7, #E7DAAF);
height: 302rpx;
margin: 0 30rpx 30rpx;
border-radius: 10rpx;
padding: 20rpx 0 0 20rpx;
box-sizing: border-box;
.card-info {
display: flex;
align-items: center;
margin-bottom: 30rpx;
.card-info-right {
margin-left: 40rpx;
.phone {
margin-bottom: 12rpx;
font-weight: 600;
font-size: 32rpx;
color: #444444;
}
.level {
font-size: 28rpx;
color: #7B5232;
}
}
}
.money {
display: flex;
font-size: 28rpx;
color: #FFFFFF;
margin-bottom: 34rpx;
text {
margin-right: 116rpx;
}
}
.charge {
display: flex;
align-items: center;
padding-right: 38rpx;
.charge-left {
flex: 1;
margin-right: 30rpx;
&>view {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
text {
font-size: 22rpx;
color: #A26341;
}
}
}
.charge-right {
width: 148rpx;
height: 52rpx;
line-height: 52rpx;
background: #7B5232;
border-radius: 30rpx;
font-size: 22rpx;
color: #FFFFFF;
text-align: center;
}
}
}
.rules {
background: #FFFFFF;
border-radius: 16rpx;
margin: 0 30rpx 30rpx;
padding: 30rpx;
.rules-title {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 34rpx;
.rules-title-main {
font-weight: 600;
font-size: 32rpx;
color: #444444;
}
.rules-title-record {
display: flex;
align-items: center;
font-size: 28rpx;
color: #444444;
}
}
.rules-con {
display: flex;
flex-wrap: wrap;
.rules-con-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 188rpx;
height: 220rpx;
border: 2rpx solid #F1F1F1;
border-radius: 16rpx;
margin-bottom: 28rpx;
&:not(:nth-child(3n)) {
margin-right: 26rpx;
}
.rules-con-item-main {
margin-bottom: 10rpx;
font-size: 30rpx;
color: #333333;
}
.rules-con-item-sub {
margin-bottom: 30rpx;
font-size: 24rpx;
color: #777777;
}
.rules-con-item-amount {
text {
font-weight: 600;
font-size: 32rpx;
color: #333333;
}
.symbol {
font-size: 20rpx;
}
}
}
}
}
.attention {
margin: 0 30rpx;
.attention-title {
position: relative;
font-weight: 600;
font-size: 32rpx;
color: #262626;
margin-bottom: 20rpx;
margin-left: 10rpx;
text {
margin-left: 14rpx;
}
&::before {
content: "";
display: block;
position: absolute;
left: 0;
bottom: 0;
width: 6rpx;
height: 100%;
border-radius: 4rpx;
background: #FF8056;
}
}
.attention-tips {
font-size: 24rpx;
color: #7A7A7A;
margin-bottom: 30rpx;
}
}
.member-btn {
position: fixed;
bottom: 80rpx;
left: 50%;
transform: translateX(-50%);
width: 670rpx;
height: 80rpx;
line-height: 80rpx;
background: #EFCC6E;
border-radius: 40rpx;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
}
}
</style>
<template>
<view class="member">
<view class="card">
<view class="card-info">
<up-image width="100rpx" height="100rpx" />
<view class="card-info-right">
<view class="phone">155****4444</view>
<view class="level">初级会员 享受9折优惠</view>
</view>
</view>
<view class="money">
<text>余额10000</text>
<view>充值</view>
</view>
<view class="charge">
<view class="charge-left">
<view>
<text>当前已充值1000升级还需2000</text>
<text>Lv.2</text>
</view>
<up-line-progress :percentage="30" activeColor="#A26341" inactiveColor="#fff"
height="8rpx"></up-line-progress>
</view>
<view class="charge-right">升级会员</view>
</view>
</view>
<!-- 充值规格 -->
<view class="rules">
<view class="rules-title">
<view class="rules-title-main">充值规格</view>
<view class="rules-title-record">
充值记录
<up-icon name="arrow-right"></up-icon>
</view>
</view>
<view class="rules-con">
<view class="rules-con-item" v-for="item in 4">
<view class="rules-con-item-main">基础会员</view>
<view class="rules-con-item-sub">永久</view>
<view class="rules-con-item-amount">
<text class="symbol"></text>
<text>1000</text>
</view>
</view>
<view class="rules-con-define">
<up-input placeholder="点击输入金额" type="number" color="#333" fontSize="28rpx"
:placeholderStyle="{color:'#989898'}">
<template #prefix>
<up-text text="自定义金额" color="#111" size="30rpx" margin="0 3px 0 0" type="tips"></up-text>
</template>
</up-input>
</view>
</view>
</view>
<!-- 注意事项 -->
<view class="attention">
<view class="attention-title"><text>注意事项</text></view>
<view class="attention-tips">1充值后帐户的金额不能提现可用于消费使用</view>
<view class="attention-tips">2账户充值出现问题可联系平台客服也可拨打平台客服咨询热线4008888888</view>
</view>
<view class="member-btn">
确认充值
</view>
</view>
</template>

View File

@ -0,0 +1,898 @@
<template>
<view class="content">
<up-navbar placeholder style="z-index: 10080;">
<template #left>
<view style="font-size: 30rpx;font-weight: bold;" @click="test">惠农批发 </view>
</template>
</up-navbar>
<view class="navbar">
<view style="width: 400rpx;">
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search>
</view>
<view class="nav-item" @click="navTo('/pages/cart/cart')">
<image src="@/static/tab/ba.png"></image>
<text>购物车</text>
</view>
<view class="nav-item" @click="navTo('/pagesOrder/order/order?type=0')">
<image src="@/static/tab/da.png"></image>
<text>我的订单</text>
</view>
<view class="nav-item" @click="navTo('/pages/my/my')">
<image src="@/static/tab/ca.png"></image>
<text>个人中心</text>
</view>
</view>
<view class='headScoll' ref='headscroll' :style="{height:isScroll?'0':'200rpx'}">
<scroll-view class="head-view" scroll-x @scrolltolower="getgoodClassList(0)">
<view class="list">
<view class="item" :class="{'item-active': topActive===item.id}"
v-for="(item, index) in goodClassList" :key="index" @click="changeOne(item, index)">
<view class="c-img"><up-image height="100rpx" width="100rpx" :src="item.pic"></up-image></view>
<view class="c-text u-line-1">{{item.name}}</view>
</view>
<view class="item" style="width: 80rpx;height: 20rpx;">
</view>
</view>
</scroll-view>
<view class="r-btn" @click="show=1">
<view></view>
<view></view>
<up-icon name="list"></up-icon>
</view>
</view>
<viewPopup nav v-if="show===1" @close="show=0">
<view class="cateOne">
<view class="head-title">全部分类</view>
<scroll-view scroll-y style="height: 600rpx;">
<view class="list">
<view class="item" :class="{'item-active': topActive===item.id}"
v-for="(item, index) in goodClassList" :key="index" @click="changeOne(item, index)">
<view class="c-img"><up-image height="100rpx" width="100rpx" :src="item.pic"></up-image>
</view>
<view class="c-text u-line-1">{{item.name}}</view>
</view>
</view>
</scroll-view>
</view>
</viewPopup>
<view class="scroll-box">
<scroll-view class="left" scroll-y @scrolltolower="getgoodClassList(topActive)">
<view class="item u-line-1" :class="{'item-active': leftActive===item.id}"
v-for="(item, index) in goodClassTow" :key="index" @click="changeTwo(item, index)">{{item.name}}
</view>
<view style="width: 100%;height: 450rpx;"></view>
</scroll-view>
<view class="right">
<view class="classify">
<scroll-view style="height: 90rpx;" scroll-x @scrolltolower="getgoodClassList(leftActive)">
<view class="classify-list">
<view class="classify-list-item u-line-1" :class="{'item-active': rightActive===item.id}"
v-for="(item, index) in goodClassThree" :key="index" @click="changeThree(item, index)">
{{item.name}}
</view>
<view style="width: 70rpx;flex-shrink: 0;"></view>
</view>
</scroll-view>
<view class="done" @click="show=2">
<up-icon name="arrow-down"></up-icon>
</view>
<view class="order-by">
<view class="item" :class="{'order-active': where.order==''}" @click="changeOrder('')">综合</view>
<view class="item" :class="{'order-active': where.order=='desc'||where.order=='asc'}"
@click="changeOrder(where.order=='asc'?'desc':'asc')">价格</view>
<view class="item" :class="{'order-active': where.order=='sales'}"
@click="changeOrder('sales')">销量</view>
</view>
</view>
<viewPopup v-if="show===2" @close="show=0">
<view class="cateOne">
<scroll-view scroll-y style="height: 230rpx;" @scrolltolower="getgoodClassList(leftActive)">
<view class="classify-list">
<view class="classify-list-item u-line-1"
:class="{'item-active': rightActive===item.id}"
v-for="(item, index) in goodClassThree" :key="index"
@click="changeThree(item, index)">
{{item.name}}
</view>
</view>
</scroll-view>
</view>
</viewPopup>
<scroll-view class="list" id='drag_area' style="overscroll-behavior: none;" @scroll="hideHeadView"
scroll-y @scrolltolower="loadMoreGood">
<view class="shop-item" v-for="(item, index) in goodList" :key="item.id"
@click="openGoodPopup(item)">
<view class="shop-img">
<up-image width="120rpx" height="120rpx" :src="item.image"></up-image>
</view>
<view class="shop-content">
<view class="title">
<view class="name u-line-2">{{item.store_name}}</view>
<view class="tip u-line-1">
<text>{{item.spec}}</text>
<!-- <text>{{item.brand_name}}|</text> -->
<!-- <text>{{item.class_name}}|</text> -->
<!-- <text>{{item.unit_name}}</text> -->
</view>
</view>
<view class="price-btn">
<view class="price">{{item.price}}</view>
<view class="btn">
<u--icon name="plus-circle-fill" size="20" color="#20b128"></u--icon>
</view>
</view>
</view>
</view>
<view style="width: 100%;height: 350rpx;"></view>
</scroll-view>
</view>
</view>
<view class="fiexd-btn-box">
<view class="price-info">
<view class="row">
<view>合计</view>
<view class="price">¥<text style="font-size: 36rpx;">{{cartInfo.total_price}}</text></view>
</view>
<!-- <view class="row">
<view style="color: #777;">原价 ¥50.00</view>
<view class="price">优惠 ¥0.00</view>
</view> -->
</view>
<view class="btn">
<up-button color="#20b128" :disabled="cartInfo.count==0" @click="settleAccounts">结算</up-button>
</view>
<view class="cart" @click="navTo('/pages/cart/cart')">
<image src="@/static/icon/cart.png"></image>
<view class="badge">{{cartInfo.count}}</view>
</view>
</view>
<goodPopup ref="goodRef" :show="showGoodPopup" @close="showGoodPopup=false" @change="changeGood" />
</view>
</template>
<script setup>
import {
onLoad,
onShow
} from "@dcloudio/uni-app"
import {
reactive,
ref,
onMounted
} from "vue"
import {
goodListApi,
goodClassListApi
} from "@/api/good.js"
import {
cartCreateApi,
cartChangeApi,
cartListApi
} from "@/api/cart.js"
import viewPopup from "@/components/viewPopup.vue"
import goodPopup from "@/components/goodPopup.vue"
import useCartStore from "@/store/cart.js"
import {
getCurrentInstance
} from 'vue';
import useUserStore from "@/store/user";
const userStore = useUserStore();
const test = () => {
uni.navigateTo({
url: '/pageQuota/quotation/index'
})
}
/*商品列表滚动隐藏头部导航 */
const instance = getCurrentInstance(); //
const targetHeight = ref(0)
const isScroll = ref(false)
let lastScollTop = 0
const hideHeadView = (e) => {
if (e.detail.scrollTop <= 0 || e.detail.scrollTop >= targetHeight.value) return
isScroll.value = e.detail.scrollTop > lastScollTop
lastScollTop = e.detail.scrollTop
}
/*商品列表滚动隐藏头部导航结束 */
const cartStore = useCartStore();
const show = ref(0);
const topActive = ref(0);
const changeOne = async (item, index) => {
topActive.value = item.id;
show.value = 0;
goodClassTow.value = item?.children || [];
goodClassThree.value = goodClassTow.value[0]?.children || [];
leftActive.value = goodClassTow.value[0]?.id || '';
rightActive.value = goodClassThree.value[0]?.id || '';
getGoodList();
if (!item.isLoading && item.id) getgoodClassList(topActive.value); // , ,
}
const leftActive = ref(0);
const changeTwo = (item, index) => {
leftActive.value = item.id;
show.value = 0;
goodClassThree.value = item?.children || [];
rightActive.value = goodClassThree.value[0]?.id || '';
getGoodList();
if (!item.isLoading && item.id) getgoodClassList(leftActive.value, 1); // , ,
}
const rightActive = ref(0);
const changeThree = (item, index) => {
rightActive.value = item.id;
show.value = 0;
getGoodList();
}
const addCart = (id, cart_num) => { //
cartCreateApi({
cart_num: cart_num,
is_new: 0, // 01
goods_id: id
}).then(res => {
getCartList();
}).catch(err => {
console.log(err);
uni.$u.toast('添加失败')
})
}
const keyword = ref('');
const searchKeyword = () => {
where.value.name = keyword.value;
getGoodList();
}
const changeOrder = (order) => {
console.log('排序', order);
where.value.order = order;
getGoodList();
}
const where = ref({
page_no: 1,
page_size: 25,
name: '',
order: ''
})
const loading = ref(true);
const goodList = ref([]);
const getGoodList = (loadmore = false) => {
loading.value = true;
let class_id = rightActive.value || leftActive.value || topActive.value || '';
let class_all = '';
// ,
if (rightActive.value == '') class_all = leftActive.value;
if (leftActive.value == '') class_all = topActive.value;
if (topActive.value == '') class_all = '';
if (class_all) class_id = ""; //
if (loadmore) where.value.page_no++;
else where.value.page_no = 1;
goodListApi({
...where.value,
class_all: class_all,
class: class_id
}).then(res => {
if (loadmore) goodList.value.push(...res.data.lists);
else goodList.value = res.data.lists;
})
}
//
const loadMoreGood = () => {
console.log('触底了');
getGoodList(true);
}
const goodClassList = ref([]); //
const goodClassTow = ref([]); //
const goodClassThree = ref([]); //
const classMap = new Map();
const getgoodClassList = (pid = 0, three = 0) => {
let page_no = classMap.get(pid) || 1;
console.log(classMap.get(pid));
goodClassListApi({
pid: pid,
page_no: page_no,
page_size: 30,
three: three
}).then(res => {
if (pid == 0) { //
if (!res.data?.lists?.length) return;
res.data?.lists?.unshift({
id: "",
name: "全部",
pic: "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/35adb202404271727457954.png",
children: []
})
res.data.lists = res.data.lists.map(item => {
if (!item.children) item.children = [];
item.children?.unshift({
id: "",
pid: item.id, //
name: "全部",
})
item.children = item.children.map(t => {
if (!t.children) t.children = [];
t.children?.unshift({
id: "",
pid: t.id,
name: "全部",
})
return t;
})
return item;
})
//
goodClassList.value = [...goodClassList.value, ...res.data?.lists];
goodClassTow.value = goodClassList.value[0]?.children || [];
goodClassThree.value = goodClassTow.value[0]?.children || [];
topActive.value = goodClassList.value[0]?.id;
leftActive.value = goodClassTow.value[0]?.id;
rightActive.value = goodClassThree.value[0]?.id;
} else {
let flag = 1;
goodClassList.value.forEach(item => { //
if (item.id == pid) {
if (!item.children) {
item.children = [];
item.children.unshift({
id: "",
pid: item.id,
name: "全部",
})
}
item.children = [...item.children, ...res.data.lists];
item.isLoading = true;
goodClassTow.value = item.children;
flag = 0;
}
})
if (flag) goodClassTow.value.forEach(item => { //
if (item.id == pid) {
if (!item.children) {
item.children = [];
item.children.unshift({
id: "",
pid: item.id,
name: "全部",
})
}
item.children = [...item.children, ...res.data.lists];
item.isLoading = true;
goodClassThree.value = item.children;
}
})
}
page_no++;
classMap.set(pid, page_no);
})
}
const navTo = (url) => {
if (!userStore.token) return uni.showModal({
content: '您需要先登录才可使用该功能, 是否前去登录',
success: (e) => {
if (e.confirm) {
userStore.setToken('');
userStore.setUserInfo({});
uni.navigateTo({
url: '/pages/login/login'
})
} else {
userStore.setToken('');
userStore.setUserInfo({});
}
}
})
uni.navigateTo({
url: url
})
}
//
const showGoodPopup = ref(false);
const goodRef = ref(null);
const goodData = ref({});
const openGoodPopup = (item) => { // /
goodData.value = item;
goodRef.value.setData(item);
showGoodPopup.value = true;
};
const changeGood = (data) => { //
showGoodPopup.value = false;
if (!userStore.token) return uni.showModal({
content: '您需要先登录才可使用该功能, 是否前去登录',
success: (e) => {
if (e.confirm) {
userStore.setToken('');
userStore.setUserInfo({});
uni.navigateTo({
url: '/pages/login/login'
})
} else {
userStore.setToken('');
userStore.setUserInfo({});
}
}
})
addCart(data.id, data.cart_num);
}
//
const settleAccounts = () => {
uni.navigateTo({
url: '/pagesOrder/settle/settle'
})
}
//
const cartInfo = ref({
total_price: '0.00',
count: 0
})
const getCartList = (res) => {
cartListApi({
page_no: 1,
page_size: 100,
}).then(res => {
cartInfo.value = {
total_price: res.data?.extend?.total_price || '0.00',
count: res.data?.count || 0
}
cartStore.setCartList(res.data?.lists.map(item => item.cart_id))
})
}
onLoad(() => {
getgoodClassList(0);
getGoodList();
})
onShow(() => {
getCartList();
})
onMounted(() => {
const instance = getCurrentInstance(); //
const getWXDom = () => {
let query = uni.createSelectorQuery().in(instance).select("#drag_area");
query
.fields({
size: true,
scrollOffset: true,
},
(data) => {
targetHeight.value = data.scrollHeight - data.height
}
)
.exec();
}
setTimeout(() => {
getWXDom()
}, 500)
})
</script>
<style lang="scss">
.content {
background-color: #fff;
}
.navbar {
padding: 0 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 22rpx;
color: #777;
.nav-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
image {
height: 40rpx;
width: 40rpx;
}
}
}
.head-view {
background-color: #fff;
height: 180rpx;
width: 750rpx;
.list {
height: 100%;
display: flex;
align-items: center;
padding: 0 20rpx;
font-size: 22rpx;
.item {
width: 120rpx;
flex-shrink: 0;
margin-right: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
.c-img {
height: 100rpx;
width: 100rpx;
flex-shrink: 0;
border-radius: 50%;
border: 2px solid transparent;
overflow: hidden;
}
.c-text {
width: 100%;
text-align: center;
box-sizing: border-box;
padding: 2rpx 4rpx 3rpx 4rpx;
border-radius: 50rpx;
margin-top: 5rpx;
}
}
.item-active {
.c-img {
border: 2px solid #20b128;
}
.c-text {
background-color: #20b128;
color: #fff;
}
}
}
}
.r-btn {
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 60rpx;
font-size: 24rpx;
background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-shadow: -10rpx 0 60rpx 1rpx rgba(0, 0, 0, 0.3);
}
.cateOne {
background-color: #fff;
.head-title {
color: #666666;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
padding-left: 30rpx;
}
.list {
padding: 20rpx 20rpx;
font-size: 22rpx;
display: grid;
grid-template-columns: repeat(5, 1fr);
justify-content: center;
grid-gap: 20rpx;
.item {
width: 120rpx;
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
.c-img {
height: 100rpx;
width: 100rpx;
flex-shrink: 0;
border-radius: 50%;
border: 2px solid transparent;
overflow: hidden;
}
.c-text {
width: 100%;
text-align: center;
box-sizing: border-box;
padding: 2rpx 4rpx 3rpx 4rpx;
border-radius: 50rpx;
margin-top: 5rpx;
}
}
.item-active {
.c-img {
border: 2px solid #20b128;
}
.c-text {
background-color: #20b128;
color: #fff;
}
}
}
.classify-list {
padding: 20rpx 30rpx;
font-size: 22rpx;
display: grid;
grid-template-columns: repeat(3, 1fr);
justify-content: center;
grid-gap: 20rpx;
.classify-list-item {
flex-shrink: 0;
text-align: center;
width: 150rpx;
height: 42rpx;
line-height: 42rpx;
background: #F6F6F6;
border-radius: 22rpx 22rpx 22rpx 22rpx;
border: 1rpx solid transparent;
}
.item-active {
border: 1rpx solid #20b128;
color: #20b128;
background-color: rgba(#20b128, 0.1);
}
}
}
.scroll-box {
// background-color: red;
display: flex;
.left {
height: calc(100vh - var(--window-top) - var(--window-bottom) - 300rpx);
/* #ifdef H5 */
height: calc(100vh - 44px - 100rpx);
/* #endif */
width: 170rpx;
box-sizing: border-box;
background-color: #f6f6f6;
font-size: 24rpx;
.item {
height: 96rpx;
line-height: 96rpx;
text-align: center;
}
.item-active {
background-color: #fff;
position: relative;
color: #20b128;
&::before {
content: '';
background-color: #20b128;
width: 6rpx;
height: 48rpx;
border-radius: 10rpx;
position: absolute;
left: 0;
top: 50%;
transform: translate(0, -50%);
}
}
}
.right {
height: calc(100vh - var(--window-top) - 300rpx);
/* #ifdef H5 */
height: calc(100vh - 96px + 20rpx);
/* #endif */
width: 580rpx;
box-sizing: border-box;
position: relative;
overflow: hidden;
.classify {
height: 150rpx;
background-color: #fff;
border-bottom: 1rpx solid #f6f6f6;
position: relative;
font-size: 24rpx;
.classify-list {
display: flex;
padding: 20rpx;
.classify-list-item {
flex-shrink: 0;
text-align: center;
width: 108rpx;
height: 42rpx;
line-height: 42rpx;
background: #F6F6F6;
border-radius: 22rpx 22rpx 22rpx 22rpx;
margin-right: 20rpx;
border: 1rpx solid transparent;
}
.item-active {
border: 1rpx solid #20b128;
color: #20b128;
background-color: rgba(#20b128, 0.1);
}
}
.done {
height: 90rpx;
width: 60rpx;
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
}
.order-by {
display: flex;
justify-content: flex-end;
align-items: center;
.item {
padding-right: 20rpx;
}
.order-active {
color: #20b128;
}
}
}
.list {
height: calc(100vh - var(--window-top) - 400rpx);
/* #ifdef H5 */
height: calc(100vh - 44px - 200rpx);
/* #endif */
.shop-item {
padding: 20rpx;
border-bottom: 1rpx solid #f6f6f6;
background-color: #fff;
display: flex;
.shop-img {
height: 120rpx;
width: 120rpx;
margin-right: 20rpx;
border-radius: 14rpx;
overflow: hidden;
}
.shop-content {
width: 380rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
.title {
.name {
font-size: 28rpx;
}
.tip {
color: #999;
font-size: 24rpx;
margin: 2rpx 0;
}
}
.price {
font-size: 30rpx;
font-weight: bold;
color: #F55726;
}
.price-btn {
display: flex;
justify-content: space-between;
.btn {
display: flex;
align-items: center;
.num {
width: 60rpx;
text-align: center;
}
}
}
}
}
}
}
}
.fiexd-btn-box {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
height: 140rpx;
height: calc(constant(safe-area-inset-bottom) + 140rpx);
/* 适用于iOS设备 */
height: calc(env(safe-area-inset-bottom) + 140rpx);
/* 适用于Android设备 */
padding-top: 40rpx;
.price-info {
.row {
display: flex;
font-size: 26rpx;
align-items: center;
&>view {
margin-right: 15rpx;
}
.price {
color: #F55726;
}
}
}
.btn {
width: 200rpx;
}
.cart {
position: absolute;
top: -40rpx;
left: 40rpx;
image {
width: 80rpx;
height: 80rpx;
}
.badge {
position: absolute;
top: 0;
right: 0;
background-color: #F55726;
color: #fff;
border-radius: 50%;
width: 26rpx;
height: 26rpx;
text-align: center;
line-height: 26rpx;
font-size: 18rpx;
}
}
}
.headScoll {
position: relative;
overflow: hidden;
transition: 400ms;
}
</style>

View File

@ -181,8 +181,6 @@
import useUserStore from "@/store/user";
const userStore = useUserStore();
const test = () => {
uni.navigateTo({
url: '/pageQuota/quotation/index'
@ -190,9 +188,6 @@
}
/*商品列表滚动隐藏头部导航 */
const instance = getCurrentInstance(); //
const targetHeight = ref(0)
@ -202,10 +197,9 @@
if (e.detail.scrollTop <= 0 || e.detail.scrollTop >= targetHeight.value) return
isScroll.value = e.detail.scrollTop > lastScollTop
lastScollTop = e.detail.scrollTop
}
/*商品列表滚动隐藏头部导航结束 */
/*商品列表滚动隐藏头部导航结束 */
const cartStore = useCartStore();
const show = ref(0);
const topActive = ref(0);
@ -241,7 +235,9 @@
cartCreateApi({
cart_num: cart_num,
is_new: 0, // 01
goods_id: id
// goods_id: id,
store_id: where.value.store_id,
product_id: id
}).then(res => {
getCartList();
}).catch(err => {
@ -267,7 +263,8 @@
page_no: 1,
page_size: 25,
name: '',
order: ''
order: '',
store_id: '2'
})
const loading = ref(true);
const goodList = ref([]);
@ -384,6 +381,7 @@
}
const navTo = (url) => {
// if (!userStore.token || !userStore.userInfo.mobile) return uni.showModal({
if (!userStore.token) return uni.showModal({
content: '您需要先登录才可使用该功能, 是否前去登录',
success: (e) => {
@ -429,7 +427,10 @@
userStore.setUserInfo({});
}
}
})
});
console.log(data);
addCart(data.id, data.cart_num);
}
//
@ -453,18 +454,20 @@
total_price: res.data?.extend?.total_price || '0.00',
count: res.data?.count || 0
}
cartStore.setCartList(res.data?.lists.map(item => item.cart_id))
cartStore.setCartList(res.data?.lists.map(item => item.id))
})
}
onLoad(() => {
onLoad((opt) => {
if (opt.id) where.value.store_id = opt.id;
getgoodClassList(0);
getGoodList();
})
onShow(() => {
getCartList();
})
onMounted(() => {
const instance = getCurrentInstance(); //
const getWXDom = () => {

View File

@ -1,127 +1,349 @@
<template>
<view class="multiple">
<view class="multiple-search">
<u-search v-model="queryParams.name" :animation="true" :showAction="false" bgColor="#f6f6f6"
placeholder="请输入门店"></u-search>
<view class="multiple-search-txt" @click.native="handleSearch">搜索</view>
</view>
<view class="multiple-card">
<scroll-view :scroll-y="true" style="height:100%;" @scrolltolower="onReachBottom">
<view class="multiple-card-wrap" style="padding-top: 12rpx;">
<block v-for="(item,indx) in shopList" :key="indx">
<view class="multiple-card-item" :class="{active:currShop == item.id}"
@click="onChooseShop(item.id)">
<view class="multiple-card-item-left">
<view class="multiple-card-item-left-title">{{item.name}}</view>
<view class="multiple-card-item-left-tag">
<text class="yellow" v-if="item.is_store == 1">可自提</text>
<text class="green" v-if="item.is_send == 1">可配送</text>
</view>
<view class="multiple-card-item-left-info">
<u-image src="../../multipleShop/images/location_small.webp" width="24rpx"
height="24rpx" />
<text>{{item.detailed_address || '-'}}</text>
</view>
<view class="multiple-card-item-left-info">
<u-image src="../../multipleShop/images/time.webp" width="24rpx" height="24rpx" />
<text
v-if="item.day_start && item.day_end">{{item.day_start + '-' + item.day_end}}</text>
<text v-else>9:00-18:00</text>
</view>
</view>
<view class="multiple-card-item-right">
<view class="multiple-card-item-right-distance">距离{{parseDistance(item.distance)}}
</view>
<view class="multiple-card-item-right-icon">
<view style="margin-right: 30rpx;" @click.stop="onPhoneCall(item.phone)">
<u-image src="../../multipleShop/images/phone.webp" width="48rpx"
height="48rpx" />
</view>
<view @click.stop="onNavgation(item)">
<u-image src="../../multipleShop/images/location.webp" width="48rpx"
height="48rpx" />
</view>
</view>
</view>
</view>
</block>
</view>
<u-loadmore :status="status" iconColor="#666" />
</scroll-view>
</view>
</view>
</template>
<script setup>
import {
reactive,
ref,
} from "vue";
import {
shopListApi
} from "@/api/multipleShop.js";
import {
onLoad,
onShow
} from "@dcloudio/uni-app";
const currShop = ref(''); //
const shopList = ref([]); //
const status = ref(''); //
//
const queryParams = reactive({
longitude: '',
latitude: '',
phone: '',
name: '',
page_no: 1,
page_size: 6
})
//
onLoad(() => {
//
getLocation();
});
//
const onChooseShop = (id) => {
currShop.value = id;
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index?id=' + id,
fail(err) {
console.log(err);
}
})
}, 300)
}
//
const onReachBottom = () => {
getShopList();
}
//
const handleSearch = () => {
shopList.value = [];
queryParams.page_no = 1;
status.value = '';
getShopList();
}
//
const getShopList = () => {
if (status.value == 'nomore') return;
if (status.value == 'loading') return;
status.value == 'loading';
shopListApi(queryParams).then(res => {
let len = res.data.lists;
status.value = queryParams.page_size > len ? 'nomore' : 'loadmore';
shopList.value = shopList.value.concat(res.data.lists);
if (status.value == 'loadmore') queryParams.page_no += 1;
})
}
//
const parseDistance = (e) => {
if (!e) return '-';
if (e > 1) {
return (e.toFixed(1)) + 'km';
} else {
return (e * 1000).toFixed(0) + 'm';
}
}
//
const onPhoneCall = (phone) => {
if (!phone) return;
uni.makePhoneCall({
phoneNumber: phone
})
}
//
const onNavgation = (item) => {
uni.openLocation({
latitude: Number(item.latitude),
longitude: Number(item.longitude),
})
}
//
const getLocation = () => {
let location = uni.getStorageSync('location');
if (location) {
let [lng, lat] = location.split(',');
queryParams.longitude = lng;
queryParams.latitude = lat;
//
getShopList();
} else {
uni.getLocation({
type: "gcj02",
success(res) {
queryParams.latitude = res.latitude;
queryParams.longitude = res.longitude;
//
getShopList();
//
uni.setStorageSync('location', `${res.longitude},${res.latitude}`)
}
})
}
}
</script>
<style lang="scss">
.detail {
width: 710rpx;
page {
background: #FAFAFA;
}
.multiple {
padding-bottom: 30rpx;
.multiple-search {
position: sticky;
top: 0;
z-index: 10;
display: flex;
height: 90rpx;
background-color: #fff;
padding: 0 24rpx;
box-sizing: border-box;
.multiple-search-txt {
position: absolute;
right: 28rpx;
top: 50%;
z-index: 11;
transform: translateY(-50%);
width: 110rpx;
height: 52rpx;
line-height: 52rpx;
text-align: center;
background: #FFFFFF;
border-radius: 12rpx;
margin: 24rpx auto 0;
padding: 0 30rpx 24rpx;
box-sizing: border-box;
.detail-order_num {
height: 78rpx;
line-height: 78rpx;
margin-bottom: 24rpx;
font-weight: 600;
font-size: 26rpx;
color: #333333;
border-bottom: 2rpx solid #f1f1f1;
}
.detail-form {
border-bottom: 2rpx solid #f1f1f1;
margin-bottom: 24rpx;
.detail-form-item {
margin-bottom: 16rpx;
font-size: 26rpx;
color: #333333;
border-radius: 30rpx 30rpx 30rpx 30rpx;
font-size: 28rpx;
color: #20B128;
}
}
.popup-goods {
.multiple-card {
height: calc(100vh - 90rpx);
padding-bottom: 12rpx;
.u-loadmore {
padding-bottom: 40rpx;
}
.multiple-card-item {
display: flex;
justify-content: space-between;
width: 630rpx;
background: #FFFFFF;
border-radius: 16rpx;
margin-bottom: 20rpx;
padding-bottom: 1rpx;
box-sizing: border-box;
border-bottom: 2rpx solid #f1f1f1;
margin: 0 24rpx 20rpx;
padding: 30rpx 0 42rpx 30rpx;
overflow: hidden;
.popup-goods-left {
margin-right: 24rpx;
}
.multiple-card-item-left {
width: 70%;
border-right: 2rpx solid #F1F1F1;
.popup-goods-right {
flex-grow: 1;
.popup-goods-right-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
.goods_name {
font-size: 24rpx;
color: #333333;
}
.goods_price {
.multiple-card-item-left-title {
margin-bottom: 14rpx;
font-weight: bold;
font-size: 28rpx;
color: #444444;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.multiple-card-item-left-tag {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-bottom: 16rpx;
text {
width: 90rpx;
height: 42rpx;
line-height: 42rpx;
text-align: center;
border-radius: 8rpx;
font-size: 24rpx;
color: #060606;
margin-right: 16rpx;
padding: 4rpx 10rpx;
}
.yellow {
background-color: #FFF8F1;
color: #FFB76D;
}
.green {
color: #20B128;
background-color: #F2FFF3;
}
}
.popup-goods-num {
margin-bottom: 20rpx;
.multiple-card-item-left-info {
display: flex;
padding-right: 10rpx;
&:nth-child(1) {
margin-bottom: 16rpx;
}
text {
font-weight: 400;
font-size: 24rpx;
color: #777777;
text-align: right;
margin-left: 4rpx;
}
}
}
.popup-goods-total {
text-align: right;
.multiple-card-item-right {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 30%;
flex-shrink: 0;
.popup-goods-total-num {
font-size: 24rpx;
color: #666666;
.multiple-card-item-right-distance {
margin-bottom: 20rpx;
font-size: 22rpx;
color: #777777;
}
.popup-goods-total-price {
font-size: 26rpx;
color: #333;
.multiple-card-item-right-icon {
display: flex;
align-items: center;
}
}
}
.active {
position: relative;
border: 2rpx solid #20B128;
&::after {
content: "";
display: block;
position: absolute;
right: -34rpx;
bottom: -8rpx;
width: 0;
height: 0;
border-left: 50rpx solid transparent;
border-right: 50rpx solid transparent;
border-bottom: 50rpx solid #20B128;
transform: rotate(135deg);
}
&::before {
content: "√";
display: block;
position: absolute;
right: 10rpx;
bottom: 4rpx;
color: #fff;
z-index: 11;
font-weight: bold;
}
}
}
}
</style>
<template>
<view class="detail">
<view class="detail-order_num">订单编号:123123123</view>
<view class="detail-form">
<view class="detail-form-item">收货人</view>
<view class="detail-form-item">核销码</view>
<view class="detail-form-item">联系电话</view>
<view class="detail-form-item">核销门店</view>
<view class="detail-form-item">核销时间</view>
</view>
<view class="popup-goods">
<view class="popup-goods-left">
<u-image width="100rpx" height="100rpx" radius="8rpx" />
</view>
<view class="popup-goods-right">
<view class="popup-goods-right-info">
<text class='goods_name'>黄牛牛肉</text>
<text class="goods_price">10.00</text>
</view>
<view class="popup-goods-num">x5</view>
</view>
</view>
<view class="popup-goods-total">
<text class="popup-goods-total-num">共5件商品总金额</text>
<text class="popup-goods-total-price">50.00</text>
</view>
</view>
</template>
<script setup>
uni.login({
success(res) {
console.log(res);
}
})
</script>

View File

@ -132,6 +132,7 @@
const showWeixin = ref(true); //
const isAgree = ref(false); //
const tempUser = ref(null);
const weixinLogin = () => {
if (!isAgree.value) return uni.$u.toast('请先阅读并同意协议');
@ -146,9 +147,12 @@
}).then(res => {
uni.hideLoading();
userStore.setToken(res.data.token);
userStore.setUserInfo(res.data);
if (!res.data.mobile) { //
tempUser.value = res.data;
return showBind.value = true;
} else {
userStore.setUserInfo(res.data);
}
navToIndex();
})
@ -167,7 +171,20 @@
getMobileByMnpApi({
code: e.detail.code
}).then(res => {
navToIndex();
// token
userStore.setUserInfo(res.data);
//
if (res.is_staff == 1) {
userStore.setUserInfo(res.data);
uni.reLaunch({
url: "/multipleShop/verificationOrder/index"
})
} else { //
uni.reLaunch({
url: "/multipleShop/index/index"
})
}
})
} else {
console.log("用户拒绝授权");

359
pages/member/member.vue Normal file
View File

@ -0,0 +1,359 @@
<!-- 会员充值 -->
<!-- <style lang="scss">
.member {
padding: 40rpx 0 300rpx 0;
.card {
background: linear-gradient(to right, #F7EED7, #E7DAAF);
height: 302rpx;
margin: 0 30rpx 30rpx;
border-radius: 10rpx;
padding: 20rpx 0 0 20rpx;
box-sizing: border-box;
.card-info {
display: flex;
align-items: center;
margin-bottom: 30rpx;
.card-info-right {
margin-left: 40rpx;
.phone {
margin-bottom: 12rpx;
font-weight: 600;
font-size: 32rpx;
color: #444444;
}
.level {
font-size: 28rpx;
color: #7B5232;
}
}
}
}
}
</style>
<template>
<view class="member">
<view class="card">
<view class="card-info">
<up-image width="100rpx" height="100rpx" />
<view class="card-info-right">
<view class="phone">155****4444</view>
<view class="level">初级会员 享受9折优惠</view>
</view>
</view>
<view></view>
</view>
</view>
</template> -->
<!-- 会员充值 -->
<style lang="scss">
.member {
// padding-top: 40rpx;
padding: 40rpx 0 300rpx 0;
.card {
background: linear-gradient(to right, #F7EED7, #E7DAAF);
height: 302rpx;
margin: 0 30rpx 30rpx;
border-radius: 10rpx;
padding: 20rpx 0 0 20rpx;
box-sizing: border-box;
.card-info {
display: flex;
align-items: center;
margin-bottom: 30rpx;
.card-info-right {
margin-left: 40rpx;
.phone {
margin-bottom: 12rpx;
font-weight: 600;
font-size: 32rpx;
color: #444444;
}
.level {
font-size: 28rpx;
color: #7B5232;
}
}
}
.money {
display: flex;
font-size: 28rpx;
color: #FFFFFF;
margin-bottom: 34rpx;
text {
margin-right: 116rpx;
}
}
.charge {
display: flex;
align-items: center;
padding-right: 38rpx;
.charge-left {
flex: 1;
margin-right: 30rpx;
&>view {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
text {
font-size: 22rpx;
color: #A26341;
}
}
}
.charge-right {
width: 148rpx;
height: 52rpx;
line-height: 52rpx;
background: #7B5232;
border-radius: 30rpx;
font-size: 22rpx;
color: #FFFFFF;
text-align: center;
}
}
}
.rules {
background: #FFFFFF;
border-radius: 16rpx;
margin: 0 30rpx 30rpx;
padding: 30rpx;
.rules-title {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 34rpx;
.rules-title-main {
font-weight: 600;
font-size: 32rpx;
color: #444444;
}
.rules-title-record {
display: flex;
align-items: center;
font-size: 28rpx;
color: #444444;
}
}
.rules-con {
display: flex;
flex-wrap: wrap;
.rules-con-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 188rpx;
height: 220rpx;
border: 2rpx solid #F1F1F1;
border-radius: 16rpx;
margin-bottom: 28rpx;
&:not(:nth-child(3n)) {
margin-right: 26rpx;
}
.rules-con-item-main {
margin-bottom: 10rpx;
font-size: 30rpx;
color: #333333;
}
.rules-con-item-sub {
margin-bottom: 30rpx;
font-size: 24rpx;
color: #777777;
}
.rules-con-item-amount {
text {
font-weight: 600;
font-size: 32rpx;
color: #333333;
}
.symbol {
font-size: 20rpx;
}
}
}
}
}
.attention {
margin: 0 30rpx;
.attention-title {
position: relative;
font-weight: 600;
font-size: 32rpx;
color: #262626;
margin-bottom: 20rpx;
margin-left: 10rpx;
text {
margin-left: 14rpx;
}
&::before {
content: "";
display: block;
position: absolute;
left: 0;
bottom: 0;
width: 6rpx;
height: 100%;
border-radius: 4rpx;
background: #FF8056;
}
}
.attention-tips {
font-size: 24rpx;
color: #7A7A7A;
margin-bottom: 30rpx;
}
}
.member-btn {
position: fixed;
bottom: 0rpx;
left: 50%;
transform: translateX(-50%);
height: 110rpx;
background-color: #F6F6F6;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding-bottom: constant(safe-area-inset-bottom);
/* 兼容 iOS < 11.2 */
padding-bottom: env(safe-area-inset-bottom);
/* 兼容 iOS >= 11.2 */
.btn-wrap {
width: 670rpx;
height: 80rpx;
line-height: 80rpx;
margin: 0 auto;
background: #EFCC6E;
border-radius: 40rpx;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
}
}
}
</style>
<template>
<view class="member">
<view class="card">
<view class="card-info">
<up-image width="100rpx" height="100rpx" />
<view class="card-info-right">
<view class="phone">155****4444</view>
<view class="level">初级会员 享受9折优惠</view>
</view>
</view>
<view class="money">
<text>余额10000</text>
<view>充值</view>
</view>
<view class="charge">
<view class="charge-left">
<view>
<text>当前已充值1000升级还需2000</text>
<text>Lv.2</text>
</view>
<up-line-progress :percentage="30" activeColor="#A26341" inactiveColor="#fff"
height="8rpx"></up-line-progress>
</view>
<view class="charge-right">升级会员</view>
</view>
</view>
<!-- 充值规格 -->
<view class="rules">
<view class="rules-title">
<view class="rules-title-main">充值规格</view>
<view class="rules-title-record">
充值记录
<up-icon name="arrow-right"></up-icon>
</view>
</view>
<view class="rules-con">
<view class="rules-con-item" v-for="item in 4">
<view class="rules-con-item-main">基础会员</view>
<view class="rules-con-item-sub">永久</view>
<view class="rules-con-item-amount">
<text class="symbol"></text>
<text>1000</text>
</view>
</view>
<view class="rules-con-define">
<up-input placeholder="点击输入金额" type="number" color="#333" fontSize="28rpx"
:placeholderStyle="{color:'#989898'}">
<template #prefix>
<up-text text="自定义金额" color="#111" size="30rpx" margin="0 3px 0 0" type="tips"></up-text>
</template>
</up-input>
</view>
</view>
</view>
<!-- 注意事项 -->
<view class="attention">
<view class="attention-title"><text>注意事项</text></view>
<view class="attention-tips">1充值后帐户的金额不能提现可用于消费使用</view>
<view class="attention-tips">2账户充值出现问题可联系平台客服也可拨打平台客服咨询热线4008888888</view>
</view>
<view class="member-btn">
<view class="btn-wrap">
确认充值
</view>
</view>
</view>
</template>
<script>
import {
rechargeApi
} from "@/api/user.js";
rechargeApi({
price: 1000
}).then(res => {
console.log(res);
})
</script>

View File

@ -1,17 +1,55 @@
<template>
<view>
<up-navbar title="我的" bgColor="rgba(0,0,0,0)" :autoBack="true">
<up-navbar title="我的" :autoBack="true" bgColor="transparent" :fixed="true">
</up-navbar>
<view class="user-info">
<image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp"
mode="widthFix"></image>
<view class="u-card">
<up-avatar :src="userInfo.avatar" size="80"></up-avatar>
<view style="display: flex;margin-bottom: 44rpx;">
<up-avatar :src="userInfo.avatar" size="56"></up-avatar>
<view class="content">
<view class="u-phone">{{userInfo.nickname}}</view>
<view class="u-id">ID: {{userInfo.id}}</view>
</view>
</view>
<view class="u-card-level">
<view class="u-level-item">
<view class="u-level-item-num">123</view>
<view class="u-level-item-txt">会员等级</view>
</view>
<view class="u-level-item">
<view class="u-level-item-num">123</view>
<view class="u-level-item-txt">可享折扣</view>
</view>
<view class="u-level-item">
<view class="u-level-item-num">123</view>
<view class="u-level-item-txt">可用余额</view>
</view>
</view>
</view>
</view>
<view class="member">
<view class="member-wrap">
<view class="member-left">
<up-image width="36rpx" height="36rpx" src="/static/icon/silver.webp"></up-image>
<text>初级会员</text>
<up-line direction="col" color="#707070" margin="0 10rpx" length="12"></up-line>
<view>活动期间下单即享初级会员</view>
</view>
<view class="member-right">立即下单</view>
</view>
<view class="member-progress">
<view>
<text>当前已充值1000升级还需2000</text>
<text>Lv.2</text>
</view>
<up-line-progress :percentage="30" activeColor="#A26341" inactiveColor="#fff"
height="8rpx"></up-line-progress>
</view>
</view>
<view class="order-info-box">
@ -24,16 +62,21 @@
<view class="">待付款</view>
<view class="badge" v-if="orderCount.no_pay">{{orderCount.no_pay}}</view>
</view>
<view class="list-item" @click="navTo(2)">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/45241202404261403353935.png">
<image src="/static/icon/wait.webp">
</image>
<view class="">收货</view>
<view class="">核销</view>
<view class="badge" v-if="orderCount.receiving">{{orderCount.receiving}}</view>
</view>
<!-- <view class="list-item">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/96915202404261403582769.png"></image>
<view class="">售后/退款</view>
</view> -->
<view class="list-item" @click="navTo(2)">
<image src="/static/icon/done.webp">
</image>
<view class="">已核销</view>
<view class="badge" v-if="orderCount.receiving">{{orderCount.receiving}}</view>
</view>
<view class="list-item" @click="navTo()">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/abdcd202404261406199643.png">
</image>
@ -45,8 +88,8 @@
<view class="card">
<up-cell-group>
<up-cell title="我的余额" :isLink="true" url="/pageQuota/Balance/index"></up-cell>
<up-cell title="我的地址" :isLink="true" url="/pagesOrder/addressList/addressList"></up-cell>
<!-- <up-cell title="我的余额" :isLink="true" url="/pageQuota/Balance/index"></up-cell> -->
</up-cell-group>
</view>
@ -112,7 +155,7 @@
overflow: hidden;
position: relative;
width: 750rpx;
height: 450rpx;
height: 436rpx;
/* #ifdef H5 */
height: 350rpx;
/* #endif */
@ -128,9 +171,8 @@
.u-card {
box-sizing: border-box;
padding: 50rpx 0 50rpx 50rpx;
display: flex;
position: absolute;
bottom: 50rpx;
top: 100rpx;
left: 0;
z-index: 2;
@ -150,33 +192,115 @@
font-size: 24rpx;
}
}
.u-card-level {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 40rpx;
.u-level-item {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
&:not(:nth-last-child(1)) {
margin-right: 100rpx;
}
.u-level-item-num {
font-weight: 600;
font-size: 32rpx;
color: #333333;
margin-bottom: 8rpx;
}
.u-level-item-txt {
font-size: 26rpx;
color: #444444;
}
}
}
}
}
.member {
width: 710rpx;
margin: 0 auto;
background: linear-gradient(135deg, #FFF9E8 0%, #F3E7C0 100%);
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(113, 113, 113, 0.11);
border-radius: 12rpx;
padding: 0 18rpx 22rpx 22rpx;
box-sizing: border-box;
.member-wrap {
display: flex;
align-items: center;
justify-content: space-between;
height: 78rpx;
margin-bottom: 20rpx;
.member-left {
display: flex;
align-items: center;
text {
font-weight: bold;
font-size: 26rpx;
color: #060606;
}
view {
font-size: 24rpx;
color: #060606;
}
}
.member-right {
width: 136rpx;
height: 56rpx;
line-height: 56rpx;
background: #FFFFFF;
border-radius: 28rpx;
font-weight: 600;
font-size: 24rpx;
color: #7D661E;
text-align: center;
}
}
.member-progress {
&>view {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
text {
font-size: 22rpx;
color: #A26341;
}
}
}
}
.order-info-box {
margin: 20rpx;
height: 140rpx;
position: relative;
.order-info {
height: 220rpx;
width: 710rpx;
background-color: #fff;
border-radius: 14rpx;
position: absolute;
top: -80rpx;
left: 0;
z-index: 3;
background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/a8863202404261349533191.png');
background-size: 35% 100%;
background-size: 28% 100%;
background-position: right;
background-repeat: no-repeat;
margin: 0 auto;
padding: 28rpx 0 40rpx 0;
.info-head {
margin-left: 20rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
font-weight: bold;
margin: 0 0 30rpx 30rpx;
}
.info-list {

View File

@ -4,28 +4,28 @@
还剩<text>{{countDown}}</text>订单自动取消
</view>
<view class="m-card m-address" style="margin-top: 20rpx;">
<view class="address-info" @click="callPhone(shopInfo.service_phone)">
<view class="address-info" @click="callPhone(shopInfo.phone)">
<view class="top" style="align-items: flex-start;">
<view style="color: #333;display: flex;align-items: center;">
<up-icon name="map"></up-icon>
<text style="margin: 0 10rpx;">自提点</text>
</view>
<view v-if="shopInfo.mer_id">
<view v-if="shopInfo.id">
<view style="color: #333;">
{{shopInfo.mer_name}}
<text v-if="shopInfo.recommend"
style="font-size: 20rpx;color: #fff;background-color: #20b128;padding: 2rpx 5rpx;padding: 1rpx 4rpx;">推荐</text>
{{shopInfo.name}}
<!-- <text v-if="shopInfo.recommend"
style="font-size: 20rpx;color: #fff;background-color: #20b128;padding: 2rpx 5rpx;padding: 1rpx 4rpx;">推荐</text> -->
</view>
<view style="font-size: 24rpx;color: #333;">
{{shopInfo.mer_address}}
{{shopInfo.detailed_address}}
</view>
<view>
<view v-if="shopInfo.service_phone">
<text style="margin-right: 10rpx;">{{shopInfo.real_name||shopInfo.mer_real_name}}</text>
<text>{{shopInfo.service_phone}}</text>
<view v-if="shopInfo.phone">
<text style="margin-right: 10rpx;">{{shopInfo.name||shopInfo.mer_real_name}}</text>
<text>{{shopInfo.phone}}</text>
</view>
<text v-if="shopInfo.distance"
style="color: #20b128;font-size: 22rpx;border: 1px solid #20b128;border-radius: 4rpx;">{{shopInfo.distance}}</text>
<!-- <text v-if="shopInfo.distance"
style="color: #20b128;font-size: 22rpx;border: 1px solid #20b128;border-radius: 4rpx;">{{shopInfo.distance}}</text> -->
</view>
</view>
</view>
@ -65,29 +65,34 @@
</view>
<view class="m-card m-good" v-for="(item,index) in datas.goods_list" :key="index">
<view class="image">
<up-image :src="item.imgs" width="120rpx" height="120rpx"></up-image>
<up-image :src="item.image" width="120rpx" height="120rpx"></up-image>
</view>
<view class="body-content">
<view>
<view class="title">
<view>{{item.class_name}}</view>
<view>¥{{item.sell}}</view>
<view>{{item.store_name}}</view>
<view>¥{{item.price}}</view>
</view>
<view class="tips">
<view>{{}}</view>
<view>x{{item.nums}}{{item.unit_name}}</view>
</view>
<view class="time">
{{item.msg}}
</view>
</view>
</view>
<view class="qr_code">
<QRCode :val="datas.verify_code" :size="150"></QRCode>
<view style="font-weight: bold;color: #333;font-size: 26;">
核销码 {{datas.verify_code}}
</view>
</view>
<view class="m-card good-info" v-if="datas.paid==0">
<view v-if="datas.goods_list" class="row">
<view>商品总价 <text>共计{{datas.goods_list.length}}款商品</text></view>
<view><text>¥</text>{{c_price(datas.total, 0)}}<text>.{{c_price(datas.total, 1)}}</text></view>
<view><text>¥</text>{{c_price(datas.total_price, 0)}}<text>.{{c_price(datas.total_price, 1)}}</text>
</view>
</view>
<view class="row">
<view>运费</view>
@ -95,8 +100,8 @@
</view>
<view class="row-need">
<view style="margin-right: 10rpx;">需付款</view>
<view v-if="datas.total">
<text>¥</text>{{c_price(datas.total, 0)}}<text>.{{c_price(datas.total, 1)}}</text>
<view v-if="datas.pay_price">
<text>¥</text>{{c_price(datas.pay_price, 0)}}<text>.{{c_price(datas.pay_price, 1)}}</text>
</view>
</view>
</view>
@ -105,8 +110,8 @@
<block v-if="datas.paid==0">
<view class="row">
<view>订单编号</view>
<up-copy :content="datas.number">
<text>{{datas.number}} | 复制</text>
<up-copy :content="datas.order_id">
<text>{{datas.order_id}} | 复制</text>
</up-copy>
</view>
<view class="row">
@ -122,12 +127,13 @@
<block v-else>
<view v-if="datas.goods_list" class="row">
<view>实付款</view>
<view><text>¥</text>{{c_price(datas.total, 0)}}<text>.{{c_price(datas.total, 1)}}</text></view>
<view><text>¥</text>{{c_price(datas.pay_price, 0)}}<text>.{{c_price(datas.pay_price, 1)}}</text>
</view>
</view>
<view class="row">
<view>订单编号</view>
<up-copy :content="datas.number">
<text>{{datas.number}} | 复制</text>
<up-copy :content="datas.order_id">
<text>{{datas.order_id}} | 复制</text>
</up-copy>
</view>
<view class="row">
@ -140,27 +146,27 @@
</view>
<view class="row" style="margin-bottom: 0;">
<view>支付状态</view>
<view v-if="datas.paid">已支付</view>
<view v-if="datas.paid == 1">已支付</view>
<view v-else class="red">待支付</view>
</view>
</block>
</view>
<view style="width: 100%;height: 200rpx;"></view>
<view class="fiexd-btn-box" v-if="datas.number">
<view class="fiexd-btn-box" v-if="datas.order_id">
<block v-if="!datas.paid">
<view style="color: #777777;" @click="showCancel=true">取消订单</view>
<view style="width: 450rpx;">
<up-button color="#20B128" shape="circle" @click="rePay" :throttleTime="1000">立即支付
¥{{datas.total}}</up-button>
¥{{datas.pay_price}}</up-button>
</view>
</block>
<block v-else>
<view></view>
<view style="width: 450rpx;">
<up-button v-if="datas.status==0||datas.status==1" color="#20B128" shape="circle"
@click="showTake=true">确认收货</up-button>
<up-button v-else color="#20B128" plain shape="circle" @click="purchaseAgain">再次购买</up-button>
<!-- <up-button v-if="datas.status==0||datas.status==1" color="#20B128" shape="circle"
@click="showTake=true">确认收货</up-button> -->
<up-button color="#20B128" plain shape="circle" @click="purchaseAgain">再次购买</up-button>
</view>
</block>
</view>
@ -188,6 +194,7 @@
import orderCanclePopup from "@/components/orderCanclePopup.vue";
import shopListPopupVue from "@/components/shopListPopup.vue";
import modal from "@/components/modal.vue";
import QRCode from "@/uni_modules/uview-plus/components/u-qrcode/u-qrcode.vue";
import {
orderDetailApi,
cancelOrderApi,
@ -227,7 +234,8 @@
order_id: datas.value.id
}).then(res => {
datas.value = res.data;
shopInfo.value = res.data.merchant_info;
shopInfo.value = res.data.store_info;
if (addressList.value.length > 0 && res.data.paid) {
addressInfo.value = addressList.value.find(item => item.address_id == res.data.address_id);
} else {
@ -319,7 +327,7 @@
}
})
}
getMerchantList();
// getMerchantList();
//
const LoadAddress = () => {
uni.getLocation({
@ -445,7 +453,7 @@
onLoad((option) => {
uni.setNavigationBarTitle({
title: option.type == 0 ? '等待付款' : '订单详情'
})
});
if (option.id) {
datas.value.id = option.id;
getDetails()
@ -480,6 +488,21 @@
color: #333333;
}
.qr_code {
margin: 0 20rpx 20rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 500rpx;
background: #fff;
border-radius: 5px;
view {
margin-top: 44rpx;
}
}
.m-address {
margin-bottom: 20rpx;
display: flex;

View File

@ -15,7 +15,7 @@
<view class="body-content">
<view style="display: flex;flex: 1;flex-shrink: 0;">
<view v-for="(item,index) in datas.goods_list" :key="index">
<image class="image" :src="item.imgs"></image>
<image class="image" :src="item.image"></image>
</view>
</view>
<view
@ -23,7 +23,7 @@
<up-icon name="arrow-right-double" color="#20B128"></up-icon>
</view>
</view>
<view class="all"> {{datas.goods_count}} 件商品, 总金额 <text>¥{{datas.total}}</text> </view>
<view class="all"> {{datas.goods_count}} 件商品, 总金额 <text>¥{{datas.total_price}}</text> </view>
</view>
<view v-if="datas.paid==0" class="item-btn">
<view style="width: 80px;"><up-button size="small" plain color="#989898" shape="circle"

View File

@ -212,7 +212,7 @@
orderListApi({
page_no: where.value[type].page_no,
page_size: where.value[type].page_size,
number: keyword.value,
order_id: keyword.value,
status: status,
paid: paid
}).then(res => {

View File

@ -5,7 +5,7 @@
<up-cell title="请添加自提点" :isLink="true" :border="false" @click="shopListShow=true"></up-cell>
</up-cell-group>
</view> -->
<view class="m-card m-address">
<!-- <view class="m-card m-address">
<view class="address-info">
<view class="top" style="align-items: flex-start;">
<view style="color: #333;display: flex;align-items: center;">
@ -30,10 +30,10 @@
</view>
</view>
<view class="address-btn">
<view style="width: 80px;"><up-button @click="shopListShow=true" size="small" shape="circle" color="#f6f6f6"
:customStyle="{color:'#666666'}">修改</up-button></view>
</view>
<view style="width: 80px;"><up-button @click="shopListShow=true" size="small" shape="circle"
color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view>
</view>
</view> -->
<view v-if="!addressInfo.address_id" class="m-card row">
<up-cell-group>
<up-cell title="我的地址" :isLink="true" :border="false" @click="openAddress()"></up-cell>
@ -51,8 +51,8 @@
</view>
</view>
<view class="address-btn">
<view style="width: 80px;"><up-button @click="showAddress = true" size="small" shape="circle" color="#f6f6f6"
:customStyle="{color:'#666666'}">修改</up-button></view>
<view style="width: 80px;"><up-button @click="showAddress = true" size="small" shape="circle"
color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view>
</view>
</view>
<view class="m-card m-good" v-for="(item,index) in cartList" :key="index">
@ -79,7 +79,8 @@
<view class="head-title">价格明细</view>
<view class="row">
<view>商品总价 <text>共计{{cartList.length}}款商品</text></view>
<view><text>¥</text>{{c_price(orderInfo.total, 0)}}<text>.{{c_price(orderInfo.total, 1)}}</text></view>
<view><text>¥</text>{{c_price(orderInfo.pay_price, 0)}}<text>.{{c_price(orderInfo.pay_price, 1)}}</text>
</view>
</view>
<view class="row">
<view>运费</view>
@ -112,9 +113,9 @@
<view class="all">
<text style="color: #000;">合计: </text>
<text></text>
<block v-if="orderInfo.total">
<text style="font-size: 32rpx;font-weight: bold;">{{c_price(orderInfo.total, 0)}}</text>
<text>.{{c_price(orderInfo.total, 1)}}</text>
<block v-if="orderInfo.total_price">
<text style="font-size: 32rpx;font-weight: bold;">{{c_price(orderInfo.total_price, 0)}}</text>
<text>.{{c_price(orderInfo.total_price, 1)}}</text>
</block>
</view>
</view>
@ -219,6 +220,7 @@
const shopInfo = ref({
mer_id: ''
});
const getMerchantList = (mer_name = null) => {
merchantListApi({
...myAddressInfo.value,
@ -235,7 +237,8 @@
}
})
}
getMerchantList();
// getMerchantList();
//
const LoadAddress = () => {
uni.getLocation({
@ -250,7 +253,8 @@
}
})
}
LoadAddress();
// LoadAddress();
const changeShop = (e) => {
shopInfo.value = e;
shopListShow.value = false;
@ -291,10 +295,10 @@
//
const submitOrder = () => {
if (!shopInfo.value.mer_id) {
uni.$u.toast('请先选择提货点');
return shopListShow.value = true;
}
// if (!shopInfo.value.mer_id) {
// uni.$u.toast('');
// return shopListShow.value = true;
// }
if (!isAddress.value) return toastAddressShow.value = true;
createOrder();
}
@ -309,14 +313,38 @@
orderInfo.value = res.data.order;
})
}
const pay_type = ref(1);
const createOrder = () => {
createOrderApi({
cart_id: cartStore.cartList,
address_id: addressInfo.value.address_id,
mer_id: shopInfo.value.mer_id,
pay_type: 1
pay_type: 1,
store_id: 2
}).then(res => {
console.log(res);
if (pay_type.value == 3) {
if (res.code == 1) {
uni.showToast({
title: res.msg,
icon: "none",
success() {
setTimeout(() => {
uni.redirectTo({
url: '/pagesOrder/order/order?back=-1&type=2'
})
}, 1500)
}
})
} else {
uni.$u.toast(res.msg);
}
} else {
console.log(1);
if (!res.data?.nonceStr) return uni.$u.toast('支付失败!');
console.log(2);
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.timeStamp,
@ -346,6 +374,7 @@
})
}
})
}
}).catch(err => {
uni.$u.toast('网络错误')
})

BIN
static/icon/done.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/icon/silver.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/icon/wait.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B