Browse Source

完善

master
453530270@qq.com 2 years ago
parent
commit
0c011647c9
  1. 11
      api/reg/index.js
  2. 4
      pages.json
  3. 219
      pages/category/index.vue
  4. 76
      pages/reg/reg.vue

11
api/reg/index.js

@ -0,0 +1,11 @@
import request from '@/utils/request'
// api地址
const api = {
smsurl:'slb/userself/v1/account/username/unique-validate/'
}
// 发送验证码(手机号+验证码)
export function sendSms(params) {
return request.get(api.smsurl+params)
}

4
pages.json

@ -69,7 +69,8 @@
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "登录"
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
}
},
{
@ -239,6 +240,7 @@
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},

219
pages/category/index.vue

@ -7,24 +7,23 @@
<!-- 二级分类 20 -->
<view class="cate-content">
<!-- 左侧 一级分类 -->
<scroll-view class="cate-left" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<!-- <text class="type-nav" :class="{ selected: curIndex == index }" v-for="(item, index) in list" :key="index"
@click="handleSelectNav(index)">{{ item.name }}</text> -->
<text>文化资源数据</text>
<text>文化数字内容</text>
<scroll-view class="cate-left" scroll-y="true">
<text class="type-nav" :class="{ selected: curIndex == index }" v-for="(item, index) in menus" :key="index"
@click="handleSelectNav(index)">{{ item.name }}</text>
</scroll-view>
<!-- 右侧 二级分类 -->
<scroll-view class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<view v-if="list[curIndex]" class="cate-right-cont">
<scroll-view class="cate-right" scroll-top="true" scroll-y="true" >
<view v-if="list" class="cate-right-cont">
<view class="cate-two-box">
<view class="cate-cont-box">
<view class="flex-three" v-for="(item, idx) in list[curIndex].children" :key="idx" @click="onTargetGoodsList(item.category_id)">
<view class="flex-three" v-for="(item, idx) in list" :key="idx" @click="onTargetGoodsList(item.category_id)">
<view class="cate-img-padding">
<view v-if="item.image" class="cate-img">
<image class="image" mode="scaleToFill" :src="item.image.preview_url"></image>
<view v-if="item.goods_image" class="cate-img">
<image class="image" mode="scaleToFill" :src="item.goods_image"></image>
</view>
</view>
<text class="name oneline-hide">{{ item.name }}</text>
<text class="name oneline-hide">{{ item.goods_name }}</text>
</view>
</view>
</view>
@ -44,11 +43,21 @@
import { PageCategoryStyleEnum } from '@/common/enum/store/page/category'
import SettingModel from '@/common/model/Setting'
import * as CategoryApi from '@/api/category'
import * as GoodsApi from '@/api/goods'
import Empty from '@/components/empty'
import Search from '@/components/search'
import Primary from './components/primary'
import Secondary from './components/secondary'
import Commodity from './components/commodity'
// ()
const menus = [
{ id: 'all', name: '全部标的数据', icon: 'qpdingdan' },
{ id: 'rs', name: '文化资源数据', icon: 'daifukuan', count: 0 },
{ id: 'rd', name: '文化数字内容', icon: 'daifahuo', count: 0 },
]
//
let limit=24;
//
let lastRefreshTime;
@ -57,9 +66,7 @@
components: {
Search,
Empty,
Primary,
Secondary,
Commodity
},
mixins: [MescrollCompMixin],
data() {
@ -71,7 +78,13 @@
//
setting: {},
//
isLoading: true
isLoading: true,
//
curIndex: 0,
//
page:1,
//
menus,
}
},
@ -114,57 +127,57 @@
// SettingModel.data(false),
//
// CategoryApi.list()
this.getAllGoods()
])
.then(result => {
//
// app.initSetting(result[0])
//
// app.initCategory(result[1])
//
})
.finally(() => app.isLoading = false)
},
/**
* 初始化分类模板设置
* @param {Object} result
*/
initSetting(setting) {
this.setting = setting[SettingKeyEnum.PAGE_CATEGORY_TEMPLATE.value]
},
/**
* 初始化分类列表数据
* @param {Object} result
*/
initCategory(result) {
this.list = result.data.list
//
handleSelectNav(index) {
this.curIndex = index
this.scrollTop = 0
//
},
//
getAllGoods(){
let rd={"goods_status":1,"page":this.page,"limit":limit}
this.bindData(rd)
},
//
getCatList(type){
if(type>0){
let rd={"record_type":type,"goods_status":1,"page":this.page,"limit":limit}
this.bindData(rd)
}else{
this.getAllGoods()
}
},
//
bindData(rd){
GoodsApi.soglist(rd).then(res=>{
this.list = res.data.data
this.page=res.data.current_page
});
},
},
/**
* 设置分享内容
*/
onShareAppMessage() {
const app = this
return {
title: _this.templet.shareTitle,
path: '/pages/category/index?' + app.$getShareUrlParams()
}
},
/**
* 分享到朋友圈
* 本接口为 Beta 版本暂只在 Android 平台支持详见分享到朋友圈 (Beta)
* https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html
*/
onShareTimeline() {
const app = this
return {
title: _this.templet.shareTitle,
path: '/pages/category/index?' + app.$getShareUrlParams()
}
}
}
</script>
@ -181,6 +194,108 @@
top: var(--window-top);
left: var(--window-left);
right: var(--window-right);
z-index: 9;
z-index: 19;
}
//
.secondary{
z-index: 6;
border-top: 1rpx solid #444;
height: 100vh;
}
//
.cate-content {
display: flex;
z-index: 1;
background: #fff;
padding-top: 96rpx;
height: 100%;
}
// + 20
.cate-left {
height: 100%;
display: flex;
flex-direction: column;
flex: 0 0 26%;
background: #f8f8f8;
color: #444;
margin-right: 22rpx;
}
.cate-right {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
.cate-right-cont {
width: 100%;
display: flex;
flex-flow: row wrap;
align-content: flex-start;
padding-top: 15rpx;
.cate-two-box {
width: 100%;
padding: 0 10px;
}
}
}
//
.type-nav {
position: relative;
height: 90rpx;
z-index: 10;
display: block;
font-size: 26rpx;
display: flex;
justify-content: center;
align-items: center;
&.selected {
background: #fff;
color: #fa2209;
border-right: none;
font-size: 28rpx;
}
}
//
.cate-cont-box {
margin-bottom: 30rpx;
padding-bottom: 10rpx;
background: #fff;
overflow: hidden;
.name {
display: block;
padding-bottom: 30rpx;
text-align: center;
font-size: 26rpx;
color: #444444;
}
.cate-img-padding {
padding: 16rpx 16rpx 4rpx 16rpx;
}
.cate-img {
position: relative;
width: 100%;
padding-top: 100%;
.image {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border-radius: 10rpx;
}
}
}
</style>

