From 837e1319ca1cce2173779add6a72965acdc43a02 Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Mon, 17 Jun 2024 15:29:52 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E4=BC=9A=E5=91=98=E6=8A=A5=E5=A4=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/address.js | 24 +++
api/user.js | 16 ++
pageQuota/vipUser/index.vue | 289 ++++++++++++++++++++++++++++++++----
utils/request.js | 156 +++++++++----------
4 files changed, 375 insertions(+), 110 deletions(-)
create mode 100644 api/address.js
diff --git a/api/address.js b/api/address.js
new file mode 100644
index 0000000..845d525
--- /dev/null
+++ b/api/address.js
@@ -0,0 +1,24 @@
+import request from '@/utils/request';
+
+export const provinceListApi = (data) => {
+ return request.get('/province', data);
+}
+
+export const cityListApi = (data) => {
+ return request.get('/city', data);
+}
+
+export const areaListApi = (data) => {
+ return request.get('/area', data);
+}
+
+export const streetListApi = (data) => {
+ return request.get('/street', data);
+}
+
+export const villageListApi = (data) => {
+ return request.get('/village', data);
+}
+export const brigadeListApi = (data) => {
+ return request.get('/brigade', data);
+}
\ No newline at end of file
diff --git a/api/user.js b/api/user.js
index 7accac7..873766a 100644
--- a/api/user.js
+++ b/api/user.js
@@ -93,4 +93,20 @@ export const capitalCountAPi = (data) => {
// 会员账户详情
export const chargeListApi = (data) => {
return request.post('/user/user/capital_flow', data);
+}
+
+export const vipRechargeApi = (data) => {
+ return request.post('/store/store/recharge', data);
+}
+
+export const rechargeCountApi = (data) => {
+ return request.get('/store/store/recharge_count', data);
+}
+
+export const rechargeListsApi = (data) => {
+ return request.get('/user/UserRecharge/lists', data);
+}
+
+export const updataOrderApi = (data) => {
+ return request.get('/pay/wechatQuery', data);
}
\ No newline at end of file
diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue
index 4600120..601c239 100644
--- a/pageQuota/vipUser/index.vue
+++ b/pageQuota/vipUser/index.vue
@@ -11,20 +11,19 @@
行业会员开通报备
-
-
-
+
+
-
-
+
-
-
-
+
+
当前已开通:
- 100
+
位行业会员
@@ -61,31 +60,88 @@
状态
-
- 1
- 军哥
- 1000.00
- 2020-10-20
- 已开通
+
+ {{index+1}}
+ {{item.real_name}}
+ {{item.price}}
+ {{item.create_time}}
+
+ 已开通
+ 未开通,查询
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {{item.city_name}}
+
+
+
+
+
+ {{item.area_name}}
+
+
+
+
+
+ {{item.street_name}}
+
+
+
+
+
+ {{item.village_name}}
+
+
+
+
+
+ {{item.brigade_name}}
+
+
+
+
+
-
\ No newline at end of file
diff --git a/utils/request.js b/utils/request.js
index 061aad8..5abe6d8 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -1,5 +1,5 @@
import {
- config
+ config
} from '@/config/app';
import useUserStore from '@/store/user';
@@ -7,89 +7,89 @@ import useUserStore from '@/store/user';
const userStore = useUserStore();
function baseRequest(url, method, data, {
- noAuth = false,
- noVerify = false,
- onReLogin = false
+ noAuth = false,
+ noVerify = false,
+ onReLogin = false
}) {
- let Url = config.HTTP_REQUEST_URL,
- header = config.HEADER;
- if (userStore.userInfo) {
- header.TOKEN = userStore.token
- }
+ let Url = config.HTTP_REQUEST_URL,
+ header = config.HEADER;
+ if (userStore.userInfo) {
+ header.TOKEN = userStore.token
+ }
- return new Promise((reslove, reject) => {
- uni.request({
- url: Url + '/api' + url,
- method: method || 'GET',
- header: {
- ...header
- },
- data: method != 'GET' ? data || {} : {},
- params: method == 'GET' ? data : {},
- success: (res) => {
- // console.log(res, 'res')
+ return new Promise((reslove, reject) => {
+ uni.request({
+ url: Url + '/api' + url,
+ method: method || 'GET',
+ header: {
+ ...header
+ },
+ data: method != 'GET' ? data || {} : {},
+ params: method == 'GET' ? data : {},
+ success: (res) => {
+ // console.log(res, 'res')
- if (res.data.show) {
- uni.showToast({
- title: res.data.msg || '操作成功',
- icon: 'none',
- })
- }
- if (noVerify)
- reslove(res.data);
- else if (res.data.code == -1) {
- if (res.data.msg == "登录超时,请重新登录" && !noAuth) {
- userStore.setToken('');
- userStore.setUserInfo({});
- uni.showModal({
- content: '您需要先登录才可使用该功能, 是否前去登录',
- success: (e) => {
- if (e.confirm) uni.navigateTo({
- url: '/pages/login/login'
- })
- }
- })
- }
- } else if (res.data.code == 0) {
- if (res.data.msg == "请求参数缺token" && !noAuth) {
- userStore.setToken('');
- userStore.setUserInfo({});
- uni.showModal({
- content: '您需要先登录才可使用该功能, 是否前去登录',
- success: (e) => {
- if (e.confirm) uni.navigateTo({
- url: '/pages/login/login'
- })
- }
- })
- }
- reject(res.data);
- } else if (res.data.code == 1) {
- reslove(res.data);
- } else if (res.data.code == 200) {
- reslove(res.data.data);
- } else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) {
- reject(res.data);
- } else if (res.data.code == 501) {
- reject(res.data);
- } else {
- reject(res.data.msg || '请检查网络');
- }
- },
- fail: (message) => {
- console.log(message, '错误信息')
- uni.showToast({
- title: '网络错误',
- icon: 'none'
- })
- reject('请求失败');
- }
- })
- });
+ if (res.data.show) {
+ uni.showToast({
+ title: res.data.msg || '操作成功',
+ icon: 'none',
+ })
+ }
+ if (noVerify)
+ reslove(res.data);
+ else if (res.data.code == -1) {
+ if (res.data.msg == "登录超时,请重新登录" && !noAuth) {
+ userStore.setToken('');
+ userStore.setUserInfo({});
+ uni.showModal({
+ content: '您需要先登录才可使用该功能, 是否前去登录',
+ success: (e) => {
+ if (e.confirm) uni.navigateTo({
+ url: '/pages/login/login'
+ })
+ }
+ })
+ }
+ } else if (res.data.code == 0) {
+ if (res.data.msg == "请求参数缺token" && !noAuth) {
+ userStore.setToken('');
+ userStore.setUserInfo({});
+ uni.showModal({
+ content: '您需要先登录才可使用该功能, 是否前去登录',
+ success: (e) => {
+ if (e.confirm) uni.navigateTo({
+ url: '/pages/login/login'
+ })
+ }
+ })
+ }
+ reject(res.data);
+ } else if (res.data.code == 1) {
+ reslove(res.data);
+ } else if (res.data.code == 200) {
+ reslove(res.data.data);
+ } else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) {
+ reject(res.data);
+ } else if (res.data.code == 501) {
+ reject(res.data);
+ } else {
+ reject(res.data.msg || '请检查网络');
+ }
+ },
+ fail: (message) => {
+ console.log(message, '错误信息')
+ uni.showToast({
+ title: '网络错误',
+ icon: 'none'
+ })
+ reject('请求失败');
+ }
+ })
+ });
}
const syhttp = {};
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
- syhttp[method] = (api, data, opt) => baseRequest(api, method, data, opt || {})
+ syhttp[method] = (api, data, opt) => baseRequest(api, method, data, opt || {})
});
export default syhttp;
\ No newline at end of file
From f11a088409283d6f6c62a1715a6f5379bd7937ff Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Mon, 17 Jun 2024 17:16:09 +0800
Subject: [PATCH 2/4] add
---
api/user.js | 6 ++
pageQuota/vipUser/index.vue | 183 +++++++++++++++++++++--------------
pages/cart/cart.vue | 9 --
pages/login/login.vue | 9 ++
pagesOrder/settle/settle.vue | 13 ++-
5 files changed, 135 insertions(+), 85 deletions(-)
diff --git a/api/user.js b/api/user.js
index 873766a..ae0730d 100644
--- a/api/user.js
+++ b/api/user.js
@@ -109,4 +109,10 @@ export const rechargeListsApi = (data) => {
export const updataOrderApi = (data) => {
return request.get('/pay/wechatQuery', data);
+}
+
+
+
+export const getStoreByPhone = (data) => {
+ return request.get('/store/Store/detail', data);
}
\ No newline at end of file
diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue
index 601c239..4ab3535 100644
--- a/pageQuota/vipUser/index.vue
+++ b/pageQuota/vipUser/index.vue
@@ -1,78 +1,94 @@
-
- 开通行业会员
- 已开通列表
-
+
+
+
+
+
+
+
-
-
-
-
- 行业会员开通报备
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 报备人:{{STORE_INFO.detailed_address}}
-
-
-
-
-
-
-
-
-
-
- 当前已开通:
-
- 位行业会员
+
+
+ 开通行业会员
+ 已开通列表
+
-
-
-
-
- 序号
- 行业会员
- 经营资金
- 开通时间
- 状态
-
-
-
- {{index+1}}
- {{item.real_name}}
- {{item.price}}
- {{item.create_time}}
-
- 已开通
- 未开通,查询
-
-
-
-
-
+
+
+
+
+ 行业会员开通报备
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 报备人:{{STORE_INFO.detailed_address}}
+
+
+
+
+
+
+
+
+
+
+ 当前已开通:
+
+ 位行业会员
+
+
+
+
+
+
+ 序号
+ 行业会员
+ 经营资金
+ 开通时间
+ 状态
+
+
+
+ {{index+1}}
+ {{item.real_name}}
+ {{item.price}}
+ {{item.create_time}}
+
+ 已开通
+ 未开通,查询
+
+
+
+
+
+
+
@@ -136,17 +152,36 @@
vipRechargeApi,
rechargeCountApi,
rechargeListsApi,
- updataOrderApi
+ updataOrderApi,
+ getStoreByPhone
} from "@/api/user.js"
import {
onPullDownRefresh
} from "@dcloudio/uni-app"
+
+ const showModa = ref(true)
+ const storePhone = ref('')
+ const confirmStore = () => {
+ getStoreByPhone({
+ phone: storePhone.value
+ }).then(res => {
+ for (let key in res.data) {
+ STORE_INFO[key] = res.data[key]
+ }
+ }).catch(err => {
+ uni.$u.toast('未查到店铺信息,请检查手机号码')
+ })
+
+
+ }
+
// 用户选择的门店信息
- let STORE_INFO = uni.getStorageSync('STORE_INFO');
- if (STORE_INFO)
- STORE_INFO = JSON.parse(STORE_INFO)
+ let STORE_INFO = reactive({
+ id: ""
+ })
+
const currentTab = ref(1)
const formData = reactive({
diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue
index e52ab5d..1e7ddac 100644
--- a/pages/cart/cart.vue
+++ b/pages/cart/cart.vue
@@ -434,15 +434,6 @@
}
}
-
- .shop-item:last-child {
- margin-bottom: 100px;
- background-color: red;
- }
-
-
-
-
}
}
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 1718f01..62ff847 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -16,6 +16,10 @@
微信快捷登录
+
+ 账号登录
+
支付方式
@@ -182,6 +189,8 @@
const userInfo = useUserStore().userInfo;
+ console.log(userInfo)
+
// 用户选择的门店信息
let STORE_INFO = uni.getStorageSync('STORE_INFO');
if (STORE_INFO)
From 6f7eed451f90af88a019b559e83e660a5dbfb252 Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Mon, 17 Jun 2024 18:47:06 +0800
Subject: [PATCH 3/4] add
---
pageQuota/vipUser/index.vue | 25 +++++++++++++++++--------
pages/index/index.vue | 4 +++-
pages/my/my.vue | 7 ++++++-
3 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue
index 4ab3535..8dea01c 100644
--- a/pageQuota/vipUser/index.vue
+++ b/pageQuota/vipUser/index.vue
@@ -67,11 +67,11 @@
- 序号
- 行业会员
- 经营资金
- 开通时间
- 状态
+ 序号
+ 行业会员
+ 经营资金
+ 开通时间
+ 状态
@@ -162,7 +162,7 @@
const showModa = ref(true)
- const storePhone = ref('')
+ const storePhone = ref('15699996666')
const confirmStore = () => {
getStoreByPhone({
phone: storePhone.value
@@ -194,7 +194,7 @@
village: "",
brigade: "",
real_name: "",
- auth_code: "130600111488101385",
+ auth_code: "",
// auth_code: "",
address: ""
})
@@ -309,6 +309,8 @@
uni.$u.toast('操作成功');
currentTab.value = 2
})
+ getCount()
+ getLists()
}
});
}
@@ -337,7 +339,6 @@
const upadtaStatus = (item) => {
- console.log(item)
updataOrderApi({
order_no: item.order_id,
recharge: 1
@@ -472,4 +473,12 @@
color: #20B128;
}
}
+
+ .uni-table-th {
+ padding: 10rpx 0 !important;
+ }
+
+ .uni-table-td {
+ padding: 10rpx 0 !important;
+ }
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 367c878..47cd6db 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -24,7 +24,7 @@
{{shareInfo.real_name?(shareInfo.real_name + '-' + STORE_INFO.name):STORE_INFO.name}}
+ style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{shareInfo.real_name?(shareInfo.real_name + '的' + STORE_INFO.name):STORE_INFO.name}}
@@ -260,6 +260,8 @@
})
const navgo = (url) => {
+ if (shareInfo.value.real_name) return
+
uni.navigateTo({
url
})
diff --git a/pages/my/my.vue b/pages/my/my.vue
index c8ec06c..70fa08d 100644
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -53,7 +53,12 @@
{{userInfo.return_money}}
- 待返还金额
+ 返还金
+
+
+
+ {{userInfo.integral}}
+ 礼品券
From f171b8be9a29c74dd9ab730d1dfac243bc0fd276 Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Mon, 17 Jun 2024 20:47:54 +0800
Subject: [PATCH 4/4] add
---
api/user.js | 5 +++++
pageQuota/vipUser/index.vue | 23 +++++++++++++++++++----
pages/index/index.vue | 36 ++++++++++++++++++------------------
pages/login/login.vue | 8 ++++++--
pages/login/test.vue | 8 +++++++-
pages/my/my.vue | 2 ++
6 files changed, 57 insertions(+), 25 deletions(-)
diff --git a/api/user.js b/api/user.js
index ae0730d..f8dbe79 100644
--- a/api/user.js
+++ b/api/user.js
@@ -115,4 +115,9 @@ export const updataOrderApi = (data) => {
export const getStoreByPhone = (data) => {
return request.get('/store/Store/detail', data);
+}
+
+
+export const getStoreInfo = (data) => {
+ return request.get('/config', data);
}
\ No newline at end of file
diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue
index 8dea01c..cd67bd8 100644
--- a/pageQuota/vipUser/index.vue
+++ b/pageQuota/vipUser/index.vue
@@ -13,7 +13,7 @@
开通行业会员
- 已开通列表
+ 已开通列表
@@ -47,11 +47,17 @@
- 报备人:{{STORE_INFO.detailed_address}}
+ 报备人:{{STORE_INFO.name}}
-
-
+
+
+
+ 完成并收款
+
+
@@ -302,12 +308,20 @@
const submit = async () => {
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
+ formData.store_id = STORE_INFO.id
uni.scanCode({
success: function(res) {
formData.auth_code = res.result
vipRechargeApi(formData).then(res => {
uni.$u.toast('操作成功');
currentTab.value = 2
+ formData.real_name = ''
+ formData.mobile = ''
+ formData.address = ''
+ tabsList.forEach(item => {
+ item.name = '请选择'
+ })
+
})
getCount()
getLists()
@@ -417,6 +431,7 @@
}
.submit-btn {
+ /* height: 200rpx; */
position: fixed;
bottom: 50rpx;
width: 710rpx;
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 47cd6db..19241d9 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -21,15 +21,15 @@
+
- {{shareInfo.real_name?(shareInfo.real_name + '的' + STORE_INFO.name):STORE_INFO.name}}
+ {{(shareInfo.real_name||userStore.userInfo.nickname + '的供销个人门店' )}}
+ {{shareInfo.real_name?(shareInfo.real_name + '的' + STORE_INFO.name):STORE_INFO.store_name}}
-
- {{STORE_INFO.detailed_address}}
-
@@ -226,7 +226,7 @@
const STORE_INFO = ref({
name: '',
- id: '',
+ id: 5,
detailed_address: '',
image: ''
});
@@ -260,11 +260,11 @@
})
const navgo = (url) => {
- if (shareInfo.value.real_name) return
+ if (userStore.userInfo.vip_name) return
- uni.navigateTo({
- url
- })
+ // uni.navigateTo({
+ // url
+ // })
}
/*商品列表滚动隐藏头部导航 */
@@ -315,7 +315,7 @@
cart_num: cart_num,
is_new: 0, // 是否直接购买0否1是
// goods_id: id,
- store_id: STORE_INFO.value.id,
+ store_id: STORE_INFO.value.id || 5,
product_id: product_id
}).then(res => {
getCartList();
@@ -343,7 +343,7 @@
name: '',
order: '',
store_name: '',
- store_id: STORE_INFO.value.id || ''
+ store_id: STORE_INFO.value.id || '5'
})
const loading = ref(true);
@@ -392,7 +392,7 @@
page_no: page_no,
page_size: 30,
level: three,
- store_id: STORE_INFO.value.id || '' // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。
+ store_id: STORE_INFO.value.id || '5' // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。
}).then(res => {
if (pid == 0) { // 加载一级分类时设置全部分类
if (!res.data?.lists?.length) return;
@@ -500,7 +500,7 @@
productLogApi({
product_id: item.product_id,
cate_id: item.cate_id,
- store_id: STORE_INFO.value.id || ''
+ store_id: STORE_INFO.value.id || '5'
});
};
const changeGood = (data) => { // 确定选择商品重量
@@ -566,9 +566,9 @@
onLoad(async (opt) => {
// 店铺id
if (opt.id) {
- where.value.store_id = opt.id;
+ where.value.store_id = 5;
const info = await shopDetailApi({
- store_id: opt.id
+ store_id: 5
});
STORE_INFO.value = info.data;
@@ -592,7 +592,7 @@
const info = uni.getStorageSync('STORE_INFO');
if (info) {
STORE_INFO.value = JSON.parse(info);
- where.value.store_id = STORE_INFO.value.id;
+ where.value.store_id = 5;
}
// 分享信息
@@ -1056,6 +1056,6 @@
.store-info {
margin: 0 0 20rpx 20rpx;
- margin-top: 80rpx;
+ margin-top: 20rpx;
}
\ No newline at end of file
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 62ff847..7e22e2e 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -90,7 +90,8 @@
import {
userLoginApi,
userLoginWeixinApi,
- getMobileByMnpApi
+ getMobileByMnpApi,
+ getStoreInfo
} from "@/api/user.js";
import useUserStore from "@/store/user.js"
import bindPhone from "@/components/bindPhone.vue"
@@ -155,6 +156,9 @@
}).then(res => {
uni.hideLoading();
userStore.setToken(res.data.token);
+ getStoreInfo().then(res => {
+ uni.setStorageSync("STORE_INFO", JSON.stringify(res.data))
+ })
if (!res.data.mobile) { //未绑定手机号
return showBind.value = true;
@@ -180,7 +184,7 @@
} else {
// 直接选择门店
uni.reLaunch({
- url: "/multipleShop/index/index"
+ url: "/pages/index/index?id=" + storeInfo.id
})
}
}
diff --git a/pages/login/test.vue b/pages/login/test.vue
index 9f01aa3..6949adb 100644
--- a/pages/login/test.vue
+++ b/pages/login/test.vue
@@ -9,7 +9,8 @@