feat: 修改门店手机号保留一天和核销码显示逻辑,优化位置授权获取功能 #3

Merged
mkm merged 2 commits from dev into master 2024-08-12 11:09:25 +08:00
12 changed files with 1375 additions and 51 deletions

View File

@ -166,3 +166,22 @@ export const isUserShipApi = (data) => {
export const getRechargeListApi = (data) => {
return request.get('/user/UserRecharge/recharge_list', data);
}
/**
* 提现信息
*/
export const getCashInfoApi = (data) => {
return request.get('/user/User/cash_info', data);
}
/**
* 提交提现申请
*/
export const CashApplicationApi = (data) => {
return request.post('/user/User/cash_application', data);
}
/**
* 提现申请记录
*/
export const getCashRecordApi = (data) => {
return request.get('/user/User/cash_record', data);
}

View File

@ -17,7 +17,7 @@ switch (env) {
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break;
case 'local':
BASE_URL = 'http://192.168.1.22:8545';
BASE_URL = 'http://192.168.1.231:8545';
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break;
default:

View File

@ -100,6 +100,27 @@
"navigationBarTitleText" : "商品列表",
"enablePullDownRefresh": true
}
},
{
"path" : "pages/user_cash/index",
"style" :
{
"navigationBarTitleText" : "提现"
}
},
{
"path" : "pages/user_cash/status",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/user_cash/list",
"style" :
{
"navigationBarTitleText" : "提现申请记录"
}
}
],
"subPackages": [{
@ -176,6 +197,13 @@
"navigationBarTitleText": "设置密码",
"enablePullDownRefresh": false
}
},
{
"path" : "delivery/index",
"style" :
{
"navigationBarTitleText" : "配送员订单"
}
}
]
},

View File

