Compare commits

...

9 Commits

Author SHA1 Message Date
zmj c899d8f472 Merge branch 'dev' of https://gitea.lihaink.cn/weipengfei/purchase-let into release 2024-07-03 09:14:27 +08:00
zmj 30ad9dfce9 add 2024-07-02 19:18:24 +08:00
zmj 39cda88ba1 add 2024-07-02 17:06:39 +08:00
zmj c53c0b8cc4 add 2024-07-02 14:04:26 +08:00
zmj 26ada06159 add 2024-07-02 10:20:26 +08:00
zmj e64727de58 add 2024-07-01 18:47:34 +08:00
zmj 68e822f33b add 2024-07-01 18:36:12 +08:00
zmj 836d546b13 add 2024-07-01 18:08:14 +08:00
zmj 00c3dc1135 add 2024-06-29 18:25:37 +08:00
17 changed files with 1096 additions and 211 deletions

View File

@ -34,3 +34,7 @@ export const setPayPassword = (data) => {
export const getFundList = (data) => { export const getFundList = (data) => {
return request.get('/user/user/fundList', 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) => { export const getVipInfoByPhone = (data) => {
return request.get('/user/user/other_user_info', 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 v-if="datas.is_bulk" class="row" style="height: 100rpx;">
<view>购买重量<text style="color: #F55726;">*</text></view> <view>购买重量<text style="color: #F55726;">*</text></view>
<view style="justify-content: end;"> <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> </view>
<view v-else class="row" style="height: 100rpx;"> <view v-else class="row" style="height: 100rpx;">
<view>购买数量<text style="color: #F55726;">*</text></view> <view>购买数量<text style="color: #F55726;">*</text></view>
<view style="justify-content: end;"> <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> </view>
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;"> <view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
@ -115,7 +115,8 @@
datas.value.cart_num = ''; datas.value.cart_num = '';
return; return;
} }
emit('change', datas.value); datas.value.types = true
emit('change', datas.value, );
} }
const subtotal = computed(() => { const subtotal = computed(() => {
@ -124,11 +125,6 @@
return Number(num * sell * 100 / 100).toFixed(2) return Number(num * sell * 100 / 100).toFixed(2)
}) })
defineExpose({ defineExpose({
setData, setData,
// founcsFn // founcsFn

View File

@ -17,7 +17,7 @@ switch (env) {
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull' WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break; break;
case 'local': 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' WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break; break;
default: default:

View File

@ -15,8 +15,8 @@
<view class="multiple-card-item-left"> <view class="multiple-card-item-left">
<view class="multiple-card-item-left-title">{{item.name}}</view> <view class="multiple-card-item-left-title">{{item.name}}</view>
<view class="multiple-card-item-left-tag"> <view class="multiple-card-item-left-tag">
<text class="yellow" v-if="item.is_store == 1">可自</text> <text class="yellow" v-if="item.reservation==1">次日可</text>
<text class="green" v-if="item.is_send == 1">可配送</text> <text class="green" v-if='item.reservation==0'>当日可提</text>
</view> </view>
<view class="multiple-card-item-left-info"> <view class="multiple-card-item-left-info">
<u-image src="../../multipleShop/images/location_small.jpg" width="24rpx" <u-image src="../../multipleShop/images/location_small.jpg" width="24rpx"
@ -66,7 +66,7 @@
onLoad, onLoad,
onShow onShow
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
let event = ''
const currShop = ref(''); // const currShop = ref(''); //
const shopList = ref([]); // const shopList = ref([]); //
const status = ref(''); // const status = ref(''); //
@ -77,31 +77,45 @@
latitude: '', latitude: '',
phone: '', phone: '',
name: '', name: '',
cart_id: "",
page_no: 1, page_no: 1,
page_size: 6 page_size: 6
}) })
// //
onLoad(() => { onLoad((opt) => {
// event = opt.event
if (opt.cart_id) queryParams.cart_id = opt.cart_id;
getLocation(); getLocation();
}); });
// //
const onChooseShop = (item) => { const onChooseShop = (item) => {
let {
id,
name,
phone,
detailed_address
} = item
uni.$emit(event, JSON.stringify({
id,
name,
phone,
detailed_address
}))
uni.navigateBack()
return return
currShop.value = item.id; // currShop.value = item.id;
uni.setStorageSync('STORE_INFO', JSON.stringify(item)); // uni.setStorageSync('STORE_INFO', JSON.stringify(item));
// , // uni.removeStorageSync('SHARE_INFO');
uni.removeStorageSync('SHARE_INFO'); // setTimeout(() => {
setTimeout(() => { // uni.reLaunch({
uni.reLaunch({ // url: '/pages/index/index?id=' + item.id,
url: '/pages/index/index?id=' + item.id, // fail(err) {
fail(err) { // console.log(err);
console.log(err); // }
} // })
}) // }, 300)
}, 300)
} }
// //
@ -162,8 +176,9 @@
const getLocation = () => { const getLocation = () => {
let location = uni.getStorageSync('location'); let location = uni.getStorageSync('location');
if (location) { if (location) {
queryParams.longitude = location.lat location = JSON.parse(location);
queryParams.latitude = location.long queryParams.longitude = location.long
queryParams.latitude = location.lat
// //
getShopList(); getShopList();
} else { } else {
@ -172,16 +187,19 @@
success(res) { success(res) {
queryParams.latitude = res.latitude; queryParams.latitude = res.latitude;
queryParams.longitude = res.longitude; queryParams.longitude = res.longitude;
// //
getShopList(); getShopList();
// //
uni.setStorageSync('location', { uni.setStorageSync('location', JSON.stringify({
lat: queryParams.latitude, lat: queryParams.latitude,
long: queryParams.longitude long: queryParams.longitude
}) }, ))
},
fail() {
console.log("获取定位失败")
getShopList();
} }
}) })
} }
} }
@ -259,7 +277,7 @@
margin-bottom: 16rpx; margin-bottom: 16rpx;
text { text {
width: 90rpx; width: 120rpx;
height: 42rpx; height: 42rpx;
line-height: 42rpx; line-height: 42rpx;
text-align: center; text-align: center;

288
pageQuota/Gifts/index.vue Normal file
View File

@ -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>

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

@ -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>

View File

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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@
<template> <template>
<view style="flex-grow: 1;overflow-y: auto;"> <view style="flex-grow: 1;overflow-y: auto;">
<view class="user-info" <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: [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)' }">
<view class="u-card"> <view class="u-card">
<view style="display: flex;" @click="updataInfp"> <view style="display: flex;" @click="updataInfp">
<up-image :src="userInfo.avatar" mode="aspectFill" width="112rpx" height="112rpx" <up-image :src="userInfo.avatar" mode="aspectFill" width="112rpx" height="112rpx"
@ -36,17 +36,15 @@
<view style="margin:0 20rpx;"> <view style="margin:0 20rpx;">
{{userInfo.id}} {{userInfo.id}}
</view> </view>
<view <view v-if="![0,4].includes(userInfo.user_ship)"
style="display: flex;align-items: center;background-color: #F6EECD;padding: 4rpx 10rpx;border-radius: 20rpx;"> style="display: flex;align-items: center;background-color: #F6EECD;padding: 4rpx 10rpx;border-radius: 20rpx;">
<view style="margin-right: 10rpx;"> <view style="margin-right: 10rpx;">
<up-icon <up-icon
name="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/e8621202406281618363287.png"></up-icon> name="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/e8621202406281618363287.png"></up-icon>
</view> </view>
{{userInfo.label_name}}会员 {{userInfo.vip_name}}会员
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="to-vip-btn" @click="navgo('/pageQuota/vipUser/index')"> <view class="to-vip-btn" @click="navgo('/pageQuota/vipUser/index')">
@ -72,14 +70,11 @@
<view class="rest-item-num">{{userInfo.return_money||'0.00'}}</view> <view class="rest-item-num">{{userInfo.return_money||'0.00'}}</view>
<view class="rest-item-txt">返还金</view> <view class="rest-item-txt">返还金</view>
</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" @click="navgo('/pageQuota/balanceDetail/index?type=3')">
<view class="rest-item-num">{{userInfo.GetNumber ||"0.00"}}</view> <view class="rest-item-num">{{userInfo.GetNumber ||"0.00"}}</view>
<view class="rest-item-txt">礼品券</view> <view class="rest-item-txt">礼品券</view>
</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-num">{{userInfo.number ||"0.00"}}</view>
<view class="rest-item-txt">冻结券</view> <view class="rest-item-txt">冻结券</view>
</view> </view>
@ -121,6 +116,8 @@
<view class="card"> <view class="card">
<up-cell-group> <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/addressList/addressList"></up-cell>
<up-cell title="支付密码" :isLink="true" url="/pagesOrder/setPayPassword/index"></up-cell> <up-cell title="支付密码" :isLink="true" url="/pagesOrder/setPayPassword/index"></up-cell>
</up-cell-group> </up-cell-group>
@ -174,7 +171,7 @@
orderCountApi orderCountApi
} from "@/api/order.js"; } from "@/api/order.js";
import { import {
onShow, onLoad,
onPullDownRefresh onPullDownRefresh
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
import { import {
@ -289,15 +286,15 @@
}) })
} }
onShow(() => { onLoad(() => {
userInfoApi().then(res => { userInfoApi().then(res => {
userInfo.value = res.data; userInfo.value = res.data;
formData.avatar = res.data.avatar formData.avatar = res.data.avatar
formData.nick_name = res.data.nickname formData.nick_name = res.data.nickname
if (res.data.user_ship == 1) { if (![0, 4].includes(res.data.user_ship)) {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: "#000000", frontColor: "#000000",
backgroundColor: "#F3FCF2" backgroundColor: "#EAFFE1"
}) })
} }
}) })
@ -320,6 +317,7 @@
background-size: 100% 100%; background-size: 100% 100%;
box-sizing: border-box; box-sizing: border-box;
padding: 70rpx 50rpx 0 50rpx; padding: 70rpx 50rpx 0 50rpx;
position: relative;
.u-card { .u-card {
display: flex; display: flex;
@ -346,10 +344,18 @@
height: 34rpx; height: 34rpx;
background-color: #39BE40; background-color: #39BE40;
border-radius: 30rpx; border-radius: 30rpx;
z-index: 2;
} }
} }
.logo {
position: absolute;
width: 236rpx;
height: 236rpx;
right: 20rpx;
z-index: 1;
opacity: 0.5
}
.balance { .balance {
display: flex; display: flex;

View File

@ -3,13 +3,13 @@
<view class="count_down" v-if="datas.paid==0&&countDown"> <view class="count_down" v-if="datas.paid==0&&countDown">
还剩<text>{{countDown}}</text>订单自动取消 还剩<text>{{countDown}}</text>订单自动取消
</view> </view>
<view class="m-card m-address" style="margin-top: 20rpx;" v-if="datas.is_writeoff==1"> <view class="m-card m-address" style="margin-top: 20rpx;">
<view class="address-info" <view class="address-info"
style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;' style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;'
@click="callPhone(store_info.phone)"> @click="callPhone(store_info.phone)">
<view class="top" style="align-items: flex-start;"> <view class="top" style="align-items: flex-start;">
<view style="color: #333;display: flex;align-items: center;flex-shrink: 0;"> <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> <view>
<view style="color: #333;"> <view style="color: #333;">
@ -32,13 +32,13 @@
</view> --> </view> -->
</view> </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" <view class="address-info"
style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;' style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;'
@click="callPhone(shopInfo.phone)"> @click="callPhone(shopInfo.phone)">
<view class="top" style="align-items: flex-start;"> <view class="top" style="align-items: flex-start;">
<view style="color: #333;display: flex;align-items: center;flex-shrink: 0;"> <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 v-if="shopInfo.id"> <view v-if="shopInfo.id">
<view style="color: #333;"> <view style="color: #333;">
@ -55,12 +55,8 @@
</view> </view>
</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> </view> -->
<!-- <view class="m-card m-address" style="margin-top: 20rpx;" v-if="addressInfo && addressInfo.address_id"> <!-- <view class="m-card m-address" style="margin-top: 20rpx;" v-if="addressInfo && addressInfo.address_id">
<view class="address-info"> <view class="address-info">
@ -266,7 +262,7 @@
const getDetails = () => { const getDetails = () => {
orderDetailApi({ orderDetailApi({
order_id: datas.value.id, order_id: datas.value.id,
...location // ...location
}).then(res => { }).then(res => {
datas.value = res.data; datas.value = res.data;
options.code = datas.value.verify_code; // options.code = datas.value.verify_code; //
@ -493,19 +489,19 @@
} }
const getLocation = () => { const getLocation = () => {
if (uni.getStorageSync('location')) { // if (uni.getStorageSync('location')) {
location = uni.getStorageSync('location') // location = uni.getStorageSync('location')
} else { // } else {
uni.getLocation({ // uni.getLocation({
type: "gcj02", // type: "gcj02",
success(res) { // success(res) {
location.lat = res.latitude; // location.lat = res.latitude;
location.long = res.longitude; // location.long = res.longitude;
uni.setStorageSync('location', location) // uni.setStorageSync('location', location)
return getDetails() // return getDetails()
} // }
}) // })
} // }
getDetails() getDetails()
} }
@ -522,7 +518,6 @@
onBackPress(() => { onBackPress(() => {
clearInterval(timer); clearInterval(timer);
console.log("清除");
}) })
const navgo = (url) => { const navgo = (url) => {

View File

@ -107,7 +107,7 @@
<view class="mask" v-if='showVerifyPop' @click="showVerifyPop=false"> <view class="mask" v-if='showVerifyPop' @click="showVerifyPop=false">
<view <view
style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);background-color: white;padding: 20rpx;"> 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;"> <view style="font-weight: bold;color: #333;font-size: 26;text-align: center;margin-top: 20rpx;">
核销码 {{orderData.verify_code}} 核销码 {{orderData.verify_code}}
</view> </view>
@ -327,27 +327,35 @@
mer_id: e.merchant, mer_id: e.merchant,
pay_type: e.pay_type pay_type: e.pay_type
}).then(res => { }).then(res => {
if (!res.data?.nonceStr) return uni.$u.toast('支付失败!'); if (res.data?.nonceStr) {
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', provider: 'wxpay',
timeStamp: res.data.timeStamp, timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr, nonceStr: res.data.nonceStr,
package: res.data.package, package: res.data.package,
signType: res.data.signType, signType: res.data.signType,
paySign: res.data.paySign, paySign: res.data.paySign,
success: (e) => { success: (e) => {
if (e.errMsg == 'requestPayment:ok') { if (e.errMsg == 'requestPayment:ok') {
uni.showToast({ uni.showToast({
title: '订单支付成功', title: '订单支付成功',
icon: 'success' icon: 'success'
}) })
reloadAll(); reloadAll();
} else uni.$u.toast('支付失败') } else uni.$u.toast('支付失败')
}, },
fail: (e) => { fail: (e) => {
uni.$u.toast('用户取消支付') uni.$u.toast('用户取消支付')
} }
}) })
} else {
uni.showToast({
title: '订单支付成功',
icon: 'success'
})
reloadAll();
}
}).catch(err => { }).catch(err => {
uni.$u.toast(err.msg || '网络错误') uni.$u.toast(err.msg || '网络错误')
}) })

