This commit is contained in:
zmj 2024-06-29 18:25:37 +08:00
parent 43612fe683
commit 00c3dc1135
15 changed files with 625 additions and 105 deletions

View File

@ -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);
}

11
api/asset.js Normal file
View File

@ -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);
}

View File

@ -154,3 +154,7 @@ export const uploadImg = (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);
}

View File

@ -2,8 +2,8 @@ let BASE_URL
let WSS_URL
import store from "@/store/user.js"
// 环境
// let env = "dev"
let env = "prod"
let env = "dev"
// let env = "prod"
// let env = "release";
// let env = "local";

View File

@ -66,7 +66,7 @@
onLoad,
onShow
} from "@dcloudio/uni-app";
let event = ''
const currShop = ref(''); //
const shopList = ref([]); //
const status = ref(''); //
@ -82,26 +82,40 @@
})
//
onLoad(() => {
onLoad((opt) => {
event = opt.event
console.log(event)
//
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,6 +176,7 @@
const getLocation = () => {
let location = uni.getStorageSync('location');
if (location) {
location = JSON.parse(location);
queryParams.longitude = location.lat
queryParams.latitude = location.long
//
@ -172,15 +187,13 @@
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
})
}, ))
}
})
}

281
pageQuota/asset/index.vue Normal file
View File

@ -0,0 +1,281 @@
<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" @click="checkAll">
<image v-if="getCheckNum()!=lists.length" src="@/static/icon/n-check.png"></image>
<image v-else src="@/static/icon/check.png"></image>
</view>
<view style="margin-left: 8rpx;" v-if='getCheckNum()==lists.length'>
全选({{getCheckNum()}})
</view>
<view style="margin-left: 8rpx;" 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 {
getUserProductStorageLists,
reservationUserProductStorage
} from "@/api/asset.js"
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
console.log(JSON.parse(data));
})
const isAll = ref(false)
const getLists = async () => {
let res = await getUserProductStorageLists({
uid: 130
})
lists.value = res.data.lists
lists.value.forEach(item => {
item.num = 1
})
}
const checkAll = () => {
lists.value.forEach(item => item.check = true)
}
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
}
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>

View File

@ -17,7 +17,7 @@
</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>
@ -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) => {
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()
}

View File

