Compare commits

..

No commits in common. "c899d8f47268dc0871a879cb8047f42fb9efb514" and "10664005c9e5682926d4f3f9244c35927c088a9b" have entirely different histories.

17 changed files with 211 additions and 1096 deletions

View File

@ -33,8 +33,4 @@ 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);
}

View File

@ -1,11 +0,0 @@
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

@ -153,8 +153,4 @@ 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

@ -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 :min="0" v-model="datas.cart_num" @change="valChange"></up-number-box>
<up-number-box 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 :min="0" v-model="datas.cart_num" @change="valChange"></up-number-box>
<up-number-box v-model="datas.cart_num" @change="valChange"></up-number-box>
</view>
</view>
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
@ -115,8 +115,7 @@
datas.value.cart_num = '';
return;
}
datas.value.types = true
emit('change', datas.value, );
emit('change', datas.value);
}
const subtotal = computed(() => {
@ -125,6 +124,11 @@
return Number(num * sell * 100 / 100).toFixed(2)
})
defineExpose({
setData,
// founcsFn

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.201:8545';
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break;
default:

View File

@ -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.reservation==1">次日可</text>
<text class="green" v-if='item.reservation==0'>当日可提</text>
<text class="yellow" v-if="item.is_store == 1">可自</text>
<text class="green" v-if="item.is_send == 1">可配送</text>
</view>
<view class="multiple-card-item-left-info">
<u-image src="../../multipleShop/images/location_small.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,45 +77,31 @@
latitude: '',
phone: '',
name: '',
cart_id: "",
page_no: 1,
page_size: 6
})
//
onLoad((opt) => {
event = opt.event
if (opt.cart_id) queryParams.cart_id = opt.cart_id;
onLoad(() => {
//
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)
}
//
@ -176,9 +162,8 @@
const getLocation = () => {
let location = uni.getStorageSync('location');
if (location) {
location = JSON.parse(location);
queryParams.longitude = location.long
queryParams.latitude = location.lat
queryParams.longitude = location.lat
queryParams.latitude = location.long
//
getShopList();
} else {
@ -187,19 +172,16 @@
success(res) {
queryParams.latitude = res.latitude;
queryParams.longitude = res.longitude;
//
getShopList();
//
uni.setStorageSync('location', JSON.stringify({
uni.setStorageSync('location', {
lat: queryParams.latitude,
long: queryParams.longitude
}, ))
},
fail() {
console.log("获取定位失败")
getShopList();
})
}
})
}
}
@ -277,7 +259,7 @@
margin-bottom: 16rpx;
text {
width: 120rpx;
width: 90rpx;
height: 42rpx;
line-height: 42rpx;
text-align: center;

View File

@ -1,288 +0,0 @@
<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>

View File

@ -1,288 +0,0 @@
<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>

View File

@ -17,7 +17,7 @@
</view>
</view>
</view>
<view class="content" v-if='type==3||type==5'>
<view class="content" v-if='type==3'>
<view class="li" v-for="(item,index) in lists" :key="index">
<view class="li-top">
<text>{{item.title}}</text>
@ -60,11 +60,10 @@
onPullDownRefresh
} from "@dcloudio/uni-app"
import {
getFundList,
getUserSingList
getFundList
} from "@/api/address.js"
const navLists = ['', '采购款明细', '余额明细', '礼品券明细', '返还金明细', '冻结券明细']
const navLists = ['', '采购款明细', '余额明细', '礼品券明细', '返还金明细']
const tabsLst = reactive([{
name: '全部'
},
@ -85,25 +84,11 @@
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
}
let res = await getFundList({
type: type.value,
mark: mark.value || ''
})
lists.value = res.data.lists
if (isPullDown) uni.stopPullDownRefresh()
}

View File

