msb_beta
ch 2 years ago
parent 341dfef6b9
commit 116c3c891e

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-17 16:36:59
* @LastEditors: ch
* @LastEditTime: 2022-04-20 11:57:58
* @LastEditTime: 2022-04-20 16:07:24
* @Description: 针对uniapp request请求做了一次封装使用思维参考axios
*
*
@ -70,7 +70,6 @@ class MsbUniRequest {
return option
}
return new Promise((resolve, reject)=>{
console.log(option);
uni.request({
...option,
success: res => {

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-17 17:42:32
* @LastEditors: ch
* @LastEditTime: 2022-04-20 15:34:09
* @LastEditTime: 2022-04-20 19:15:36
* @Description: 项目接口请求统一处理器返回一个需要token和不需要token的请求封装方法
*/
@ -11,8 +11,8 @@ import $store from '@/common/store';
const ENV = 'test';
const BASE_URL = {
'test' : 'http://k8s-horse-gateway.mashibing.cn',
// 'test' : '',
// 'test' : 'http://k8s-horse-gateway.mashibing.cn',
'test' : '',
'release' : '',
'prod' : ''
};
@ -53,10 +53,15 @@ let repeatFlag = [];
* @param {*} option
*/
const repeatVerify = (option)=>{
if(repeatFlag.includes(JSON.stringify(option))){
let flag = {
url : option.url,
method : option.method,
data : option.data
}
if(repeatFlag.includes(JSON.stringify(flag))){
return Promise.reject({message:'请勿频繁操作'});
}
repeatFlag.push(JSON.stringify(option));
repeatFlag.push(JSON.stringify(flag));
return false;
};
/**
@ -64,9 +69,16 @@ const repeatVerify = (option)=>{
* @param {*} option
*/
const clearRepeat = (option) =>{
console.log(repeatFlag)
repeatFlag = repeatFlag.filter( i => {
return i !== JSON.stringify(option)
return i !== JSON.stringify({
url : option.url,
method : option.method,
data : option.data
})
});
console.log(repeatFlag)
}
// 不需要token的接口封装
@ -74,7 +86,6 @@ const MsbRequest = new MsbUniRequest();
MsbRequest.baseUrl = BASE_URL[ENV];
MsbRequest.use('request', (option) => {
console.log('option',option);
if(option.header.repeat){
// 如果当前请求不允许重复调用,则检查重复请求,当前接口有正在请求则不发起请求
const isRepeatVerify = repeatVerify(option);

@ -6,6 +6,7 @@
"aliasPath" : "/",
"style": {
"navigationStyle" : "custom",
"navigationBarTitleText": "马士兵严选",
"backgroundColor" : "#69ADE5"
}
},

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-22 14:12:18
* @LastEditors: ch
* @LastEditTime: 2022-04-20 14:45:43
* @LastEditTime: 2022-04-20 19:23:18
* @Description: file content
-->
<template>
@ -10,7 +10,7 @@
<view class="form">
<UiCell class="form--item" title="收货人" :rightIcon="false">
<template slot="value">
<input class="form--itemInput" v-model="address.name" placeholder="请输入收货人姓名"/>
<input class="form--itemInput" v-model="address.name" :maxlength="10" placeholder="请输入收货人姓名"/>
</template>
</UiCell>
<UiCell class="form--item" title="手机号码" :rightIcon="false">

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-22 14:12:18
* @LastEditors: ch
* @LastEditTime: 2022-04-20 14:45:36
* @LastEditTime: 2022-04-20 19:23:30
* @Description: file content
-->
<template>
@ -10,7 +10,7 @@
<view class="form">
<UiCell class="form--item" title="收货人" :rightIcon="false">
<template slot="value">
<input class="form--itemInput" v-model="address.name" placeholder="请输入收货人姓名"/>
<input class="form--itemInput" v-model="address.name" :maxlength="10" placeholder="请输入收货人姓名"/>
</template>
</UiCell>
<UiCell class="form--item" title="手机号码" :rightIcon="false">

@ -23,7 +23,7 @@
<!-- 购物车商品列表 -->
<view v-else class="cart-list">
<view class="cart-item" v-for="(item, index) in list" :key="index"
@click="$Router.push(`goodsDetail?id=${item.id}`)">
@click="$Router.push(`/goodsDetail?id=${item.id}`)">
<label class="cart-item--radio" @click.stop="handleCheckItem(item.id)">
<radio class="radio" color="#FF875B"
:checked="checkedIds.length ? checkedIds.includes(item.id) : false" />

@ -2,14 +2,12 @@
* @Author: ch
* @Date: 2022-03-23 10:31:12
* @LastEditors: ch
* @LastEditTime: 2022-04-12 10:09:44
* @LastEditTime: 2022-04-20 18:29:40
* @Description: file content
-->
<template>
<view class="banner">
<u-swiper keyName="img" :list="data" height="240rpx" indicator indicatorMode="dot">
</u-swiper>
<u-swiper bgColor="none" radius="18rpx" keyName="img" :list="data" height="240rpx" indicator indicatorMode="dot"></u-swiper>
<view class="desc">
<view class="desc--item">
<image class="desc--icon" src='@/static/index/bz.png'></image>
@ -50,53 +48,42 @@ export default {
.banner{
height: 388rpx;
position: relative;
padding: 40rpx 30rpx 0;
// margin-bottom: 50rpx;
padding: 50rpx 30rpx 0;
overflow: hidden;
&::before{
display: block;
content: '';
position: absolute;
left: -5vw;
top:0;
top:-2rpx;
height: 231rpx;
width: 110vw;
background: $color-blue5;
border-bottom-left-radius: 100%;
border-bottom-right-radius: 100%;
}
.swiper{
background-color: none !important;
}
}
.desc{
display: flex;
justify-content: space-between;
margin-top: 24rpx;
margin-top: 14rpx;
padding-right: 10rpx;
&--item{
display: flex;
align-items: center;
}
&--icon{
width: 22rpx;
height: 24rpx;
width: 42rpx;
height: 44rpx;
position: relative;
margin-right: 11rpx;
overflow: initial;
// box-shadow: 0 0 5rpx #f00;
&::before{
display: block;
content: '';
position: absolute;
width: 10rpx;
height: 10rpx;
border-radius: 50%;
top: 10rpx;
left: 7rpx;
box-shadow: 0 0 20rpx #FA7204;
background: #FA7204;
z-index: -1;
}
}
&--txt{
font-size: 22rpx;
color: $color-grey5;
margin-top: 4rpx;
}
}
</style>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-23 10:29:07
* @LastEditors: ch
* @LastEditTime: 2022-04-12 18:54:58
* @LastEditTime: 2022-04-20 19:05:54
* @Description: file content
-->
<template>
@ -85,6 +85,7 @@ export default {
}
.title{
margin-top: 20rpx;
font-weight: bold;
}
.desc{
color: $color-grey4;
@ -116,6 +117,7 @@ export default {
height: 215rpx;
background: $color-grey0;
border-radius: 8rpx;
margin-left: 20rpx;
&--info-box{
display: flex;
justify-content: space-between;

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-23 10:07:48
* @LastEditors: ch
* @LastEditTime: 2022-04-13 09:45:18
* @LastEditTime: 2022-04-20 18:21:52
* @Description: file content
-->
<template>
@ -18,7 +18,7 @@
</view>
<view class="seckill-title--more">
<text>查看更多</text>
<image class="seckill-title--more-icon" src="@/static/common/arrow.png"></image>
<image class="seckill-title--more-icon" src="@/static/index/arrow.png"></image>
</view>
</view>
<view class="seckill--group">
@ -114,6 +114,7 @@ export default {
align-items: center;
&--text{
font-size: 36rpx;
font-weight: bold;
}
&--left{
display: flex;
@ -173,10 +174,11 @@ export default {
margin-right: 8rpx;
}
&--more{
display: inline-block;
display: flex;
align-items: center;
text{
font-size: $font-size-sm;
color: $color-grey5;
color: $color-grey4;
}
}

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2019-08-22 19:41:20
* @LastEditors: ch
* @LastEditTime: 2022-04-14 17:37:40
* @LastEditTime: 2022-04-20 19:02:05
* @Description: file content
-->
<template>
@ -13,6 +13,7 @@
<text class="search--input">请输入您想搜索的商品名称</text>
</view>
<view class="msg">
<u-badge class="msg--badge" max="99" :value="0"></u-badge>
<image class="msg--icon" src="@/static/index/msg.png"></image>
</view>
</view>
@ -53,9 +54,8 @@ export default {
return {
scrollTop : 0,
bannerList: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
'https://msb-edu-dev.oss-cn-beijing.aliyuncs.com/uc/account-avatar/banner.png',
'https://msb-edu-dev.oss-cn-beijing.aliyuncs.com/uc/account-avatar/banner.png'
],
categoryList : [
],
@ -133,23 +133,33 @@ page{
.logo{
width: 265rpx;
height: 50rpx;
background: url("@/static/index/logo.png");
background-size: 265rpx;
background: url("@/static/index/logo.png") no-repeat;
background-size: 244rpx;
&__min{
width: 50rpx;
}
}
.msg{
padding-right: 10rpx;
position: relative;
&--badge{
position: absolute;
right: 0;
top: -14rpx;
z-index: 999;
border:1px solid $color-grey0
}
&--icon{
width: 32rpx;
height: 38rpx;
width: 33rpx;
height: 42rpx;
}
}
.search{
padding: 0 30rpx;
padding: 5rpx 30rpx 0;
background: $color-blue5;
&__min{
width: 548rpx;
padding: 0;
}
&--input{
display: flex;
@ -160,13 +170,13 @@ page{
color: $color-grey0;
border-radius: 8rpx;
padding: 0 30rpx;
font-size: $font-size-sm;
font-size: $font-size-base;
&::after{
display: block;
content: "";
width: 34rpx;
height: 36rpx;
background: url("@/static/index/search.png");
height: 38rpx;
background: url("@/static/index/search.png") no-repeat;
background-size: 100%;
}
}
@ -179,15 +189,17 @@ page{
.category{
display: flex;
padding: 0 20rpx;
padding: 0 35rpx;
flex-wrap: wrap;
justify-content: space-between;
&--item{
padding: 0 10rpx;
width: 130rpx;
margin-bottom: 40rpx;
}
&--image-box{
width: 120rpx;
height: 120rpx;
margin: 0 auto;
}
&--image{
width: 120rpx;
@ -202,6 +214,7 @@ page{
}
.title{
font-size: 36rpx;
font-weight: bold;
margin: 60rpx 30rpx 30rpx;
}

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-22 15:36:46
* @LastEditors: ch
* @LastEditTime: 2022-04-15 18:45:28
* @LastEditTime: 2022-04-20 19:36:46
* @Description: file content
-->
<template>
@ -13,7 +13,7 @@
<view class="logo">马士兵严选</view>
<u--form class="login">
<u-form-item>
<input placeholder="请输入手机号" v-model="phone" class="login--input" border="bottom" />
<input placeholder="请输入手机号" type="number" v-model="phone" class="login--input" border="bottom" />
</u-form-item>
<u-form-item class="login--code">
<input placeholder="验证码" type="number" maxlength="6" class="login--input" v-model="code" border="bottom" />
@ -26,7 +26,7 @@
<UiButton class="login--btn" type="gradual" @click="login"></UiButton>
<label class="login--agreement">
<radio class="radio" :checked="checked" @click="checked = !checked" color="#FF875B"/>
同意<text class="link">用户协议</text><text class="link">隐私协议</text>,首次登陆将自动注册
同意<text class="link">用户协议</text><text class="link">隐私协议</text>首次登录自动注册
</label>
</view>
</template>
@ -42,7 +42,8 @@ export default {
sendStatus : false,
checked: false,
phone : '',
code : ''
code : '',
loginStatus : false
}
},
mounted(){
@ -74,6 +75,10 @@ export default {
},
async login(){
if(this.loginStatus){
return false;
}
this.loginStatus = true;
if(!IsPhone(this.phone)){
uni.$u.toast('请输入正确手机号');
return false;
@ -108,7 +113,8 @@ export default {
const len = pages.length;
const prevPage = pages[len - 2];
const tabBar = ['pages/index/index','pages/goods/category'];
console.log(prevPage);
this.loginStatus = false;
if(len > 1){
// tabBartabBar
if(tabBar.includes(prevPage.route)){

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 946 B

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 826 B

Loading…
Cancel
Save