View File

@ -1,7 +1,7 @@
<template> <template>
<view class=""> <view class="">
<!-- <view class="m-card m-address"> <!-- <view class="m-card m-address"> -->
<view class="address-info" @click="showAddress = true" v-if='orderInfo.shipping_type == 1'> <!-- <view class="address-info" @click="showAddress = true">
<view class="top"> <view class="top">
<up-icon name="account"></up-icon> <up-icon name="account"></up-icon>
<view class="t-name">{{ addressInfo.real_name }}</view> <view class="t-name">{{ addressInfo.real_name }}</view>
@ -10,16 +10,16 @@
<view class="bottom u-line-2"> <view class="bottom u-line-2">
{{ addressInfo.detail }} {{ addressInfo.detail }}
</view> </view>
</view> </view> -->
<view class="address-info" v-else> <!-- <view class="address-info">
<view class="top"> <view class="top">
{{ STORE_INFO.name }} {{ STORE_INFO.name }}是的
</view> </view>
<view class="bottom u-line-2"> <view class="bottom u-line-2">
{{ STORE_INFO.detailed_address }} {{ STORE_INFO.detailed_address }}
</view> </view>
</view> </view> -->
<view class="address-btn item-center"> <!-- <view class="address-btn item-center">
<view class='ship-type' style=""> <view class='ship-type' style="">
<view class="ship-type-item" :class='{ actShipItem: orderInfo.shipping_type == 2 }' <view class="ship-type-item" :class='{ actShipItem: orderInfo.shipping_type == 2 }'
@click='orderInfo.shipping_type = 2'> @click='orderInfo.shipping_type = 2'>
@ -30,8 +30,39 @@
配送 配送
</view> </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;">
<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> -->
<view class="m-card m-good" v-for="(item, index) in cartList" :key="index"> <view class="m-card m-good" v-for="(item, index) in cartList" :key="index">
<view class="image"> <view class="image">
<up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image> <up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image>
@ -81,9 +112,9 @@
<view class="m-card order-remark"> <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> <text style="margin-right: 20rpx;">是否存货</text>
<up-radio-group v-model="isCh" placement="row"> <up-radio-group v-model="is_storage" placement="row">
<up-radio activeColor="#20b128" label="是" name="1" style="margin-right: 10rpx;"></up-radio> <up-radio activeColor="#20b128" label="立即提货" :name="0" style="margin-right: 10rpx;"></up-radio>
<up-radio activeColor="#20b128" label="否" name="0"></up-radio> <up-radio activeColor="#20b128" label="全部存货" :name="1"></up-radio>
</up-radio-group> </up-radio-group>
</view> --> </view> -->
<view class="head-title" style="margin-top: 20rpx;"> <view class="head-title" style="margin-top: 20rpx;">
@ -201,7 +232,8 @@
import { import {
userInfoApi, userInfoApi,
addressListsApi, addressListsApi,
merchantListApi merchantListApi,
checkInventoryApi
} from "@/api/user.js"; } from "@/api/user.js";
import { import {
createOrderApi createOrderApi
@ -216,7 +248,7 @@
const cartStore = useCartStore(); const cartStore = useCartStore();
const reservation_time = ref('') const reservation_time = ref('')
const isCh = ref(0) const is_storage = ref(0)
const formData = ref({ const formData = ref({
remark: "" remark: ""
@ -282,8 +314,8 @@
const getMerchantList = (mer_name = null) => { const getMerchantList = (mer_name = null) => {
merchantListApi({ merchantListApi({
...myAddressInfo.value, // ...myAddressInfo.value,
mer_name: mer_name ? mer_name : '' // mer_name: mer_name ? mer_name : ''
}).then(res => { }).then(res => {
merchantList.value = res.data.lists; merchantList.value = res.data.lists;
if (mer_name === null && myAddressInfo.value.long && merchantList.value.length > 0 && !shopInfo if (mer_name === null && myAddressInfo.value.long && merchantList.value.length > 0 && !shopInfo
@ -299,19 +331,19 @@
// getMerchantList(); // getMerchantList();
// //
const LoadAddress = () => { // const LoadAddress = () => {
uni.getLocation({ // uni.getLocation({
success: (res) => {}, // success: (res) => {},
fail: (err) => { // fail: (err) => {
uni.$u.toast('定位失败, 请手动选择提货点!') // uni.$u.toast(', !')
}, // },
complete: (res) => { // complete: (res) => {
myAddressInfo.value.long = res.longitude || ""; // myAddressInfo.value.long = res.longitude || "";
myAddressInfo.value.lat = res.latitude || ""; // myAddressInfo.value.lat = res.latitude || "";
getMerchantList(); // getMerchantList();
} // }
}) // })
} // }
// LoadAddress(); // LoadAddress();
const changeShop = (e) => { const changeShop = (e) => {
@ -356,23 +388,55 @@
} }
// //
let location = {
lat: '',
long: "",
};
let reservation = ref(0);
const shop_Info = ref({})
const cartList = ref([]); const cartList = ref([]);
const orderInfo = ref({}); const orderInfo = ref({});
const checkOrder = () => { const checkOrder = (store_id) => {
checkOrderApi({ checkOrderApi({
cart_id: cartStore.cartList, cart_id: cartStore.cartList,
store_id: STORE_INFO.id || 0 store_id: STORE_INFO.id || 0,
...location
}).then(res => { }).then(res => {
cartList.value = res.data.cart_list; cartList.value = res.data.cart_list;
orderInfo.value = res.data.order; orderInfo.value = res.data.order;
if (orderInfo.value.default_delivery == 0) { shop_Info.value = res.data.shopInfo || {}
orderInfo.value.shipping_type = 2 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); const passwordBoardVisible = ref(false);
@ -394,15 +458,17 @@
const payFn = () => { const payFn = () => {
let shareInfo = uni.getStorageSync('SHARE_INFO'); let shareInfo = uni.getStorageSync('SHARE_INFO');
createOrderApi({ createOrderApi({
reservation: reservation.value,
password: password.value, password: password.value,
spread_uid: (shareInfo && shareInfo.uid) ? shareInfo.uid : '', spread_uid: (shareInfo && shareInfo.uid) ? shareInfo.uid : '',
cart_id: cartStore.cartList, cart_id: cartStore.cartList,
address_id: addressInfo.value.address_id, address_id: addressInfo.value.address_id,
pay_type: pay_type.value, pay_type: pay_type.value,
store_id: STORE_INFO.id || 0, store_id: STORE_INFO.id || 0,
reservation_time: reservation_time.value, store_id: shop_Info.value.id,
shipping_type: orderInfo.value.shipping_type, shipping_type: orderInfo.value.shipping_type,
mark: formData.value.remark mark: formData.value.remark,
is_storage: is_storage.value
}).then(res => { }).then(res => {
if (pay_type.value == 3 || pay_type.value == 18) { if (pay_type.value == 3 || pay_type.value == 18) {
if (res.code == 1) { if (res.code == 1) {
@ -481,7 +547,25 @@
} }
onLoad(options => { 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(() => { onShow(() => {
getAddressList(); getAddressList();
@ -489,6 +573,17 @@
</script> </script>
<style lang="scss"> <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 { .m-card {
margin: 20rpx; margin: 20rpx;
border-radius: 14rpx; border-radius: 14rpx;