登录前置
This commit is contained in:
parent
5619fa3411
commit
715101f18e
16
pages.json
16
pages.json
@ -21,6 +21,12 @@
|
||||
// "group": "商城"
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pages/index/login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/category",
|
||||
"style": {
|
||||
@ -56,12 +62,7 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/index/login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/index/search",
|
||||
"style": {
|
||||
@ -86,8 +87,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
"subPackages": [{
|
||||
"root": "pages/goods",
|
||||
"pages": [{
|
||||
"path": "index",
|
||||
|
||||
@ -26,7 +26,8 @@
|
||||
</view> -->
|
||||
<view v-if="serviceIcon" class="detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center"
|
||||
style="margin-left: 12rpx;" @tap="backHome">
|
||||
<image class="item-icon" src="https://mall.jiangxiaoxian.hschool.com.cn/backHome.png" mode="aspectFit">
|
||||
<image class="item-icon" src="https://mall.jiangxiaoxian.hschool.com.cn/backHome.png"
|
||||
mode="aspectFit">
|
||||
</image>
|
||||
<view class="item-title">首页</view>
|
||||
</view>
|
||||
@ -60,8 +61,9 @@
|
||||
</button>
|
||||
</view>
|
||||
<view style="margin: 0 auto;position: absolute;bottom: -90rpx;width: 100%;text-align: center;">
|
||||
<image style="width: 50rpx;height: 50rpx;" src="https://mall.jiangxiaoxian.hschool.com.cn/registerCancel.png"
|
||||
mode="aspectFill" @click="showLogin = false"></image>
|
||||
<image style="width: 50rpx;height: 50rpx;"
|
||||
src="https://mall.jiangxiaoxian.hschool.com.cn/registerCancel.png" mode="aspectFill"
|
||||
@click="showLogin = false"></image>
|
||||
</view>
|
||||
</su-popup>
|
||||
</template>
|
||||
@ -161,6 +163,7 @@
|
||||
}
|
||||
|
||||
const goodShare = ref(false)
|
||||
|
||||
function shareGoods() {
|
||||
console.log('shareGoods');
|
||||
showShareModal();
|
||||
@ -182,7 +185,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);
|
||||
}
|
||||
// 关闭登录弹框
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
@ -263,20 +269,21 @@
|
||||
|
||||
//获取平台客服电话
|
||||
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({
|
||||
@ -289,7 +296,7 @@
|
||||
console.log("拨打电话失败", err)
|
||||
}
|
||||
})
|
||||
}else {
|
||||
} else {
|
||||
chatPhone.value = true;
|
||||
toLogin();
|
||||
}
|
||||
@ -382,5 +389,4 @@
|
||||
// margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -26,7 +26,8 @@
|
||||
{{ state.selectedSkuPrice.original_price || state.goodsInfo.original_price }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-else style="font-size: 42rpx;font-weight: 500;line-height: 30rpx;color: #ff3000;" @click.stop="toLogin">登录查看价格</view>
|
||||
<view v-else style="font-size: 42rpx;font-weight: 500;line-height: 30rpx;color: #ff3000;"
|
||||
@click.stop="toLogin">登录查看价格</view>
|
||||
<view class="sales-text">
|
||||
{{ formatSales(state.goodsInfo.sales_show_type, state.goodsInfo.sales) }}
|
||||
</view>
|
||||
@ -95,8 +96,8 @@
|
||||
@close="state.showActivityModel = false" />
|
||||
</block>
|
||||
|
||||
<su-popup :show="showLogin == true" type="center" round="10"
|
||||
@close="showLogin = false" @open="showLogin = true">
|
||||
<su-popup :show="showLogin == true" type="center" round="10" @close="showLogin = false"
|
||||
@open="showLogin = true">
|
||||
<view class="popup">
|
||||
|
||||
<button class="texbut" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||
@ -105,8 +106,9 @@
|
||||
</button>
|
||||
</view>
|
||||
<view style="margin: 0 auto;position: absolute;bottom: -90rpx;width: 100%;text-align: center;">
|
||||
<image style="width: 50rpx;height: 50rpx;" src="https://mall.jiangxiaoxian.hschool.com.cn/registerCancel.png"
|
||||
mode="aspectFill" @click="showLogin = false"></image>
|
||||
<image style="width: 50rpx;height: 50rpx;"
|
||||
src="https://mall.jiangxiaoxian.hschool.com.cn/registerCancel.png" mode="aspectFill"
|
||||
@click="showLogin = false"></image>
|
||||
</view>
|
||||
</su-popup>
|
||||
|
||||
@ -173,7 +175,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);
|
||||
}
|
||||
// 关闭登录弹框
|
||||
@ -334,7 +339,6 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.detail-card {
|
||||
background-color: #ffff;
|
||||
margin: 14rpx 20rpx;
|
||||
@ -539,5 +543,4 @@
|
||||
// margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -84,14 +84,14 @@
|
||||
<view v-for="(a, b) in e.children" :id="'second_' + a.id">
|
||||
<view class="title-box ss-flex ss-col-center ss-row-between ss-p-b-30">
|
||||
<view class="title-text">{{ a.name }}</view>
|
||||
<button class="ss-reset-button more-btn" @click="toSecondCate(c, '0')">
|
||||
<button class="ss-reset-button more-btn" @click="toSecondCate(a, '0')">
|
||||
查看更多
|
||||
<text class="cicon-forward"></text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="goods-item-box ss-flex ss-flex-wrap ss-p-b-20">
|
||||
<view class="goods-item" v-for="(f, q) in a.children" :key="f.id"
|
||||
@click="toSecondCate(e, q)" v-if="a.children.length > 0">
|
||||
@click="toSecondCate(a, q)" v-if="a.children.length > 0">
|
||||
<view>
|
||||
<image class="goods-img" :src="f.image" mode="aspectFill">
|
||||
</image>
|
||||
@ -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
|
||||
})
|
||||
|
||||
@ -1,214 +1,216 @@
|
||||
<!-- 页面 -->
|
||||
<template>
|
||||
<view>
|
||||
<view class="ss-flex flex-wrap">
|
||||
<view class="goods-box" v-for="item in pagination?.data" :key="item.id">
|
||||
<view @click="sheep.$router.go('/pages/goods/index', { id: item.id })">
|
||||
<view class="goods-img">
|
||||
<image class="goods-img" :src="sheep.$url.cdn(item.image)" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="goods-content">
|
||||
<view class="goods-title ss-line-1 ss-m-b-28">{{ item.title }}</view>
|
||||
<view class="goods-price" v-if="isLogin == true">¥{{ item.price[0] }}</view>
|
||||
<view class="goods-price" v-else @click.stop="toLogin">登录查看价格</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<su-popup :show="showLogin == true" type="center" round="10"
|
||||
@close="showLogin = false" @open="showLogin = true">
|
||||
<view class="popup">
|
||||
|
||||
<button class="texbut" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||
<!-- <image style="width: 100%;height: 136rpx;" src="https://mall.jiangxiaoxian.hschool.com.cn/loginBtnTwo.png"></image> -->
|
||||
<!-- 授权登录 -->
|
||||
</button>
|
||||
<view>
|
||||
<view class="ss-flex flex-wrap">
|
||||
<view class="goods-box" v-for="item in pagination?.data" :key="item.id">
|
||||
<view @click="sheep.$router.go('/pages/goods/index', { id: item.id })">
|
||||
<view class="goods-img">
|
||||
<image class="goods-img" :src="sheep.$url.cdn(item.image)" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="goods-content">
|
||||
<view class="goods-title ss-line-1 ss-m-b-28">{{ item.title }}</view>
|
||||
<view class="goods-price" v-if="isLogin == true">¥{{ item.price[0] }}</view>
|
||||
<view class="goods-price" v-else @click.stop="toLogin">登录查看价格</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</su-popup>
|
||||
</view>
|
||||
<su-popup :show="showLogin == true" type="center" round="10" @close="showLogin = false"
|
||||
@open="showLogin = true">
|
||||
<view class="popup">
|
||||
|
||||
<button class="texbut" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||
<!-- <image style="width: 100%;height: 136rpx;" src="https://mall.jiangxiaoxian.hschool.com.cn/loginBtnTwo.png"></image> -->
|
||||
<!-- 授权登录 -->
|
||||
</button>
|
||||
</view>
|
||||
</su-popup>
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
computed,
|
||||
ref,
|
||||
reactive,
|
||||
} from 'vue';
|
||||
import third from '@/sheep/api/third';
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
activeMenu: [Number, String],
|
||||
pagination: Object,
|
||||
});
|
||||
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;
|
||||
console.log('showLogin', showLogin.value);
|
||||
}
|
||||
// 关闭登录弹框
|
||||
function closeLogin() {
|
||||
console.log('closeLogin');
|
||||
showLogin.value = false;
|
||||
}
|
||||
// 打开登录的弹框
|
||||
function openLogin() {
|
||||
console.log('openLogin');
|
||||
showLogin.value = true;
|
||||
}
|
||||
// 使用微信手机号
|
||||
async function getPhoneNumber(e) {
|
||||
console.log('获取手机号', e, e.detail.errMsg);
|
||||
if (e.detail.errMsg !== 'getPhoneNumber:ok') {} else {
|
||||
encryptedData.value = e.detail.encryptedData // 用于解密
|
||||
iv.value = e.detail.iv // 用于解密
|
||||
getCode()
|
||||
// let result = await sheep.$platform.useProvider().bindUserPhoneNumber(e.detail);
|
||||
// console.log('result', result);
|
||||
// if (result) {
|
||||
// sheep.$store('user').getInfo();
|
||||
// // closeAuthModal();
|
||||
// closeLogin();
|
||||
// }
|
||||
}
|
||||
}
|
||||
// 获取code和sessionId
|
||||
function getCode() {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res) => {
|
||||
wxCode.value = res.code
|
||||
// loginResult.value = res
|
||||
// getSessionId();
|
||||
Login();
|
||||
}
|
||||
})
|
||||
}
|
||||
// 登录接口
|
||||
function Login() {
|
||||
const session_id = uni.getStorageSync('sessionId')
|
||||
console.log('session_id', session_id);
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const {
|
||||
code
|
||||
} = await third.wechat.wxLogin({
|
||||
platform: 'miniProgram',
|
||||
payload: encodeURIComponent(
|
||||
JSON.stringify({
|
||||
sessionId: session_id,
|
||||
iv: iv.value,
|
||||
encryptedData: encryptedData.value,
|
||||
code: wxCode.code,
|
||||
}),
|
||||
),
|
||||
});
|
||||
if (code === 1) {
|
||||
resolve(true);
|
||||
showLogin.value = false;
|
||||
}
|
||||
resolve(false);
|
||||
});
|
||||
}
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
computed,
|
||||
ref,
|
||||
reactive,
|
||||
} from 'vue';
|
||||
import third from '@/sheep/api/third';
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
activeMenu: [Number, String],
|
||||
pagination: Object,
|
||||
});
|
||||
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);
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/login'
|
||||
});
|
||||
// showLogin.value = true;
|
||||
// console.log('showLogin', showLogin.value);
|
||||
}
|
||||
// 关闭登录弹框
|
||||
function closeLogin() {
|
||||
console.log('closeLogin');
|
||||
showLogin.value = false;
|
||||
}
|
||||
// 打开登录的弹框
|
||||
function openLogin() {
|
||||
console.log('openLogin');
|
||||
showLogin.value = true;
|
||||
}
|
||||
// 使用微信手机号
|
||||
async function getPhoneNumber(e) {
|
||||
console.log('获取手机号', e, e.detail.errMsg);
|
||||
if (e.detail.errMsg !== 'getPhoneNumber:ok') {} else {
|
||||
encryptedData.value = e.detail.encryptedData // 用于解密
|
||||
iv.value = e.detail.iv // 用于解密
|
||||
getCode()
|
||||
// let result = await sheep.$platform.useProvider().bindUserPhoneNumber(e.detail);
|
||||
// console.log('result', result);
|
||||
// if (result) {
|
||||
// sheep.$store('user').getInfo();
|
||||
// // closeAuthModal();
|
||||
// closeLogin();
|
||||
// }
|
||||
}
|
||||
}
|
||||
// 获取code和sessionId
|
||||
function getCode() {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res) => {
|
||||
wxCode.value = res.code
|
||||
// loginResult.value = res
|
||||
// getSessionId();
|
||||
Login();
|
||||
}
|
||||
})
|
||||
}
|
||||
// 登录接口
|
||||
function Login() {
|
||||
const session_id = uni.getStorageSync('sessionId')
|
||||
console.log('session_id', session_id);
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const {
|
||||
code
|
||||
} = await third.wechat.wxLogin({
|
||||
platform: 'miniProgram',
|
||||
payload: encodeURIComponent(
|
||||
JSON.stringify({
|
||||
sessionId: session_id,
|
||||
iv: iv.value,
|
||||
encryptedData: encryptedData.value,
|
||||
code: wxCode.code,
|
||||
}),
|
||||
),
|
||||
});
|
||||
if (code === 1) {
|
||||
resolve(true);
|
||||
showLogin.value = false;
|
||||
}
|
||||
resolve(false);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.goods-box {
|
||||
width: calc((100% - 20rpx) / 2);
|
||||
margin-bottom: 20rpx;
|
||||
.goods-box {
|
||||
width: calc((100% - 20rpx) / 2);
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.goods-img {
|
||||
width: 246rpx;
|
||||
height: 246rpx;
|
||||
border-radius: 10rpx 10rpx 0px 0px;
|
||||
}
|
||||
.goods-img {
|
||||
width: 246rpx;
|
||||
height: 246rpx;
|
||||
border-radius: 10rpx 10rpx 0px 0px;
|
||||
}
|
||||
|
||||
.goods-content {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 0px 20rpx 4rpx rgba(199, 199, 199, 0.22);
|
||||
padding: 20rpx 0 32rpx 16rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 0 0 10rpx 10rpx;
|
||||
.goods-content {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 0px 20rpx 4rpx rgba(199, 199, 199, 0.22);
|
||||
padding: 20rpx 0 32rpx 16rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 0 0 10rpx 10rpx;
|
||||
|
||||
.goods-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
.goods-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.goods-price {
|
||||
font-size: 24rpx;
|
||||
font-family: OPPOSANS;
|
||||
font-weight: 500;
|
||||
color: #e1212b;
|
||||
}
|
||||
}
|
||||
.goods-price {
|
||||
font-size: 24rpx;
|
||||
font-family: OPPOSANS;
|
||||
font-weight: 500;
|
||||
color: #e1212b;
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(2n + 1) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
&: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;
|
||||
.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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
#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;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,39 +1,239 @@
|
||||
<template>
|
||||
<!-- 空登陆页 -->
|
||||
<view></view>
|
||||
<!-- 空登陆页 -->
|
||||
<view class="app-container">
|
||||
<view class="header">
|
||||
<image src="https://mall.jiangxiaoxian.hschool.com.cn/loginLogo.jpg" mode=""></image>
|
||||
<view class="headerText" style="margin-top: 30rpx;">登录,中团小管家</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="input-box">
|
||||
<input class="accountBox" v-model="loginForm.account" placeholder="账号" placeholder-style="color:#3d3d3d" />
|
||||
<input class="passBox" v-model="loginForm.password" :password="true" input="safe-password" placeholder="密码"
|
||||
placeholder-style="color:#3d3d3d"></input>
|
||||
<!-- <view class="accountBox">
|
||||
<input class="" v-model="loginForm.accountNum" type="number" placeholder="账号"></input>
|
||||
</view> -->
|
||||
<!-- <view class="passBox">
|
||||
<uni-easyinput v-model="loginForm.password" :password="true"
|
||||
input="safe-password" placeholder="密码"></uni-easyinput>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
<view class="wxButton">
|
||||
<button class="login-style" @click="tologin()">
|
||||
<view class="text">
|
||||
立即登录
|
||||
</view>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { isEmpty } from 'lodash';
|
||||
import sheep from '@/sheep';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import {
|
||||
isEmpty
|
||||
} from 'lodash';
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
computed,
|
||||
ref,
|
||||
reactive
|
||||
} from 'vue';
|
||||
|
||||
onLoad(async (options) => {
|
||||
// #ifdef H5
|
||||
let event = '';
|
||||
if (options.login_code) {
|
||||
event = 'login';
|
||||
const { code } = await sheep.$platform.useProvider().login(options.login_code);
|
||||
if (code === 1) {
|
||||
sheep.$store('user').getInfo();
|
||||
}
|
||||
}
|
||||
if (options.bind_code) {
|
||||
event = 'bind';
|
||||
const { code } = await sheep.$platform.useProvider().bind(options.bind_code);
|
||||
}
|
||||
// onLoad(async (options) => {
|
||||
// // #ifdef H5
|
||||
// let event = '';
|
||||
// if (options.login_code) {
|
||||
// event = 'login';
|
||||
// const {
|
||||
// code
|
||||
// } = await sheep.$platform.useProvider().login(options.login_code);
|
||||
// if (code === 1) {
|
||||
// sheep.$store('user').getInfo();
|
||||
// }
|
||||
// }
|
||||
// if (options.bind_code) {
|
||||
// event = 'bind';
|
||||
// const {
|
||||
// code
|
||||
// } = await sheep.$platform.useProvider().bind(options.bind_code);
|
||||
// }
|
||||
|
||||
// 检测H5登录回调
|
||||
let returnUrl = uni.getStorageSync('returnUrl');
|
||||
if (returnUrl) {
|
||||
uni.removeStorage('returnUrl');
|
||||
location.replace(returnUrl);
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/',
|
||||
});
|
||||
}
|
||||
// // 检测H5登录回调
|
||||
// let returnUrl = uni.getStorageSync('returnUrl');
|
||||
// if (returnUrl) {
|
||||
// uni.removeStorage('returnUrl');
|
||||
// location.replace(returnUrl);
|
||||
// } else {
|
||||
// uni.switchTab({
|
||||
// url: '/',
|
||||
// });
|
||||
// }
|
||||
|
||||
// #endif
|
||||
});
|
||||
// // #endif
|
||||
// });
|
||||
|
||||
const loginForm = ref({
|
||||
account: '',
|
||||
password: '',
|
||||
})
|
||||
|
||||
const isLogin = computed(() => sheep.$store('user').isLogin);
|
||||
|
||||
function tologin() {
|
||||
console.log('dengl1', loginForm.value, isLogin.value);
|
||||
sheep.$api.app.account(loginForm.value).then((res) => {
|
||||
console.log('res-login:', res)
|
||||
if (res.code == 1) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/category'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
console.log('dengl1', isLogin.value);
|
||||
if (isLogin.value == true) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/category'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-container {
|
||||
height: 100%;
|
||||
min-height: 100vh;
|
||||
/* 确保最小高度为100vh */
|
||||
padding: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
// justify-content: center;
|
||||
/* 垂直居中内容 */
|
||||
background-image: url('https://mall.jiangxiaoxian.hschool.com.cn/loginPageBack.png');
|
||||
background-size: 100% 100%;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
|
||||
.header {
|
||||
width: 100%;
|
||||
height: 450rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: left;
|
||||
justify-content: flex-end;
|
||||
padding-left: 40rpx;
|
||||
margin-bottom: 100rpx;
|
||||
|
||||
image {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
.headerText {
|
||||
margin-top: 30rpx;
|
||||
color: #323232;
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
line-height: 67rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.input-box {
|
||||
margin: 0 auto;
|
||||
|
||||
.accountBox {
|
||||
padding: 0 30rpx;
|
||||
width: 570rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 163rpx;
|
||||
border: 2rpx solid #323232;
|
||||
color: #3d3d3d;
|
||||
font-size: 32rpx;
|
||||
line-height: 45rpx;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.passBox {
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
width: 570rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 163rpx;
|
||||
border: 2rpx solid #323232;
|
||||
color: #3d3d3d;
|
||||
font-size: 32rpx;
|
||||
line-height: 45rpx;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.wxButton {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
width: 670rpx;
|
||||
margin-top: 60rpx;
|
||||
|
||||
.login-style {
|
||||
background-color: #FEC136;
|
||||
font-size: 32rpx;
|
||||
color: #323232;
|
||||
margin: 20rpx;
|
||||
border-radius: 100rpx;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
image {
|
||||
position: absolute;
|
||||
top: 15rpx;
|
||||
left: 20rpx;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin-left: 30rpx
|
||||
}
|
||||
|
||||
.text {}
|
||||
}
|
||||
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
font-size: small;
|
||||
align-items: center;
|
||||
color: #b1b1b1;
|
||||
|
||||
.xieyi {
|
||||
color: #5de198;
|
||||
margin: 0 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
@ -37,7 +37,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-name fs-36 weight8 flexD" v-else>
|
||||
<view style="font-weight: 800;" @click="toLogin">登录/注册</view>
|
||||
<view style="font-weight: 800;">登录/注册</view>
|
||||
</view>
|
||||
<!-- <view class="fs-28 weight4" style="margin-top: 30rpx;">会员到期时间:
|
||||
剩余{{ userInfo.all_mobile_num ? userInfo.all_mobile_num : 0 }}次
|
||||
@ -63,11 +63,13 @@
|
||||
</view>
|
||||
<view class="myOrder-second">
|
||||
<view class="pendingBox" @click="toPage('/pages/order/list?type=1')">
|
||||
<image class="pendImg" src="https://mall.jiangxiaoxian.hschool.com.cn/pendPay.png"></image>
|
||||
<image class="pendImg" src="https://mall.jiangxiaoxian.hschool.com.cn/pendPay.png">
|
||||
</image>
|
||||
<view class="fs-28 weight4" style="margin-top: 20rpx;color: #3d3d3d;">待支付</view>
|
||||
</view>
|
||||
<view class="pendingBox" @click="toPage('/pages/order/list?type=2')">
|
||||
<image class="pendImg" src="https://mall.jiangxiaoxian.hschool.com.cn/shipment.png"></image>
|
||||
<image class="pendImg" src="https://mall.jiangxiaoxian.hschool.com.cn/shipment.png">
|
||||
</image>
|
||||
<view class="fs-28 weight4" style="margin-top: 20rpx;color: #3d3d3d;">待发货</view>
|
||||
</view>
|
||||
<view class="pendingBox" @click="toPage('/pages/order/list?type=3')">
|
||||
@ -76,7 +78,8 @@
|
||||
<view class="fs-28 weight4" style="margin-top: 20rpx;color: #3d3d3d;">待收货</view>
|
||||
</view>
|
||||
<view class="pendingBox" @click="toPage('/pages/order/list?type=4')">
|
||||
<image class="pendImg" src="https://mall.jiangxiaoxian.hschool.com.cn/completed.png"></image>
|
||||
<image class="pendImg" src="https://mall.jiangxiaoxian.hschool.com.cn/completed.png">
|
||||
</image>
|
||||
<view class="fs-28 weight4" style="margin-top: 20rpx;color: #3d3d3d;">已完成</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -97,7 +100,8 @@
|
||||
</view>
|
||||
<view class="line-row" style="margin: 40rpx 0;"></view>
|
||||
<!-- 关于我们 -->
|
||||
<view class="fabuBox" @click="toPage(`/pages/public/richtext?id=`+ appInfo.about_us.id + '&title='+ appInfo.about_us.title)">
|
||||
<view class="fabuBox"
|
||||
@click="toPage(`/pages/public/richtext?id=`+ appInfo.about_us.id + '&title='+ appInfo.about_us.title)">
|
||||
<view class="flex align-items">
|
||||
<image style="width: 36rpx;height: 36rpx;margin-right: 20rpx;"
|
||||
src="https://mall.jiangxiaoxian.hschool.com.cn/aboutUs.png"></image>
|
||||
@ -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);
|
||||
|
||||
@ -4,6 +4,12 @@ import {
|
||||
} from '@/sheep/config';
|
||||
|
||||
export default {
|
||||
account: (data) =>
|
||||
request({
|
||||
url: 'user.user/accountLogin',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
// 系统初始化
|
||||
init: (templateId) =>
|
||||
request({
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -10,4 +10,11 @@ export default {
|
||||
}),
|
||||
)}`,
|
||||
|
||||
account: (data) =>
|
||||
request({
|
||||
url: 'user.user/accountLogin',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -81,8 +81,9 @@
|
||||
</button>
|
||||
</view>
|
||||
<view style="margin: 0 auto;position: absolute;bottom: -90rpx;width: 100%;text-align: center;">
|
||||
<image style="width: 50rpx;height: 50rpx;" src="https://mall.jiangxiaoxian.hschool.com.cn/registerCancel.png"
|
||||
mode="aspectFill" @click="showLogin = false"></image>
|
||||
<image style="width: 50rpx;height: 50rpx;"
|
||||
src="https://mall.jiangxiaoxian.hschool.com.cn/registerCancel.png" mode="aspectFill"
|
||||
@click="showLogin = false"></image>
|
||||
</view>
|
||||
</su-popup>
|
||||
</template>
|
||||
@ -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);
|
||||
}
|
||||
// 关闭登录弹框
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user