@ -655,8 +655,7 @@
}
const settleAccounts = () => {
if (+cartInfo.value.pay_price < 500) return showOverlay.value = true;
if (+cartInfo.value.pay_price < 500 && userStore.userInfo.user_ship==0 ) return showOverlay.value = true;
uni.navigateTo({
url: '/pagesOrder/settle/settle'
})

View File

@ -7,7 +7,7 @@
</template>
</up-navbar>
<view class="login-box">
<image class="logo" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/35adb202404271727457954.png">
<image class="logo" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/35adb202404271727457954.png" @click="test()">
</image>
<view class="tips">欢迎登录泸优采</view>
<block v-if="showWeixin">
@ -16,7 +16,7 @@
<up-button @click="weixinLogin" color="#20B128" size="large"><up-icon color="#fff"
size="28"></up-icon></up-button>
</view>
<view class="btn" style="width: 7rem; margin: 1rem auto;">
<view class="btn" style="width: 7rem; margin: 1rem auto;" v-if="test_click>=8">
<up-button @click="navgo('/pages/login/test')" color="#20B128" size="large"><up-icon
name="account-fill" color="#fff" size="28"></up-icon></up-button>
</view>
@ -100,8 +100,11 @@
config
} from "@/config/app.js"
const test_click=ref(0);
const showOfficial = ref(false);
const test=()=>{
test_click.value++
}
const navToIndex = () => {
if (userStore.userInfo && userStore.token) uni.reLaunch({
url: '/pages/index/index'

View File

@ -51,7 +51,8 @@
会员报备
</view>
</view>
<view class="balance" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
<!-- <view class="balance" @click="navgo('/pageQuota/balanceDetail/index?type=2')">L -->
<view class="balance" @click="navgo('/pages/user_cash/index')">
<view class="" style="font-size: 28rpx;transform: translateY(10rpx);">
余额:
</view>
@ -121,7 +122,9 @@
<up-cell title="预约记录" :isLink="true" url="/pageQuota/asset/lists"></up-cell> -->
<up-cell title="我的地址" :isLink="true" url="/pagesOrder/addressList/addressList"></up-cell>
<up-cell title="支付密码" :isLink="true" url="/pagesOrder/setPayPassword/index"></up-cell>
<!-- <up-cell title="商品列表" :isLink="true" url="pages/product/product"></up-cell> -->
<up-cell title="商品列表" :isLink="true" url="pages/product/product" v-if="userInfo.system_store_id>0"></up-cell>
<up-cell title="配送员订单" :isLink="true" url="pagesOrder/delivery/index" v-if="userInfo.system_store_id>0"></up-cell>
</up-cell-group>
</view>

View File

@ -9,9 +9,9 @@
:showAction="false"></up-search>
</view>
</up-sticky>
<up-list @scrolltolower="loadMoreGood">
<u-list @scrolltolower="loadMoreGood" :enableFlex="enable_flex">
<view v-if="frequentlyList.length>0" class="list">
<up-list-item class="shop-item" v-for="(item, index) in frequentlyList" :key="index">
<view class="shop-item" v-for="(item, index) in frequentlyList" :key="index" >
<image class="shop-img" :src="item.image"></image>
<view class="shop-content" style="width: 490rpx;">
<view class="title">
@ -29,15 +29,15 @@
</view>
</view>
</view>
</up-list-item>
<up-loadmore :status="status" />
</view>
<u-loadmore :status="status" />
</view>
<view v-else style="margin-top: 100rpx;">
<up-empty :text="text"
icon="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/29955202404260944367594.png">
</up-empty>
</view>
</up-list>
</u-list>
</view>
</template>
@ -57,7 +57,7 @@
let status = ref('loadmore')
let list1 = ['零售', '商户', '会员']
let keyword = ref('');
let enable_flex=ref(true)
const where = ref({
page_no: 1,
page_size: 15,
@ -99,6 +99,34 @@
</script>
<style lang="scss">
.tabs {
color: #444444;
font-size: 32rpx;
margin-right: 30rpx;
}
.tabs-active {
color: #20B128;
// font-size: 34rpx;
transition: 300ms;
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top));
width: 100%;
background-color: #f6f6f6;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
.page-box1 {
position: relative;
@ -123,11 +151,6 @@
border-radius: 20rpx;
overflow: hidden;
// height: calc(100vh - var(--window-top) - 400rpx);
// /* #ifdef H5 */
// height: calc(100vh - 44px - 200rpx);
// /* #endif */
.shop-item {
padding: 20rpx;
border-bottom: 1rpx solid #f6f6f6;
@ -196,4 +219,36 @@
}
}
.cart-btn {
.cart-check {
display: flex;
align-items: center;
image {
width: 40rpx;
height: 40rpx;
margin: 0 10rpx;
}
}
.btn-boxs {
display: flex;
.all-price {
display: flex;
align-items: center;
margin-right: 20rpx;
.price {
color: #20B128;
display: table-cell;
vertical-align: bottom;
font-weight: bold;
}
}
}
}
</style>

506
pages/user_cash/index.vue Normal file
View File

@ -0,0 +1,506 @@
<template>
<view
style="--view-theme: rgb(32, 177, 40);--view-priceColor:#FF7600;--view-minorColor:rgba(108, 198, 94, 0.5);--view-minorColorT:rgba(66, 202, 77, 0.1);--view-bntColor:#FE960F;--view-gradient:#4DEA4D">
<view class='cash-withdrawal'>
<!-- #ifdef MP -->
<view class="accountTitle">
<view :style="{height:getHeight.barTop+'px'}"></view>
<view class="sysTitle acea-row row-center-wrapper" :style="{height:getHeight.barHeight+'px'}">
<text class="iconfont icon-ic_leftarrow" @click="goarrow"></text>
</view>
</view>
<view :style="{height:(getHeight.barTop+getHeight.barHeight)+'px'}"></view>
<!-- #endif -->
<view class="header">
<view class="headerCon">
<navigator url="/pageQuota/balanceDetail/index?type=2" hover-class="navigator-hover">
<view class="money">{{userInfo.now_money}}</view>
<view>可提现金额</view>
</navigator>
</view>
</view>
<view class='wrapper'>
<view>
<form @submit="subCash">
<view class="list">
<view class="itemCon">
<view class='item acea-row row-between-wrapper'>
<view class='name'>提现</view>
<view class='input acea-row row-between-wrapper'>
<input :value='cashVal' :maxlength="moneyMaxLeng"
:placeholder='"最低提现金额:¥"+minPrice' placeholder-class='placeholder'
name="money" type='digit'></input>
<view class="all" @click="allCash">全部提现</view>
</view>
</view>
</view>
<view class='tip'>
<navigator url="/pages/user_cash/list" hover-class="navigator-hover">
当前可提现金额: <text class="price">{{userInfo.now_money}}</text>
<text>查看提现记录</text>
</navigator>
</view>
<view class='tip'>
说明: <text class="num">{{userInfo.notes}}</text>
</view>
</view>
<button formType="submit"
style="margin-top: 15rpx;color: white; background-color: rgb(32, 177, 40); border-color: rgb(32, 177, 40); border-width: 1px; border-style: solid;">立即提现</button>
</form>
</view>
</view>
</view>
<!-- #ifdef MP -->
<authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
<!-- #endif -->
</view>
</template>
<script>
import {
getCashInfoApi,
CashApplicationApi,
getCashRecordApi
} from "@/api/user.js"
// import {
// extractCash,
// } from '@/api/user.js';
import {
mapGetters
} from "vuex";
export default {
components: {},
data() {
return {
// #ifdef MP
getHeight: this.getWXStatusHeight(),
// #endif
index: 0,
minPrice: 0.00, //
userInfo: [],
prevent: true, //
moneyMaxLeng: 8,
withdraw_fee: '0',
true_money: 0,
cashVal: '',
};
},
computed: {
...mapGetters(['isLogin']),
disabled() {
return true
}
},
onLoad() {},
onShow() {
getCashInfoApi().then(res => {
this.userInfo = res.data;
})
},
methods: {
goarrow() {
uni.navigateBack()
},
allCash() {
this.cashVal = '';
this.$nextTick(() => {
this.cashVal = this.userInfo.now_money;
})
},
//
getWXStatusHeight() {
//
const barTop = uni.getSystemInfoSync().statusBarHeight;
// #ifdef MP
//
const menuButtonInfo = wx.getMenuButtonBoundingClientRect() || 0
//
const barHeight = menuButtonInfo.height + (menuButtonInfo.top - barTop) * 2
let barWidth = menuButtonInfo.width
// #endif
// #ifndef MP
//
const barHeight = parseInt(barTop) + 10;
let barWidth = '100%'
// #endif
return {
barHeight,
barTop,
barWidth
}
},
subCash: function(e) {
let that = this,
value = e.detail.value;
value.extract_type = 'balance';
if (value.money.length == 0) return uni.$u.toast('请填写提现金额');
if (Number(value.money) < Number(that.minPrice)) return uni.$u.toast('提现金额不能低于:¥' + that.minPrice);
if (this.prevent) {
this.prevent = false
} else {
return
}
console.log(value)
CashApplicationApi(value).then(res => {
uni.$u.toast(res.msg);
setTimeout(()=>{
uni.navigateTo({
url: `/pages/my/my`
})
},1500)
}).catch(err => {
return uni.$u.toast(err);
});
}
}
}
</script>
<style lang="scss">
.cash-withdrawal {
.accountTitle {
background: linear-gradient(90deg, var(--view-theme) 0%, var(--view-gradient) 100%);
position: fixed;
left: 0;
top: 0;
width: 100%;
z-index: 99;
.sysTitle {
width: 100%;
position: relative;
font-weight: 500;
color: #fff;
font-size: 30rpx;
.iconfont {
position: absolute;
font-size: 36rpx;
left: 11rpx;
width: 60rpx;
}
}
}
.header {
width: 100%;
height: 380rpx;
background: linear-gradient(90deg, var(--view-theme) 0%, var(--view-gradient) 100%);
font-size: 30rpx;
font-weight: 400;
color: #F5F5F5;
text-align: center;
padding-top: 88rpx;
position: relative;
&::after {
position: absolute;
content: ' ';
width: 50%;
height: 160rpx;
background: linear-gradient(180deg, var(--view-theme) 0%, #F5F5F5 100%);
left: 0;
}
&:before {
position: absolute;
content: ' ';
width: 50%;
height: 160rpx;
background: linear-gradient(180deg, var(--view-gradient) 0%, #F5F5F5 100%);
right: 0;
bottom: -146rpx;
}
.headerCon {
background-image: url('../static/cashBg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 278rpx;
}
.money {
font-size: 76rpx;
font-weight: 600;
color: #FFFFFF;
font-family: 'Regular';
margin-bottom: 16rpx;
}
}
}
.cash-withdrawal .wrapper {
width: 710rpx;
margin: -100rpx auto 0 auto;
position: relative;
z-index: 9;
.nav {
width: 100%;
height: 110rpx;
background-color: rgba(255, 255, 255, 0.9);
border-radius: 24rpx 24rpx 0 0;
position: relative;
z-index: 9;
&.on {
height: unset;
padding: 18rpx 0 8rpx 0;
background-color: #fff;
.item {
padding-top: 0;
padding-left: 30rpx;
font-weight: 500;
color: #333;
}
}
.item {
width: 33.33%;
height: 84rpx;
line-height: 84rpx;
color: #666666;
font-size: 26rpx;
position: relative;
z-index: 9;
&.items {
font-size: 28rpx;
color: var(--view-theme);
font-weight: 500 !important;
}
&.on {
width: 50%;
padding-left: 0;
text-align: center;
}
&.ons {
color: var(--view-theme);
font-weight: 500;
font-size: 28rpx;
}
&.on1,
&.on2,
&.on3 {
font-weight: 400;
padding-left: 0;
text-align: center;
}
&.on6,
&.on7,
&.on8,
&.on9 {
width: 25%;
font-weight: 400;
padding-left: 0;
text-align: center;
}
}
.navBg {
position: absolute;
background-repeat: no-repeat;
background-size: 100% 100%;
width: 710rpx;
height: 122rpx;
left: 0;
bottom: 0;
box-sizing: border-box;
&.on1 {
background-image: url('../static/tixian01.png');
}
&.on2 {
background-image: url('../static/tixian02.png');
}
&.on3 {
background-image: url('../static/tixian03.png');
}
&.on4 {
background-image: url('../static/tixian04.png');
}
&.on5 {
background-image: url('../static/tixian05.png');
}
&.on6 {
background-image: url('../static/tixian06.png');
}
&.on7 {
background-image: url('../static/tixian07.png');
}
&.on8 {
background-image: url('../static/tixian08.png');
}
&.on9 {
background-image: url('../static/tixian09.png');
}
}
}
.bnt {
font-size: 28rpx;
color: #fff;
width: 710rpx;
height: 88rpx;
text-align: center;
border-radius: 50rpx;
line-height: 88rpx;
margin: 48rpx auto;
}
}
.cash-withdrawal .wrapper .list {
padding: 0 30rpx 48rpx 30rpx;
background-color: #fff;
border-radius: 0 0 24rpx 24rpx;
.itemCon {
border-bottom: 1px solid #EEEEEE;
padding-bottom: 15rpx;
margin-bottom: 42rpx;
}
}
.cash-withdrawal .wrapper .list .item {
font-size: 28rpx;
color: #333;
padding: 28rpx 0;
}
.cash-withdrawal .wrapper .list .item .name {
width: 130rpx;
}
.cash-withdrawal .wrapper .list .item .input {
width: 505rpx;
input {
font-size: 28rpx;
}
.iconfont {
color: #ccc;
}
.icon-ic_camera {
font-size: 38rpx;
margin-bottom: 6rpx;
}
.all {
font-size: 26rpx;
color: var(--view-theme);
}
}
.cash-withdrawal .wrapper .list .item .input .placeholder {
color: #ccc;
}
.cash-withdrawal .wrapper .list .item .picEwm,
.cash-withdrawal .wrapper .list .item .pictrue {
width: 128rpx;
height: 128rpx;
border-radius: 14rpx;
position: relative;
margin-right: 23rpx;
background: #F5F5F5;
}
.cash-withdrawal .wrapper .list .item .picEwm image {
width: 100%;
height: 100%;
border-radius: 3rpx;
}
.cash-withdrawal .wrapper .list .item .picEwm .icon-ic_close {
position: absolute;
right: 0;
top: 0;
font-size: 24rpx;
width: 32rpx;
height: 32rpx;
background: #999999;
border-radius: 0 16rpx 0 16rpx;
color: #fff;
text-align: center;
line-height: 32rpx;
}
.cash-withdrawal .wrapper .list .item .pictrue {
font-size: 22rpx;
color: #BBBBBB;
}
.cash-withdrawal .wrapper .list .item .pictrue .icon-icon25201 {
font-size: 47rpx;
color: #DDDDDD;
margin-bottom: 3px;
}
.cash-withdrawal .wrapper .list .tip {
font-size: 24rpx;
color: #999;
margin-top: 16rpx;
.price {
color: var(--view-theme);
margin: 0 16rpx;
}
.num {
margin-left: 16rpx;
}
}
.cash-withdrawal .wrapper .list .tip2 {
font-size: 26rpx;
color: #999;
text-align: center;
margin: 44rpx 0 20rpx 0;
}
.cash-withdrawal .wrapper .list .value {
height: 135rpx;
line-height: 135rpx;
border-bottom: 1rpx solid #eee;
width: 690rpx;
margin: 0 auto;
}
.cash-withdrawal .wrapper .list .value input {
font-size: 80rpx;
color: #282828;
height: 135rpx;
text-align: center;
}
.cash-withdrawal .wrapper .list .value .placeholder2 {
color: #bbb;
}
.bg-gray {
background-color: var(--view-theme);
opacity: 0.4;
}
</style>

93
pages/user_cash/list.vue Normal file
View File

@ -0,0 +1,93 @@
<template>
<block v-if="lists.length>0">
<view class="content">
<view class="li" v-for="(item,index) in lists" :key="index">
<view class="li-top">
<text>{{item.title}}</text>
<text style="font-weight: bold;" :style="{color:item.pay_status=='1'?'#50C758':'red'
}">{{item.price}}</text>
</view>
<view class="li-top" style="margin-bottom: 0;">
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
<text style="font-size: 24rpx;color: grey;" >{{item.status_name}}</text>
</view>
</view>
</view>
</block>
<up-empty v-else mode="history" style="margin-top: 20vh;" text='没有更多内容了'>
</up-empty>
<view style="height: 50rpx;">
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import {
onLoad,
onPullDownRefresh
} from "@dcloudio/uni-app"
import {
getCashRecordApi
} from "@/api/user.js"
const mark = ref(0)
const lists = ref([])
let type = ref('')
const getLists = async (isPullDown = false) => {
let res = await getCashRecordApi({
})
lists.value = res.data
if (isPullDown) uni.stopPullDownRefresh()
}
onLoad((opt) => {
type.value = opt.type
getLists()
})
onPullDownRefresh(() => {
getLists(true)
})
</script>
<style lang="scss">
.content {
background-color: white;
width: 690rpx;
padding: 20rpx;
margin: 0 auto;
box-sizing: border-box;
margin: 0 auto;
margin-top: 30rpx;
border-radius: 20rpx;
margin-bottom: 100rpx;
.li {
margin-top: 20rpx;
border-bottom: 1px solid #EDF2FA;
padding-bottom: 20rpx;
.li-top {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
}
}
}
</style>

View File

@ -0,0 +1,34 @@
<template>
<view style="--view-theme: #42CA4D;--view-priceColor:#FF7600;--view-minorColor:rgba(108, 198, 94, 0.5);--view-minorColorT:rgba(66, 202, 77, 0.1);--view-bntColor:#FE960F;--view-gradient:#4DEA4D">
<view class="px-20 mt-40">
<view class="bg--w111-fff rd-24rpx flex-col flex-center box">
<text class="iconfont icon-a-ic_CompleteSelect"></text>
<view class="fs-32 lh-44rpx mt-64">提现申请已提交等待人工审核</view>
<view class="w-498 h-88 rd-44rpx flex-center fs-28 text--w111-fff bg-color mt-30" @tap="goPage">好的</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'status',
methods:{
goPage(){
uni.switchTab({
url: '/pages/my/my'
})
}
}
}
</script>
<style scoped>
.box{
padding: 88rpx 0 64rpx;
}
.icon-a-ic_CompleteSelect{
font-size: 112rpx;
color: #00B42A;
}
</style>

View File

@ -0,0 +1,596 @@
<template>
<view class="wrap">
<up-navbar placeholder style="z-index: 100800;" @leftClick="navBack">
<template #center>
<view>订单</view>
</template>
</up-navbar>
<up-sticky bgColor="#fff">
<view style="padding: 10rpx 20rpx 0 20rpx;">
<up-search shape="round" v-model="keyword" @custom="searchOn" @search="searchOn" @clear="searchOn"
:actionStyle="{color: '#20b128'}"></up-search>
</view>
<up-tabs :current="tabsActive" :list="tablist" lineColor="#20b128" :scrollable="false"
:activeStyle=" { color: '#20b128', fontWeight: 'bold' }" @change="changeTab"></up-tabs>
</up-sticky>
<swiper class="swiper-box" :current="swiperCurrent" @animationfinish="animationfinish">
<swiper-item class="swiper-item" v-for="(list, k) in orderList" :key="k">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="loadMoreGood"
@refresherrefresh="refresherrefresh(1)" :refresher-triggered="triggered" refresher-enabled
refresher-background="#F6F6F6">
<view class="page-box">
<view v-if="list.length>0" class="list">
<good v-for="(item, index) in list" :datas="item" :key="index" :type="k" :status="status"
:order_id='item.order_id' @cancleOrder="cancleOrder" @takeOrder="takeOrder"
@rePay="rePay" @purchaseAgain="purchaseAgain" @applyAfterSales="applyAfterSales"
@showVerifyFn='showVerifyFn'></good>
</view>
<view v-if="!where[k].loading&&list.length==0" style="padding-top: 100rpx;">
<up-empty text="订单空空如也"
icon="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/29955202404260944367594.png">
</up-empty>
</view>
<view v-else-if="where[k].loadend" style="padding-top: 100rpx;">
<view style="text-align: center;color: #999;">没有更多了</view>
</view>
<view v-if="where[k].loading"
style="padding-top: 100rpx;display: flex;flex-direction: column;align-items: center;">
<up-loading-icon mode="circle"></up-loading-icon>
<view style="margin-top: 20rpx;color: #999;">加载中</view>
</view>
<view style="width: 100%;height: 300rpx;"></view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
<orderCanclePopup :show="showCancel" @close="showCancel=false" @change="submitCancel" />
<modal :show="showTake" title="确认收货" content="请确认您已收到货" @close="showTake=false" @change="confirmReceipt" />
</template>
<script setup>
import {
onLoad,
onUnload,
onPullDownRefresh
} from "@dcloudio/uni-app"
import {
ref
} from 'vue';
import good from "../order/component/good.vue";
import orderCanclePopup from "@/components/orderCanclePopup.vue"
import modal from "@/components/modal.vue"
import ZyPasswordboard from '@/uni_modules/zy-passwordboard/components/zy-passwordboard/zy-passwordboard.vue';
import {
cancelOrderApi,
rePaymentApi,
confirmReceiptApi,
orderListApi,
purchaseAgainApi
} from "@/api/order.js"
import {
userInfoApi
} from "@/api/user.js"
const tabsActive = ref(0)
const changeTab = ({
index
}) => {
tabsActive.value = index;
swiperCurrent.value = index;
}
const tablist = ref([{
name: '全部'
}, {
name: '退款/售后'
}]);
const swiperCurrent = ref(0);
const animationfinish = ({
detail: {
current
}
}) => {
swiperCurrent.value = current;
tabsActive.value = current;
if (swiperCurrent.value == 0 && orderList.value[0].length == 0) getOrderList(0, '', ''); //
if (swiperCurrent.value == 4 && orderList.value[4].length == 0) getOrderList(4, -1, 1); //退
}
const showVerifyPop = ref(false)
const orderData = ref({})
const showVerifyFn = (e) => {
showVerifyPop.value = true
orderData.value = e
}
//
const showCancel = ref(false);
let cancelId = '';
const submitCancel = (e) => {
showCancel.value = false;
cancelOrderApi({
order_id: cancelId,
value: e.name
}).then(res => {
uni.showToast({
title: '取消成功',
icon: 'none'
})
orderList.value[1] = orderList.value[1].filter(item => item.id !== cancelId)
})
}
//
const cancleOrder = (e) => {
cancelId = e.id;
showCancel.value = true;
}
//
const showTake = ref(false);
let takeId = "";
const takeOrder = (e) => {
takeId = e.id;
showTake.value = true;
}
//
const confirmReceipt = () => {
confirmReceiptApi({
order_id: takeId
}).then(res => {
showTake.value = false;
uni.$u.toast('确认收货成功');
reloadAll();
})
}
//
const purchaseAgain = (e) => {
purchaseAgainApi({
order_id: e.id
}).then(res => {
uni.$u.toast('已加入购物车');
uni.navigateTo({
url: '/pages/cart/cart'
})
})
}
// <!--sb-->
const refundShow = ref(false);
const goodsList = ref([]); //
const afterSalesType = ref(''); // 0 1 2
const orderId = ref('');
//
const applyAfterSales = (item) => {
refundShow.value = true;
goodsList.value = item.goods_list;
orderId.value = item.id;
}
//
const onPageToAfterSales = () => {
if (afterSalesType.value === '') return uni.$u.toast('请选择售后类型');
if (!goodsList.value || goodsList.value.length == 0) return uni.$u.toast('暂无可申请售后的商品');
let goods = goodsList.value.find(i => i.isSelected);
if (goods == undefined) return uni.$u.toast('请选择需要申请售后的商品');
let ids = [];
let goodsListSel = [];
goodsList.value.map(i => {
if (i.isSelected) {
ids.push(i.old_cart_id);
goodsListSel.push(i);
}
});
uni.navigateTo({
url: "/pages/afterSales/afterSales",
success(res) {
refundShow.value = false; // close modal
res.eventChannel.emit('orderDetail', {
id: orderId.value, //id
old_cart_id: ids,
refund_type: afterSalesType.value,
goodsList: goodsListSel
})
}
})
}
//
const onChooseGoods = (item) => {
if (item.hasOwnProperty('isSelected')) {
item.isSelected = !item.isSelected;
} else {
item.isSelected = true;
}
}
const pay_type = ref('3')
const rePay = async (e) => {
payFn(e)
return
if (!pay_type.value) return uni.$u.toast('请选择支付方式');
if (pay_type.value == 3 || pay_type.value == 18) {
let res = await userInfoApi()
return res.data.pay_password ? passwordBoardVisible.value = true : showModal.value = true
}
}
//
const password = ref(''); //
const passwordBoardVisible = ref(false);
const passwordBoardProps = {
title: '输入支付密码',
onComplete(value) {
password.value = value
passwordBoardVisible.value = false
console.log(password.value)
// payFn()
}
};
const closeKeyBord = () => {
password.value = ''
}
const payFn = (e) => {
rePaymentApi({
order_id: e.id,
address_id: e.address_id,
mer_id: e.merchant,
pay_type: e.pay_type
}).then(res => {
if (res.data?.nonceStr) {
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: (e) => {
if (e.errMsg == 'requestPayment:ok') {
uni.showToast({
title: '订单支付成功',
icon: 'success'
})
reloadAll();
} else uni.$u.toast('支付失败')
},
fail: (e) => {
uni.$u.toast('用户取消支付')
}
})
} else {
uni.showToast({
title: '订单支付成功',
icon: 'success'
})
reloadAll();
}
}).catch(err => {
uni.$u.toast(err.msg || '网络错误')
})
}
const notWxPay = () => {
alert("不是微信支付")
}
//
const where = ref([{
page_no: 1,
page_size: 25,
loading: false,
loadend: false
}, {
page_no: 1,
page_size: 25,
loading: false,
loadend: false
},
{
page_no: 1,
page_size: 25,
loading: false,
loadend: false
},
{
page_no: 1,
page_size: 25,
loading: false,
loadend: false
},
{
page_no: 1,
page_size: 25,
loading: false,
loadend: false
}
])
const keyword = ref('')
const orderList = ref([
[],
[],
[],
[],
[]
])
const getOrderList = (type = 0, status = '', paid = 1, ifPullReFresh = false) => {
if (where.value[type].loadend) return;
where.value[type].loading = true;
orderListApi({
page_no: where.value[type].page_no,
page_size: where.value[type].page_size,
order_id: keyword.value,
status: status,
paid: paid
}).then(res => {
if (where.value[type].page_no == 1) orderList.value[type] = [];
orderList.value[type] = [...orderList.value[type], ...res.data.lists];
if (res.data.lists.length < where.value[type].page_size) where.value[type].loadend = true;
where.value[type].page_no++;
where.value[type].loading = false;
if (ifPullReFresh) uni.stopPullDownRefresh();
}).catch(err => {
where.value[type].loading = false;
})
}
const loadMoreGood = () => {
if (swiperCurrent.value == 0) getOrderList(0, '', ''); //
if (swiperCurrent.value == 1) getOrderList(1, '', 0); //
if (swiperCurrent.value == 2) getOrderList(2, 1, 1); //
if (swiperCurrent.value == 3) getOrderList(3, 2, 1); //
if (swiperCurrent.value == 4) getOrderList(4, -1, 1); //退
}
//
const searchOn = (ifPullReFresh = false) => {
orderList.value[+swiperCurrent.value] = [];
console.log(swiperCurrent.value)
where.value[+swiperCurrent.value].page_no = 1;
where.value[+swiperCurrent.value].loadend = false;
if (swiperCurrent.value == 0) getOrderList(0, '', '', ifPullReFresh); //
if (swiperCurrent.value == 1) getOrderList(1, '', 0, ifPullReFresh); //
if (swiperCurrent.value == 2) getOrderList(2, 1, 1, ifPullReFresh); //
if (swiperCurrent.value == 3) getOrderList(3, 2, 1, ifPullReFresh); //
if (swiperCurrent.value == 4) getOrderList(4, -1, 1, ifPullReFresh); //退
}
let back = 0;
const navBack = () => {
uni.navigateBack({
delta: back ? +back : 0
})
}
const reloadAll = () => { //
where.value.forEach(item => {
item.page_no = 1;
item.loadend = false;
});
getOrderList(0, '', ''); //
getOrderList(1, '', 0); //
getOrderList(2, 1, 1); //
getOrderList(3, 2, 1); //
getOrderList(4, -1, 1); //退
}
onLoad((options) => {
if (options.type) {
tabsActive.value = +options.type;
swiperCurrent.value = +options.type;
searchOn();
}
if (options.back) back = options.back;
uni.$on('reLoadOrderList', reloadAll);
})
onUnload(() => {
uni.$off('reLoadOrderList', reloadAll)
})
const triggered = ref(false);
let flag = false
const refresherrefresh = (type = 1) => {
if (flag) return
flag = true
triggered.value = true;
searchOn()
console.log("别恶心我了")
setTimeout(() => {
triggered.value = false;
flag = false
}, 500)
}
</script>
<style lang="scss">
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top));
width: 100%;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
.page-box {
margin: 20rpx;
}
.address-popup {
// padding: 30rpx;
background-color: #F6F6F6;
.head-title {
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
padding: 20rpx;
}
.afterSales-type {
margin: 0 20rpx 20rpx;
background: #FFFFFF;
border-radius: 16rpx;
padding: 20rpx;
box-sizing: border-box;
.afterSales-type-title {
font-size: 32rpx;
color: #444444;
margin-bottom: 28rpx;
}
.afterSales-type-con {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.afterSales-type-item {
width: 200rpx;
height: 70rpx;
line-height: 70rpx;
border-radius: 12rpx;
color: #777777;
border: 2rpx solid #D3D3D3;
font-size: 28rpx;
text-align: center;
&:not(:nth-last-child(1)) {
margin-right: 24rpx;
}
}
.fuck-active {
color: #FC452F;
border: 2rpx solid #FC452F;
font-weight: 600;
}
}
.afterSales-type-tip {
font-size: 20rpx;
color: #FC452F;
}
}
.scroll-wrap {
margin: 0 20rpx;
background: #FFFFFF;
border-radius: 16rpx;
padding: 20rpx 20rpx 1rpx;
box-sizing: border-box;
.goods {
.goods-item {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
.goods-item-left {
display: flex;
align-items: center;
.goods-item-left-img {
margin-right: 20rpx;
}
.goods-item-left-info {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 164rpx;
.goods_name {
font-size: 28rpx;
color: #060606;
max-width: 400rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.goods_detail {
display: flex;
align-items: center;
.goods-detail_num {
margin-right: 30rpx;
font-size: 28rpx;
color: #333333;
}
.goods_detail_price {
display: flex;
.symbol {
align-self: flex-end;
font-size: 22rpx;
color: #333333;
}
.numbers {
font-size: 32rpx;
color: #333333;
}
}
}
}
}
.goods-item-right {
image {
width: 48rpx;
height: 48rpx;
}
}
}
}
}
}
@keyframes disappear {
to {
opacity: 0;
/* 渐隐 */
transform: scale(0);
/* 缩小 */
}
}
.mask {
position: fixed;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, .5);
top: 0;
left: 0;
z-index: 99999 !important;
}
</style>

View File

@ -83,13 +83,17 @@
</view>
</view>
</view>
<view class="m-card good-info">
<view class="head-title">价格明细</view>
<view class="row">
<view>商品总价 <text>共计{{ cartList.length }}款商品</text></view>
<view>
<view v-if="orderInfo.pay_price">
<text>¥</text>{{ c_price(orderInfo.pay_price, 0) }}<text>.{{ c_price(orderInfo.pay_price, 1) }}</text>
</view>
<view v-else>
<up-skeleton :loading="true" :animate="true" ></up-skeleton>
</view>
</view>
<view class="row">
<view>运费</view>
@ -255,10 +259,13 @@
import ZyPasswordboard from '@/uni_modules/zy-passwordboard/components/zy-passwordboard/zy-passwordboard.vue';
const userInfo = useUserStore().userInfo;
const shop_Info = ref({})
//
let STORE_INFO = uni.getStorageSync('STORE_INFO');
if (STORE_INFO)
STORE_INFO = JSON.parse(STORE_INFO)
if (STORE_INFO){
shop_Info.value = JSON.parse(STORE_INFO)
}
const cartStore = useCartStore();
const reservation_time = ref('')
@ -344,23 +351,6 @@
})
}
// getMerchantList();
//
// const LoadAddress = () => {
// uni.getLocation({
// success: (res) => {},
// fail: (err) => {
// uni.$u.toast(', !')
// },
// complete: (res) => {
// myAddressInfo.value.long = res.longitude || "";
// myAddressInfo.value.lat = res.latitude || "";
// getMerchantList();
// }
// })
// }
// LoadAddress();
const changeShop = (e) => {
shopInfo.value = e;
shopListShow.value = false;
@ -412,13 +402,12 @@
long: "",
};
let reservation = ref(0);
const shop_Info = ref({})
const cartList = ref([]);
const orderInfo = ref({});
const checkOrder = (store_id) => {
checkOrderApi({
cart_id: cartStore.cartList,
store_id: STORE_INFO.id || 0,
store_id: shop_Info.value.id || 0,
...location
}).then(res => {
cartList.value = res.data.cart_list;
@ -447,7 +436,7 @@
}).then(res => {
reservation.value = res.data.reservation
})
checkOrder(datas.id)
// formData.store_id = datas.id
// formData.store_name = datas.name
})
@ -483,7 +472,6 @@
cart_id: cartStore.cartList,
address_id: addressInfo.value.address_id,
pay_type: pay_type.value,
store_id: STORE_INFO.id || 0,
store_id: shop_Info.value.id,
shipping_type: orderInfo.value.shipping_type,
mark: formData.value.remark,
@ -607,7 +595,7 @@
const userLocationfalse = () => {
LocationShow.value = false;
uni.$u.toast('获取位置当前失败,为你推荐当前门店')
checkOrder(STORE_INFO.id);
checkOrder(shop_Info.value.id);
}
const opensettings = (a = false) => {
if (a == false) {