Merge remote-tracking branch 'origin/dev'
This commit is contained in:
commit
3a8d54a407
|
@ -34,3 +34,7 @@ export const setPayPassword = (data) => {
|
|||
export const getFundList = (data) => {
|
||||
return request.get('/user/user/fundList', data);
|
||||
}
|
||||
|
||||
export const getUserSingList = (data) => {
|
||||
return request.get('/user/user/userSing', data);
|
||||
}
|
|
@ -7,3 +7,9 @@ export const goodListApi = (data) => {
|
|||
export const goodClassListApi = (data) => {
|
||||
return request.get('/goods/goodsclass/lists', data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getPush = (data) => {
|
||||
return request.get('/push', data);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
import request from '@/utils/request';
|
||||
|
||||
|
||||
export const getUserProductStorageLists = (data) => {
|
||||
return request.get('/user_product_storage/UserProductStorage/lists', data);
|
||||
}
|
||||
|
||||
|
||||
export const reservationUserProductStorage = (data) => {
|
||||
return request.post('/user_product_storage/UserProductStorage/reservation', data);
|
||||
}
|
|
@ -75,3 +75,7 @@ export const refundReasonListApi = (data) => {
|
|||
export const applyRefundApi = (data) => {
|
||||
return request.post('/order/order/apply_refund', data);
|
||||
}
|
||||
|
||||
export const UserProductStorageLogApi = (data) => {
|
||||
return request.get('/user_product_storage_log/UserProductStorageLog/lists', data);
|
||||
}
|
16
api/user.js
16
api/user.js
|
@ -150,3 +150,19 @@ export const getReportingSms = (data) => {
|
|||
export const uploadImg = (data) => {
|
||||
return request.post('/Upload/image', data);
|
||||
}
|
||||
|
||||
export const getVipInfoByPhone = (data) => {
|
||||
return request.get('/user/user/other_user_info', data);
|
||||
}
|
||||
|
||||
export const checkInventoryApi = (data) => {
|
||||
return request.post('/order/order/checkInventory', data);
|
||||
}
|
||||
|
||||
export const isUserShipApi = (data) => {
|
||||
return request.post('/user_ship/UserShip/is_user_ship', data);
|
||||
}
|
||||
|
||||
export const getRechargeListApi = (data) => {
|
||||
return request.get('/user/UserRecharge/recharge_list', data);
|
||||
}
|
|
@ -37,13 +37,13 @@
|
|||
<view v-if="datas.is_bulk" class="row" style="height: 100rpx;">
|
||||
<view>购买重量<text style="color: #F55726;">*</text></view>
|
||||
<view style="justify-content: end;">
|
||||
<up-number-box v-model="datas.cart_num" @change="valChange"></up-number-box>
|
||||
<up-number-box :min="0" v-model="datas.cart_num" @change="valChange"></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="row" style="height: 100rpx;">
|
||||
<view>购买数量<text style="color: #F55726;">*</text></view>
|
||||
<view style="justify-content: end;">
|
||||
<up-number-box v-model="datas.cart_num" @change="valChange"></up-number-box>
|
||||
<up-number-box :min="0" v-model="datas.cart_num" @change="valChange"></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
|
||||
|
@ -63,14 +63,7 @@
|
|||
computed,
|
||||
nextTick,
|
||||
ref,
|
||||
|
||||
} from "vue"
|
||||
import {
|
||||
toast
|
||||
} from "../uni_modules/uview-plus";
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
|
||||
const foucs1 = ref(null)
|
||||
const props = defineProps({
|
||||
|
@ -78,20 +71,17 @@
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
priceKey: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
const valChange = () => {
|
||||
uni.vibrateShort();
|
||||
}
|
||||
|
||||
let priceKey = ref({})
|
||||
if (uni.getStorageSync('PRICE_KEY')) {
|
||||
priceKey.value = JSON.parse(uni.getStorageSync('PRICE_KEY'));
|
||||
} else {
|
||||
priceKey.value = {};
|
||||
}
|
||||
|
||||
|
||||
const datas = ref({
|
||||
cart_num: ''
|
||||
});
|
||||
|
@ -115,20 +105,18 @@
|
|||
datas.value.cart_num = '';
|
||||
return;
|
||||
}
|
||||
emit('change', datas.value);
|
||||
datas.value.types = true
|
||||
emit('change', datas.value, );
|
||||
}
|
||||
|
||||
const subtotal = computed(() => {
|
||||
let num = +datas.value.cart_num || 1;
|
||||
let sell = +datas.value[priceKey.value.off_activity == 1 ? priceKey.value.price : priceKey.value.op_price];
|
||||
let sell = +datas.value[props.priceKey.off_activity == 1 ? props.priceKey.price : props
|
||||
.priceKey
|
||||
.op_price];
|
||||
return Number(num * sell * 100 / 100).toFixed(2)
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
setData,
|
||||
// founcsFn
|
||||
|
|
|
@ -17,7 +17,7 @@ switch (env) {
|
|||
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
|
||||
break;
|
||||
case 'local':
|
||||
BASE_URL = 'http://192.168.1.201:8545';
|
||||
BASE_URL = 'http://192.168.1.22:8545';
|
||||
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
<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>
|
||||
<text class="yellow" v-if="item.reservation==1">次日可提</text>
|
||||
<text class="green" v-if='item.reservation==0'>当日可提</text>
|
||||
</view>
|
||||
<view class="multiple-card-item-left-info">
|
||||
<u-image src="../../multipleShop/images/location_small.jpg" width="24rpx"
|
||||
|
@ -66,7 +66,7 @@
|
|||
onLoad,
|
||||
onShow
|
||||
} from "@dcloudio/uni-app";
|
||||
|
||||
let event = ''
|
||||
const currShop = ref(''); // 选择门店
|
||||
const shopList = ref([]); // 门店列表
|
||||
const status = ref(''); // 滚动状态
|
||||
|
@ -77,31 +77,45 @@
|
|||
latitude: '',
|
||||
phone: '',
|
||||
name: '',
|
||||
cart_id: "",
|
||||
page_no: 1,
|
||||
page_size: 6
|
||||
})
|
||||
|
||||
// 初始化
|
||||
onLoad(() => {
|
||||
// 获取定位
|
||||
onLoad((opt) => {
|
||||
event = opt.event
|
||||
if (opt.cart_id) queryParams.cart_id = opt.cart_id;
|
||||
getLocation();
|
||||
});
|
||||
|
||||
// 门店选择
|
||||
const onChooseShop = (item) => {
|
||||
let {
|
||||
id,
|
||||
name,
|
||||
phone,
|
||||
detailed_address
|
||||
} = item
|
||||
uni.$emit(event, JSON.stringify({
|
||||
id,
|
||||
name,
|
||||
phone,
|
||||
detailed_address
|
||||
}))
|
||||
uni.navigateBack()
|
||||
return
|
||||
currShop.value = item.id;
|
||||
uni.setStorageSync('STORE_INFO', JSON.stringify(item));
|
||||
// 如果选择了新店铺,删除之前的分享信息
|
||||
uni.removeStorageSync('SHARE_INFO');
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index?id=' + item.id,
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
}, 300)
|
||||
// currShop.value = item.id;
|
||||
// uni.setStorageSync('STORE_INFO', JSON.stringify(item));
|
||||
// uni.removeStorageSync('SHARE_INFO');
|
||||
// setTimeout(() => {
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/index/index?id=' + item.id,
|
||||
// fail(err) {
|
||||
// console.log(err);
|
||||
// }
|
||||
// })
|
||||
// }, 300)
|
||||
}
|
||||
|
||||
// 触底刷新
|
||||
|
@ -162,8 +176,9 @@
|
|||
const getLocation = () => {
|
||||
let location = uni.getStorageSync('location');
|
||||
if (location) {
|
||||
queryParams.longitude = location.lat
|
||||
queryParams.latitude = location.long
|
||||
location = JSON.parse(location);
|
||||
queryParams.longitude = location.long
|
||||
queryParams.latitude = location.lat
|
||||
// 加载店铺列表
|
||||
getShopList();
|
||||
} else {
|
||||
|
@ -172,16 +187,19 @@
|
|||
success(res) {
|
||||
queryParams.latitude = res.latitude;
|
||||
queryParams.longitude = res.longitude;
|
||||
|
||||
// 加载店铺列表
|
||||
getShopList();
|
||||
|
||||
// 避免下次再获取
|
||||
uni.setStorageSync('location', {
|
||||
uni.setStorageSync('location', JSON.stringify({
|
||||
lat: queryParams.latitude,
|
||||
long: queryParams.longitude
|
||||
})
|
||||
}, ))
|
||||
},
|
||||
fail() {
|
||||
console.log("获取定位失败")
|
||||
getShopList();
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -259,7 +277,7 @@
|
|||
margin-bottom: 16rpx;
|
||||
|
||||
text {
|
||||
width: 90rpx;
|
||||
width: 120rpx;
|
||||
height: 42rpx;
|
||||
line-height: 42rpx;
|
||||
text-align: center;
|
||||
|
|
|
@ -0,0 +1,288 @@
|
|||
<template>
|
||||
<view class="m-card m-good" v-for="(item, index) in lists" :key="index">
|
||||
<view class="shop-check" @click="item.check=!item.check">
|
||||
<image v-if="!item.check" src="@/static/icon/n-check.png"></image>
|
||||
<image v-else src="@/static/icon/check.png"></image>
|
||||
</view>
|
||||
|
||||
<view class="image">
|
||||
<up-image width="160rpx" height="160rpx" :src="item.image"></up-image>
|
||||
</view>
|
||||
<view class="body-content">
|
||||
<view>
|
||||
<view class="title">
|
||||
<view> <text>{{item.store_name }}</text> x<text>{{item.nums }}</text> </view>
|
||||
<view>¥{{item.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
<view style="float: right;">
|
||||
<up-number-box :min="1" :max="item.nums" v-model="item.num"></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 200rpx;" />
|
||||
|
||||
<view class="bottom">
|
||||
<view style="display: flex;align-items: center;">
|
||||
<view class="all-checl">
|
||||
<image v-if="getCheckNum()!=lists.length" @click="checkAll" src="@/static/icon/n-check.png"></image>
|
||||
<image @click="checkAllNot" v-else src="@/static/icon/check.png"></image>
|
||||
</view>
|
||||
<view style="margin-left: 8rpx;" @click="checkAll" v-if='getCheckNum() !=lists.length'>
|
||||
全选({{getCheckNum()}})
|
||||
</view>
|
||||
<view style="margin-left: 8rpx;" @click="checkAllNot" v-else>
|
||||
全不选({{getCheckNum()}})
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;align-items: center;">
|
||||
<up-button color="#20b128" shape="circle" @click="showPop=true">
|
||||
<view class="">
|
||||
预约提货({{getCheckNum()}})
|
||||
</view>
|
||||
</up-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<up-popup :show="showPop" @close="showPop=false" @open="showPop=true" mode="center">
|
||||
<view class="popContent">
|
||||
<view class="tit">
|
||||
预约提货
|
||||
</view>
|
||||
<view class="label">
|
||||
预约时间:<view class="left" @click="showCalendar=true">
|
||||
{{formData.times}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label">
|
||||
选择门店:<view class="left" @click="navgo('/multipleShop/index/index?event=asset')">
|
||||
{{formData.store_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="rect-btn">
|
||||
<view style="width: 236rpx;">
|
||||
<up-button @click="showPop=false">取消</up-button>
|
||||
</view>
|
||||
<view style="width: 236rpx;">
|
||||
<up-button color="#20b128" @click="submit">确定</up-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
<up-calendar :show="showCalendar" color="#20B128" @confirm="confirmDate" @close='showCalendar=false'></up-calendar>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive
|
||||
} from "vue"
|
||||
import {
|
||||
onPullDownRefresh
|
||||
} from "@dcloudio/uni-app"
|
||||
|
||||
import {
|
||||
getUserProductStorageLists,
|
||||
reservationUserProductStorage
|
||||
} from "@/api/asset.js"
|
||||
import useUserStore from "@/store/user";
|
||||
let userInfo = useUserStore().userInfo
|
||||
const value = ref(1)
|
||||
const showPop = ref(false)
|
||||
const showCalendar = ref(false)
|
||||
const lists = ref([])
|
||||
|
||||
const navgo = (url) => {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
}
|
||||
|
||||
const getCheckNum = () => {
|
||||
return lists.value.filter(item => item.check).length
|
||||
}
|
||||
|
||||
const formData = reactive({
|
||||
info: [],
|
||||
times: "",
|
||||
store_id: "",
|
||||
store_name: "",
|
||||
})
|
||||
|
||||
uni.$on('asset', function(data) {
|
||||
let datas = JSON.parse(data)
|
||||
formData.store_id = datas.id
|
||||
formData.store_name = datas.name
|
||||
})
|
||||
|
||||
const getLists = async (isPull) => {
|
||||
let res = await getUserProductStorageLists({
|
||||
uid: userInfo.id
|
||||
})
|
||||
lists.value = res.data.lists
|
||||
lists.value.forEach(item => {
|
||||
item.num = 1
|
||||
})
|
||||
if (isPull) uni.stopPullDownRefresh()
|
||||
}
|
||||
|
||||
// 全选&&全不选
|
||||
const isAll = ref(false)
|
||||
const checkAll = () => {
|
||||
lists.value.forEach(item => item.check = true)
|
||||
}
|
||||
const checkAllNot = () => {
|
||||
lists.value.forEach(item => item.check = false)
|
||||
}
|
||||
// 全选&&全不选结束
|
||||
|
||||
const submit = async () => {
|
||||
formData.info = (lists.value.filter(item => item.check)).map(item => {
|
||||
return {
|
||||
product_id: item.product_id,
|
||||
nums: item.num
|
||||
}
|
||||
})
|
||||
await reservationUserProductStorage({
|
||||
...formData
|
||||
})
|
||||
showPop.value = false
|
||||
getLists()
|
||||
}
|
||||
const confirmDate = (e) => {
|
||||
formData.times = e[0]
|
||||
showCalendar.value = false
|
||||
}
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
getLists(true)
|
||||
})
|
||||
getLists()
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.m-card {
|
||||
margin: 20rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.m-good {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 14rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.body-content {
|
||||
width: 490rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
color: #989898;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 24rpx;
|
||||
margin-top: 10rpx;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.time {
|
||||
padding: 5rpx 10rpx;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
border-radius: 10rpx;
|
||||
// display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop-check {
|
||||
width: 60rpx;
|
||||
height: 150rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.all-checl {
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
width: 100vw;
|
||||
padding: 50rpx 20rpx;
|
||||
padding-top: 20rpx;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
background-color: white;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.popContent {
|
||||
width: 600rpx;
|
||||
height: 400rpx;
|
||||
padding: 20rpx 50rpx;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
.tit {
|
||||
text-align: center;
|
||||
font-size: 34rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.rect-btn {
|
||||
display: flex;
|
||||
// margin-top: 50rpx;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: flex;
|
||||
position: relative;
|
||||
margin-bottom: 30rpx;
|
||||
align-items: center;
|
||||
|
||||
.left {
|
||||
margin-left: 20rpx;
|
||||
width: 300rpx;
|
||||
height: 70rpx;
|
||||
border: 1px solid #EDF2FA;
|
||||
line-height: 70rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
// vertical-align: bottom;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,294 @@
|
|||
<template>
|
||||
<block v-if="lists.length">
|
||||
<view class="m-card m-good" v-for="(item, index) in lists" :key="index">
|
||||
<view class="shop-check" @click="item.check=!item.check">
|
||||
<image v-if="!item.check" src="@/static/icon/n-check.png"></image>
|
||||
<image v-else src="@/static/icon/check.png"></image>
|
||||
</view>
|
||||
|
||||
<view class="image">
|
||||
<up-image width="160rpx" height="160rpx" :src="item.image"></up-image>
|
||||
</view>
|
||||
<view class="body-content">
|
||||
<view>
|
||||
<view class="title">
|
||||
<view> <text>{{item.store_name }}</text> x<text>{{item.nums }}</text> </view>
|
||||
<view>¥{{item.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
<view style="float: right;">
|
||||
<up-number-box :min="1" :max="item.nums" v-model="item.num"></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
|
||||
<up-empty v-else mode="history" style="margin-top: 20vh;" text='没有更多内容了'>
|
||||
</up-empty>
|
||||
<view style="height: 200rpx;" />
|
||||
|
||||
<view class="bottom">
|
||||
<view style="display: flex;align-items: center;">
|
||||
<view class="all-checl">
|
||||
<image v-if="getCheckNum()!=lists.length" @click="checkAll" src="@/static/icon/n-check.png"></image>
|
||||
<image @click="checkAllNot" v-else src="@/static/icon/check.png"></image>
|
||||
</view>
|
||||
<view style="margin-left: 8rpx;" @click="checkAll" v-if='getCheckNum() !=lists.length'>
|
||||
全选({{getCheckNum()}})
|
||||
</view>
|
||||
<view style="margin-left: 8rpx;" @click="checkAllNot" v-else>
|
||||
全不选({{getCheckNum()}})
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;align-items: center;">
|
||||
<up-button color="#20b128" shape="circle" @click="showPop=true">
|
||||
<view class="">
|
||||
预约提货({{getCheckNum()}})
|
||||
</view>
|
||||
</up-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<up-popup :show="showPop" @close="showPop=false" @open="showPop=true" mode="center">
|
||||
<view class="popContent">
|
||||
<view class="tit">
|
||||
预约提货
|
||||
</view>
|
||||
<view class="label">
|
||||
预约时间:<view class="left" @click="showCalendar=true">
|
||||
{{formData.times}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="label">
|
||||
选择门店:<view class="left" @click="navgo('/multipleShop/index/index?event=asset')">
|
||||
{{formData.store_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="rect-btn">
|
||||
<view style="width: 236rpx;">
|
||||
<up-button @click="showPop=false">取消</up-button>
|
||||
</view>
|
||||
<view style="width: 236rpx;">
|
||||
<up-button color="#20b128" @click="submit">确定</up-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
<up-calendar :show="showCalendar" color="#20B128" @confirm="confirmDate" @close='showCalendar=false'></up-calendar>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive
|
||||
} from "vue"
|
||||
import {
|
||||
onPullDownRefresh
|
||||
} from "@dcloudio/uni-app"
|
||||
|
||||
import {
|
||||
getUserProductStorageLists,
|
||||
reservationUserProductStorage
|
||||
} from "@/api/asset.js"
|
||||
import useUserStore from "@/store/user";
|
||||
let userInfo = useUserStore().userInfo
|
||||
const value = ref(1)
|
||||
const showPop = ref(false)
|
||||
const showCalendar = ref(false)
|
||||
const lists = ref([])
|
||||
|
||||
const navgo = (url) => {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
}
|
||||
|
||||
const getCheckNum = () => {
|
||||
return lists.value.filter(item => item.check).length
|
||||
}
|
||||
|
||||
const formData = reactive({
|
||||
info: [],
|
||||
times: "",
|
||||
store_id: "",
|
||||
store_name: "",
|
||||
})
|
||||
|
||||
uni.$on('asset', function(data) {
|
||||
let datas = JSON.parse(data)
|
||||
formData.store_id = datas.id
|
||||
formData.store_name = datas.name
|
||||
})
|
||||
|
||||
const getLists = async (isPull) => {
|
||||
let res = await getUserProductStorageLists({
|
||||
uid: userInfo.id
|
||||
})
|
||||
lists.value = res.data.lists
|
||||
lists.value.forEach(item => {
|
||||
item.num = 1
|
||||
})
|
||||
if (isPull) uni.stopPullDownRefresh()
|
||||
}
|
||||
|
||||
// 全选&&全不选
|
||||
const isAll = ref(false)
|
||||
const checkAll = () => {
|
||||
lists.value.forEach(item => item.check = true)
|
||||
}
|
||||
const checkAllNot = () => {
|
||||
lists.value.forEach(item => item.check = false)
|
||||
}
|
||||
// 全选&&全不选结束
|
||||
|
||||
const submit = async () => {
|
||||
formData.info = (lists.value.filter(item => item.check)).map(item => {
|
||||
return {
|
||||
product_id: item.product_id,
|
||||
nums: item.num
|
||||
}
|
||||
})
|
||||
await reservationUserProductStorage({
|
||||
...formData
|
||||
})
|
||||
showPop.value = false
|
||||
getLists()
|
||||
}
|
||||
const confirmDate = (e) => {
|
||||
formData.times = e[0]
|
||||
showCalendar.value = false
|
||||
}
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
getLists(true)
|
||||
})
|
||||
getLists()
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.m-card {
|
||||
margin: 20rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.m-good {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 14rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.body-content {
|
||||
width: 490rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
color: #989898;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 24rpx;
|
||||
margin-top: 10rpx;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.time {
|
||||
padding: 5rpx 10rpx;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
border-radius: 10rpx;
|
||||
// display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop-check {
|
||||
width: 60rpx;
|
||||
height: 150rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.all-checl {
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
width: 100vw;
|
||||
padding: 50rpx 20rpx;
|
||||
padding-top: 20rpx;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
background-color: white;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.popContent {
|
||||
width: 600rpx;
|
||||
height: 400rpx;
|
||||
padding: 20rpx 50rpx;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
.tit {
|
||||
text-align: center;
|
||||
font-size: 34rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.rect-btn {
|
||||
display: flex;
|
||||
// margin-top: 50rpx;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: flex;
|
||||
position: relative;
|
||||
margin-bottom: 30rpx;
|
||||
align-items: center;
|
||||
|
||||
.left {
|
||||
margin-left: 20rpx;
|
||||
width: 300rpx;
|
||||
height: 70rpx;
|
||||
border: 1px solid #EDF2FA;
|
||||
line-height: 70rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
// vertical-align: bottom;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,137 @@
|
|||
<template>
|
||||
<up-sticky bgColor="#fff" style="padding: 20rpx;">
|
||||
<up-tabs :list="tabsLst" :itemStyle="{ width: '50vw', paddingBottom: '20rpx' }" lineColor='#50C758'
|
||||
:current='currentTab' @change="tabsChange"></up-tabs>
|
||||
</up-sticky>
|
||||
<view class="content" v-if="lists.length">
|
||||
<view class="card" v-for="(item,index) in lists" :key="item.id">
|
||||
<view class="head">
|
||||
<view class="">
|
||||
{{item.system_store_name}}
|
||||
</view>
|
||||
<view v-if="currentTab==0" style="text-decoration: underline;text-underline-offset: 5rpx;"
|
||||
@click="hdClick(item)">
|
||||
提货码
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-li" v-if="currentTab==0">
|
||||
<text class="lab">预约时间:</text>{{item.times}}
|
||||
</view>
|
||||
<view class="card-li" v-if="currentTab==1">
|
||||
<text class="lab">提货时间:</text>{{item.update_time}}
|
||||
</view>
|
||||
<view class="card-li" style="display: flex;justify-content: space-between;">
|
||||
<view class="">
|
||||
<text class="lab">商品信息:</text>{{item.store_name}}
|
||||
</view>
|
||||
<view class="">
|
||||
x{{item.nums}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<up-empty v-else mode="history" style="margin-top: 20vh;" text='没有更多内容了'>
|
||||
</up-empty>
|
||||
|
||||
<view class="mask" v-if='showVerifyPop' @click="showVerifyPop=false">
|
||||
<view
|
||||
style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);background-color: white;padding: 20rpx;">
|
||||
<up-image :src="orderData.verify_img" width="710rpx" height="105rpx"></up-image>
|
||||
<view style="font-weight: bold;color: #333;font-size: 26;text-align: center;margin-top: 20rpx;">
|
||||
提货码 {{orderData.verify_code}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive
|
||||
} from "vue"
|
||||
import {
|
||||
UserProductStorageLogApi
|
||||
} from "@/api/order.js"
|
||||
import useUserStore from "@/store/user";
|
||||
|
||||
const userStore = useUserStore().userInfo;
|
||||
const currentTab = ref(0)
|
||||
const showVerifyPop = ref(false)
|
||||
const orderData = reactive({})
|
||||
const tabsLst = reactive([{
|
||||
name: '已预约'
|
||||
},
|
||||
{
|
||||
name: '已提货'
|
||||
},
|
||||
|
||||
]);
|
||||
|
||||
const tabsChange = (e) => {
|
||||
currentTab.value = e.index
|
||||
getLists()
|
||||
}
|
||||
|
||||
|
||||
const lists = ref([{}])
|
||||
const getLists = async () => {
|
||||
let res = await UserProductStorageLogApi({
|
||||
uid: userStore.id,
|
||||
status: currentTab.value
|
||||
})
|
||||
lists.value = res.data.lists
|
||||
}
|
||||
|
||||
const hdClick = (item) => {
|
||||
orderData.verify_code = item.verify_code
|
||||
orderData.verify_img = item.verify_img
|
||||
showVerifyPop.value = true
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.card {
|
||||
background-color: white;
|
||||
border-radius: 20rpx;
|
||||
// padding: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.head {
|
||||
background-color: #50C758;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
color: white;
|
||||
padding: 20rpx;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card-li {
|
||||
padding: 0 20rpx;
|
||||
margin-top: 10rpx;
|
||||
|
||||
.lab {
|
||||
color: #989898;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, .5);
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 99999 !important;
|
||||
}
|
||||
</style>
|
|
@ -13,16 +13,16 @@
|
|||
</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.before_balance}}</text>
|
||||
<text style="font-size: 24rpx;color: grey;">余额 {{item.balance}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" v-if='type==3'>
|
||||
<view class="content" v-if='type==3||type==5'>
|
||||
<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.financial_pm?'#50C758':'red'
|
||||
}">{{ !item.financial_pm?'+':'-' }}{{item.number}}</text>
|
||||
<text style="font-weight: bold;" :style="{color:item.financial_pm?'#50C758':'red'
|
||||
}">{{ item.financial_pm?'+':'-' }}{{item.number}}</text>
|
||||
</view>
|
||||
<view class="li-top" style="margin-bottom: 0;">
|
||||
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<view class="content" v-if='type==4'>
|
||||
<view class="li" v-for="(item,index) in lists" :key="index">
|
||||
<view class="li-top">
|
||||
<text>{{item.order_sn}}</text>
|
||||
<text>{{item.title}}</text>
|
||||
<text style="font-weight: bold;" :style="{color:!item.status?'#50C758':'red'
|
||||
}">{{ !item.status?'+':'-' }}{{item.number}}</text>
|
||||
</view>
|
||||
|
@ -60,10 +60,11 @@
|
|||
onPullDownRefresh
|
||||
} from "@dcloudio/uni-app"
|
||||
import {
|
||||
getFundList
|
||||
getFundList,
|
||||
getUserSingList
|
||||
} from "@/api/address.js"
|
||||
|
||||
const navLists = ['', '采购款明细', '余额明细', '礼品券明细', '返还金明细']
|
||||
const navLists = ['', '采购款明细', '余额明细', '礼品券明细', '返还金明细', '冻结券明细']
|
||||
const tabsLst = reactive([{
|
||||
name: '全部'
|
||||
},
|
||||
|
@ -84,11 +85,25 @@
|
|||
const lists = ref([])
|
||||
let type = ref('')
|
||||
const getLists = async (isPullDown = false) => {
|
||||
let res = await getFundList({
|
||||
type: type.value,
|
||||
mark: mark.value || ''
|
||||
})
|
||||
lists.value = res.data.lists
|
||||
if (type.value == 3 || type.value == 5) {
|
||||
let res = await getUserSingList({
|
||||
type: type.value == 3 ? 1 : 0,
|
||||
page_no: 1,
|
||||
page_size: 999,
|
||||
mark: mark.value || ''
|
||||
})
|
||||
lists.value = res.data.lists
|
||||
console.log(lists.value)
|
||||
|
||||
} else {
|
||||
|
||||
let res = await getFundList({
|
||||
type: type.value,
|
||||
mark: mark.value || ''
|
||||
})
|
||||
lists.value = res.data.lists
|
||||
}
|
||||
|
||||
if (isPullDown) uni.stopPullDownRefresh()
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<template>
|
||||
<image style="width: 100vw" mode='widthFix'
|
||||
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/8d49820240705171635925.png">
|
||||
</image>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
31
pages.json
31
pages.json
|
@ -53,7 +53,7 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#D3FDCA"
|
||||
"navigationBarBackgroundColor": "#CDFBBC"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/charge/charge_record",
|
||||
|
@ -235,6 +235,35 @@
|
|||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "vipUser/activePage",
|
||||
"style": {
|
||||
"navigationBarTitleText": "采购礼包",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "asset/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户资产",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "asset/lists",
|
||||
"style": {
|
||||
"navigationBarTitleText": "预约记录",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "Gifts/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "赠品区",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "balanceDetail/index",
|
||||
"style": {
|
||||
|
|
|
@ -23,10 +23,13 @@
|
|||
<template #left>
|
||||
<view class="store-info">
|
||||
<view style="display: flex;font-size: 30rpx;font-weight: bold;">
|
||||
<text v-if="userStore.userInfo.user_ship == 1 || shareInfo.store_id"
|
||||
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{
|
||||
(shareInfo.real_name || (
|
||||
userStore.userInfo.real_name || userStore.userInfo.nickname)) + '的供销个人门店' }}</text>
|
||||
<text v-if=" vipList.includes(userStore.userInfo.user_ship) || shareInfo.store_id"
|
||||
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
|
||||
<text v-if="vipList.includes(userStore.userInfo.user_ship)">
|
||||
{{ (userStore.userInfo.real_name || userStore.userInfo.nickname) + '的供销个人门店' }}</text>
|
||||
<text v-else>
|
||||
{{(shareInfo.real_name || (userStore.userInfo.real_name || userStore.userInfo.nickname)) + '的供销个人门店' }}</text>
|
||||
</text>
|
||||
<text v-else
|
||||
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{
|
||||
STORE_INFO.store_name }}</text>
|
||||
|
@ -159,15 +162,15 @@
|
|||
{{ item.store_name }}
|
||||
</view>
|
||||
<view class="shop-content-li" v-if="priceKey.off_activity==1">
|
||||
<view class="shop-content-li-l" style="color: #FC452F;">
|
||||
活动价
|
||||
<view class="shop-content-li-l">
|
||||
售价
|
||||
</view>
|
||||
<view class="shop-content-li-r" style="color:#FC452F ;">¥<text
|
||||
style="font-size: 30rpx;">{{item[priceKey.price]}}</text>/{{ item.unit_name }}
|
||||
</view>
|
||||
<view class="tag">
|
||||
<view class="tag" v-if="item.tag">
|
||||
<view class="icon" />
|
||||
赠10%品牌礼品券
|
||||
{{item.tag}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="shop-content-li" style="color: #999999;" v-if="priceKey.off_activity==1">
|
||||
|
@ -222,13 +225,14 @@
|
|||
<view class="btn">
|
||||
<up-button color="#20b128" :disabled="cartInfo.pay_price<=0" @click="settleAccounts"> 支付</up-button>
|
||||
</view>
|
||||
<view class="cart" @click="navTo(`/pages/cart/cart`)">
|
||||
<view class="cart" @tap.stop="navTo('/pages/cart/cart')" s>
|
||||
<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" />
|
||||
<goodPopup ref="goodRef" :priceKey='priceKey' :show="showGoodPopup" @close="showGoodPopup = false"
|
||||
@change="changeGood" />
|
||||
|
||||
<u-overlay :show="showOverlay" @click="showOverlay = false">
|
||||
<view class="warp">
|
||||
|
@ -290,14 +294,12 @@
|
|||
} from "@/api/multipleShop.js";
|
||||
|
||||
import useUserStore from "@/store/user";
|
||||
const vipList = reactive([1, 2, 3, 4, 5, 6, 7, 8])
|
||||
const userStore = useUserStore();
|
||||
const STORE_INFO = reactive({
|
||||
id: '',
|
||||
store_name: ""
|
||||
})
|
||||
|
||||
|
||||
|
||||
const priceKey = reactive({
|
||||
off_activity: "",
|
||||
op_price: "",
|
||||
|
@ -327,7 +329,7 @@
|
|||
// 分享给好友
|
||||
onShareAppMessage(() => {
|
||||
let shareStr = '?id=' + STORE_INFO.id;
|
||||
if (userStore.userInfo.user_ship == 1) {
|
||||
if (vipList.includes(userStore.userInfo.user_ship)) {
|
||||
shareStr = shareStr + '&spread_uid=' + userStore.userInfo.id + '&real_name=' + (userStore.userInfo
|
||||
.real_name || userStore.userInfo.nickname)
|
||||
}
|
||||
|
@ -397,7 +399,10 @@
|
|||
}
|
||||
|
||||
const addCart = (product_id, cart_num) => { //加入购物车
|
||||
console.log("触发了加入购物车")
|
||||
|
||||
cartCreateApi({
|
||||
type: 1,
|
||||
cart_num: cart_num,
|
||||
is_new: 0, // 是否直接购买0否1是
|
||||
// goods_id: id,
|
||||
|
@ -613,6 +618,7 @@
|
|||
};
|
||||
const changeGood = (data) => { // 确定选择商品重量
|
||||
showGoodPopup.value = false;
|
||||
if (!data.types) return
|
||||
if (!userStore.token) return uni.showModal({
|
||||
content: '您需要先登录才可使用该功能, 是否前去登录',
|
||||
success: (e) => {
|
||||
|
@ -629,6 +635,7 @@
|
|||
},
|
||||
});
|
||||
|
||||
console.log('data', data)
|
||||
addCart(data.product_id, data.cart_num);
|
||||
}
|
||||
|
||||
|
@ -697,6 +704,7 @@
|
|||
getShareInfo()
|
||||
|
||||
onLoad(async (opt) => {
|
||||
console.log('opt', opt)
|
||||
if (opt.id) {
|
||||
where.value.store_id = (opt.id == 'undefined' ? STORE_INFO.id : opt.id);
|
||||
} else {
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
<block v-if="showWeixin">
|
||||
<up-transition :show="showWeixin">
|
||||
<view class="btn">
|
||||
<up-button @click="weixinLogin" color="#20B128" size="large"><up-icon name="weixin-fill"
|
||||
color="#fff" size="28"></up-icon>微信快捷登录</up-button>
|
||||
<up-button @click="weixinLogin" color="#20B128" size="large"><up-icon color="#fff"
|
||||
size="28"></up-icon>手机号快捷登录</up-button>
|
||||
</view>
|
||||
<view class="btn" v-if="config.ENV=='dev'">
|
||||
<view class="btn" v-if="config.ENV !='prod'">
|
||||
<up-button @click="navgo('/pages/login/test')" color="#20B128" size="large"><up-icon
|
||||
name="account-fill" color="#fff" size="28"></up-icon>手机号快捷登录</up-button>
|
||||
name="account-fill" color="#fff" size="28"></up-icon>真-手机号快捷登录</up-button>
|
||||
</view>
|
||||
<!-- <view class="btn">
|
||||
<up-button @click="officialCode" color="#20B128" size="large"><up-icon name="weixin-fill" color="#fff"
|
||||
|
@ -212,7 +212,7 @@
|
|||
}).then(res => {
|
||||
//手机号获取成功 可以本地缓存用户信息以及token
|
||||
userStore.setUserInfo(res.data);
|
||||
userStore.setToken(res.data.token);
|
||||
res.data.token && userStore.setToken(res.data.token);
|
||||
//身份授权成功 核销人员
|
||||
if (res.is_staff == 1) {
|
||||
userStore.setUserInfo(res.data);
|
||||
|
|
196
pages/my/my.vue
196
pages/my/my.vue
|
@ -20,71 +20,61 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.balance {
|
||||
position: absolute;
|
||||
top: 160rpx;
|
||||
z-index: 999;
|
||||
left: 80rpx;
|
||||
font-size: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 620rpx;
|
||||
justify-content: space-between;
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view>
|
||||
<!-- <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 style="flex-grow: 1;overflow-y: auto;">
|
||||
<view class="user-info"
|
||||
:style="{backgroundImage: [0].includes(userInfo.user_ship)?'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp)':'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/aace1202407021022357574.png)' }">
|
||||
<view class="u-card">
|
||||
<view style="display: flex;" @click="updataInfp">
|
||||
<up-avatar :src="userInfo.avatar" size="56"></up-avatar>
|
||||
<up-image :src="userInfo.avatar" mode="aspectFill" width="112rpx" height="112rpx"
|
||||
shape="circle"></up-image>
|
||||
<view class="content">
|
||||
<view class="u-phone">{{userInfo.nickname}}</view>
|
||||
<view class="u-id">ID: {{userInfo.id}}</view>
|
||||
<view style="font-size: 32rpx;">{{userInfo.nickname}}</view>
|
||||
<view class="uid">
|
||||
<text>ID:</text>
|
||||
<view style="margin:0 20rpx;">
|
||||
{{userInfo.id}}
|
||||
</view>
|
||||
<view v-if="![0].includes(userInfo.user_ship)"
|
||||
style="display: flex;align-items: center;background-color: #F6EECD;padding: 4rpx 10rpx;border-radius: 20rpx;">
|
||||
<view style="margin-right: 10rpx;">
|
||||
<up-icon
|
||||
name="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/e8621202406281618363287.png"></up-icon>
|
||||
</view>
|
||||
{{userInfo.vip_name}}会员
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="to-vip-btn" @click="navgo('/pageQuota/vipUser/index')">
|
||||
会员报备
|
||||
</view>
|
||||
</view>
|
||||
<view class="balance" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
|
||||
<view class="" style="font-size: 28rpx;transform: translateY(10rpx);">
|
||||
余额:
|
||||
</view>
|
||||
<view style="font-size: 50rpx;">
|
||||
{{userInfo.now_money||"0.00"}}<text style="font-size: 28rpx;"> (元)</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="balance" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
|
||||
<view class="" style="font-size: 28rpx;transform: translateY(10rpx);">
|
||||
余额:
|
||||
</view>
|
||||
<view class="">
|
||||
{{userInfo.now_money||"0.00"}}<text style="font-size: 28rpx;"> (元)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rest">
|
||||
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
|
||||
<view class="rest-item-num">{{userInfo.now_money||"0.00"}}</view>
|
||||
<view class="rest-item-txt">余额</view>
|
||||
</view> -->
|
||||
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=1')">
|
||||
<view class="rest-item-num">{{userInfo.purchase_funds||'0.00'}}</view>
|
||||
<view class="rest-item-txt">采购款</view>
|
||||
</view>
|
||||
<view class="rest-item">
|
||||
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=4')">
|
||||
<view class="rest-item-num">{{userInfo.return_money||'0.00'}}</view>
|
||||
<view class="rest-item-txt">返还金</view>
|
||||
</view>
|
||||
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
|
||||
|
||||
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
|
||||
<view class="rest-item">
|
||||
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')">
|
||||
<view class="rest-item-num">{{userInfo.GetNumber ||"0.00"}}</view>
|
||||
<view class="rest-item-txt">礼品券</view>
|
||||
</view>
|
||||
<view class="rest-item">
|
||||
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=5')">
|
||||
<view class="rest-item-num">{{userInfo.number ||"0.00"}}</view>
|
||||
<view class="rest-item-txt">冻结券</view>
|
||||
</view>
|
||||
|
@ -126,6 +116,9 @@
|
|||
|
||||
<view class="card">
|
||||
<up-cell-group>
|
||||
<!-- <up-cell v-if="userInfo.user_ship==1" title="赠品区" :isLink="true" url="/pageQuota/Gifts/index"></up-cell> -->
|
||||
<!-- <up-cell title="我的资产" :isLink="true" url="/pageQuota/asset/index"></up-cell>
|
||||
<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-group>
|
||||
|
@ -141,13 +134,14 @@
|
|||
</view>
|
||||
|
||||
<up-popup :show="showPop" @close="showPop=false" @open="showPop=true">
|
||||
<view class="popContent">
|
||||
<view class="popContent" :style="{paddingBottom:isFoucs?'500rpx':'50rpx'}">
|
||||
<view style="text-align: center;font-size: 30rpx;font-weight: bold;">
|
||||
修改个人信息
|
||||
</view>
|
||||
<up-form labelPosition="left">
|
||||
<up-form-item label="呢称" prop="userInfo.name" borderBottom ref="item1">
|
||||
<up-input v-model="formData.nick_name" border="none" placeholder="请输入个人呢称"></up-input>
|
||||
<up-form-item label="呢称" prop="userInfo.name" borderBottom ref="item1" @tap="isFoucs=true">
|
||||
<up-input :adjustPosition="false" @blur="isFoucs=false" v-model="formData.nick_name" border="none"
|
||||
placeholder="请输入个人呢称"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item label="头像" prop="userInfo.sex" borderBottom ref="item1">
|
||||
<up-image :src="formData.avatar" width="80px" height="80px" @click="uploadAvatar"></up-image>
|
||||
|
@ -178,7 +172,7 @@
|
|||
orderCountApi
|
||||
} from "@/api/order.js";
|
||||
import {
|
||||
onShow,
|
||||
onLoad,
|
||||
onPullDownRefresh
|
||||
} from "@dcloudio/uni-app"
|
||||
import {
|
||||
|
@ -190,7 +184,7 @@
|
|||
config
|
||||
} from "@/config/app.js"
|
||||
|
||||
|
||||
let isFoucs = ref(false);
|
||||
const userStore = useUserStore();
|
||||
const userInfo = ref({});
|
||||
let token = uni.getStorageSync('token') || ''
|
||||
|
@ -233,7 +227,6 @@
|
|||
const showPop = ref(false)
|
||||
|
||||
const updataInfp = () => {
|
||||
console.log(5454)
|
||||
showPop.value = true
|
||||
}
|
||||
|
||||
|
@ -263,6 +256,7 @@
|
|||
title: '上传中...'
|
||||
});
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
console.log('ewser', config.HTTP_REQUEST_URL)
|
||||
uni.uploadFile({
|
||||
url: config.HTTP_REQUEST_URL + '/api/Upload/image', //仅为示例,非真实的接口地址
|
||||
filePath: tempFilePaths[0],
|
||||
|
@ -292,12 +286,17 @@
|
|||
})
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
onLoad(() => {
|
||||
userInfoApi().then(res => {
|
||||
userInfo.value = res.data;
|
||||
formData.avatar = res.data.avatar
|
||||
formData.nick_name = res.data.nickname
|
||||
|
||||
if (![0].includes(res.data.user_ship)) {
|
||||
uni.setNavigationBarColor({
|
||||
frontColor: "#000000",
|
||||
backgroundColor: "#EAFFE1"
|
||||
})
|
||||
}
|
||||
})
|
||||
getOrderCount();
|
||||
})
|
||||
|
@ -312,84 +311,57 @@
|
|||
|
||||
<style lang="scss">
|
||||
.user-info {
|
||||
overflow: hidden;
|
||||
// background-color: red;
|
||||
width: 100vw;
|
||||
height: 300rpx;
|
||||
background-size: 100% 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 70rpx 50rpx 0 50rpx;
|
||||
position: relative;
|
||||
width: 750rpx;
|
||||
height: 250rpx;
|
||||
|
||||
.bg {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.u-card {
|
||||
box-sizing: border-box;
|
||||
padding: 50rpx 0 50rpx 50rpx;
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
|
||||
.to-vip-btn {
|
||||
color: white;
|
||||
padding: 10rpx 20rpx;
|
||||
background-color: #39BE40;
|
||||
border-radius: 30rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
align-items: center;
|
||||
|
||||
.content {
|
||||
// width: 500rpx;
|
||||
padding-left: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
.u-phone {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.u-id {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.u-card-level {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.u-level-item {
|
||||
.uid {
|
||||
margin-top: 15rpx;
|
||||
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;
|
||||
}
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.to-vip-btn {
|
||||
color: white;
|
||||
padding: 10rpx 20rpx;
|
||||
height: 34rpx;
|
||||
background-color: #39BE40;
|
||||
border-radius: 30rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
|
||||
.logo {
|
||||
position: absolute;
|
||||
width: 236rpx;
|
||||
height: 236rpx;
|
||||
right: 20rpx;
|
||||
z-index: 1;
|
||||
opacity: 0.5
|
||||
}
|
||||
|
||||
.balance {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 35rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,12 +4,41 @@
|
|||
还剩<text>{{countDown}}</text>订单自动取消
|
||||
</view>
|
||||
<view class="m-card m-address" style="margin-top: 20rpx;">
|
||||
<view class="address-info"
|
||||
style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;'
|
||||
@click="callPhone(store_info.phone)">
|
||||
<view class="top" style="align-items: flex-start;">
|
||||
<view style="color: #333;display: flex;align-items: center;flex-shrink: 0;">
|
||||
<text style="margin: 0 10rpx;color:#20B128">自提点</text>
|
||||
</view>
|
||||
<view>
|
||||
<view style="color: #333;">
|
||||
{{store_info.name}}
|
||||
</view>
|
||||
<view style="font-size: 24rpx;color: #333;">
|
||||
{{store_info.detailed_address}}
|
||||
</view>
|
||||
<view>
|
||||
<view v-if="store_info.phone">
|
||||
<text style="margin-right: 10rpx;">{{store_info.name||store_info.mer_real_name}}</text>
|
||||
<text>{{store_info.phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view @click.stop="navgo('/multipleShop/index/index')"
|
||||
style="padding: 20rpx;background-color:#20B128;color: white;border-radius: 40rpx;flex-shrink: 0;">
|
||||
所有提货点
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="m-card m-address" style="margin-top: 20rpx;" v-else>
|
||||
<view class="address-info"
|
||||
style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;'
|
||||
@click="callPhone(shopInfo.phone)">
|
||||
<view class="top" style="align-items: flex-start;">
|
||||
<view style="color: #333;display: flex;align-items: center;flex-shrink: 0;">
|
||||
<text style="margin: 0 10rpx;color:#20B128">推荐自提点</text>
|
||||
<text style="margin: 0 10rpx;color:#20B128">自提点</text>
|
||||
</view>
|
||||
<view v-if="shopInfo.id">
|
||||
<view style="color: #333;">
|
||||
|
@ -26,13 +55,10 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click.stop="navgo('/multipleShop/index/index')"
|
||||
style="padding: 20rpx;background-color:#20B128;color: white;border-radius: 40rpx;flex-shrink: 0;">
|
||||
所有提货点
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-card m-address" style="margin-top: 20rpx;" v-if="addressInfo && addressInfo.address_id">
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="m-card m-address" style="margin-top: 20rpx;" v-if="addressInfo && addressInfo.address_id">
|
||||
<view class="address-info">
|
||||
<view class="top">
|
||||
<up-icon name="account"></up-icon>
|
||||
|
@ -47,8 +73,8 @@
|
|||
<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-address" style="margin-top: 20rpx;" v-else>
|
||||
</view> -->
|
||||
<!-- <view class="m-card m-address" style="margin-top: 20rpx;" v-else>
|
||||
<view class="address-info">
|
||||
<view class="top">
|
||||
<up-icon name="account"></up-icon>
|
||||
|
@ -59,7 +85,7 @@
|
|||
<view style="width: 80px;"><up-button @click="showAddress = true" size="small" shape="circle"
|
||||
color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="m-card m-good" v-for="(item,index) in datas.goods_list" :key="index">
|
||||
<view class="image">
|
||||
<up-image :src="item.image" width="120rpx" height="120rpx"></up-image>
|
||||
|
@ -231,15 +257,17 @@
|
|||
})
|
||||
}
|
||||
|
||||
const store_info = ref({})
|
||||
const datas = ref({})
|
||||
const getDetails = () => {
|
||||
orderDetailApi({
|
||||
order_id: datas.value.id,
|
||||
...location
|
||||
// ...location
|
||||
}).then(res => {
|
||||
datas.value = res.data;
|
||||
options.code = datas.value.verify_code; // 生成条形码的值
|
||||
shopInfo.value = res.data.near_store;
|
||||
store_info.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 {
|
||||
|
@ -461,19 +489,19 @@
|
|||
}
|
||||
|
||||
const getLocation = () => {
|
||||
if (uni.getStorageSync('location')) {
|
||||
location = uni.getStorageSync('location')
|
||||
} else {
|
||||
uni.getLocation({
|
||||
type: "gcj02",
|
||||
success(res) {
|
||||
location.lat = res.latitude;
|
||||
location.long = res.longitude;
|
||||
uni.setStorageSync('location', location)
|
||||
return getDetails()
|
||||
}
|
||||
})
|
||||
}
|
||||
// if (uni.getStorageSync('location')) {
|
||||
// location = uni.getStorageSync('location')
|
||||
// } else {
|
||||
// uni.getLocation({
|
||||
// type: "gcj02",
|
||||
// success(res) {
|
||||
// location.lat = res.latitude;
|
||||
// location.long = res.longitude;
|
||||
// uni.setStorageSync('location', location)
|
||||
// return getDetails()
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
getDetails()
|
||||
}
|
||||
|
||||
|
@ -490,7 +518,6 @@
|
|||
|
||||
onBackPress(() => {
|
||||
clearInterval(timer);
|
||||
console.log("清除");
|
||||
})
|
||||
|
||||
const navgo = (url) => {
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
<view class="mask" v-if='showVerifyPop' @click="showVerifyPop=false">
|
||||
<view
|
||||
style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);background-color: white;padding: 20rpx;">
|
||||
<up-image :src="orderData.verify_img" width="404rpx" height="60rpx"></up-image>
|
||||
<up-image :src="orderData.verify_img" width="710rpx" height="105rpx"></up-image>
|
||||
<view style="font-weight: bold;color: #333;font-size: 26;text-align: center;margin-top: 20rpx;">
|
||||
核销码 {{orderData.verify_code}}
|
||||
</view>
|
||||
|
@ -327,27 +327,35 @@
|
|||
mer_id: e.merchant,
|
||||
pay_type: e.pay_type
|
||||
}).then(res => {
|
||||
if (!res.data?.nonceStr) return uni.$u.toast('支付失败!');
|
||||
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('用户取消支付')
|
||||
}
|
||||
})
|
||||
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 || '网络错误')
|
||||
})
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="">
|
||||
<!-- <view class="m-card m-address">
|
||||
<view class="address-info" @click="showAddress = true" v-if='orderInfo.shipping_type == 1'>
|
||||
<!-- <view class="m-card m-address"> -->
|
||||
<!-- <view class="address-info" @click="showAddress = true">
|
||||
<view class="top">
|
||||
<up-icon name="account"></up-icon>
|
||||
<view class="t-name">{{ addressInfo.real_name }}</view>
|
||||
|
@ -10,16 +10,16 @@
|
|||
<view class="bottom u-line-2">
|
||||
{{ addressInfo.detail }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-info" v-else>
|
||||
</view> -->
|
||||
<!-- <view class="address-info">
|
||||
<view class="top">
|
||||
{{ STORE_INFO.name }}
|
||||
{{ STORE_INFO.name }}是的
|
||||
</view>
|
||||
<view class="bottom u-line-2">
|
||||
{{ STORE_INFO.detailed_address }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-btn item-center">
|
||||
</view> -->
|
||||
<!-- <view class="address-btn item-center">
|
||||
<view class='ship-type' style="">
|
||||
<view class="ship-type-item" :class='{ actShipItem: orderInfo.shipping_type == 2 }'
|
||||
@click='orderInfo.shipping_type = 2'>
|
||||
|
@ -30,8 +30,39 @@
|
|||
配送
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="m-card m-address" style="margin-top: 20rpx;">
|
||||
<view class="address-info"
|
||||
style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;'>
|
||||
<view class="top" style="align-items: flex-start;">
|
||||
<view style="color: #333;width: 200rpx;">
|
||||
<view style="margin: 0 10rpx;color:#20B128;width: 150rpx;">推荐自提点</view>
|
||||
<view class="isreser"> {{reservation?"次日可提":"当日可提" }}
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view style="color: #333;">
|
||||
{{shop_Info.name}}
|
||||
</view>
|
||||
<view style="font-size: 24rpx;color: #333;margin: 10rpx 0;">
|
||||
{{shop_Info.detailed_address}}
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
<text>{{shop_Info.phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 20rpx;background-color:#20B128;color: white;border-radius: 40rpx;flex-shrink: 0;"
|
||||
@click="navgo(`/multipleShop/index/index?event=settle&cart_id=${cartStore.cartList.join(',')}`)">
|
||||
切换门店
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- </view> -->
|
||||
<view class="m-card m-good" v-for="(item, index) in cartList" :key="index">
|
||||
<view class="image">
|
||||
<up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image>
|
||||
|
@ -67,7 +98,7 @@
|
|||
<view class="row" v-if="[4,5,6].includes(userInfo.user_ship)" style="color: red;">
|
||||
<view>优惠减免</view>
|
||||
<view>
|
||||
<text>-¥</text>{{ c_price(orderInfo.activity_price, 0) }}<text>.{{ c_price(orderInfo.activity_price, 1) }}</text>
|
||||
<text>-¥</text>{{ c_price(orderInfo.frozen_money, 0) }}<text>.{{ c_price(orderInfo.frozen_money, 1) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row" v-if="userInfo.user_ship==1 ">
|
||||
|
@ -81,9 +112,9 @@
|
|||
<view class="m-card order-remark">
|
||||
<!-- <view style="display: flex;align-items: center;">
|
||||
<text style="margin-right: 20rpx;">是否存货</text>
|
||||
<up-radio-group v-model="isCh" placement="row">
|
||||
<up-radio activeColor="#20b128" label="是" name="1" style="margin-right: 10rpx;"></up-radio>
|
||||
<up-radio activeColor="#20b128" label="否" name="0"></up-radio>
|
||||
<up-radio-group v-model="is_storage" placement="row">
|
||||
<up-radio activeColor="#20b128" label="立即提货" :name="0" style="margin-right: 10rpx;"></up-radio>
|
||||
<up-radio activeColor="#20b128" label="全部存货" :name="1"></up-radio>
|
||||
</up-radio-group>
|
||||
</view> -->
|
||||
<view class="head-title" style="margin-top: 20rpx;">
|
||||
|
@ -201,7 +232,8 @@
|
|||
import {
|
||||
userInfoApi,
|
||||
addressListsApi,
|
||||
merchantListApi
|
||||
merchantListApi,
|
||||
checkInventoryApi
|
||||
} from "@/api/user.js";
|
||||
import {
|
||||
createOrderApi
|
||||
|
@ -216,7 +248,7 @@
|
|||
|
||||
const cartStore = useCartStore();
|
||||
const reservation_time = ref('')
|
||||
const isCh = ref(0)
|
||||
const is_storage = ref(0)
|
||||
|
||||
const formData = ref({
|
||||
remark: ""
|
||||
|
@ -282,8 +314,8 @@
|
|||
|
||||
const getMerchantList = (mer_name = null) => {
|
||||
merchantListApi({
|
||||
...myAddressInfo.value,
|
||||
mer_name: mer_name ? mer_name : ''
|
||||
// ...myAddressInfo.value,
|
||||
// mer_name: mer_name ? mer_name : ''
|
||||
}).then(res => {
|
||||
merchantList.value = res.data.lists;
|
||||
if (mer_name === null && myAddressInfo.value.long && merchantList.value.length > 0 && !shopInfo
|
||||
|
@ -299,19 +331,19 @@
|
|||
|
||||
// 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();
|
||||
}
|
||||
})
|
||||
}
|
||||
// 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) => {
|
||||
|
@ -356,23 +388,55 @@
|
|||
}
|
||||
|
||||
// 订单相关
|
||||
let location = {
|
||||
lat: '',
|
||||
long: "",
|
||||
};
|
||||
let reservation = ref(0);
|
||||
const shop_Info = ref({})
|
||||
const cartList = ref([]);
|
||||
const orderInfo = ref({});
|
||||
const checkOrder = () => {
|
||||
const checkOrder = (store_id) => {
|
||||
checkOrderApi({
|
||||
cart_id: cartStore.cartList,
|
||||
store_id: STORE_INFO.id || 0
|
||||
store_id: STORE_INFO.id || 0,
|
||||
...location
|
||||
}).then(res => {
|
||||
cartList.value = res.data.cart_list;
|
||||
orderInfo.value = res.data.order;
|
||||
if (orderInfo.value.default_delivery == 0) {
|
||||
orderInfo.value.shipping_type = 2
|
||||
}
|
||||
shop_Info.value = res.data.shopInfo || {}
|
||||
checkInventoryApi({
|
||||
cart_id: cartStore.cartList,
|
||||
store_id: store_id || res.data.shopInfo.id
|
||||
}).then(res => {
|
||||
reservation.value = res.data.reservation
|
||||
})
|
||||
// if (orderInfo.value.default_delivery == 0) {
|
||||
// orderInfo.value.shipping_type = 2
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
const pay_type = ref('7');
|
||||
|
||||
uni.$on('settle', function(data) {
|
||||
let datas = JSON.parse(data)
|
||||
shop_Info.value = datas
|
||||
console.log(datas)
|
||||
checkInventoryApi({
|
||||
cart_id: cartStore.cartList,
|
||||
store_id: datas.id
|
||||
}).then(res => {
|
||||
reservation.value = res.data.reservation
|
||||
})
|
||||
|
||||
// formData.store_id = datas.id
|
||||
// formData.store_name = datas.name
|
||||
})
|
||||
|
||||
|
||||
|
||||
// const checkOrderA
|
||||
const pay_type = ref('7');
|
||||
|
||||
// 支付密码
|
||||
const passwordBoardVisible = ref(false);
|
||||
|
@ -394,15 +458,17 @@
|
|||
const payFn = () => {
|
||||
let shareInfo = uni.getStorageSync('SHARE_INFO');
|
||||
createOrderApi({
|
||||
reservation: reservation.value,
|
||||
password: password.value,
|
||||
spread_uid: (shareInfo && shareInfo.uid) ? shareInfo.uid : '',
|
||||
cart_id: cartStore.cartList,
|
||||
address_id: addressInfo.value.address_id,
|
||||
pay_type: pay_type.value,
|
||||
store_id: STORE_INFO.id || 0,
|
||||
reservation_time: reservation_time.value,
|
||||
store_id: shop_Info.value.id,
|
||||
shipping_type: orderInfo.value.shipping_type,
|
||||
mark: formData.value.remark
|
||||
mark: formData.value.remark,
|
||||
is_storage: is_storage.value
|
||||
}).then(res => {
|
||||
if (pay_type.value == 3 || pay_type.value == 18) {
|
||||
if (res.code == 1) {
|
||||
|
@ -481,7 +547,25 @@
|
|||
}
|
||||
|
||||
onLoad(options => {
|
||||
checkOrder();
|
||||
if (uni.getStorageSync('location')) {
|
||||
location = JSON.parse(uni.getStorageSync('location'))
|
||||
checkOrder();
|
||||
} else {
|
||||
uni.getLocation({
|
||||
type: "gcj02",
|
||||
success(res) {
|
||||
location.lat = res.latitude;
|
||||
location.long = res.longitude;
|
||||
uni.setStorageSync('location', JSON.stringify(location))
|
||||
checkOrder();
|
||||
},
|
||||
fail() {
|
||||
uni.$u.toast('获取位置当前失败,为你推荐当前门店')
|
||||
checkOrder(STORE_INFO.id);
|
||||
},
|
||||
complete() {}
|
||||
})
|
||||
}
|
||||
})
|
||||
onShow(() => {
|
||||
getAddressList();
|
||||
|
@ -489,6 +573,17 @@
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.isreser {
|
||||
// margin: 0 10rpx;
|
||||
// margin-top: 5rpx;
|
||||
color: black;
|
||||
background-color: #F6EECD;
|
||||
// padding: 5rpx 4rpx;
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.m-card {
|
||||
margin: 20rpx;
|
||||
border-radius: 14rpx;
|
||||
|
|
Loading…
Reference in New Issue