76
pages/reg/reg.vue

@ -12,12 +12,13 @@
<form>
<!-- 手机号 -->
<view class="form-item">
<input class="form-item--input" type="number" v-model="mobile" maxlength="11" autocomplete="off" placeholder="输入手机号码" />
<input class="form-item--input" type="number" v-model="mobile" maxlength="11" autocomplete="off" placeholder="输入手机号码"
@input="onInputStepper($event, item)"/>
</view>
<!-- 验证码 -->
<view class="form-item">
<input class="form-item--input" type="number" v-model="mobile" maxlength="11" autocomplete="off" placeholder="输入6位验证码" />
<a class="btn" href="" @click="getsmscode">获取验证码</a>
<input class="form-item--input" type="number" v-model="chkcode" maxlength="11" autocomplete="off" placeholder="输入6位验证码" />
<button class="abtn" href="" @click="getsmscode" ref="abtn">获取验证码 </button>
</view>
<!-- 密码 -->
<view class="form-item">
@ -58,8 +59,9 @@
</template>
<script>
import { inArray, debounce } from '@/utils/util'
import store from '@/store'
import * as LoginApi from '@/api/login'
import * as regApi from '@/api/reg/index'
import * as Verify from '@/utils/verify'
import whpop from './components/WhPopup'
@ -76,6 +78,8 @@
isLoading: false,
//
mobile: '',
//
chkcode:'',
//
vpass:"",
//
@ -95,19 +99,20 @@
},
methods: {
//
radioChange(evt) {
this.userType = evt.detail.value
if(this.userType=="企业"){
this.utchk2=false
this.utchk1=true;
}else{
this.utchk2=true
this.utchk1=false;
//
onInputStepper({ value }, item){
//
if (item.mobile == value) return
//
if (!item.debounceHandle) {
item.oldValue = item.goods_num
item.debounceHandle = debounce(this.validteMobile(), 500)
}
let bb = this.$md5("123456")
},
//
item.mobile = value
item.debounceHandle(item, item.oldValue, value)
},
//
readpri(e){
this.isTick=!this.isTick
@ -123,6 +128,36 @@
return ture;
},
//
getsmscode(){
this.countDown(2200)
//
// let mb = this.mobile
// if(this.validteMobile(mb)){
// regApi.sendSms(mb).then(res=>{
// if(res.resultCode=="00000000"){
// if(res.data ==1){
// this.$toast("")
// //
// }
// }
// console.log(res)
// });
// }
},
//
countDown(st){
this.$refs["abtn"] = "sdfsdf"+st
//let st = 120;
// if(st<0){
// }else{
// st --
// }
// setTimeout()
},
//
formValidation() {
const app = this
@ -139,7 +174,7 @@
}
//
if(!app.isTick){
this.$toast("请勾选《隐私保护政策》和《户注册协议》")
this.$toast("请勾选《隐私保护政策》和《户注册协议》")
return false
}
return true
@ -156,12 +191,13 @@
//
validteMobile(str) {
//
if (Verify.isEmpty(str)) {
this.$toast('请先输入手机号')
return false
}
if (!Verify.isMobile(str)) {
this.$toast('请输入正确格式的手机号')
this.$toast("输入正确格式手机号码")
return false
}
return true
@ -276,6 +312,10 @@
flex:1;
height: 100%;
}
.abtn{
font-size: 26rpx;
}

Loading…
Cancel
Save