diff --git a/pages.json b/pages.json
index 4b59869..b845815 100644
--- a/pages.json
+++ b/pages.json
@@ -21,6 +21,12 @@
// "group": "商城"
// }
// },
+ {
+ "path": "pages/index/login",
+ "style": {
+ "navigationBarTitleText": "登录"
+ }
+ },
{
"path": "pages/index/category",
"style": {
@@ -55,13 +61,8 @@
"group": "商城"
}
},
-
- {
- "path": "pages/index/login",
- "style": {
- "navigationBarTitleText": "登录"
- }
- },
+
+
{
"path": "pages/index/search",
"style": {
@@ -86,8 +87,7 @@
}
}
],
- "subPackages": [
- {
+ "subPackages": [{
"root": "pages/goods",
"pages": [{
"path": "index",
@@ -502,7 +502,7 @@
}
]
},
-
+
{
"root": "pages/app",
"pages": [{
diff --git a/pages/goods/components/detail/detail-tabbar.vue b/pages/goods/components/detail/detail-tabbar.vue
index 4719abc..d139ed2 100644
--- a/pages/goods/components/detail/detail-tabbar.vue
+++ b/pages/goods/components/detail/detail-tabbar.vue
@@ -26,7 +26,8 @@
-->
-
+
首页
@@ -60,8 +61,9 @@
-
+
@@ -159,8 +161,9 @@
}
}
}
-
+
const goodShare = ref(false)
+
function shareGoods() {
console.log('shareGoods');
showShareModal();
@@ -172,17 +175,20 @@
// toLogin();
// }
}
-
+
const isLogin = computed(() => sheep.$store('user').isLogin);
const showLogin = ref(false);
const iv = ref('');
const wxCode = ref('');
const encryptedData = ref('');
-
+
// 打开登录的弹框
function toLogin() {
console.log('toLogin——打开登录的弹框:', showLogin.value);
- showLogin.value = true;
+ // showLogin.value = true;
+ uni.reLaunch({
+ url: '/pages/index/login'
+ });
console.log('showLogin', showLogin.value);
}
// 关闭登录弹框
@@ -244,10 +250,10 @@
if (code === 1) {
resolve(true);
showLogin.value = false;
- if(goodShare.value == true) {
+ if (goodShare.value == true) {
shareGoods();
}
- if(chatPhone.value == true) {
+ if (chatPhone.value == true) {
getInfoUser();
}
}
@@ -260,40 +266,41 @@
// id: props.modelValue.id,
// });
// };
-
+
//获取平台客服电话
function getInfoUser() {
- userApi.profile().then(res=> {
- if (res.code == 1){
- console.log('获取个人信息:',res.data);
- userInfo.value = res.data;
- console.log('联系平台客服', userInfo.value.platform_contact_number);
- onChat();
- };
- });
+ userApi.profile().then(res => {
+ if (res.code == 1) {
+ console.log('获取个人信息:', res.data);
+ userInfo.value = res.data;
+ console.log('联系平台客服', userInfo.value.platform_contact_number);
+ onChat();
+ };
+ });
}
-
+
//联系平台客服
const chatPhone = ref(false);
+
function onChat() {
- if(isLogin.value == true) {
+ if (isLogin.value == true) {
chatPhone.value = false;
console.log('联系平台客服', userInfo.value.platform_contact_number);
wx.makePhoneCall({
phoneNumber: userInfo.value.platform_contact_number,
success: function() {
console.log("拨打电话成功")
-
+
},
fail: function(err) {
console.log("拨打电话失败", err)
}
})
- }else {
+ } else {
chatPhone.value = true;
toLogin();
}
-
+
}
@@ -332,7 +339,7 @@
}
}
}
-
+
.popup {
background-image: url('https://mall.jiangxiaoxian.hschool.com.cn/loginBack.png');
background-size: 100%;
@@ -345,7 +352,7 @@
justify-content: flex-end;
padding-left: 73rpx;
padding-right: 73rpx;
-
+
.img_shouquan {
position: absolute;
width: 680rpx;
@@ -353,8 +360,8 @@
left: -25rpx;
top: -390rpx;
}
-
-
+
+
#txt2 {
text-align: center;
margin-top: 200rpx;
@@ -364,7 +371,7 @@
position: relative;
font-weight: 500;
}
-
+
.texbut {
width: 507rpx;
height: 93rpx;
@@ -382,5 +389,4 @@
// margin: 0 auto;
}
}
-
\ No newline at end of file
diff --git a/pages/goods/index.vue b/pages/goods/index.vue
index c3dfd74..f83387e 100644
--- a/pages/goods/index.vue
+++ b/pages/goods/index.vue
@@ -26,7 +26,8 @@
{{ state.selectedSkuPrice.original_price || state.goodsInfo.original_price }}
- 登录查看价格
+ 登录查看价格
{{ formatSales(state.goodsInfo.sales_show_type, state.goodsInfo.sales) }}
@@ -68,9 +69,9 @@
-
+
-
+
@@ -94,22 +95,23 @@
-
-
+
+
-
+
-
+
@@ -162,18 +164,21 @@
showActivityModel: false,
activityInfo: [],
});
-
+
const isLogin = computed(() => sheep.$store('user').isLogin);
const showLogin = ref(false);
const iv = ref('');
const wxCode = ref('');
const encryptedData = ref('');
-
-
+
+
// 打开登录的弹框
function toLogin() {
console.log('toLogin——打开登录的弹框:', showLogin.value);
- showLogin.value = true;
+ // showLogin.value = true;
+ uni.reLaunch({
+ url: '/pages/index/login'
+ });
console.log('showLogin', showLogin.value);
}
// 关闭登录弹框
@@ -239,7 +244,7 @@
resolve(false);
});
}
-
+
// 规格变更
function onSkuChange(e) {
@@ -334,7 +339,6 @@
\ No newline at end of file
diff --git a/pages/index/category.vue b/pages/index/category.vue
index 60f5a04..330a640 100644
--- a/pages/index/category.vue
+++ b/pages/index/category.vue
@@ -84,14 +84,14 @@
{{ a.name }}
-
+ @click="toSecondCate(a, q)" v-if="a.children.length > 0">
@@ -669,16 +669,25 @@
//查看更多
function toSecondCate(e, index) {
- console.log('列表数据');
+ console.log('列表数据', e.children);
console.log('查看更多e:', e.id, e.name, index);
// clog
- if (e.children.length != 0) {
+ // 如果index为'0'字符串,表示点击"查看更多",传递二级分类ID
+ // 如果index为数字,表示点击三级分类,传递三级分类ID
+ if (index === '0' && e.children && e.children.length > 0) {
+ // 点击"查看更多",传递二级分类ID
+ uni.navigateTo({
+ url: '/pages/goods/list?categoryId=' + e.id + '&name=' + e.name
+ })
+ } else if (typeof index === 'number' && e.children && e.children.length > 0) {
+ // 点击三级分类,传递三级分类ID
const thirdId = e.children[index].id;
- console.log('查看更多-thirdId:', thirdId);
+ console.log('点击三级分类-thirdId:', thirdId);
uni.navigateTo({
url: '/pages/goods/list?categoryId=' + thirdId + '&name=' + e.name
})
} else {
+ // 没有子分类的情况,传递二级分类ID
uni.navigateTo({
url: '/pages/goods/list?categoryId=' + e.id + '&name=' + e.name
})
diff --git a/pages/index/components/first-two.vue b/pages/index/components/first-two.vue
index 0dbcd78..a46a705 100644
--- a/pages/index/components/first-two.vue
+++ b/pages/index/components/first-two.vue
@@ -1,214 +1,216 @@
-
-
-
-
-
-
-
-
- {{ item.title }}
- ¥{{ item.price[0] }}
- 登录查看价格
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ &:nth-child(2n + 1) {
+ margin-right: 20rpx;
+ }
+ }
+
+ .popup {
+ background-image: url('https://mall.jiangxiaoxian.hschool.com.cn/loginBack.png');
+ background-size: 100%;
+ width: 540rpx;
+ height: 640rpx;
+ display: flex;
+ padding-bottom: 44rpx;
+ flex-direction: column;
+ align-items: baseline;
+ justify-content: flex-end;
+ padding-left: 73rpx;
+ padding-right: 73rpx;
+
+ .img_shouquan {
+ position: absolute;
+ width: 680rpx;
+ height: 857rpx;
+ left: -25rpx;
+ top: -390rpx;
+ }
+
+
+ #txt2 {
+ text-align: center;
+ margin-top: 200rpx;
+ font-size: 28rpx;
+ color: #525252;
+ margin-bottom: 60rpx;
+ position: relative;
+ font-weight: 500;
+ }
+
+ .texbut {
+ width: 507rpx;
+ height: 93rpx;
+ border-radius: 16rpx;
+ // background: #ffbd25;
+ background-image: url('https://mall.jiangxiaoxian.hschool.com.cn/loginBtnTwo.png');
+ background-size: 100%;
+ font-size: 34rpx;
+ color: #3d3d3d;
+ font-weight: bold;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-top: 30rpx;
+ // margin: 0 auto;
+ }
+ }
+
\ No newline at end of file
diff --git a/pages/index/login.vue b/pages/index/login.vue
index 54da565..e404991 100644
--- a/pages/index/login.vue
+++ b/pages/index/login.vue
@@ -1,39 +1,239 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 立即登录
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/index/user.vue b/pages/index/user.vue
index 1259612..15865f5 100644
--- a/pages/index/user.vue
+++ b/pages/index/user.vue
@@ -37,7 +37,7 @@
- 登录/注册
+ 登录/注册
-
+
@@ -178,7 +182,7 @@
import {
showShareModal
} from '@/sheep/hooks/useModal';
-
+
const appInfo = computed(() => sheep.$store('app').info);
// 状态栏置顶相关变量
@@ -290,7 +294,10 @@
// 打开登录的弹框
function toLogin() {
console.log('toLogin', showLogin.value);
- showLogin.value = true;
+ // showLogin.value = true;
+ uni.reLaunch({
+ url: '/pages/index/login'
+ });
console.log('showLogin', showLogin.value);
}
// 关闭登录弹框
@@ -430,19 +437,26 @@
//退出登录
function onLogout() {
- uni.showModal({
- title: '提示',
- content: '确认退出账号?',
- success: async function (res) {
- if (res.confirm) {
- const result = await sheep.$store('user').logout();
- if (result) {
- sheep.$router.go('/pages/index/user');
- }
- }
- },
- });
- }
+ uni.showModal({
+ title: '提示',
+ content: '确认退出账号?',
+ success: async function(res) {
+ if (res.confirm) {
+ const result = await sheep.$store('user').logout();
+ if (result) {
+ // sheep.$router.go('/pages/index/user');
+ // uni.navigateTo({
+ // url: '/pages/index/login'
+ // })
+ uni.reLaunch({
+ url: '/pages/index/login'
+ });
+ }
+
+ }
+ },
+ });
+ }
//分享限制
const canShareApp = ref(false);
diff --git a/sheep/api/app.js b/sheep/api/app.js
index 833250d..072ba23 100644
--- a/sheep/api/app.js
+++ b/sheep/api/app.js
@@ -4,6 +4,12 @@ import {
} from '@/sheep/config';
export default {
+ account: (data) =>
+ request({
+ url: 'user.user/accountLogin',
+ method: 'POST',
+ data,
+ }),
// 系统初始化
init: (templateId) =>
request({
diff --git a/sheep/api/index.js b/sheep/api/index.js
index 33ac2c3..1fa576b 100644
--- a/sheep/api/index.js
+++ b/sheep/api/index.js
@@ -16,6 +16,8 @@ import rent from "./rent"
import school from "./school"
import home from "./home"
import staff from "./staff"
+import loginApi from './login'
+
export default {
activity,
@@ -36,5 +38,6 @@ export default {
school,
home,
staff,
+ loginApi
}
diff --git a/sheep/api/login.js b/sheep/api/login.js
index c66366b..0899baf 100644
--- a/sheep/api/login.js
+++ b/sheep/api/login.js
@@ -9,5 +9,12 @@ export default {
path,
}),
)}`,
+
+ account: (data) =>
+ request({
+ url: 'user.user/accountLogin',
+ method: 'POST',
+ data,
+ }),
};
diff --git a/sheep/components/s-goods-column/s-goods-column.vue b/sheep/components/s-goods-column/s-goods-column.vue
index 6ce34e6..3da29ba 100644
--- a/sheep/components/s-goods-column/s-goods-column.vue
+++ b/sheep/components/s-goods-column/s-goods-column.vue
@@ -1,565 +1,509 @@
-
-
-
-
-
-
-
-
-
- {{ data.title }}
-
-
- {{ priceUnit }}
- {{ isArray(data.price) ? data.price[0] : data.price }}
-
- 登录查看价格
-
-
+
+
+
+
+
+
+
+
+
+ {{ data.title }}
+
+
+ {{ priceUnit }}
+ {{ isArray(data.price) ? data.price[0] : data.price }}
+
+ 登录查看价格
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
- {{ data.title }}
-
-
- {{ priceUnit }}
- {{ isArray(data.price) ? data.price[0] : data.price }}
-
- 登录查看价格
-
-
+
+
+ {{ data.title }}
+
+
+ {{ priceUnit }}
+ {{ isArray(data.price) ? data.price[0] : data.price }}
+
+ 登录查看价格
+
+
-
-
-
-
-
-
-
-
-
- {{ data.title }}
-
-
- {{ data.subtitle }}
-
-
-
-
- {{ item.title }}
-
-
-
-
-
- {{ priceUnit }}
- {{ isArray(data.price) ? data.price[0] : data.price }}
-
- 登录查看价格
+
+
+
+
+
+
+
+
+
+ {{ data.title }}
+
+
+ {{ data.subtitle }}
+
+
+
+
+ {{ item.title }}
+
+
+
+
+
+ {{ priceUnit }}
+ {{ isArray(data.price) ? data.price[0] : data.price }}
+
+ 登录查看价格
-
- {{ priceUnit }}
- {{ data.original_price }}
-
-
+
+ {{ priceUnit }}
+ {{ data.original_price }}
+
+
-
- {{ salesAndStock }}
-
-
+
+ {{ salesAndStock }}
+
+
-
-
+
+
-
-
-
-
-
- 秒杀
-
- 拼团
-
-
-
-
-
- {{ data.title }}
-
-
- {{ data.subtitle }}
-
-
-
-
-
-
- {{ item.title }}
-
-
-
-
-
- {{ priceUnit }}
- {{ isArray(data.price) ? data.price[0] : data.price }}
-
- 登录查看价格
-
- {{ priceUnit }}
- {{ data.original_price }}
-
-
-
- {{ salesAndStock }}
-
-
-
+
+
+
+
+
+ 秒杀
+
+ 拼团
+
+
+
+
+
+ {{ data.title }}
+
+
+ {{ data.subtitle }}
+
+
+
+
+
+
+ {{ item.title }}
+
+
+
+
+
+ {{ priceUnit }}
+ {{ isArray(data.price) ? data.price[0] : data.price }}
+
+ 登录查看价格
+
+ {{ priceUnit }}
+ {{ data.original_price }}
+
+
+
+ {{ salesAndStock }}
+
+
+
-
- 去购买
-
-
+
+ 去购买
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
- {{ data.title }}
-
-
- {{ data.subtitle }}
-
-
-
-
-
-
- {{ item.title }}
-
-
-
-
-
- {{ priceUnit }}
- {{ isArray(data.price) ? data.price[0] : data.price }}
-
- 登录查看价格
-
- {{ priceUnit }}
- {{ data.original_price }}
-
-
-
- {{ salesAndStock }}
-
-
-
+
+
+
+ {{ data.title }}
+
+
+ {{ data.subtitle }}
+
+
+
+
+
+
+ {{ item.title }}
+
+
+
+
+
+ {{ priceUnit }}
+ {{ isArray(data.price) ? data.price[0] : data.price }}
+
+ 登录查看价格
+
+ {{ priceUnit }}
+ {{ data.original_price }}
+
+
+
+ {{ salesAndStock }}
+
+
+
-
- 去购买
-
-
-
-
-
-
-
-
+
+ 去购买
+
+
-
+
+
+
+
+
+
+
+ .sl-goods-price {
+ font-size: 30rpx;
+ color: $red;
+ line-height: 36rpx;
+ }
+
+ .buy-box {
+ position: absolute;
+ bottom: 20rpx;
+ right: 20rpx;
+ z-index: 2;
+ width: 148rpx;
+ height: 50rpx;
+ background: linear-gradient(90deg, #fe8900, #ff5e00);
+ border-radius: 25rpx;
+ font-size: 24rpx;
+ color: #ffffff;
+ }
+ }
+
\ No newline at end of file
diff --git a/sheep/components/s-select-sku/s-select-sku.vue b/sheep/components/s-select-sku/s-select-sku.vue
index 83ecae4..8fd560f 100644
--- a/sheep/components/s-select-sku/s-select-sku.vue
+++ b/sheep/components/s-select-sku/s-select-sku.vue
@@ -81,8 +81,9 @@
-
+
@@ -135,7 +136,10 @@
// 打开登录的弹框
function toLogin() {
console.log('toLogin——打开登录的弹框:', showLogin.value);
- showLogin.value = true;
+ // showLogin.value = true;
+ uni.reLaunch({
+ url: '/pages/index/login'
+ });
console.log('showLogin', showLogin.value);
}
// 关闭登录弹框