@ -7,26 +7,22 @@
<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>
<view v-else>
<!-- <view class="tabs">
<text @click="currentTab = 1" :class="{ actText: currentTab == 1 }">开通{{ Role == 1 ? '行业会员' : '商户' }}
</text>
<text @click="currentTab = 2, getCount(), getLists()" :class="{ actText: currentTab == 2 }"> 已开通列表</text>
<view class="lines" :class="{ actLine: currentTab == 2 }" />
</view> -->
<up-sticky bgColor="#fff" style="padding: 20rpx;">
<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-tabs :list="tabsLst" :itemStyle="{width:'33vw',paddingBottom:'20rpx'}" lineColor='#50C758'
:current='currentTab' @change="tabsChange"></up-tabs>
</up-sticky>
<!-- tabs0 -->
<block v-if='currentTab == 0'>
<view class="card card1">
@ -36,14 +32,13 @@
</view>
<up-form labelPosition="left" :model="formData" :borderBottom='false'>
<up-form-item label="">
<up-input @change="phoneChnge(1)" v-model="formData.mobile" border="none" prefixIcon="phone"
placeholder="请输入电话号码"
<up-input v-model="formData.real_name" border="none" prefixIcon="account" placeholder="请输入真实姓名"
:customStyle="{ background: '#F3F3F3', padding: '20rpx', 'border-radius': '30rpx' }"
:placeholderStyle="{ color: '#444444' }"
:prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
</up-form-item>
<up-form-item label="">
<up-input v-model="formData.real_name" border="none" prefixIcon="account" placeholder="请输入真实姓名"
<up-input v-model="formData.mobile" border="none" prefixIcon="phone" placeholder="请输入电话号码"
:customStyle="{ background: '#F3F3F3', padding: '20rpx', 'border-radius': '30rpx' }"
:placeholderStyle="{ color: '#444444' }"
:prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
@ -58,7 +53,7 @@
suffixIcon='arrow-down'></up-input>
</view>
</up-form-item>
<up-form-item label="" v-if="Role==1">
<up-form-item label="">
<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="{
@ -86,7 +81,7 @@
报备人:{{ STORE_INFO.name }}
</view>
<view class="store-info" v-if="Role==1">
<view class="store-info">
<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"
@ -103,21 +98,21 @@
<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 && Role==1">
<block v-if="currentTab==1">
<view class="card card1">
<view class="card1-tit">
行业会员追加经营资金
<!-- <up-input v-model='formData2.auth_code'> </up-input> -->
<!-- <up-input v-model='formData.auth_code'> </up-input> -->
</view>
<up-form labelPosition="left" :model="formData2" :borderBottom='false'>
<up-form-item label="">
<up-input @change="phoneChnge(2)" v-model="formData2.mobile" border="none" prefixIcon="phone"
<up-input @change="phoneChnge" v-model="formData2.mobile" border="none" prefixIcon="phone"
placeholder="输入电话号码自动查询"
:customStyle="{ background: '#F3F3F3', padding: '20rpx', 'border-radius': '30rpx' }"
:placeholderStyle="{ color: '#444444' }"
@ -181,7 +176,7 @@
</block>
<!-- tabs2 -->
<block v-if="currentTab == 2 &&Role==1">
<block v-if="currentTab == 2">
<view class="vip-card">
<text>当前已开通</text>
<up-count-to :startVal="0" :endVal="count"></up-count-to>
@ -202,17 +197,10 @@
<!-- 表格数据行 -->
<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">
<view>
{{ item.real_name }}
</view>
<view style="color: #33B83A;" @click="popPhone=item.mobile,showModal=true">
查看号码
</view>
</uni-td>
<uni-td style="font-size: 20rpx;" align="center">{{ item.real_name }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center">{{ item.price }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center">{{ item.create_time }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center">{{ item.ship_name }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center">{{ item.label_name }}</uni-td>
<uni-td style="font-size: 20rpx;" align="center">
<view v-if="item.paid == 1 ">已开通</view>
<view v-else style="color:#33B83A ;">
@ -228,40 +216,6 @@
</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-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.mobile }}</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;" />
@ -310,16 +264,7 @@
</view>
</up-popup>
<up-picker :show="showPop1" :columns="columns" @confirm='conformRole' @cancel='showPop1 = false'
@close="showPop1 = false" @open="showPop1 = true" keyName='title' confirmColor='#33B83A'></up-picker>
<up-modal :show="showModal" title="电话号码" content='15884967539' :closeOnClickOverlay="true" :zoom="true"
confirmColor='#33B83A' @confirm='showModal=false' @close="showModal=false">
<view class="slot-content">
{{popPhone}}
</view>
</up-modal>
@close="showPop1 = false" @open="showPop1 = true" keyName='label_name' confirmColor='#33B83A'></up-picker>
</template>
<script setup>
import {
@ -358,11 +303,9 @@
config
} from "@/config/app.js"
const showModal = ref(false)
const showPop1 = ref(false)
const Role = ref(1)
const popPhone = ref('')
// const range = ref({})
const range = ref({})
const columns = ref([])
const showModa = ref(true)
const storePhone = ref('')
@ -377,15 +320,6 @@
},
]);
const tabsLst2 = reactive([{
name: '开通商户'
},
{
name: '已开通列表'
},
]);
const tabsChange = (e) => {
currentTab.value = e.index
@ -395,10 +329,7 @@
}
// getLists()
}
const tabsChange1 = (e) => {
currentTab.value = (e.index)
getLists()
}
const confirmStore = () => {
getStoreByPhone({
@ -524,8 +455,18 @@
price: "",
})
const getFormData2 = (data) => {
const phoneChnge = async () => {
if (formData2.mobile.length == 0) resetFormData();
if (!checkPhone(formData2.mobile)) return
uni.showLoading({
title: '查询用户中'
})
let {
data
} = await getVipInfoByPhone({
mobile: formData2.mobile
})
uni.hideLoading()
formData2.city = data.address_info?.city
formData2.area = data.address_info?.area
formData2.province = data.address_info?.province
@ -533,66 +474,17 @@
formData2.village = data.address_info?.village
formData2.real_name = data.real_name
formData2.address = data.address_info?.address_like
formData2.label_id = data.user_ship
formData2.label_id = data.label_id
// formData2.label_limit = data.label_id
formData2.user_ship = data.user_ship
formData2.brigade = data.address_info?.brigade
columns.value[0].forEach(item => {
if (item.id == formData2.label_id) {
formData2.label_name = item.title
if (item.label_id == data.label_id) {
formData2.label_name = item.label_name
formData2.label_limit = item.limit
}
})
}
const phoneChnge = async (type) => {
// typewhite 1 2
if (type == 1) {
if (!checkPhone(formData.mobile)) return
try {
let {
data
} = await getVipInfoByPhone({
mobile: formData.mobile
})
formData2.mobile = formData.mobile
if (data.user_ship == 4 || data.user_ship == 0) return;
if (Role.value == 1) {
uni.$u.toast('该用户已是会员请使用追加经营资金进行收款')
currentTab.value = 1
return getFormData2(data)
} else {
return uni.$u.toast('该用户已是会员,无法进行商户报备')
}
} catch (error) {}
} else {
if (formData2.mobile.length == 0) resetFormData();
if (!checkPhone(formData2.mobile)) return
uni.showLoading({
title: '查询用户中'
})
try {
let {
data
} = await getVipInfoByPhone({
mobile: formData2.mobile
})
// if (data.user_ship != 4) {
// uni.hideLoading()
// return uni.$u.toast('');
// }
if (formData.mobile) {
formData2.mobile = formData.mobile
}
uni.hideLoading()
return getFormData2(data)
} catch (error) {
uni.hideLoading()
uni.$u.toast('查询失败');
}
}
}
@ -608,6 +500,8 @@
for (let key in formData2) {
formData2[key] = ''
}
tabsList.forEach(item => {
item.name = '请选择'
})
@ -618,8 +512,8 @@
}
const conformRole = (e) => {
formData.label_name = e.value[0].title
formData.label_id = e.value[0].id
formData.label_name = e.value[0].label_name
formData.label_id = e.value[0].label_id
formData.price = (+e.value[0].limit).toFixed(2)
formData.label_limit = e.value[0].limit
showPop1.value = false
@ -636,11 +530,9 @@
else if (formData.village) return [3, 'village'];
else if (formData.brigade) return [4, 'brigade'];
}
const addressTbasChange = (e) => {
currentAddressIndex.value = e.index
}
const addressList = reactive({
city: [],
area: [],
@ -722,6 +614,8 @@
},
]);
let timerInvol = null
// scoket
const userInfo = useUserStore().userInfo;
@ -733,7 +627,9 @@
user_channel.on('message', function(data) {
try {
uni.hideLoading({});
console.log(timerInvol)
clearTimeout(timerInvol);
console.log("清除" + timerInvol)
paySuccessToTabs2()
} catch (error) {}
});
@ -742,40 +638,11 @@
//
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
formData.store_id = STORE_INFO.id
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(
`${formData2.label_name}角色最低金额不能低于${formData2.label_limit}`);
formData2.store_id = STORE_INFO.id
// formData2.recharge_type = 'INDUSTRYMEMBERS'
// formData2.user_ship = formData2.label_id
// vipRechargeApi(formData2).then(res => {
// uni.showLoading({
// title: '...'
// });
// timerInvol = setTimeout(() => {
// uni.hideLoading();
// uni.$u.toast('');
// console.log("")
// }, 10000)
// })
// return
uni.scanCode({
success: function(res) {
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
@ -784,7 +651,7 @@
});
formData2.auth_code = res.result
formData2.recharge_type = 'INDUSTRYMEMBERS'
formData2.user_ship = formData2.label_id
formData2.user_ship = 1
vipRechargeApi(formData2).then(res => {
timerInvol = setTimeout(() => {
uni.hideLoading();
@ -792,6 +659,7 @@
uni.$u.toast('支付超时');
}, 30000)
})
}
});
} else {
@ -805,7 +673,7 @@
formData.store_id = STORE_INFO.id
if (Role.value == 1) {
// formData.recharge_type = 'INDUSTRYMEMBERS'
// formData.user_ship = formData.label_id
// formData.user_ship = 1
// vipRechargeApi(formData).then(res => {
// uni.showLoading({
// title: '...'
@ -825,7 +693,7 @@
});
formData.auth_code = res.result
formData.recharge_type = 'INDUSTRYMEMBERS'
formData.user_ship = formData.label_id
formData.user_ship = 1
vipRechargeApi(formData).then(res => {
timerInvol = setTimeout(() => {
uni.hideLoading();
@ -833,10 +701,13 @@
uni.$u.toast('支付超时');
}, 30000)
})
}
});
}
}
}
const rePay = (item) => {
@ -881,8 +752,8 @@
page_no: 1,
page_size: 25,
loadingOver: false
}
}
const count = ref(0)
const getCount = async () => {
if (Role.value == 4) return;
@ -898,21 +769,13 @@
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",
page_no: 1,
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
}
let res = await rechargeListsApi({
store_id: STORE_INFO.id,
recharge_type: "INDUSTRYMEMBERS",
page_no: 1,
page_size: 25
})
lists.value = res.data.lists
}
@ -929,15 +792,15 @@
}
onLoad(() => {
// getUserShip().then(res => {
// range.value = res.data.lists.map(item => {
// return {
// value: item.id,
// text: item.title
// }
// })f
// })
getUserShip().then(res => {
range.value = res.data.lists.map(item => {
return {
value: item.id,
text: item.title
}
})
})
getUserLabel().then(res => {
columns.value = [res.data.lists]
})
getPhoneOneDay()

View File

@ -235,21 +235,6 @@
"enablePullDownRefresh": true
}
},
{
"path": "asset/index",
"style": {
"navigationBarTitleText": "会员资产",
"enablePullDownRefresh": true
}
},
{
"path": "Gifts/index",
"style": {
"navigationBarTitleText": "赠品区",
"enablePullDownRefresh": true
}
},
{
"path": "balanceDetail/index",
"style": {

View File

@ -225,7 +225,7 @@
<view class="btn">
<up-button color="#20b128" :disabled="cartInfo.pay_price<=0" @click="settleAccounts"> 支付</up-button>
</view>
<view class="cart" @tap.stop="navTo('/pages/cart/cart')" s>
<view class="cart" @click="navTo(`/pages/cart/cart`)">
<image src="@/static/icon/cart.png"></image>
<view class="badge">{{ cartInfo.count }}</view>
</view>
@ -400,10 +400,7 @@
}
const addCart = (product_id, cart_num) => { //
console.log("触发了加入购物车")
cartCreateApi({
type: 1,
cart_num: cart_num,
is_new: 0, // 01
// goods_id: id,
@ -619,7 +616,6 @@
};
const changeGood = (data) => { //
showGoodPopup.value = false;
if (!data.types) return
if (!userStore.token) return uni.showModal({
content: '您需要先登录才可使用该功能, 是否前去登录',
success: (e) => {
@ -636,7 +632,6 @@
},
});
console.log('data', data)
addCart(data.product_id, data.cart_num);
}

View File

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

View File

@ -24,7 +24,7 @@
<template>
<view style="flex-grow: 1;overflow-y: auto;">
<view class="user-info"
:style="{backgroundImage: [0,4].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)' }">
: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)' }">
<view class="u-card">
<view style="display: flex;" @click="updataInfp">
<up-image :src="userInfo.avatar" mode="aspectFill" width="112rpx" height="112rpx"
@ -36,15 +36,17 @@
<view style="margin:0 20rpx;">
{{userInfo.id}}
</view>
<view v-if="![0,4].includes(userInfo.user_ship)"
<view
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}}会员
{{userInfo.label_name}}会员
</view>
</view>
</view>
</view>
<view class="to-vip-btn" @click="navgo('/pageQuota/vipUser/index')">
@ -70,11 +72,14 @@
<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" @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" @click="navgo('/pageQuota/balanceDetail/index?type=5')">
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')">
<view class="rest-item-num">{{userInfo.number ||"0.00"}}</view>
<view class="rest-item-txt">冻结券</view>
</view>
@ -116,8 +121,6 @@
<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="/pagesOrder/addressList/addressList"></up-cell>
<up-cell title="支付密码" :isLink="true" url="/pagesOrder/setPayPassword/index"></up-cell>
</up-cell-group>
@ -171,7 +174,7 @@
orderCountApi
} from "@/api/order.js";
import {
onLoad,
onShow,
onPullDownRefresh
} from "@dcloudio/uni-app"
import {
@ -286,15 +289,15 @@
})
}
onLoad(() => {
onShow(() => {
userInfoApi().then(res => {
userInfo.value = res.data;
formData.avatar = res.data.avatar
formData.nick_name = res.data.nickname
if (![0, 4].includes(res.data.user_ship)) {
if (res.data.user_ship == 1) {
uni.setNavigationBarColor({
frontColor: "#000000",
backgroundColor: "#EAFFE1"
backgroundColor: "#F3FCF2"
})
}
})
@ -317,7 +320,6 @@
background-size: 100% 100%;
box-sizing: border-box;
padding: 70rpx 50rpx 0 50rpx;
position: relative;
.u-card {
display: flex;
@ -344,18 +346,10 @@
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

@ -3,13 +3,13 @@
<view class="count_down" v-if="datas.paid==0&&countDown">
还剩<text>{{countDown}}</text>订单自动取消
</view>
<view class="m-card m-address" style="margin-top: 20rpx;">
<view class="m-card m-address" style="margin-top: 20rpx;" v-if="datas.is_writeoff==1">
<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>
<text style="margin: 0 10rpx;color:#20B128">核销门店</text>
</view>
<view>
<view style="color: #333;">
@ -32,13 +32,13 @@
</view> -->
</view>
</view>
<!-- <view class="m-card m-address" style="margin-top: 20rpx;" v-else>
<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;">
@ -55,8 +55,12 @@
</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>
<!-- <view class="m-card m-address" style="margin-top: 20rpx;" v-if="addressInfo && addressInfo.address_id">
<view class="address-info">
@ -262,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; //
@ -489,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()
}
@ -518,6 +522,7 @@
onBackPress(() => {
clearInterval(timer);
console.log("清除");
})
const navgo = (url) => {

View File

@ -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="710rpx" height="105rpx"></up-image>
<up-image :src="orderData.verify_img" width="404rpx" height="60rpx"></up-image>
<view style="font-weight: bold;color: #333;font-size: 26;text-align: center;margin-top: 20rpx;">
核销码 {{orderData.verify_code}}
</view>
@ -327,35 +327,27 @@
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();
}
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('用户取消支付')
}
})
}).catch(err => {
uni.$u.toast(err.msg || '网络错误')
})

