Compare commits

...

14 Commits

Author SHA1 Message Date
mkm d404316141 Merge pull request 'feat: 修改配置文件和页面逻辑,优化商品采购和订单获取功能' (#4) from dev into product
Reviewed-on: #4
2024-09-17 11:33:40 +08:00
mkm cf972be23f feat: 修改配置文件和页面逻辑,优化商品采购和订单获取功能 2024-09-17 11:32:33 +08:00
mkm 3bb57fb887 feat: 优化商品弹窗逻辑,添加商品规格和价格展示 2024-09-14 17:51:32 +08:00
mkm b8806a4cad Merge branch 'dev' of https://gitea.lihaink.cn/weipengfei/purchase-let into product 2024-09-14 09:14:50 +08:00
mkm 0956a9dbd5 feat: 修改配置文件和页面逻辑,优化商品采购和订单获取功能 2024-09-14 09:13:05 +08:00
mkm eae6bf36da feat: 优化商品弹窗逻辑,添加商品规格和价格展示 2024-09-13 22:00:07 +08:00
mkm 742402180b feat: 添加新功能和优化现有逻辑,增强用户体验 2024-09-03 17:14:27 +08:00
mkm e665c4ced7 feat: 修改配置文件和页面逻辑,优化门店信息获取功能 2024-08-19 22:44:31 +08:00
mkm d4e222e0b6 1 2024-08-19 18:29:46 +08:00
mkm 6b68c8f916 1 2024-08-16 18:02:02 +08:00
mkm 3dd2ed5777 feat: 修改配置文件和页面逻辑,优化门店信息获取功能 2024-08-16 09:00:46 +08:00
mkm d7255d9690 feat: 添加采购商品列表和获取功能,优化订单获取逻辑 2024-08-14 22:59:44 +08:00
mkm 937730558c feat: 添加采购商品列表和获取功能 2024-08-14 18:01:44 +08:00
mkm b11e4aa681 feat: 添加新订单列表和支付功能,优化订单获取逻辑 2024-08-13 18:03:39 +08:00
28 changed files with 2187 additions and 408 deletions

View File

@ -21,7 +21,12 @@ export const cartListApi = (data) => {
noAuth: true
});
}
//购物车-批发列表
export const cartWholesaleListApi = (data) => {
return request.get('/order/cart/wholesale_lists', data, {
noAuth: true
});
}
//购物车-常买记录
export const frequentlyPurchaseApi = (data) => {
return request.get('/order/order/frequently_purchase', data);

View File

@ -11,3 +11,10 @@ export const goodClassListApi = (data) => {
export const storeProductListApi = (data) => {
return request.get('/product/product/store_lists', data);
}
/**
* 批发商品列表
*/
export const storeProductWholesaleListApi = (data) => {
return request.get('/product/product/wholesale_lists', data);
}

View File

@ -9,6 +9,10 @@ export const createOrderApi = (data) => {
export const orderListApi = (data) => {
return request.get('/order/order/order_list', data);
}
//门店订单列表
export const storeOrderListApi = (data) => {
return request.get('/order/order/store_order_list', data);
}
//订单详情
export const orderDetailApi = (data) => {

View File

@ -0,0 +1,9 @@
import request from '@/utils/request';
export const purchaseProductOfferLists = (data) => {
return request.get('/purchase_product_offer/purchaseproductoffer/lists', data);
}
//报价单提交
export const purchaseProductOfferUpdate = (data) => {
return request.post('/purchase_product_offer/purchaseproductoffer/offer_update', data);
}

View File

@ -185,3 +185,9 @@ export const CashApplicationApi = (data) => {
export const getCashRecordApi = (data) => {
return request.get('/user/User/cash_record', data);
}
/**
* 提交身份证
*/
export const UpdateIdCardApi = (data) => {
return request.post('/user/User/update_id_card', data);
}

View File

@ -6,38 +6,36 @@
</view>
<view class="row">
<view>商品名称</view>
<view>{{ datas.name || datas.goods_name || datas.store_name }}</view>
</view>
<view class="row" v-if="datas.store_info">
<view>商品规格</view>
<view>{{ datas.store_info}}</view>
</view>
<view class="row">
<view>商品单位</view>
<view>{{ datas.unit_name }}</view>
</view>
<view class="row">
<view>商品价格</view>
<view>¥ {{priceKey.off_activity==1? datas[priceKey.price]: datas[priceKey.op_price] }} /
{{ datas.unit_name }}
</view>
</view>
<view class="row" v-if="datas.batch > 0">
<view>起批量</view>
<view>{{ datas.batch }}{{ datas.unit_name }}起批 </view>
<view>{{ datas.sku_name}}</view>
</view>
<view class="row">
<view>小计</view>
<view style="color: #F55726;" v-if="+datas.cart_num < +datas.batch">
{{ `${datas.batch}${datas.unit_name}起批` }}
<view style="border-bottom: 1rpx solid #f6f6f6;margin-bottom: 0.625rem;padding-bottom: 0.625rem;">
<view class="u-page__tag-item" v-for="(item, index) in attr_value" :key="index">
<up-tag :text="item.sku_name" :plain="checkedProduct!=index" type="success" :name="index"
@click="radioClick" size="large">
</up-tag>
</view>
<view style="color: #F55726;" v-else>¥ {{ subtotal }}</view>
</view>
<!-- <view class="row">
<view>商品价格</view>
<view>¥ {{price}}/
</view>
</view> -->
<!-- <view class="row" v-if="datas.batch > 0">
<view>起批量</view>
<view>{{ datas.batch }}{{ datas.unit_name }}起批 </view>
</view> -->
<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-input type="digit" placeholder="请输入重量" border="surround" v-model="datas.cart_num"
@change="valChange" style="width: 100rpx;">
<!-- <template #suffix>
<span>{{ datas.unit_name }}</span>
</template> -->
</up-input>
<!-- <up-number-box :min="0.1" :step="0.1" v-model="datas.cart_num" @change="valChange"></up-number-box> -->
</view>
</view>
<view v-else class="row" style="height: 100rpx;">
@ -46,6 +44,13 @@
<up-number-box :min="0" v-model="datas.cart_num" @change="valChange"></up-number-box>
</view>
</view>
<view class="row">
<view>小计</view>
<view style="color: #F55726;" v-if="+datas.cart_num < +datas.batch">
{{ `${datas.batch}${datas.unit_name}起批` }}
</view>
<view style="color: #F55726;" v-else>¥ {{ subtotal }}</view>
</view>
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
<view style="width: 30%;margin-right: 30rpx;">
<up-button @click="close" color="#f7f7f7"><text style="color: #333;">取消</text></up-button>
@ -66,6 +71,8 @@
} from "vue"
const foucs1 = ref(null)
const checkedProduct = ref(0)
const price = ref(0)
const props = defineProps({
show: {
type: Boolean,
@ -78,17 +85,22 @@
})
const valChange = () => {
const valChange = (e) => {
uni.vibrateShort();
}
const datas = ref({
cart_num: ''
});
const attr_value = ref({});
const setData = (e) => {
datas.value = e;
if (Number(e.batch) > 0) datas.value.cart_num = e.batch;
else datas.value.cart_num = 1;
datas.value = e.attr_value[0]
attr_value.value = e.attr_value
if (Number(e.attr_value[0].batch) > 0) {
datas.value.cart_num = e.attr_value[0].batch;
} else {
datas.value.cart_num = 1;
}
}
@ -96,7 +108,15 @@
const close = () => {
emit('close');
}
const radioClick = (key) => {
checkedProduct.value = key
datas.value = attr_value.value[key]
if (Number(datas.value.batch) > 0) {
datas.value.cart_num = datas.value.batch;
} else {
datas.value.cart_num = 1;
}
};
const change = () => {
if (+datas.value.cart_num < +datas.value.batch) return uni.$u.toast(
`购买数量不能小于${datas.value.batch}${datas.value.unit_name}`);
@ -114,6 +134,11 @@
let sell = +datas.value[props.priceKey.off_activity == 1 ? props.priceKey.price : props
.priceKey
.op_price];
if (!sell) {
sell = datas.value.price
num = datas.value.cart_num
}
return Number(num * sell * 100 / 100).toFixed(2)
})
@ -174,4 +199,9 @@
/* 缩小 */
}
}
.u-page__tag-item {
display: inline-block;
margin-right: 10rpx;
}
</style>

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.231:8545';
BASE_URL = 'http://192.168.1.5:8545';
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break;
default:
@ -33,6 +33,7 @@ let config = {
WSS_URL: WSS_URL,
HEADER: {
'content-type': 'application/json',
'accept':'json',
//#ifdef MP
'Form-type': 'routine',
//#endif

View File

@ -0,0 +1,254 @@
<template>
<view>
<view class="content">
<up-transition :show="true" mode="slide-left">
<view v-if="goodsList1.length>0">
<view class="card" v-for="(item,index) in goodsList1" :key='index'>
<view class="head">
<!-- <text> {{orer_sn}}</text> -->
<!-- <text style="color: #989898;">{{time}}</text> -->
</view>
<view class="card-content">
<view class="card-content-l" style="width: 152rpx;height: 152rpx;">
<image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image>
</view>
<view class="card-content-r">
<view class="title ellipsis">
{{item.store_name}}
</view>
<view>
单位:{{item.unit_name}}
</view>
<view>
规格:{{item.store_info}}
</view>
<view style="color: red;">
需求量 {{item.need_num}}
</view>
</view>
</view>
<view class="card-footer">
<up-button size="small" type="primary" shape="circle"
@click="cancleOrder(item)" v-if="item.buyer_confirm==0">确认已采购</up-button>
<up-button size="small" type="success" shape="circle"
v-else disabled >{{item.buyer_confirm_name}}</up-button>
</view>
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
</view>
</view>
<up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty>
<!-- <button @click="test2">叫我按钮</button> -->
</up-transition>
<up-modal :show="show" title="采购确认" showCancelButton @cancel="show=false" @confirm="offerUpdate()">
<up-form labelPosition="left">
<up-form-item label="名称">
<up-input v-model="formData.store_name" border="none"></up-input>
</up-form-item>
<up-form-item label="数量">
<up-input v-model="formData.nums" border="none" @change='changeInputPrice'></up-input>
</up-form-item>
<up-form-item label="单价">
<up-input v-model="formData.price" border="none" @change='changeInputPrice'></up-input>
</up-form-item>
<up-form-item label="总价">
<up-input v-model="formData.total_price" border="none"></up-input>
</up-form-item>
</up-form>
</up-modal>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive,
} from "vue"
import {
purchaseProductOfferLists,
purchaseProductOfferUpdate
} from "@/api/purchase_product_offer.js"
const test2 = () => {
console.log("点解")
uni.navigateTo({
url: '/pages/index/index'
})
}
const show = ref(false)
const formData = ref({
"id": '',
"store_name": '',
'product_id': '',
'nums': '',
'price': '',
'total_price':''
})
// tabsindex
const tabIndex = ref(1)
const {
windowWidth
} = uni.getSystemInfoSync();
const tabsLeft = ref(((windowWidth / 2) - 26) / 2)
const tabsRight = ref(tabsLeft.value + (windowWidth / 2))
// tabsindex
const priceBlur = (index, goodsList) => {
goodsList[index].price = Number(goodsList[index].price).toFixed(2)
}
//
const showGoods = ref(false)
const showGoods1 = ref(false)
const goodsList = ref([])
const goodsList1 = ref([])
const getGoodsList = async () => {
let res = await purchaseProductOfferLists({})
goodsList1.value = res.data.lists
}
const cancleOrder = (item) => {
show.value = true
formData.value.store_name = item['store_name']
formData.value.id = item['id']
formData.value.nums = item['need_num']
formData.value.product_id = item['product_id']
}
const offerUpdate = () => {
purchaseProductOfferUpdate(formData.value).then(res=>{
uni.$u.toast(res.msg);
show.value=false
getGoodsList()
})
}
const changeInputPrice=(e)=>{
if(formData.value.nums>0 && formData.value.price>0){
formData.value.total_price=formData.value.nums*formData.value.price
}
}
getGoodsList()
</script>
<style lang="scss">
.head {
padding: 20rpx;
background-color: white;
position: relative;
.act {
color: #20B128;
}
.line {
width: 26px;
height: 5rpx;
background-color: #20B128;
border-radius: 50rpx;
position: absolute;
transition: 300ms;
}
}
.content {
padding: 20rpx;
padding-bottom: 150rpx;
.card {
width: 710rpx;
margin: 0 auto;
padding: 20rpx;
box-sizing: border-box;
background-color: white;
.card-content {
display: flex;
position: relative;
.card-content-l {
margin-right: 20rpx;
position: relative;
.status {
width: 152rpx;
height: 40rpx;
background-color: rgba(0, 0, 0, .3);
text-align: center;
color: white;
font-size: 24rpx;
line-height: 40rpx;
position: absolute;
bottom: 0;
}
}
.card-content-r {
display: flex;
flex-direction: column;
justify-content: space-between;
.title {
font-size: 30rpx;
width: 500rpx;
}
.need {
color: #777777;
font-size: 24rpx;
}
.ipt {
display: flex;
height: 56rpx;
}
}
.status-png {
position: absolute;
right: 20rpx;
}
}
.card-footer {
margin-top: 30rpx;
text-align: right;
font-size: 28rpx;
color: #060606;
}
}
.submit-btn {
position: fixed;
bottom: 50rpx;
width: 710rpx;
margin: 0 auto;
}
}
.detail {
width: 88rpx;
height: 88rpx;
border-radius: 88rpx;
text-align: center;
line-height: 88rpx;
background-color: #50C758;
color: white;
position: absolute;
bottom: 300rpx;
right: 20rpx;
}
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

View File

@ -121,6 +121,13 @@
{
"navigationBarTitleText" : "提现申请记录"
}
},
{
"path" : "pages/wholesale/index",
"style" :
{
"navigationBarTitleText" : "批发"
}
}
],
"subPackages": [{
@ -202,7 +209,7 @@
"path" : "delivery/index",
"style" :
{
"navigationBarTitleText" : "配送员订单"
"navigationBarTitleText" : "门店订单"
}
}
]
@ -306,6 +313,13 @@
"navigationBarTitleText": "余额明细",
"enablePullDownRefresh": true
}
},
{
"path" : "purchase_product_offer/index",
"style" :
{
"navigationBarTitleText" : "采购商品列表"
}
}
]
}

