From 00c3dc11350c739e9b4cb2f80ba810bbfa730729 Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Sat, 29 Jun 2024 18:25:37 +0800
Subject: [PATCH] add
---
api/address.js | 4 +
api/asset.js | 11 ++
api/user.js | 4 +
config/app.js | 4 +-
multipleShop/index/index.vue | 49 ++++--
pageQuota/asset/index.vue | 281 ++++++++++++++++++++++++++++++
pageQuota/balanceDetail/index.vue | 31 +++-
pageQuota/vipUser/index.vue | 135 ++++++++++++--
pages.json | 9 +
pages/index/index.vue | 1 +
pages/login/login.vue | 6 +-
pages/my/my.vue | 34 +++-
pagesOrder/detail/detail.vue | 35 ++--
pagesOrder/order/order.vue | 11 +-
pagesOrder/settle/settle.vue | 115 ++++++++----
15 files changed, 625 insertions(+), 105 deletions(-)
create mode 100644 api/asset.js
create mode 100644 pageQuota/asset/index.vue
diff --git a/api/address.js b/api/address.js
index 7cd7b05..7c46129 100644
--- a/api/address.js
+++ b/api/address.js
@@ -33,4 +33,8 @@ export const setPayPassword = (data) => {
export const getFundList = (data) => {
return request.get('/user/user/fundList', data);
+}
+
+export const getUserSingList = (data) => {
+ return request.get('/user/user/userSing', data);
}
\ No newline at end of file
diff --git a/api/asset.js b/api/asset.js
new file mode 100644
index 0000000..761c258
--- /dev/null
+++ b/api/asset.js
@@ -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);
+}
\ No newline at end of file
diff --git a/api/user.js b/api/user.js
index 98fcf50..bd5b2fc 100644
--- a/api/user.js
+++ b/api/user.js
@@ -153,4 +153,8 @@ export const uploadImg = (data) => {
export const getVipInfoByPhone = (data) => {
return request.get('/user/user/other_user_info', data);
+}
+
+export const checkInventoryApi = (data) => {
+ return request.post('/order/order/checkInventory', data);
}
\ No newline at end of file
diff --git a/config/app.js b/config/app.js
index 3500d16..a484fa4 100644
--- a/config/app.js
+++ b/config/app.js
@@ -2,8 +2,8 @@ let BASE_URL
let WSS_URL
import store from "@/store/user.js"
// 环境
-// let env = "dev"
-let env = "prod"
+let env = "dev"
+// let env = "prod"
// let env = "release";
// let env = "local";
diff --git a/multipleShop/index/index.vue b/multipleShop/index/index.vue
index 5637c50..93f0064 100644
--- a/multipleShop/index/index.vue
+++ b/multipleShop/index/index.vue
@@ -66,7 +66,7 @@
onLoad,
onShow
} from "@dcloudio/uni-app";
-
+ let event = ''
const currShop = ref(''); // 选择门店
const shopList = ref([]); // 门店列表
const status = ref(''); // 滚动状态
@@ -82,26 +82,40 @@
})
// 初始化
- onLoad(() => {
+ onLoad((opt) => {
+ event = opt.event
+ console.log(event)
// 获取定位
getLocation();
});
// 门店选择
const onChooseShop = (item) => {
+ let {
+ id,
+ name,
+ phone,
+ detailed_address
+ } = item
+ uni.$emit(event, JSON.stringify({
+ id,
+ name,
+ phone,
+ detailed_address
+ }))
+ uni.navigateBack()
return
- currShop.value = item.id;
- uni.setStorageSync('STORE_INFO', JSON.stringify(item));
- // 如果选择了新店铺,删除之前的分享信息
- uni.removeStorageSync('SHARE_INFO');
- setTimeout(() => {
- uni.reLaunch({
- url: '/pages/index/index?id=' + item.id,
- fail(err) {
- console.log(err);
- }
- })
- }, 300)
+ // currShop.value = item.id;
+ // uni.setStorageSync('STORE_INFO', JSON.stringify(item));
+ // uni.removeStorageSync('SHARE_INFO');
+ // setTimeout(() => {
+ // uni.reLaunch({
+ // url: '/pages/index/index?id=' + item.id,
+ // fail(err) {
+ // console.log(err);
+ // }
+ // })
+ // }, 300)
}
// 触底刷新
@@ -162,6 +176,7 @@
const getLocation = () => {
let location = uni.getStorageSync('location');
if (location) {
+ location = JSON.parse(location);
queryParams.longitude = location.lat
queryParams.latitude = location.long
// 加载店铺列表
@@ -172,15 +187,13 @@
success(res) {
queryParams.latitude = res.latitude;
queryParams.longitude = res.longitude;
-
// 加载店铺列表
getShopList();
-
// 避免下次再获取
- uni.setStorageSync('location', {
+ uni.setStorageSync('location', JSON.stringify({
lat: queryParams.latitude,
long: queryParams.longitude
- })
+ }, ))
}
})
}
diff --git a/pageQuota/asset/index.vue b/pageQuota/asset/index.vue
new file mode 100644
index 0000000..c0132bc
--- /dev/null
+++ b/pageQuota/asset/index.vue
@@ -0,0 +1,281 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.store_name }} x{{item.nums }}
+ ¥{{item.price}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 全选({{getCheckNum()}})
+
+
+ 全不选({{getCheckNum()}})
+
+
+
+
+
+ 预约提货({{getCheckNum()}})
+
+
+
+
+
+
+
+
+
+ 标题
+
+
+ 预约时间:
+ {{formData.times}}
+
+
+
+ 选择门店:
+ {{formData.store_name}}
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pageQuota/balanceDetail/index.vue b/pageQuota/balanceDetail/index.vue
index 4efc17d..d94418a 100644
--- a/pageQuota/balanceDetail/index.vue
+++ b/pageQuota/balanceDetail/index.vue
@@ -17,7 +17,7 @@
-
+
{{item.title}}
@@ -60,10 +60,11 @@
onPullDownRefresh
} from "@dcloudio/uni-app"
import {
- getFundList
+ getFundList,
+ getUserSingList
} from "@/api/address.js"
- const navLists = ['', '采购款明细', '余额明细', '礼品券明细', '返还金明细']
+ const navLists = ['', '采购款明细', '余额明细', '礼品券明细', '返还金明细', '冻结券明细']
const tabsLst = reactive([{
name: '全部'
},
@@ -84,11 +85,25 @@
const lists = ref([])
let type = ref('')
const getLists = async (isPullDown = false) => {
- let res = await getFundList({
- type: type.value,
- mark: mark.value || ''
- })
- lists.value = res.data.lists
+ if (type.value == 3 || type.value == 5) {
+ let res = await getUserSingList({
+ type: type.value == 3 ? 1 : 0,
+ page_no: 1,
+ page_size: 999,
+ mark: mark.value || ''
+ })
+ lists.value = res.data.lists
+ console.log(lists.value)
+
+ } else {
+
+ let res = await getFundList({
+ type: type.value,
+ mark: mark.value || ''
+ })
+ lists.value = res.data.lists
+ }
+
if (isPullDown) uni.stopPullDownRefresh()
}
diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue
index e4ccde1..1cb8e3c 100644
--- a/pageQuota/vipUser/index.vue
+++ b/pageQuota/vipUser/index.vue
@@ -7,6 +7,15 @@
+
+
+
+
+
+
+
+
@@ -19,8 +28,10 @@
-->
-
+
+
@@ -53,7 +64,7 @@
suffixIcon='arrow-down'>
-
+
+
- 完成并收款
+ {{Role==1?'完成并收款':"完成" }}
-
+
行业会员追加经营资金
@@ -176,7 +187,7 @@
-
+
当前已开通:
@@ -216,6 +227,56 @@
+
+
+
+
+
+ 当前已开通:
+
+ 位{{ Role == 1 ? '行业会员' : '商户' }}
+
+
+
+
+
+
+
+ 商户
+ 开通时间
+ 状态
+
+
+
+
+ {{ item.nickname }}
+ {{ item.create_time }}
+
+ 已开通
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -320,6 +381,15 @@
},
]);
+ const tabsLst2 = reactive([{
+ name: '开通商户'
+ },
+ {
+ name: '已开通列表'
+ },
+ ]);
+
+
const tabsChange = (e) => {
currentTab.value = e.index
@@ -329,7 +399,10 @@
}
// getLists()
}
-
+ const tabsChange1 = (e) => {
+ currentTab.value = (e.index)
+ getLists()
+ }
const confirmStore = () => {
getStoreByPhone({
@@ -638,6 +711,30 @@
// 提交
const submit = async (type = 1) => {
+ if (Role.value == 4) {
+ if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
+ if (!formData.mobile) return uni.$u.toast('请填写电话号码');
+ if (!formData.code) return uni.$u.toast('请输入短信验证码');
+ if (!formData.address) return uni.$u.toast('请选择地址');
+ delete formData.recharge_type
+ delete formData.auth_code
+ formData.user_ship = 4
+ vipRechargeApi(formData).then(res => {
+ resetFormData()
+ getLists()
+ currentTab.value = 1
+
+ })
+ return
+ }
+
+
+
+
+
+
+
+
if (type == 2) {
if (!formData2.mobile) return uni.$u.toast('请填写电话号码');
if (formData2.price < formData2.label_limit) return uni.$u.toast(
@@ -769,13 +866,21 @@
where.loadingOver = false
where.page_no = 1
where.page_size = 25
- let res = await rechargeListsApi({
- store_id: STORE_INFO.id,
- recharge_type: "INDUSTRYMEMBERS",
- page_no: 1,
- page_size: 25
- })
- lists.value = res.data.lists
+ if (Role.value == 1) {
+ let res = await rechargeListsApi({
+ store_id: STORE_INFO.id,
+ recharge_type: "INDUSTRYMEMBERS",
+ page_no: 1,
+ page_size: 25
+ })
+ lists.value = res.data.lists
+ } else {
+ let res = await getCreateLists({
+ store_id: STORE_INFO.id,
+ })
+ lists.value = res.data.lists
+ count.value = res.data.count
+ }
}
diff --git a/pages.json b/pages.json
index f3b81ad..1770fef 100644
--- a/pages.json
+++ b/pages.json
@@ -235,6 +235,15 @@
"enablePullDownRefresh": true
}
},
+
+ {
+ "path": "asset/index",
+ "style": {
+ "navigationBarTitleText": "会员资产",
+ "enablePullDownRefresh": true
+ }
+ },
+
{
"path": "balanceDetail/index",
"style": {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index cb5f161..5527d90 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -401,6 +401,7 @@
const addCart = (product_id, cart_num) => { //加入购物车
cartCreateApi({
+ type: 1,
cart_num: cart_num,
is_new: 0, // 是否直接购买0否1是
// goods_id: id,
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 357ad27..0471e5a 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -16,10 +16,10 @@
手机号快捷登录
-
+ name="account-fill" color="#fff" size="28">真-手机号快捷登录
+
@@ -266,7 +266,7 @@
const getDetails = () => {
orderDetailApi({
order_id: datas.value.id,
- ...location
+ // ...location
}).then(res => {
datas.value = res.data;
options.code = datas.value.verify_code; // 生成条形码的值
@@ -493,19 +493,19 @@
}
const getLocation = () => {
- if (uni.getStorageSync('location')) {
- location = uni.getStorageSync('location')
- } else {
- uni.getLocation({
- type: "gcj02",
- success(res) {
- location.lat = res.latitude;
- location.long = res.longitude;
- uni.setStorageSync('location', location)
- return getDetails()
- }
- })
- }
+ // if (uni.getStorageSync('location')) {
+ // location = uni.getStorageSync('location')
+ // } else {
+ // uni.getLocation({
+ // type: "gcj02",
+ // success(res) {
+ // location.lat = res.latitude;
+ // location.long = res.longitude;
+ // uni.setStorageSync('location', location)
+ // return getDetails()
+ // }
+ // })
+ // }
getDetails()
}
@@ -522,7 +522,6 @@
onBackPress(() => {
clearInterval(timer);
- console.log("清除");
})
const navgo = (url) => {
diff --git a/pagesOrder/order/order.vue b/pagesOrder/order/order.vue
index b9adf37..8593c6e 100644
--- a/pagesOrder/order/order.vue
+++ b/pagesOrder/order/order.vue
@@ -107,7 +107,16 @@
-
+
+
+
+
+
+
+
+
+
+
核销码 {{orderData.verify_code}}
diff --git a/pagesOrder/settle/settle.vue b/pagesOrder/settle/settle.vue
index ef089a1..476bbf2 100644
--- a/pagesOrder/settle/settle.vue
+++ b/pagesOrder/settle/settle.vue
@@ -1,7 +1,7 @@
-
+
+
+
+
+
+
+
+ 推荐自提点
+
+
+
+ {{shop_Info.name}}
+
+
+ {{shop_Info.detailed_address}}
+
+
+
+ {{shop_Info.phone}}
+
+
+
+
+
+ 当日可提
+
- -->
+
+
+
@@ -79,13 +106,13 @@
订单备注
{{formData.remark.length}}/140
@@ -201,7 +228,8 @@
import {
userInfoApi,
addressListsApi,
- merchantListApi
+ merchantListApi,
+ checkInventoryApi
} from "@/api/user.js";
import {
createOrderApi
@@ -216,7 +244,7 @@
const cartStore = useCartStore();
const reservation_time = ref('')
- const isCh = ref(0)
+ const is_storage = ref(0)
const formData = ref({
remark: ""
@@ -282,8 +310,8 @@
const getMerchantList = (mer_name = null) => {
merchantListApi({
- ...myAddressInfo.value,
- mer_name: mer_name ? mer_name : ''
+ // ...myAddressInfo.value,
+ // mer_name: mer_name ? mer_name : ''
}).then(res => {
merchantList.value = res.data.lists;
if (mer_name === null && myAddressInfo.value.long && merchantList.value.length > 0 && !shopInfo
@@ -299,19 +327,19 @@
// getMerchantList();
// 定位
- const LoadAddress = () => {
- uni.getLocation({
- success: (res) => {},
- fail: (err) => {
- uni.$u.toast('定位失败, 请手动选择提货点!')
- },
- complete: (res) => {
- myAddressInfo.value.long = res.longitude || "";
- myAddressInfo.value.lat = res.latitude || "";
- getMerchantList();
- }
- })
- }
+ // const LoadAddress = () => {
+ // uni.getLocation({
+ // success: (res) => {},
+ // fail: (err) => {
+ // uni.$u.toast('定位失败, 请手动选择提货点!')
+ // },
+ // complete: (res) => {
+ // myAddressInfo.value.long = res.longitude || "";
+ // myAddressInfo.value.lat = res.latitude || "";
+ // getMerchantList();
+ // }
+ // })
+ // }
// LoadAddress();
const changeShop = (e) => {
@@ -356,21 +384,28 @@
}
// 订单相关
+ let location;
+ const shop_Info = ref({})
const cartList = ref([]);
const orderInfo = ref({});
const checkOrder = () => {
checkOrderApi({
cart_id: cartStore.cartList,
- store_id: STORE_INFO.id || 0
+ store_id: STORE_INFO.id || 0,
+ ...location
}).then(res => {
cartList.value = res.data.cart_list;
orderInfo.value = res.data.order;
+ shop_Info.value = res.data.shopInfo || {}
+ console.log(shop_Info.value)
if (orderInfo.value.default_delivery == 0) {
orderInfo.value.shipping_type = 2
}
})
}
+
+ // const checkOrderA
const pay_type = ref('7');
@@ -402,7 +437,8 @@
store_id: STORE_INFO.id || 0,
reservation_time: reservation_time.value,
shipping_type: orderInfo.value.shipping_type,
- mark: formData.value.remark
+ mark: formData.value.remark,
+ is_storage: is_storage.value
}).then(res => {
if (pay_type.value == 3 || pay_type.value == 18) {
if (res.code == 1) {
@@ -481,7 +517,22 @@
}
onLoad(options => {
+ if (uni.getStorageSync('location')) {
+ location = JSON.parse(uni.getStorageSync('location'))
+ } else {
+ uni.getLocation({
+ type: "gcj02",
+ success(res) {
+ location.lat = res.latitude;
+ location.long = res.longitude;
+ uni.setStorageSync('location', JSON.stringify(location))
+ }
+ })
+ }
+
checkOrder();
+
+
})
onShow(() => {
getAddressList();