View File

@ -1,7 +1,7 @@
<template>
<view class="">
<!-- <view class="m-card m-address"> -->
<!-- <view class="address-info" @click="showAddress = true">
<!-- <view class="m-card m-address">
<view class="address-info" @click="showAddress = true" v-if='orderInfo.shipping_type == 1'>
<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">
</view>
<view class="address-info" v-else>
<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,39 +30,8 @@
配送
</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;">推荐自提点</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>
@ -112,9 +81,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="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 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>
</view> -->
<view class="head-title" style="margin-top: 20rpx;">
@ -232,8 +201,7 @@
import {
userInfoApi,
addressListsApi,
merchantListApi,
checkInventoryApi
merchantListApi
} from "@/api/user.js";
import {
createOrderApi
@ -248,7 +216,7 @@
const cartStore = useCartStore();
const reservation_time = ref('')
const is_storage = ref(0)
const isCh = ref(0)
const formData = ref({
remark: ""
@ -314,8 +282,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
@ -331,19 +299,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) => {
@ -388,56 +356,24 @@
}
//
let location = {
lat: '',
long: "",
};
let reservation = ref(0);
const shop_Info = ref({})
const cartList = ref([]);
const orderInfo = ref({});
const checkOrder = (store_id) => {
const checkOrder = () => {
checkOrderApi({
cart_id: cartStore.cartList,
store_id: STORE_INFO.id || 0,
...location
store_id: STORE_INFO.id || 0
}).then(res => {
cartList.value = res.data.cart_list;
orderInfo.value = res.data.order;
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
// }
if (orderInfo.value.default_delivery == 0) {
orderInfo.value.shipping_type = 2
}
})
}
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);
@ -458,17 +394,15 @@
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,
store_id: shop_Info.value.id,
reservation_time: reservation_time.value,
shipping_type: orderInfo.value.shipping_type,
mark: formData.value.remark,
is_storage: is_storage.value
mark: formData.value.remark
}).then(res => {
if (pay_type.value == 3 || pay_type.value == 18) {
if (res.code == 1) {
@ -547,25 +481,7 @@
}
onLoad(options => {
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() {}
})
}
checkOrder();
})
onShow(() => {
getAddressList();
@ -573,17 +489,6 @@
</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;