View File

@ -29,7 +29,7 @@
</view>
<view class="afterSales-goods-right-info">
<text class="goods_desc">{{item.unit}}</text>
<text class="goods_num">x5</text>
<text class="goods_num">x{{item.cart_num}}</text>
</view>
</view>
</view>

View File

@ -33,7 +33,7 @@
<view class="shop-content">
<view class="title">
<view class="name u-line-2">{{item.goods_name}}</view>
<view class="tip u-line-1">{{item.unit_name}}</view>
<view class="tip u-line-1">{{item.sku_name}}</view>
<view v-if="priceKey.off_activity==1" class="tip u-line-1">原价<text
style="text-decoration: line-through;">{{item[priceKey.op_price]}}</text>
</view>
@ -41,7 +41,7 @@
<view class="price-btn">
<view class="price">{{item[priceKey.price]}}</view>
<view class="btn">
<view class="num">{{item.cart_num}}</view>
<view class="num">{{item.cart_num}}/{{item.unit_name}}</view>
<u--icon name="plus-circle-fill" size="20" color="#20b128"></u--icon>
</view>
</view>
@ -244,7 +244,7 @@
const cartList = ref([]);
const cartInfo = ref({});
const getcartList = (check = true) => {
cartListApi().then(res => {
cartListApi({store_id:STORE_INFO.id}).then(res => {
if (check) {
res.data.lists = res.data.lists.map(item => {
item.check = true;

View File

@ -23,21 +23,16 @@
<template #left>
<view class="store-info">
<view style="display: flex;font-size: 30rpx;font-weight: bold;">
<!-- <text v-if=" vipList.includes(userStore.userInfo.user_ship) || shareInfo.store_id"
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
<text v-if="vipList.includes(userStore.userInfo.user_ship)">
{{ (userStore.userInfo.real_name || userStore.userInfo.nickname) + '的个人门店' }}</text>
<text v-else>
{{(shareInfo.real_name || (userStore.userInfo.real_name || userStore.userInfo.nickname)) + '的供销店' }}</text>
</text> -->
<text v-if="shareInfo.uid"
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="navgo('/multipleShop/index/index?event=store_info')">
{{shareInfo.real_name}}
</text>
<text v-else
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"
@click="navgo('/multipleShop/index/index?event=store_info')">{{
STORE_INFO.store_name }}</text>
<up-icon name="arrow-right"></up-icon>
<up-icon name="arrow-right" label="切换" labelSize="10px"
@click="navgo('/multipleShop/index/index?event=store_info')"></up-icon>
</view>
</view>
</template>
@ -187,6 +182,10 @@
<view class="shop-content-li-r" style="color:#FC452F ;"><text
style="font-size: 28rpx;">{{item[priceKey.op_price]}}</text>
</view>
<view class="tag" v-if="item.tag">
<view class="icon" />
{{item.tag}}
</view>
</view>
<view class="shop-content-li" style="justify-content: space-between;"
@ -207,7 +206,8 @@
</view> -->
</view>
<view class="shopconetent-btn">
<u--icon name="plus-circle-fill" size="20" color="#20b128"></u--icon>
<u--icon name="plus-circle-fill" size="20" color="#20b128" v-if="item.is_lack==0"></u--icon>
<u--icon name="plus-circle-fill" size="20" color="#c1ffc0" v-else></u--icon>
</view>
</view>
</view>
@ -258,6 +258,20 @@
</view>
</view>
</u-overlay>
<up-popup :show="LocationShow" mode="bottom" @open="LocationShowOpen()">
<view style="margin: 40rpx 10rpx;">
<up-row customStyle="margin-bottom: 10px" gutter="10">
<up-col span="6">
<up-button text="取消" @click="userLocationfalse()"></up-button>
</up-col>
<up-col span="6">
<up-button type="primary" text="设置授权" color="#20B128" @click="opensettings()"></up-button>
</up-col>
</up-row>
</view>
</up-popup>
</view>
</template>
@ -298,11 +312,17 @@
} from "@/api/multipleShop.js";
import useUserStore from "@/store/user";
//
let location = {
lat: '',
long: "",
};
const vipList = reactive([1, 2, 3, 4, 5, 6, 7, 8])
const userStore = useUserStore();
const STORE_INFO = reactive({
id: '',
store_name: ""
store_name: "",
abbreviation: ''
})
const priceKey = reactive({
off_activity: "",
@ -310,31 +330,56 @@
price: ""
})
const showModal = ref(false)
const navgo = (url) => {
showModal.value &&= false
uni.navigateTo({
url
})
}
const LocationShow = ref(false)
uni.$on('store_info', function(data) {
let datas = JSON.parse(data)
if (datas) {
datas.store_name = datas.name
uni.setStorageSync("STORE_INFO", JSON.stringify(datas));
STORE_INFO.id = datas.id
STORE_INFO.store_name = datas.name
STORE_INFO.abbreviation = datas.abbreviation
shareInfo.value.real_name = datas.name
shareInfo.value.store_id = datas.id
}
getgoodClassList(0)
getGoodList()
})
const getStoreInfoFn = () => {
if (uni.getStorageSync('STORE_INFO').length) {
let data = JSON.parse(uni.getStorageSync('STORE_INFO'))
for (let key in data) {
STORE_INFO[key] = data[key]
}
}
} else {
getStoreInfo().then(res => {
uni.setStorageSync("STORE_INFO", JSON.stringify(res.data));
let data = res.data;
for (let key in data) {
STORE_INFO[key] = data[key]
}
getgoodClassList(0);
getGoodList();
})
}
getAll()
}
//
onShareAppMessage(() => {
let shareStr = '?id=' + STORE_INFO.id;
if (vipList.includes(userStore.userInfo.user_ship)) {
shareStr = shareStr + '&spread_uid=' + userStore.userInfo.id + '&real_name=' + (userStore.userInfo.share_name)
shareStr = shareStr + '&spread_uid=' + userStore.userInfo.id + '&real_name=' + (userStore.userInfo
.share_name)
} else {
shareStr = shareStr + '&real_name=' + STORE_INFO.abbreviation
}
let shareInfo = {
// title: (userStore.userInfo.real_name || userStore.userInfo.nickname) + '',
@ -402,7 +447,7 @@
getGoodList();
}
const addCart = (product_id, cart_num) => { //
const addCart = (product_id, cart_num,attr_value_id) => { //
console.log("触发了加入购物车")
cartCreateApi({
@ -411,7 +456,8 @@
is_new: 0, // 01
// goods_id: id,
store_id: STORE_INFO.id,
product_id: product_id
product_id: product_id,
attr_value_id:attr_value_id
}).then(res => {
getCartList();
}).catch(err => {
@ -608,6 +654,9 @@
const goodRef = ref(null);
const goodData = ref({});
const openGoodPopup = (item) => { // /
if(item.is_lack==1){
return false
}
navTo(false)
if (!userStore.token || !userStore.userInfo.mobile) return;
goodData.value = item;
@ -640,7 +689,7 @@
});
console.log('data', data)
addCart(data.product_id, data.cart_num);
addCart(data.product_id, data.cart_num,data.id);
}
@ -655,7 +704,7 @@
}
const settleAccounts = () => {
if (+cartInfo.value.pay_price < 500 && userStore.userInfo.user_ship==0 ) return showOverlay.value = true;
if (+cartInfo.value.pay_price < 500 && userStore.userInfo.user_ship == 0) return showOverlay.value = true;
uni.navigateTo({
url: '/pagesOrder/settle/settle'
})
@ -672,6 +721,7 @@
cartListApi({
page_no: 1,
page_size: 100,
store_id: STORE_INFO.id,
}).then(res => {
cartInfo.value = {
total_price: res.data?.extend?.total_price || '0.00',
@ -699,26 +749,25 @@
store_id: ''
});
const getShareInfo = () => {
if (uni.getStorageSync('SHARE_INFO')) {
shareInfo.value = (uni.getStorageSync('SHARE_INFO'))
}
}
getShareInfo()
// const getShareInfo = () => {
// if (uni.getStorageSync('SHARE_INFO')) {
// shareInfo.value = (uni.getStorageSync('SHARE_INFO'))
// }
// }
onLoad(async (opt) => {
console.log('opt', opt)
if (opt.id) {
where.value.store_id = (opt.id == 'undefined' ? STORE_INFO.id : opt.id);
} else {
where.value.store_id = STORE_INFO.id
}
// id
if (opt.id && opt.id != 'undefined') {
where.value.store_id = opt.id;
const info = await shopDetailApi({
store_id: where.value.store_id
});
STORE_INFO.id = opt.id
STORE_INFO.store_name = opt.real_name
if (opt.real_name == '' || opt.real_name == undefined) {
shopDetailApi({
store_id: opt.id
}).then(res => {
STORE_INFO.store_name=res.data.name
})
}
//
if (opt.spread_uid) {
shareInfo.value.uid = opt.spread_uid;
@ -726,10 +775,12 @@
shareInfo.value.store_id = opt.id;
uni.setStorageSync('SHARE_INFO', shareInfo.value);
}
getAll()
} else {
uni.removeStorageSync('SHARE_INFO')
getLocation()
}
getStoreInfoFn()
// #ifndef H5
//
btns.value = uni.getMenuButtonBoundingClientRect();
@ -737,9 +788,12 @@
})
onShow(() => {
if (STORE_INFO.id) {
getCartList();
}
//
if (userStore.token && userStore.userInfo.mobile) {
userInfoApi().then(res => {
userInfoApi({store_id:STORE_INFO.id}).then(res => {
const user = res.data;
userStore.setUserInfo(user);
if (!user.openid) loginUpdateUserApi({
@ -750,14 +804,116 @@
uni.reLaunch({
url: "/multipleShop/verificationOrder/index"
})
}
});
}
});
//
const getLocation = () => {
// #ifdef MP-WEIXIN
uni.getSetting({
success(res) {
if (res.authSetting["scope.userLocation"] == false) {
LocationShowOpen()
} else {
opensettings(true)
}
}
})
// #endif
// #ifdef H5
userLocationfalse()
// #endif
}
const LocationShowOpen = () => {
LocationShow.value = true;
}
const getAll = () => {
getgoodClassList(0)
getGoodList()
getCartList();
}
});
//
const opensettings = (a = false) => {
if (a == false) {
uni.openSetting({
success(res) {
LocationShow.value = false;
if (res.authSetting["scope.userLocation"] == true) {
uni.authorize({
scope: 'scope.userLocation',
success() {
uni.getLocation({
type: "gcj02",
success(res) {
location.lat = res.latitude;
location.long = res.longitude;
uni.setStorageSync('location', JSON.stringify(
location))
getStoreInfo(location).then(res => {
STORE_INFO.id = res.data.id
STORE_INFO.store_name = res.data.store_name
STORE_INFO.abbreviation = res.data
.abbreviation
getAll()
uni.setStorageSync('STORE_INFO', JSON
.stringify(STORE_INFO))
})
},
})
},
fail(e) {
userLocationfalse()
},
})
}
},
fail(e) {
userLocationfalse()
}
});
} else {
uni.authorize({
scope: 'scope.userLocation',
success() {
uni.getLocation({
type: "gcj02",
success(res) {
location.lat = res.latitude;
location.long = res.longitude;
uni.setStorageSync('location', JSON.stringify(location))
getStoreInfo(location).then(res => {
STORE_INFO.id = res.data.id
STORE_INFO.store_name = res.data.store_name
STORE_INFO.abbreviation = res.data.abbreviation
getAll()
uni.setStorageSync('STORE_INFO', JSON.stringify(STORE_INFO))
})
},
})
},
fail(e) {
userLocationfalse()
},
})
}
}
//
const userLocationfalse = () => {
LocationShow.value = false;
uni.$u.toast('获取位置失败,为你展示默认门店')
getStoreInfoFn()
}
let instance; //
const getWXDom = () => {
let query = uni.createSelectorQuery().in(instance).select("#drag_area");

View File

@ -9,7 +9,7 @@
<view class="login-box">
<image class="logo" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/35adb202404271727457954.png" @click="test()">
</image>
<view class="tips">欢迎登录优采</view>
<view class="tips">欢迎登录优采</view>
<block v-if="showWeixin">
<up-transition :show="showWeixin">
<view class="btn">

View File

@ -3,7 +3,7 @@
<view style="text-align: center;">
<image class="logo" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/35adb202404271727457954.png">
</image>
<view class="tips">欢迎登录优采</view>
<view class="tips">欢迎登录优采</view>
</view>
<view class='card'>

View File

@ -123,8 +123,9 @@
<up-cell title="我的地址" :isLink="true" url="/pagesOrder/addressList/addressList"></up-cell>
<up-cell title="支付密码" :isLink="true" url="/pagesOrder/setPayPassword/index"></up-cell>
<up-cell title="商品列表" :isLink="true" url="pages/product/product" v-if="userInfo.system_store_id>0"></up-cell>
<up-cell title="配送员订单" :isLink="true" url="pagesOrder/delivery/index" v-if="userInfo.system_store_id>0"></up-cell>
<up-cell title="订单列表" :isLink="true" url="pagesOrder/delivery/index" v-if="userInfo.system_store_id>0"></up-cell>
<up-cell title="采购列表" :isLink="true" url="pageQuota/purchase_product_offer/index" v-if="userInfo.delivery_service_id>0"></up-cell>
<up-cell title="我要批发" :isLink="true" url="pages/wholesale/index" v-if="userInfo.label_id==99"></up-cell>
</up-cell-group>
</view>

View File

@ -55,7 +55,7 @@
const frequentlyList = ref([]);
let text = '没有商品'
let status = ref('loadmore')
let list1 = ['零售', '商户', '会员']
let list1 = ['零售', '商户', '供货价']
let keyword = ref('');
let enable_flex=ref(true)
const where = ref({

View File

@ -43,6 +43,9 @@
</navigator>
</view>
<view class='tip'>
本月已提现金额:<text class="num">{{userInfo.extract_price}}</text>
</view>
<view class='tip'>
说明: <text class="num">{{userInfo.notes}}</text>
</view>
@ -56,6 +59,20 @@
<!-- #ifdef MP -->
<authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
<!-- #endif -->
<up-modal :show="IDCardShow" title="提现信息补充" showCancelButton @cancel="IDCardShow=false" @confirm="UpdateCard()">
<up-form labelPosition="left">
<up-form-item label="姓名:" label-width="80px">
<up-input v-model="real_name" border="none" placeholder="请输入对应的真实姓名"></up-input>
</up-form-item>
<up-form-item label="电话:" label-width="80px">
<up-input v-model="mobile" border="none" disabled></up-input>
</up-form-item>
<up-form-item label="身份证号:" label-width="80px">
<up-input v-model="id_card" border="none" placeholder="请输入身份证号"></up-input>
</up-form-item>
</up-form>
</up-modal>
</view>
</template>
@ -63,7 +80,8 @@
import {
getCashInfoApi,
CashApplicationApi,
getCashRecordApi
getCashRecordApi,
UpdateIdCardApi
} from "@/api/user.js"
// import {
// extractCash,
@ -79,13 +97,17 @@
getHeight: this.getWXStatusHeight(),
// #endif
index: 0,
minPrice: 0.00, //
minPrice: 1.00, //
userInfo: [],
prevent: true, //
moneyMaxLeng: 8,
withdraw_fee: '0',
true_money: 0,
cashVal: '',
IDCardShow: false,
id_card:'',
real_name:'',
mobile:''
};
},
computed: {
@ -98,6 +120,8 @@
onShow() {
getCashInfoApi().then(res => {
this.userInfo = res.data;
this.mobile=res.data.mobile;
this.real_name=res.data.real_name;
})
},
methods: {
@ -145,19 +169,33 @@
} else {
return
}
console.log(value)
if (this.userInfo.id_card==''||this.userInfo.id_card==null) {
this.IDCardShow = true
return
}
CashApplicationApi(value).then(res => {
uni.$u.toast(res.msg);
setTimeout(()=>{
setTimeout(() => {
uni.navigateTo({
url: `/pages/my/my`
})
},1500)
}, 1500)
}).catch(err => {
return uni.$u.toast(err);
return uni.$u.toast(err.msg);
});
},
UpdateCard:function(){
UpdateIdCardApi({'id_card':this.id_card,'real_name':this.real_name}).then(res => {
uni.$u.toast(res.msg);
setTimeout(() => {
uni.navigateTo({
url: `/pages/user_cash/index`
})
}, 1500)
}).catch(err => {
return uni.$u.toast(err.msg);
});
}
}
}
</script>

1163
pages/wholesale/index.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,220 @@
<template>
<view class="shop-item">
<view class="item-title" @click="navTo">
<view>{{order_id}}</view>
<view v-if="datas.paid==0">
<text>待付款</text>
</view>
<view v-else>
<text v-if="datas.status==0">待核销</text>
<text v-if="datas.status==1">待核销</text>
<text v-if="datas.status==2||datas.status==3">已完成</text>
</view>
</view>
<view class="item-body" @click="navTo">
<view class="body-content">
<view>
<view v-for="(item,index) in datas.goods_list" :key="index"
style="display: flex;margin-bottom: 20rpx;">
<image class="image" :src="item.image"></image>
<view style="width: 520rpx;">
<view class="" style="display: flex;justify-content: space-between;">
<view>
{{item.store_name}}
</view>
<view style="font-size: 32rpx;">
{{item.price}}
</view>
</view>
<view class="" style="display: flex;justify-content: space-between;">
<view>
{{item.unit_name}}
</view>
<view style="font-size: 32rpx;">
x{{item.cart_num}}
</view>
</view>
</view>
</view>
</view>
<!-- <view
style="display: flex;flex-direction: column;align-items: center;justify-content: center;width: 100rpx;">
<up-icon name="arrow-right-double" color="#20B128"></up-icon>
</view> -->
</view>
<view class="all"> {{datas.goods_count}} 件商品, 总金额 <text>¥{{datas.pay_price}}</text> </view>
</view>
<view class="item-btn">
<view @click="navTo" style="width: 80px;">
<up-button size="small" plain color="#20B128" shape="circle">查看详情</up-button>
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive,
nextTick
} from "vue"
// 0123)
const props = defineProps({
type: {
type: Number,
default: 0
},
datas: {
type: Object,
default: () => {}
},
status: {
type: String,
default: ''
},
order_id: {
type: String,
default: '0'
}
})
const navTo = () => {
if (props.datas.status == -1) {
uni.navigateTo({
url: "/pages/afterSales/afterSalesOrderDetail",
success(res) {
res.eventChannel.emit('afterSalesDetail', props.datas)
}
})
} else {
uni.navigateTo({
url: `/pagesOrder/detail/detail?type=${props.datas.paid}&id=${props.datas.id}`
})
}
}
const emit = defineEmits(['cancleOrder', 'rePay', 'takeOrder', 'purchaseAgain']);
const cancleOrder = () => {
emit('cancleOrder', props.datas)
}
const takeOrder = () => {
emit('takeOrder', props.datas)
}
const purchaseAgain = () => {
emit('purchaseAgain', props.datas)
}
const rePay = () => {
emit('rePay', props.datas)
}
const applySh = () => {
emit('applyAfterSales', props.datas)
}
const showVerifyFn = () => {
emit('showVerifyFn', props.datas)
}
const showVerifyPop = ref(false)
const options = reactive({
width: 500, // rpx
height: 100, // rpx
code: props.datas.verify_code, //
}, )
</script>
<style lang="scss">
.shop-item {
width: 710rpx;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 14rpx;
padding: 20rpx;
box-sizing: border-box;
.item-title {
display: flex;
justify-content: space-between;
}
.item-body {
margin: 20rpx 0;
.body-content {
display: flex;
justify-content: space-between;
color: #989898;
.image {
width: 120rpx;
height: 120rpx;
margin-right: 20rpx;
border-radius: 14rpx;
}
.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;
}
}
.all {
text-align: right;
font-size: 26rpx;
text {
color: #F55726;
}
}
}
.item-btn {
display: flex;
justify-content: flex-end;
view {
width: 80rpx;
margin-left: 20rpx;
}
}
.item-close {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #F6F6F6;
padding: 15rpx;
border-radius: 14rpx;
.title {
display: flex;
.type {
font-weight: 600;
margin-right: 20rpx;
}
}
}
}
</style>

View File

@ -1,10 +1,6 @@
<template>
<view class="wrap">
<up-navbar placeholder style="z-index: 100800;" @leftClick="navBack">
<template #center>
<view>订单</view>
</template>
</up-navbar>
<up-sticky bgColor="#fff">
<view style="padding: 10rpx 20rpx 0 20rpx;">
<up-search shape="round" v-model="keyword" @custom="searchOn" @search="searchOn" @clear="searchOn"
@ -58,7 +54,7 @@
import {
ref
} from 'vue';
import good from "../order/component/good.vue";
import good from "./component/goods.vue";
import orderCanclePopup from "@/components/orderCanclePopup.vue"
import modal from "@/components/modal.vue"
import ZyPasswordboard from '@/uni_modules/zy-passwordboard/components/zy-passwordboard/zy-passwordboard.vue';
@ -66,7 +62,7 @@
cancelOrderApi,
rePaymentApi,
confirmReceiptApi,
orderListApi,
storeOrderListApi,
purchaseAgainApi
} from "@/api/order.js"
import {
@ -84,6 +80,10 @@
}
const tablist = ref([{
name: '全部'
},{
name: '待核销'
}, {
name: '已核销'
}, {
name: '退款/售后'
}]);
@ -98,6 +98,8 @@
tabsActive.value = current;
if (swiperCurrent.value == 0 && orderList.value[0].length == 0) getOrderList(0, '', ''); //
if (swiperCurrent.value == 2 && orderList.value[2].length == 0) getOrderList(2, 1, 1); //
if (swiperCurrent.value == 3 && orderList.value[3].length == 0) getOrderList(3, 2, 1); //
if (swiperCurrent.value == 4 && orderList.value[4].length == 0) getOrderList(4, -1, 1); //退
}
@ -109,28 +111,6 @@
}
//
const showCancel = ref(false);
let cancelId = '';
const submitCancel = (e) => {
showCancel.value = false;
cancelOrderApi({
order_id: cancelId,
value: e.name
}).then(res => {
uni.showToast({
title: '取消成功',
icon: 'none'
})
orderList.value[1] = orderList.value[1].filter(item => item.id !== cancelId)
})
}
//
const cancleOrder = (e) => {
cancelId = e.id;
showCancel.value = true;
}
//
const showTake = ref(false);
@ -151,17 +131,7 @@
})
}
//
const purchaseAgain = (e) => {
purchaseAgainApi({
order_id: e.id
}).then(res => {
uni.$u.toast('已加入购物车');
uni.navigateTo({
url: '/pages/cart/cart'
})
})
}
// <!--sb-->
const refundShow = ref(false);
@ -215,78 +185,14 @@
}
}
const pay_type = ref('3')
const rePay = async (e) => {
payFn(e)
return
if (!pay_type.value) return uni.$u.toast('请选择支付方式');
if (pay_type.value == 3 || pay_type.value == 18) {
let res = await userInfoApi()
return res.data.pay_password ? passwordBoardVisible.value = true : showModal.value = true
}
}
//
const password = ref(''); //
const passwordBoardVisible = ref(false);
const passwordBoardProps = {
title: '输入支付密码',
onComplete(value) {
password.value = value
passwordBoardVisible.value = false
console.log(password.value)
// payFn()
}
};
const closeKeyBord = () => {
password.value = ''
}
const payFn = (e) => {
rePaymentApi({
order_id: e.id,
address_id: e.address_id,
mer_id: e.merchant,
pay_type: e.pay_type
}).then(res => {
if (res.data?.nonceStr) {
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: (e) => {
if (e.errMsg == 'requestPayment:ok') {
uni.showToast({
title: '订单支付成功',
icon: 'success'
})
reloadAll();
} else uni.$u.toast('支付失败')
},
fail: (e) => {
uni.$u.toast('用户取消支付')
}
})
} else {
uni.showToast({
title: '订单支付成功',
icon: 'success'
})
reloadAll();
}
}).catch(err => {
uni.$u.toast(err.msg || '网络错误')
})
}
const notWxPay = () => {
alert("不是微信支付")
}
//
@ -331,7 +237,7 @@
const getOrderList = (type = 0, status = '', paid = 1, ifPullReFresh = false) => {
if (where.value[type].loadend) return;
where.value[type].loading = true;
orderListApi({
storeOrderListApi({
page_no: where.value[type].page_no,
page_size: where.value[type].page_size,
order_id: keyword.value,
@ -400,6 +306,7 @@
if (options.back) back = options.back;
uni.$on('reLoadOrderList', reloadAll);
getOrderList(0, '', ''); //
})
onUnload(() => {

View File

@ -9,7 +9,7 @@
@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;">
@ -97,7 +97,7 @@
<view>¥{{item.price}}</view>
</view>
<view class="tips">
<view>{{}}</view>
<view>{{item.sku_name}}</view>
<view>x{{item.nums}}{{item.unit_name}}</view>
</view>
</view>

View File

@ -19,19 +19,19 @@
<image class="image" :src="item.image"></image>
<view style="width: 520rpx;">
<view class="" style="display: flex;justify-content: space-between;">
<view>
<view style="color: black;font-size: 30rpx;">
{{item.store_name}}
</view>
<view style="font-size: 32rpx;">
<view style="font-size: 24rpx;">
{{item.price}}
</view>
</view>
<view class="" style="display: flex;justify-content: space-between;">
<view>
{{item.unit_name}}
{{item.sku_name}}
</view>
<view style="font-size: 32rpx;">
x{{item.cart_num}}
<view style="font-size: 24rpx;">
x{{item.cart_num}}/{{item.unit_name}}
</view>
</view>
</view>

View File

@ -1,46 +1,14 @@
<template>
<view class="">
<!-- <view class="m-card m-address"> -->
<!-- <view class="address-info" @click="showAddress = true">
<view class="top">
<up-icon name="account"></up-icon>
<view class="t-name">{{ addressInfo.real_name }}</view>
<view>{{ addressInfo.phone }}</view>
</view>
<view class="bottom u-line-2">
{{ addressInfo.detail }}
</view>
</view> -->
<!-- <view class="address-info">
<view class="top">
{{ STORE_INFO.name }}是的
</view>
<view class="bottom u-line-2">
{{ STORE_INFO.detailed_address }}
</view>
</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'>
自提
</view>
<view class="ship-type-item" @click='orderInfo.shipping_type = 1'
:class='{ actShipItem: orderInfo.shipping_type == 1 }' v-if='orderInfo.default_delivery == 1'>
配送
</view>
</view>
</view> -->
<view class="m-card m-address" style="margin-top: 20rpx;">
<view class="address-info"
style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;'>
<view class="top" style="align-items: flex-start;">
<view style="color: #333;width: 200rpx;">
<view style="margin: 0 10rpx;color:#20B128;width: 150rpx;">推荐自提</view>
<!-- <view style="color: #333;width: 200rpx;">
<view style="margin: 0 10rpx;color:#20B128;width: 150rpx;">配送点</view>
<view class="isreser"> {{reservation?"次日可提":"当日可提" }}
</view>
</view>
</view> -->
<view>
<view style="color: #333;">
{{shop_Info.name}}
@ -57,13 +25,14 @@
</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 class="m-card good-info">
<view class="head-title">商品明细</view>
<!-- </view> -->
<view class="m-card m-good" v-for="(item, index) in cartList" :key="index">
<view class="m-good" v-for="(item, index) in cartList" :key="index">
<view class="image">
<up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image>
</view>
@ -74,8 +43,8 @@
<view>¥{{ item.price }}</view>
</view>
<view class="tips">
<view>{{ item.unit_name }}</view>
<view>x{{ item.cart_num }}</view>
<view>{{ item.sku_name }}</view>
<view>x{{ item.cart_num }}/{{ item.unit_name }}</view>
</view>
</view>
<view class="time">
@ -84,6 +53,8 @@
</view>
</view>
</view>
<view class="m-card good-info">
<view class="head-title">价格明细</view>
<view class="row">
@ -92,7 +63,7 @@
<text>¥</text>{{ c_price(orderInfo.pay_price, 0) }}<text>.{{ c_price(orderInfo.pay_price, 1) }}</text>
</view>
<view v-else>
<up-skeleton :loading="true" :animate="true" ></up-skeleton>
<up-skeleton :loading="true" :animate="true"></up-skeleton>
</view>
</view>
<view class="row">
@ -101,17 +72,26 @@
</view>
<view class="row" v-if="[4,5,6].includes(userInfo.user_ship)" style="color: red;">
<view>优惠减免</view>
<view>
<view v-if="orderInfo.frozen_money">
<text>¥</text>{{ c_price(orderInfo.frozen_money, 0) }}<text>.{{ c_price(orderInfo.frozen_money, 1) }}</text>
</view>
<view v-else>
<up-skeleton :loading="true" :animate="true"></up-skeleton>
</view>
</view>
<view class="row" v-if="userInfo.user_ship==1 ">
<view>优惠返还</view>
<view>
<view v-if="orderInfo.activity_price">
<text>¥</text>{{ c_price(orderInfo.activity_price, 0) }}<text>.{{ c_price(orderInfo.activity_price, 1) }}</text>
</view>
<view v-else>
<up-skeleton :loading="true" :animate="true"></up-skeleton>
</view>
</view>
<up-alert v-if="timeContent!=''" type="error" :description="timeContent"></up-alert>
<!-- <up-notice-bar text="门店切换已移动到首页,若切换店铺,购物车商品将跟随门店一起切换"></up-notice-bar> -->
</view>
<view class="m-card order-remark">
<!-- <view style="display: flex;align-items: center;">
@ -201,6 +181,7 @@
</view>
</view>
<up-modal :show="timeShow" :content='timeContent' @confirm="timeShow=false"></up-modal>
<addressPopup ref="addressRef" :show="showAddress" :list="addressList" @close="showAddress = false"
@change="changeAddress" />
@ -213,20 +194,6 @@
<up-modal :show="showModal" title="您还没设置密码" :closeOnClickOverlay="true" zoom confirmText='去设置' showCancelButton
@close='showModal=false' @cancel='showModal=false' @confirm="navgo('/pagesOrder/setPayPassword/index')"
confirmColor='#27B52F' cancelText='取消'></up-modal>
<up-popup :show="LocationShow" mode="bottom" @open="LocationShowOpen()">
<view style="margin: 40rpx 10rpx;">
<up-row customStyle="margin-bottom: 10px" gutter="10">
<up-col span="6">
<up-button text="取消" @click="userLocationfalse()"></up-button>
</up-col>
<up-col span="6">
<up-button type="primary" text="设置授权" color="#20B128" @click="opensettings()"></up-button>
</up-col>
</up-row>
</view>
</up-popup>
</view>
</template>
@ -263,15 +230,19 @@
//
let STORE_INFO = uni.getStorageSync('STORE_INFO');
if (STORE_INFO){
console.log(STORE_INFO)
if (STORE_INFO) {
shop_Info.value = JSON.parse(STORE_INFO)
} else {
uni.$u.toast('获取门店信息失败,请在首页选择门店')
}
const cartStore = useCartStore();
const reservation_time = ref('')
const is_storage = ref(0)
const LocationShow = ref(false)
const timeShow = ref(false)
const timeContent = ref('')
const formData = ref({
remark: ""
})
@ -413,6 +384,10 @@
cartList.value = res.data.cart_list;
orderInfo.value = res.data.order;
shop_Info.value = res.data.shopInfo || {}
if (res.data.alert != '') {
timeShow.value = true
timeContent.value = res.data.alert
}
checkInventoryApi({
cart_id: cartStore.cartList,
store_id: store_id || res.data.shopInfo.id
@ -425,24 +400,6 @@
})
}
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
})
checkOrder(datas.id)
// formData.store_id = datas.id
// formData.store_name = datas.name
})
// const checkOrderA
const pay_type = ref('7');
@ -560,98 +517,18 @@
}
onLoad(options => {
// if (uni.getStorageSync('location')) {
// try {
// location = JSON.parse(uni.getStorageSync('location'))
// checkOrder();
// } catch (e) {
// getLocation()
// }
// } else {
getLocation()
// }
})
const getLocation = () => {
// #ifdef H5
userLocationfalse()
// #endif
// #ifdef MP-WEIXIN
uni.getSetting({
success(res) {
if (res.authSetting["scope.userLocation"] == false) {
LocationShowOpen()
} else {
opensettings(true)
}
}
})
// #endif
}
const LocationShowOpen = () => {
LocationShow.value = true;
}
const userLocationfalse = () => {
LocationShow.value = false;
uni.$u.toast('获取位置当前失败,为你推荐当前门店')
checkOrder(shop_Info.value.id);
}
const opensettings = (a = false) => {
if (a == false) {
uni.openSetting({
success(res) {
LocationShow.value = false;
if (res.authSetting["scope.userLocation"] == true) {
uni.authorize({
scope: 'scope.userLocation',
success() {
uni.getLocation({
type: "gcj02",
success(res) {
location.lat = res.latitude;
location.long = res.longitude;
uni.setStorageSync('location', JSON.stringify(
location))
checkOrder();
},
})
},
fail(e) {
userLocationfalse()
},
})
}
},
fail(e) {
userLocationfalse()
}
});
} else {
uni.authorize({
scope: 'scope.userLocation',
success() {
uni.getLocation({
type: "gcj02",
success(res) {
location.lat = res.latitude;
location.long = res.longitude;
uni.setStorageSync('location', JSON.stringify(location))
checkOrder();
},
})
},
fail(e) {
userLocationfalse()
},
})
}
}
onShow(() => {
getAddressList();
})
uni.$on('settle', function(data) {
let datas = JSON.parse(data)
shop_Info.value = datas
})
</script>
<style lang="scss">