@ -7,6 +7,15 @@
<up-input v-model="storePhone" placeholder="请输入门店手机号"></up-input>
</up-form-item>
</up-form>
<up-form labelPosition="left" label-width="100rpx">
<up-form-item label="身份" borderBottom>
<up-radio-group v-model="Role" placement="row">
<up-radio activeColor="#20b128" label="行业会员" :name="1"
style="margin-right: 10rpx;"></up-radio>
<up-radio activeColor="#20b128" label="商户" :name="4"></up-radio>
</up-radio-group>
</up-form-item>
</up-form>
</view>
</up-modal>
</view>
@ -19,8 +28,10 @@
<view class="lines" :class="{ actLine: currentTab == 2 }" />
</view> -->
<up-sticky bgColor="#fff" style="padding: 20rpx;">
<up-tabs :list="tabsLst" :itemStyle="{width:'33vw',paddingBottom:'20rpx'}" lineColor='#50C758'
:current='currentTab' @change="tabsChange"></up-tabs>
<up-tabs v-if="Role==1" :list="tabsLst" :itemStyle="{width:'33vw',paddingBottom:'20rpx'}"
lineColor='#50C758' :current='currentTab' @change="tabsChange"></up-tabs>
<up-tabs v-else :list="tabsLst2" :itemStyle="{width:'50vw',paddingBottom:'20rpx'}" lineColor='#50C758'
:current='currentTab' @change="tabsChange1"></up-tabs>
</up-sticky>
<!-- tabs0 -->
@ -53,7 +64,7 @@
suffixIcon='arrow-down'></up-input>
</view>
</up-form-item>
<up-form-item label="">
<up-form-item label="" v-if="Role==1">
<view @click="showPop1 = true" style="width: 100%;">
<up-input style="pointer-events: none" v-model="formData.label_name" border="none"
prefixIcon="man-add" readonly placeholder="点击选择用户身份" :customStyle="{
@ -81,7 +92,7 @@
报备人:{{ STORE_INFO.name }}
</view>
<view class="store-info">
<view class="store-info" v-if="Role==1">
<view class="" style="width: 300rpx;margin: 0 auto;border-bottom: 1px solid #F3F3F3;">
<up-input inputAlign='center' type='digit' placeholder="请输入金额" @focus="formData.price=''"
color='#FF6B00' :placeholderStyle="{fontSize:'28rpx'}" fontSize='20px' border="none"
@ -98,13 +109,13 @@
<view class="submit-btn" @click="submit">
<view
style='width: 710rpx;height: 100rpx;text-align: center;line-height: 100rpx;text-align: center;color: white;background-color: #33B83A;border-radius: 50rpx;font-size:40rpx ;'>
完成并收款
{{Role==1?'完成并收款':"完成" }}
</view>
</view>
</block>
<block v-if="currentTab==1">
<block v-if="currentTab==1 && Role==1">
<view class="card card1">
<view class="card1-tit">
行业会员追加经营资金
@ -176,7 +187,7 @@
</block>
<!-- tabs2 -->
<block v-if="currentTab == 2">
<block v-if="currentTab == 2 &&Role==1">
<view class="vip-card">
<text>当前已开通</text>
<up-count-to :startVal="0" :endVal="count"></up-count-to>
@ -216,6 +227,56 @@
</uni-table>
</view>
</block>
<block v-if="currentTab == 1 &&Role==4">
<view class="vip-card">
<text>当前已开通</text>
<up-count-to :startVal="0" :endVal="count"></up-count-to>
<text>{{ Role == 1 ? '行业会员' : '商户' }}</text>
</view>
<view class="table">
<uni-table stripe emptyText="暂无更多数据" width="100%">
<!-- 表头行 -->
<uni-tr>
<!-- <uni-th width="20" align="center">序号</uni-th> -->
<uni-th width="50" align="center">商户</uni-th>
<uni-th width="50" align="center">开通时间</uni-th>
<uni-th width="50" align="center">状态</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item, index) in lists" :key="item.order_id">
<!-- <uni-td align="center">{{index+1}}</uni-td> -->
<uni-td style="font-size: 20rpx;" align="center">{{ item.nickname }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center">{{ item.create_time }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center">
<view>已开通</view>
</uni-td>
</uni-tr>
</uni-table>
</view>
</block>
</view>
<view style="height: 50rpx;" />
@ -320,6 +381,15 @@
},
]);
const tabsLst2 = reactive([{
name: '开通商户'
},
{
name: '已开通列表'
},
]);
const tabsChange = (e) => {
currentTab.value = e.index
@ -329,7 +399,10 @@
}
// getLists()
}
const tabsChange1 = (e) => {
currentTab.value = (e.index)
getLists()
}
const confirmStore = () => {
getStoreByPhone({
@ -638,6 +711,30 @@
//
const submit = async (type = 1) => {
if (Role.value == 4) {
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
if (!formData.code) return uni.$u.toast('请输入短信验证码');
if (!formData.address) return uni.$u.toast('请选择地址');
delete formData.recharge_type
delete formData.auth_code
formData.user_ship = 4
vipRechargeApi(formData).then(res => {
resetFormData()
getLists()
currentTab.value = 1
})
return
}
if (type == 2) {
if (!formData2.mobile) return uni.$u.toast('请填写电话号码');
if (formData2.price < formData2.label_limit) return uni.$u.toast(
@ -769,6 +866,7 @@
where.loadingOver = false
where.page_no = 1
where.page_size = 25
if (Role.value == 1) {
let res = await rechargeListsApi({
store_id: STORE_INFO.id,
recharge_type: "INDUSTRYMEMBERS",
@ -776,6 +874,13 @@
page_size: 25
})
lists.value = res.data.lists
} else {
let res = await getCreateLists({
store_id: STORE_INFO.id,
})
lists.value = res.data.lists
count.value = res.data.count
}
}

View File

@ -235,6 +235,15 @@
"enablePullDownRefresh": true
}
},
{
"path": "asset/index",
"style": {
"navigationBarTitleText": "会员资产",
"enablePullDownRefresh": true
}
},
{
"path": "balanceDetail/index",
"style": {

View File

@ -401,6 +401,7 @@
const addCart = (product_id, cart_num) => { //
cartCreateApi({
type: 1,
cart_num: cart_num,
is_new: 0, // 01
// goods_id: id,

View File

@ -16,10 +16,10 @@
<up-button @click="weixinLogin" color="#20B128" size="large"><up-icon color="#fff"
size="28"></up-icon></up-button>
</view>
<!-- <view class="btn">
<view class="btn">
<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> -->
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"
size="28"></up-icon></up-button>

View File

@ -24,7 +24,7 @@
<template>
<view style="flex-grow: 1;overflow-y: auto;">
<view class="user-info"
:style="{backgroundImage: userInfo.user_ship!=1?'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp)':'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/a8055202406281609236596.png)' }">
:style="{backgroundImage: userInfo.user_ship!=1?'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp)':'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/dbf18202406291057413355.png)' }">
<view class="u-card">
<view style="display: flex;" @click="updataInfp">
<up-image :src="userInfo.avatar" mode="aspectFill" width="112rpx" height="112rpx"
@ -36,7 +36,7 @@
<view style="margin:0 20rpx;">
{{userInfo.id}}
</view>
<view
<view v-if="userInfo.user_ship==1"
style="display: flex;align-items: center;background-color: #F6EECD;padding: 4rpx 10rpx;border-radius: 20rpx;">
<view style="margin-right: 10rpx;">
<up-icon
@ -45,13 +45,21 @@
{{userInfo.label_name}}会员
</view>
</view>
</view>
</view>
<view class="to-vip-btn" @click="navgo('/pageQuota/vipUser/index')">
会员报备
</view>
<view class="logo" v-if="userInfo.user_ship==1">
<up-image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/f361a202406291058319809.png"
width="200rpx" height="200rpx"></up-image>
</view>
</view>
<view class="balance" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
<view class="" style="font-size: 28rpx;transform: translateY(10rpx);">
@ -79,7 +87,7 @@
<view class="rest-item-num">{{userInfo.GetNumber ||"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=5')">
<view class="rest-item-num">{{userInfo.number ||"0.00"}}</view>
<view class="rest-item-txt">冻结券</view>
</view>
@ -121,6 +129,7 @@
<view class="card">
<up-cell-group>
<up-cell title="我的资产" :isLink="true" url="/pageQuota/asset/index"></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>
@ -174,7 +183,7 @@
orderCountApi
} from "@/api/order.js";
import {
onShow,
onLoad,
onPullDownRefresh
} from "@dcloudio/uni-app"
import {
@ -289,7 +298,7 @@
})
}
onShow(() => {
onLoad(() => {
userInfoApi().then(res => {
userInfo.value = res.data;
formData.avatar = res.data.avatar
@ -320,6 +329,7 @@
background-size: 100% 100%;
box-sizing: border-box;
padding: 70rpx 50rpx 0 50rpx;
position: relative;
.u-card {
display: flex;
@ -346,10 +356,18 @@
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;

View File

@ -38,7 +38,7 @@
@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;">
@ -55,10 +55,10 @@
</view>
</view>
</view>
<view @click.stop="navgo('/multipleShop/index/index')"
<!-- <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>
@ -266,7 +266,7 @@
const getDetails = () => {
orderDetailApi({
order_id: datas.value.id,
...location
// ...location
}).then(res => {
datas.value = res.data;
options.code = datas.value.verify_code; //
@ -493,19 +493,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()
}
@ -522,7 +522,6 @@
onBackPress(() => {
clearInterval(timer);
console.log("清除");
})
const navgo = (url) => {

View File

@ -107,7 +107,16 @@
<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>

View File

@ -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,35 @@
配送
</view>
</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;" @click="navgo('/multipleShop/index/index')">
<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;">
{{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;">
当日可提
</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>
@ -79,13 +106,13 @@
</view>
<view class="m-card order-remark">
<!-- <view style="display: flex;align-items: center;">
<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>
<view class="head-title" style="margin-top: 20rpx;">
<text>订单备注</text>
<text>{{formData.remark.length}}/140</text>
@ -201,7 +228,8 @@
import {
userInfoApi,
addressListsApi,
merchantListApi
merchantListApi,
checkInventoryApi
} from "@/api/user.js";
import {
createOrderApi
@ -216,7 +244,7 @@
const cartStore = useCartStore();
const reservation_time = ref('')
const isCh = ref(0)
const is_storage = ref(0)
const formData = ref({
remark: ""
@ -282,8 +310,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 +327,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,21 +384,28 @@
}
//
let location;
const shop_Info = ref({})
const cartList = ref([]);
const orderInfo = ref({});
const checkOrder = () => {
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;
shop_Info.value = res.data.shopInfo || {}
console.log(shop_Info.value)
if (orderInfo.value.default_delivery == 0) {
orderInfo.value.shipping_type = 2
}
})
}
// const checkOrderA
const pay_type = ref('7');
@ -402,7 +437,8 @@
store_id: STORE_INFO.id || 0,
reservation_time: reservation_time.value,
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 +517,22 @@
}
onLoad(options => {
if (uni.getStorageSync('location')) {
location = JSON.parse(uni.getStorageSync('location'))
} else {
uni.getLocation({
type: "gcj02",
success(res) {
location.lat = res.latitude;
location.long = res.longitude;
uni.setStorageSync('location', JSON.stringify(location))
}
})
}
checkOrder();
})
onShow(() => {
getAddressList();