62
uni_modules/uview-plus/package-lock.json generated Normal file
View File

@ -0,0 +1,62 @@
{
"name": "uview-plus",
"version": "3.2.14",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "uview-plus",
"version": "3.2.14",
"dependencies": {
"clipboard": "^2.0.11",
"dayjs": "^1.11.3",
"uview-plus": "file:"
},
"engines": {
"HBuilderX": "^3.1.0"
}
},
"node_modules/clipboard": {
"version": "2.0.11",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.11.tgz",
"integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
"dependencies": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"node_modules/dayjs": {
"version": "1.11.13",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"node_modules/delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
},
"node_modules/good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
"dependencies": {
"delegate": "^3.1.2"
}
},
"node_modules/select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
},
"node_modules/tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
},
"node_modules/uview-plus": {
"resolved": "",
"link": true
}
}
}

View File

@ -85,7 +85,8 @@
},
"dependencies": {
"clipboard": "^2.0.11",
"dayjs": "^1.11.3"
"dayjs": "^1.11.3",
"uview-plus": "file:"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"

View File

@ -0,0 +1,20 @@
{
"name": "@uview-plus/types",
"version": "3.2.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@uview-plus/types",
"version": "3.2.5",
"license": "MIT",
"dependencies": {
"@uview-plus/types": "file:"
}
},
"node_modules/@uview-plus/types": {
"resolved": "",
"link": true
}
}
}

View File

@ -22,5 +22,8 @@
"homepage": "https://github.com/ijry/uview-plus#readme",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
"@uview-plus/types": "file:"
}
}

View File

@ -22,6 +22,7 @@ function baseRequest(url, method, data, {
url: Url + '/api' + url,
method: method || 'GET',
header: {
accept:'json',
...header
},
data: method != 'GET' ? data || {} : {},