Merge remote-tracking branch 'origin/feature/1.8.0-uniapp' into feature/1.8.0-uniapp
@ -0,0 +1,7 @@
|
|||||||
|
/unpackage/dist/*
|
||||||
|
/unpackage/cache/*
|
||||||
|
/unpackage/release/*
|
||||||
|
/node_modules/*
|
||||||
|
/.idea/*
|
||||||
|
/.hbuilderx/
|
||||||
|
/.vscode/
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
onLaunch: function() {
|
||||||
|
console.log('App Launch')
|
||||||
|
},
|
||||||
|
onShow: function() {
|
||||||
|
console.log('App Show')
|
||||||
|
},
|
||||||
|
onHide: function() {
|
||||||
|
console.log('App Hide')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
/* 引入uView基础样式 */
|
||||||
|
@import "@/uni_modules/uview-ui/index.scss";
|
||||||
|
|
||||||
|
/*每个页面公共scss */
|
||||||
|
@import "app.scss";
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
/* 页面公共scss */
|
||||||
|
.container {
|
||||||
|
padding-top: var(--status-bar-height);//uni-app提供了状态栏高度的css变量--status-bar-height
|
||||||
|
background-color: $uni-bg-color;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 布局间距 */
|
||||||
|
.m-0-r {
|
||||||
|
margin: 0rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mtb-0-r {
|
||||||
|
margin-top: 0rpx;
|
||||||
|
margin-bottom: 0rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-mlt {
|
||||||
|
margin-left: 0rpx;
|
||||||
|
margin-right: 0rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mtb-30-r {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mlr-30-r {
|
||||||
|
margin-left: 30rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt-20-r {margin-top: 20rpx;}
|
||||||
|
.mt-30-r {margin-top: 30rpx;}
|
||||||
|
.mt-40-r {margin-top: 40rpx;}
|
||||||
|
.mt-50-r {margin-top: 50rpx;}
|
||||||
|
|
||||||
|
.mb-20-r {margin-bottom: 20rpx;}
|
||||||
|
.mb-30-r {margin-bottom: 30rpx;}
|
||||||
|
.mb-40-r {margin-bottom: 40rpx;}
|
||||||
|
.mb-50-r {margin-bottom: 50rpx;}
|
||||||
|
|
||||||
|
.ml-20-r {margin-left: 20rpx;}
|
||||||
|
.ml-30-r {margin-left: 30rpx;}
|
||||||
|
.ml-40-r {margin-left: 40rpx;}
|
||||||
|
.ml-50-r {margin-left: 50rpx;}
|
||||||
|
|
||||||
|
.mr-20-r {margin-right: 20rpx;}
|
||||||
|
.mr-30-r {margin-right: 30rpx;}
|
||||||
|
.mr-40-r {margin-right: 40rpx;}
|
||||||
|
.mr-50-r {margin-right: 50rpx;}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
const { http } = uni.$u
|
||||||
|
|
||||||
|
/* login */
|
||||||
|
//使用手机 + 密码登录
|
||||||
|
export const passwordLogin = params => http.post('/app-api/member/user/login', params)
|
||||||
|
//发送手机验证码
|
||||||
|
export const sendSmsCode = params => http.post('/app-api/member/send-sms-code', params)
|
||||||
|
//使用手机 + 验证码登录
|
||||||
|
export const smsLogin = params => http.post('/app-api/member/sms-login', params)
|
||||||
|
|
||||||
|
/* index */
|
||||||
|
// 获取滚动图数据
|
||||||
|
export const getBannerData = params => http.get('/app-api/index', params)
|
||||||
|
// 获取滚动通知数据
|
||||||
|
export const getNoticeData = params => http.get('/app-api/notice', params)
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
baseUrl: 'http://192.168.3.199:8086'
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
uni.$u.props.gap.bgColor = '#ffffff'
|
||||||
|
uni.$u.props.gap.height = '10'
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<script>
|
||||||
|
let coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||||
|
CSS.supports('top: constant(a)'))
|
||||||
|
document.write(
|
||||||
|
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||||
|
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||||
|
</script>
|
||||||
|
<title></title>
|
||||||
|
<!--preload-links-->
|
||||||
|
<!--app-context-->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"><!--app-html--></div>
|
||||||
|
<script type="module" src="/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import App from './App'
|
||||||
|
|
||||||
|
// vuex
|
||||||
|
import store from './store'
|
||||||
|
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
Vue.prototype.$store = store
|
||||||
|
|
||||||
|
// 引入全局uView
|
||||||
|
import uView from '@/uni_modules/uview-ui'
|
||||||
|
|
||||||
|
App.mpType = 'app'
|
||||||
|
Vue.use(uView)
|
||||||
|
|
||||||
|
const app = new Vue({
|
||||||
|
store,
|
||||||
|
...App
|
||||||
|
})
|
||||||
|
|
||||||
|
// 引入请求封装
|
||||||
|
require('./util/request/index')(app)
|
||||||
|
|
||||||
|
app.$mount()
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
{
|
||||||
|
"name" : "yudao-ui-app",
|
||||||
|
"appid" : "__UNI__CA099E3",
|
||||||
|
"description" : "yudao-ui-app for ruoyi-vue-pro",
|
||||||
|
"versionName" : "1.0.0",
|
||||||
|
"versionCode" : "100",
|
||||||
|
"transformPx" : false,
|
||||||
|
/* 5+App特有相关 */
|
||||||
|
"app-plus" : {
|
||||||
|
"usingComponents" : true,
|
||||||
|
"nvueStyleCompiler" : "uni-app",
|
||||||
|
"compilerVersion" : 3,
|
||||||
|
"splashscreen" : {
|
||||||
|
"alwaysShowBeforeRender" : true,
|
||||||
|
"waiting" : true,
|
||||||
|
"autoclose" : true,
|
||||||
|
"delay" : 0
|
||||||
|
},
|
||||||
|
/* 模块配置 */
|
||||||
|
"modules" : {},
|
||||||
|
/* 应用发布信息 */
|
||||||
|
"distribute" : {
|
||||||
|
/* android打包配置 */
|
||||||
|
"android" : {
|
||||||
|
"permissions" : [
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
/* ios打包配置 */
|
||||||
|
"ios" : {},
|
||||||
|
/* SDK配置 */
|
||||||
|
"sdkConfigs" : {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* 快应用特有相关 */
|
||||||
|
"quickapp" : {},
|
||||||
|
/* 小程序特有相关 */
|
||||||
|
"mp-weixin" : {
|
||||||
|
"appid" : "",
|
||||||
|
"setting" : {
|
||||||
|
"urlCheck" : false
|
||||||
|
},
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-alipay" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-baidu" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-toutiao" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : false
|
||||||
|
},
|
||||||
|
"vueVersion" : "2"
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
@ -0,0 +1,182 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
|
||||||
|
<view class="unp-header">
|
||||||
|
<view class="unp-logo">
|
||||||
|
<u-avatar size="80" icon="github-circle-fill" fontSize="80"></u-avatar>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="unp-box">
|
||||||
|
<u--form class="unp-form" labelPosition="left" :model="formData" :rules="rules" ref="form">
|
||||||
|
<u-form-item label="账号" prop="username" borderBottom ref="item-username">
|
||||||
|
<u-input type="text" maxlength="20" v-model="formData.username" clearable placeholder="账号由数字和字母组成" border="none" @change="handleUsernameChange"></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<u-gap height="20"></u-gap>
|
||||||
|
|
||||||
|
<u-form-item label="验证码" prop="code" labelWidth="80" borderBottom>
|
||||||
|
<u--input type="number" maxlength="6" v-model="formData.code" border="none" placeholder="请填写验证码"></u--input>
|
||||||
|
<u-button slot="right" @tap="getCode" :text="tips" type="success" size="mini" :disabled="codeDisabled"></u-button>
|
||||||
|
<u-code ref="uCode" @change="codeChange" seconds="60" @start="codeDisabled = true" @end="codeDisabled = false"></u-code>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<u-gap height="20"></u-gap>
|
||||||
|
|
||||||
|
<u-form-item label="密码" prop="password" borderBottom ref="item-password">
|
||||||
|
<u-input :type="inputType" maxlength="20" v-model="formData.password" placeholder="新密码由数字、字母和符号组成" border="none" @change="handlePasswordChange">
|
||||||
|
<template slot="suffix">
|
||||||
|
<u-icon v-if="inputType === 'password'" size="20" color="#666666" name="eye-fill" @click="inputType = 'text'"></u-icon>
|
||||||
|
<u-icon v-if="inputType === 'text'" size="20" color="#666666" name="eye-off" @click="inputType = 'password'"></u-icon>
|
||||||
|
</template>
|
||||||
|
</u-input>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<view class="lk-group">
|
||||||
|
<!-- 占位 -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<u-button
|
||||||
|
type="error"
|
||||||
|
text="重置密码"
|
||||||
|
customStyle="margin-top: 50px"
|
||||||
|
@click="handleSubmit"
|
||||||
|
></u-button>
|
||||||
|
|
||||||
|
<u-gap height="20"></u-gap>
|
||||||
|
<u-button type="info" text="返回" @click="navigateBack()"></u-button>
|
||||||
|
|
||||||
|
</u--form>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
codeDisabled: false,
|
||||||
|
tips: '',
|
||||||
|
inputType: 'password',
|
||||||
|
formData: {
|
||||||
|
username: '',
|
||||||
|
code: '',
|
||||||
|
password: '',
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'username': {
|
||||||
|
type: 'string',
|
||||||
|
max: 20,
|
||||||
|
required: true,
|
||||||
|
message: '请输入您的账号',
|
||||||
|
trigger: ['blur', 'change']
|
||||||
|
},
|
||||||
|
'code': {
|
||||||
|
type: 'number',
|
||||||
|
max: 6,
|
||||||
|
required: true,
|
||||||
|
message: '请输入验证码',
|
||||||
|
trigger: ['blur', 'change']
|
||||||
|
},
|
||||||
|
'password': {
|
||||||
|
type: 'string',
|
||||||
|
max: 20,
|
||||||
|
required: true,
|
||||||
|
message: '请输入您的新密码',
|
||||||
|
trigger: ['blur', 'change']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleUsernameChange(e){
|
||||||
|
let str = uni.$u.trim(e, 'all');
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.formData.username = str
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handlePasswordChange(e){
|
||||||
|
let str = uni.$u.trim(e, 'all');
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.formData.password = str
|
||||||
|
})
|
||||||
|
},
|
||||||
|
codeChange(text) {
|
||||||
|
this.tips = text;
|
||||||
|
},
|
||||||
|
getCode() {
|
||||||
|
if (this.$refs.uCode.canGetCode) {
|
||||||
|
// 模拟向后端请求验证码
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在获取验证码'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
|
uni.$u.toast('验证码已发送');
|
||||||
|
// 通知验证码组件内部开始倒计时
|
||||||
|
this.$refs.uCode.start();
|
||||||
|
}, 2000);
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('倒计时结束后再发送');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSubmit() {
|
||||||
|
this.$refs.form.validate().then(res => {
|
||||||
|
uni.$u.toast('点击了重置密码')
|
||||||
|
}).catch(err => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
navigateBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.unp-header {
|
||||||
|
height: 400rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.unp-logo {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.unp-box {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.unp-form{
|
||||||
|
width: 560rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lk-group {
|
||||||
|
height: 40rpx;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 12rpx;
|
||||||
|
|
||||||
|
color: #3c9cff;
|
||||||
|
text-decoration: #3c9cff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -0,0 +1,325 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<!--搜索栏-->
|
||||||
|
<u-sticky style="top: 0" offset-top="0">
|
||||||
|
<view class="search-wrap">
|
||||||
|
<u-search placeholder="搜索" disabled height="32" :show-action="false" @click="handleSearchClick"></u-search>
|
||||||
|
</view>
|
||||||
|
</u-sticky>
|
||||||
|
|
||||||
|
<!--轮播图-->
|
||||||
|
<u-swiper :list="swiperList" previousMargin="20" nextMargin="20" circular height="200" @change="e => current = e.current" :autoplay="true" @click="handleSwiperClick">
|
||||||
|
<view slot="indicator" class="indicator">
|
||||||
|
<view class="indicator__dot" v-for="(item, index) in swiperList" :key="index" :class="[index === current && 'indicator__dot--active']">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-swiper>
|
||||||
|
|
||||||
|
<!--宫格菜单按钮-->
|
||||||
|
<view class="mt-40-r mb-30-r">
|
||||||
|
<u-grid :border="false" col="4"><u-grid-item v-for="(item,index) in menuList" :key="index">
|
||||||
|
<u-icon :name="item.icon" :size="40"></u-icon>
|
||||||
|
<text class="grid-title">{{item.title}}</text>
|
||||||
|
</u-grid-item>
|
||||||
|
</u-grid>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!--消息滚动栏-->
|
||||||
|
<u-notice-bar style="padding: 13px 12px" :text="noticeList" mode="link" direction="column" @click="click"></u-notice-bar>
|
||||||
|
|
||||||
|
<!--商品展示栏-->
|
||||||
|
<view>
|
||||||
|
<u-gap height="180" bgColor="#398ade"></u-gap>
|
||||||
|
<view class="prod-block">
|
||||||
|
<view class="bloc-header">
|
||||||
|
<text class="bloc-title">每日上新</text>
|
||||||
|
<text class="see-more">查看更多</text>
|
||||||
|
</view>
|
||||||
|
<u-grid class="prod-grid" :border="false" col="3">
|
||||||
|
<u-grid-item class="prod-item-box" v-for="(item,index) in productList" :key="index">
|
||||||
|
<view class="prod-item">
|
||||||
|
<u--image class="prod-image" width="230rpx" height="230rpx" :src="item"></u--image>
|
||||||
|
<view class="item-info">
|
||||||
|
<view class="info-text">
|
||||||
|
<u--text :lines="2" size="14px" color="#333333" text="山不在高,有仙则名。水不在深,有龙则灵。斯是陋室,惟吾德馨。"></u--text>
|
||||||
|
</view>
|
||||||
|
<view class="price-and-cart">
|
||||||
|
<u--text-price color="red" size="12" integerSize="18" :text="233.33"></u--text-price>
|
||||||
|
<u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-grid-item>
|
||||||
|
</u-grid>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<view class="prod-block half">
|
||||||
|
<view class="bloc-header">
|
||||||
|
<text class="bloc-title">商品热卖</text>
|
||||||
|
<text class="more">更多 ></text>
|
||||||
|
</view>
|
||||||
|
<u-grid class="prod-grid" :border="false" col="2">
|
||||||
|
<u-grid-item class="prod-item-box" v-for="(item,index) in productList" :key="index">
|
||||||
|
<view class="prod-item">
|
||||||
|
<u--image class="prod-image" width="345rpx" height="345rpx" :src="item"></u--image>
|
||||||
|
<view class="item-info">
|
||||||
|
<view class="info-text">
|
||||||
|
<u--text :lines="1" size="14px" color="#333333" text="山不在高,有仙则名。水不在深,有龙则灵。斯是陋室,惟吾德馨。"></u--text>
|
||||||
|
<u--text :lines="1" size="12px" color="#939393" text="斯是陋室,惟吾德馨。"></u--text>
|
||||||
|
</view>
|
||||||
|
<view class="price-and-cart">
|
||||||
|
<u--text-price color="red" size="12" integerSize="18" :text="233.33"></u--text-price>
|
||||||
|
<u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-grid-item>
|
||||||
|
</u-grid>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<view class="prod-block list">
|
||||||
|
<view class="bloc-header">
|
||||||
|
<text class="bloc-title">更多宝贝</text>
|
||||||
|
<text></text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<u-list class="prod-list" @scrolltolower="scrolltolower">
|
||||||
|
<u-list-item v-for="(item, index) in productList" :key="index">
|
||||||
|
<view class="prod-item">
|
||||||
|
<u--image class="prod-image" width="210rpx" height="210rpx" :src="item"></u--image>
|
||||||
|
<view class="item-info">
|
||||||
|
<view class="info-text">
|
||||||
|
<u--text :lines="2" size="14px" color="#333333" text="山不在高,有仙则名。水不在深,有龙则灵。斯是陋室,惟吾德馨。"></u--text>
|
||||||
|
<u--text :lines="1" size="12px" color="#939393" text="斯是陋室,惟吾德馨。"></u--text>
|
||||||
|
</view>
|
||||||
|
<view class="price-and-cart">
|
||||||
|
<u--text-price color="red" size="12" integerSize="18" :text="233.33"></u--text-price>
|
||||||
|
<u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-list-item>
|
||||||
|
</u-list>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-gap height="5px"></u-gap>
|
||||||
|
<!--加载更多-->
|
||||||
|
<u-loadmore fontSize="32rpx" :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText"/>
|
||||||
|
|
||||||
|
<u-gap height="10px"></u-gap>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getBannerData,getNoticeData} from "../../common/api";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
current: 0,
|
||||||
|
currentNum: 0,
|
||||||
|
bannerList: [
|
||||||
|
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
|
||||||
|
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
|
||||||
|
'https://cdn.uviewui.com/uview/swiper/swiper1.png',],
|
||||||
|
menuList: [{icon: 'gift', title: '热门推荐'}, {icon: 'star', title: '收藏转发'}, {icon: 'thumb-up', title: '点赞投币'}, {icon: 'heart', title: '感谢支持'}],
|
||||||
|
noticeList:[
|
||||||
|
'寒雨连江夜入吴',
|
||||||
|
'平明送客楚山孤',
|
||||||
|
'洛阳亲友如相问',
|
||||||
|
'一片冰心在玉壶'
|
||||||
|
],
|
||||||
|
productList: [
|
||||||
|
'https://cdn.uviewui.com/uview/album/1.jpg',
|
||||||
|
'https://cdn.uviewui.com/uview/album/2.jpg',
|
||||||
|
'https://cdn.uviewui.com/uview/album/3.jpg',
|
||||||
|
'https://cdn.uviewui.com/uview/album/4.jpg',
|
||||||
|
'https://cdn.uviewui.com/uview/album/5.jpg',
|
||||||
|
],
|
||||||
|
status: 'nomore',
|
||||||
|
loadingText: '努力加载中...',
|
||||||
|
loadmoreText: '轻轻上拉',
|
||||||
|
nomoreText: '实在没有了...'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
//this.loadBannerData();
|
||||||
|
//this.loadNoticeData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loadBannerData() {
|
||||||
|
getBannerData().then(res => {
|
||||||
|
this.bannerList = res.data;
|
||||||
|
}).catch(err => {
|
||||||
|
//console.log(err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loadNoticeData() {
|
||||||
|
getNoticeData().then(res => {
|
||||||
|
this.noticeList = res.data;
|
||||||
|
}).catch(err => {
|
||||||
|
//console.log(err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSearchClick(e) {
|
||||||
|
console.log('监听点击准备跳转页面')
|
||||||
|
},
|
||||||
|
handleSwiperClick(index){
|
||||||
|
console.log('点击了图片索引值:',index)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
swiperList(){
|
||||||
|
return this.bannerList.map(item => {
|
||||||
|
if (item){
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
noticeTextList() {
|
||||||
|
return this.noticeList.map(item => {
|
||||||
|
if (item.title){
|
||||||
|
return item.title;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.search-wrap {
|
||||||
|
background: #ffffff;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indicator {
|
||||||
|
@include flex(row);
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
&__dot {
|
||||||
|
height: 15rpx;
|
||||||
|
width: 15rpx;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
background-color: rgba(255, 255, 255, 0.35);
|
||||||
|
margin: 0 10rpx;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
|
||||||
|
&--active {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-title {
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prod-block {
|
||||||
|
margin-top: -160px;
|
||||||
|
.bloc-header {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 10rpx 30rpx;
|
||||||
|
|
||||||
|
.bloc-title {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
}
|
||||||
|
.see-more {
|
||||||
|
color: #ffffff;
|
||||||
|
background: #3c9cff;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.half, &.list {
|
||||||
|
margin-top: 0;
|
||||||
|
.bloc-header {
|
||||||
|
margin-top: 50rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.bloc-title {
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
.more {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.prod-grid {
|
||||||
|
width: 730rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
.prod-item-box {
|
||||||
|
padding: 10rpx;
|
||||||
|
.prod-item {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
box-shadow: -1rpx 1rpx 2rpx #afd3f5, 1rpx 1rpx 0rpx #afd3f5;
|
||||||
|
justify-content: left;
|
||||||
|
/deep/ * {
|
||||||
|
border-radius: 10rpx 10rpx 0 0;
|
||||||
|
}
|
||||||
|
.item-info {
|
||||||
|
padding: 15rpx;
|
||||||
|
.info-text {
|
||||||
|
padding-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
.price-and-cart {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.prod-list {
|
||||||
|
height: auto !important;
|
||||||
|
|
||||||
|
.prod-item {
|
||||||
|
padding: 20rpx;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 1rpx solid #f3f3f3;
|
||||||
|
|
||||||
|
.prod-image {
|
||||||
|
border-radius: 10rpx;
|
||||||
|
/deep/ * {
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-info {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
.info-text {
|
||||||
|
padding-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
.price-and-cart {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
个人资料
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
@ -0,0 +1,144 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
|
||||||
|
<view class="unp-header">
|
||||||
|
<view class="unp-logo">
|
||||||
|
<u-avatar size="80" icon="github-circle-fill" fontSize="80"></u-avatar>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="unp-box">
|
||||||
|
<u--form class="unp-form" labelPosition="left" :model="formData" :rules="rules" ref="form">
|
||||||
|
<u-form-item label="账号" prop="username" borderBottom ref="item-username">
|
||||||
|
<u-input type="text" maxlength="20" v-model="formData.username" clearable placeholder="账号由数字和字母组成" border="none" @change="handleUsernameChange"></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<u-gap height="20"></u-gap>
|
||||||
|
|
||||||
|
<u-form-item label="密码" prop="password" borderBottom ref="item-password">
|
||||||
|
<u-input :type="inputType" maxlength="20" v-model="formData.password" placeholder="密码由数字、字母和符号组成" border="none" @change="handlePasswordChange">
|
||||||
|
<template slot="suffix">
|
||||||
|
<u-icon v-if="inputType === 'password'" size="20" color="#666666" name="eye-fill" @click="inputType = 'text'"></u-icon>
|
||||||
|
<u-icon v-if="inputType === 'text'" size="20" color="#666666" name="eye-off" @click="inputType = 'password'"></u-icon>
|
||||||
|
</template>
|
||||||
|
</u-input>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<view class="lk-group">
|
||||||
|
<!-- 占位 -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<u-button
|
||||||
|
type="success"
|
||||||
|
text="注册账号"
|
||||||
|
customStyle="margin-top: 50px"
|
||||||
|
@click="handleSubmit"
|
||||||
|
></u-button>
|
||||||
|
|
||||||
|
<u-gap height="20"></u-gap>
|
||||||
|
<u-button type="info" text="返回" @click="navigateBack()"></u-button>
|
||||||
|
|
||||||
|
</u--form>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
inputType: 'password',
|
||||||
|
formData: {
|
||||||
|
username: '',
|
||||||
|
password: '',
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'username': {
|
||||||
|
type: 'string',
|
||||||
|
max: 20,
|
||||||
|
required: true,
|
||||||
|
message: '请输入您的账号',
|
||||||
|
trigger: ['blur', 'change']
|
||||||
|
},
|
||||||
|
'password': {
|
||||||
|
type: 'string',
|
||||||
|
max: 20,
|
||||||
|
required: true,
|
||||||
|
message: '请输入您的密码',
|
||||||
|
trigger: ['blur', 'change']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleUsernameChange(e){
|
||||||
|
let str = uni.$u.trim(e, 'all');
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.formData.username = str
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handlePasswordChange(e){
|
||||||
|
let str = uni.$u.trim(e, 'all');
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.formData.password = str
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSubmit() {
|
||||||
|
this.$refs.form.validate().then(res => {
|
||||||
|
uni.$u.toast('点击了注册账号')
|
||||||
|
}).catch(err => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
navigateBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.unp-header {
|
||||||
|
height: 400rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.unp-logo {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.unp-box {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.unp-form{
|
||||||
|
width: 560rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lk-group {
|
||||||
|
height: 40rpx;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 12rpx;
|
||||||
|
|
||||||
|
color: #3c9cff;
|
||||||
|
text-decoration: #3c9cff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<view class="user-header">
|
||||||
|
<view class="user-info" @click="handleUserInfoClick">
|
||||||
|
<u-avatar size="80" :src="avatar"></u-avatar>
|
||||||
|
<text class="nick-name">{{nickName}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<u-gap height="10" bgColor="#f6f6f6"></u-gap>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<view class="order-header">
|
||||||
|
<text class="order-title">我的订单</text>
|
||||||
|
<view class="see-all">
|
||||||
|
<text>查看全部</text>
|
||||||
|
<u-icon name="arrow-right"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="mt-40-r mb-40-r">
|
||||||
|
<u-grid :border="false" :col="orderStatusList.length"><u-grid-item v-for="(item,index) in orderStatusList" :key="index">
|
||||||
|
<u-icon :name="item.icon" :size="32"></u-icon>
|
||||||
|
<text class="grid-title">{{item.title}}</text>
|
||||||
|
</u-grid-item>
|
||||||
|
</u-grid>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<u-gap height="10" bgColor="#f6f6f6"></u-gap>
|
||||||
|
<view class="mt-20-r mb-20-r">
|
||||||
|
<u-grid :border="false" col="3"><u-grid-item v-for="(item,index) in statisticsList" :key="index">
|
||||||
|
<text class="grid-value">{{item.value}}</text>
|
||||||
|
<text class="grid-title">{{item.title}}</text>
|
||||||
|
</u-grid-item>
|
||||||
|
</u-grid>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<u-gap height="10" bgColor="#f6f6f6"></u-gap>
|
||||||
|
|
||||||
|
<u-cell-group class="fun-list">
|
||||||
|
<u-cell class="fun-item" :border="false" icon="gift" title="分销中心" isLink></u-cell>
|
||||||
|
<u-cell class="fun-item" :border="false" icon="tags" title="领券中心" isLink></u-cell>
|
||||||
|
<u-cell class="fun-item" :border="false" icon="coupon" title="我的优惠券" isLink></u-cell>
|
||||||
|
<u-cell class="fun-item" :border="false" icon="map" title="收获地址" isLink></u-cell>
|
||||||
|
</u-cell-group>
|
||||||
|
|
||||||
|
<u-button class="logout-btn" type="error" color="#ea322b" text="确定"></u-button>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
avatar:'',
|
||||||
|
nickName:'点击登录',
|
||||||
|
orderStatusList: [{icon: 'rmb-circle', title: '待支付'}, {icon: 'car', title: '代发货'}, {icon: 'order', title: '待收货'}, {icon: 'integral', title: '已完成'}],
|
||||||
|
statisticsList: [{value: '2', title: '我的收藏'}, {value: '3', title: '我的消息'}, {value: '3', title: '我的足迹'}]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleUserInfoClick(){
|
||||||
|
// TODO 判断是否已经登录逻辑
|
||||||
|
if (!uni.getStorageSync('token')) {
|
||||||
|
uni.$u.route('/pages/login/login');
|
||||||
|
} else {
|
||||||
|
uni.$u.route('/pages/profile/profile');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.user-header {
|
||||||
|
height: 280rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.user-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.nick-name {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-header {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
border-bottom: 1rpx solid #f3f3f3;
|
||||||
|
|
||||||
|
.order-title {
|
||||||
|
color: #333333;
|
||||||
|
font-size: 34rpx;
|
||||||
|
}
|
||||||
|
.see-all {
|
||||||
|
height: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: right;
|
||||||
|
color: #666666;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-title {
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-value {
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #2b85e4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fun-list {
|
||||||
|
.fun-item {
|
||||||
|
padding-top: 10rpx;
|
||||||
|
padding-bottom: 10rpx;
|
||||||
|
border-bottom: 1rpx solid #f3f3f3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.logout-btn {
|
||||||
|
margin-top: 60rpx;
|
||||||
|
width: 300rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020 www.uviewui.com
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<view class="u-text-price-wrap">
|
||||||
|
<uvText
|
||||||
|
class="u-text-price-item"
|
||||||
|
v-for="(item,index) in textArray"
|
||||||
|
:key="index"
|
||||||
|
:text="item"
|
||||||
|
:size="(index === 1 && integerSize) ? integerSize : size"
|
||||||
|
:color="color"
|
||||||
|
>
|
||||||
|
</uvText>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* 此组件存在只为简单的显示特定样式的价格数字
|
||||||
|
*/
|
||||||
|
import uvText from "../u-text/u-text.vue";
|
||||||
|
import props from "../u-text/props.js";
|
||||||
|
export default {
|
||||||
|
name: "u--text-price",
|
||||||
|
mixins: [uni.$u.mpMixin, props, uni.$u.mixin],
|
||||||
|
components: {
|
||||||
|
uvText,
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
//整形部分字体大小可单独定义
|
||||||
|
integerSize: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: uni.$u.props.text.size
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
textArray() {
|
||||||
|
let array = ['¥'];
|
||||||
|
if (!/^\d+(\.\d+)?$/.test(this.text)) {
|
||||||
|
uni.$u.error('组件<u--text-price :text="???" 此处参数应为金额数字');
|
||||||
|
} else {
|
||||||
|
let arr = parseFloat(this.text).toFixed(2).split('.');
|
||||||
|
array.push(arr[0]);
|
||||||
|
array.push('.' + arr[1]);
|
||||||
|
}
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.u-text-price-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-text-price-item{
|
||||||
|
flex: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
// 头像图片组
|
||||||
|
urls: {
|
||||||
|
type: Array,
|
||||||
|
default: uni.$u.props.avatarGroup.urls
|
||||||
|
},
|
||||||
|
// 最多展示的头像数量
|
||||||
|
maxCount: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: uni.$u.props.avatarGroup.maxCount
|
||||||
|
},
|
||||||
|
// 头像形状
|
||||||
|
shape: {
|
||||||
|
type: String,
|
||||||
|
default: uni.$u.props.avatarGroup.shape
|
||||||
|
},
|
||||||
|
// 图片裁剪模式
|
||||||
|
mode: {
|
||||||
|
type: String,
|
||||||
|
default: uni.$u.props.avatarGroup.mode
|
||||||
|
},
|
||||||
|
// 超出maxCount时是否显示查看更多的提示
|
||||||
|
showMore: {
|
||||||
|
type: Boolean,
|
||||||
|
default: uni.$u.props.avatarGroup.showMore
|
||||||
|
},
|
||||||
|
// 头像大小
|
||||||
|
size: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: uni.$u.props.avatarGroup.size
|
||||||
|
},
|
||||||
|
// 指定从数组的对象元素中读取哪个属性作为图片地址
|
||||||
|
keyName: {
|
||||||
|
type: String,
|
||||||
|
default: uni.$u.props.avatarGroup.keyName
|
||||||
|
},
|
||||||
|
// 头像之间的遮挡比例
|
||||||
|
gap: {
|
||||||
|
type: [String, Number],
|
||||||
|
validator(value) {
|
||||||
|
return value >= 0 && value <= 1
|
||||||
|
},
|
||||||
|
default: uni.$u.props.avatarGroup.gap
|
||||||
|
},
|
||||||
|
// 需额外显示的值
|
||||||
|
extraValue: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: uni.$u.props.avatarGroup.extraValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
$u-button-active-opacity:0.75 !default;
|
||||||
|
$u-button-loading-text-margin-left:4px !default;
|
||||||
|
$u-button-text-color: #FFFFFF !default;
|
||||||
|
$u-button-text-plain-error-color:$u-error !default;
|
||||||
|
$u-button-text-plain-warning-color:$u-warning !default;
|
||||||
|
$u-button-text-plain-success-color:$u-success !default;
|
||||||
|
$u-button-text-plain-info-color:$u-info !default;
|
||||||
|
$u-button-text-plain-primary-color:$u-primary !default;
|
||||||
|
.u-button {
|
||||||
|
&--active {
|
||||||
|
opacity: $u-button-active-opacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--active--plain {
|
||||||
|
background-color: rgb(217, 217, 217);
|
||||||
|
}
|
||||||
|
|
||||||
|
&__loading-text {
|
||||||
|
margin-left:$u-button-loading-text-margin-left;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__text,
|
||||||
|
&__loading-text {
|
||||||
|
color:$u-button-text-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__text--plain--error {
|
||||||
|
color:$u-button-text-plain-error-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__text--plain--warning {
|
||||||
|
color:$u-button-text-plain-warning-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__text--plain--success{
|
||||||
|
color:$u-button-text-plain-success-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__text--plain--info {
|
||||||
|
color:$u-button-text-plain-info-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__text--plain--primary {
|
||||||
|
color:$u-button-text-plain-primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
// nvue下hover-class无效
|
||||||
|
$u-button-before-top:50% !default;
|
||||||
|
$u-button-before-left:50% !default;
|
||||||
|
$u-button-before-width:100% !default;
|
||||||
|
$u-button-before-height:100% !default;
|
||||||
|
$u-button-before-transform:translate(-50%, -50%) !default;
|
||||||
|
$u-button-before-opacity:0 !default;
|
||||||
|
$u-button-before-background-color:#000 !default;
|
||||||
|
$u-button-before-border-color:#000 !default;
|
||||||
|
$u-button-active-before-opacity:.15 !default;
|
||||||
|
$u-button-icon-margin-left:4px !default;
|
||||||
|
$u-button-plain-u-button-info-color:$u-info;
|
||||||
|
$u-button-plain-u-button-success-color:$u-success;
|
||||||
|
$u-button-plain-u-button-error-color:$u-error;
|
||||||
|
$u-button-plain-u-button-warning-color:$u-error;
|
||||||
|
|
||||||
|
.u-button {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
&__text {
|
||||||
|
white-space: nowrap;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
position: absolute;
|
||||||
|
top:$u-button-before-top;
|
||||||
|
left:$u-button-before-left;
|
||||||
|
width:$u-button-before-width;
|
||||||
|
height:$u-button-before-height;
|
||||||
|
border: inherit;
|
||||||
|
border-radius: inherit;
|
||||||
|
transform:$u-button-before-transform;
|
||||||
|
opacity:$u-button-before-opacity;
|
||||||
|
content: " ";
|
||||||
|
background-color:$u-button-before-background-color;
|
||||||
|
border-color:$u-button-before-border-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--active {
|
||||||
|
&:before {
|
||||||
|
opacity: .15
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__icon+&__text:not(:empty),
|
||||||
|
&__loading-text {
|
||||||
|
margin-left:$u-button-icon-margin-left;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--plain {
|
||||||
|
&.u-button--primary {
|
||||||
|
color: $u-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--plain {
|
||||||
|
&.u-button--info {
|
||||||
|
color:$u-button-plain-u-button-info-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--plain {
|
||||||
|
&.u-button--success {
|
||||||
|
color:$u-button-plain-u-button-success-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--plain {
|
||||||
|
&.u-button--error {
|
||||||
|
color:$u-button-plain-u-button-error-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--plain {
|
||||||
|
&.u-button--warning {
|
||||||
|
color:$u-button-plain-u-button-warning-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
<template>
|
||||||
|
<view class="u-calendar-header u-border-bottom">
|
||||||
|
<text
|
||||||
|
class="u-calendar-header__title"
|
||||||
|
v-if="showTitle"
|
||||||
|
>{{ title }}</text>
|
||||||
|
<text
|
||||||
|
class="u-calendar-header__subtitle"
|
||||||
|
v-if="showSubtitle"
|
||||||
|
>{{ subtitle }}</text>
|
||||||
|
<view class="u-calendar-header__weekdays">
|
||||||
|
<text class="u-calendar-header__weekdays__weekday">一</text>
|
||||||
|
<text class="u-calendar-header__weekdays__weekday">二</text>
|
||||||
|
<text class="u-calendar-header__weekdays__weekday">三</text>
|
||||||
|
<text class="u-calendar-header__weekdays__weekday">四</text>
|
||||||
|
<text class="u-calendar-header__weekdays__weekday">五</text>
|
||||||
|
<text class="u-calendar-header__weekdays__weekday">六</text>
|
||||||
|
<text class="u-calendar-header__weekdays__weekday">日</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'u-calendar-header',
|
||||||
|
mixins: [uni.$u.mpMixin, uni.$u.mixin],
|
||||||
|
props: {
|
||||||
|
// 标题
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
// 副标题
|
||||||
|
subtitle: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
// 是否显示标题
|
||||||
|
showTitle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
// 是否显示副标题
|
||||||
|
showSubtitle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
name() {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "../../libs/css/components.scss";
|
||||||
|
|
||||||
|
.u-calendar-header {
|
||||||
|
padding-bottom: 4px;
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-size: 16px;
|
||||||
|
color: $u-main-color;
|
||||||
|
text-align: center;
|
||||||
|
height: 42px;
|
||||||
|
line-height: 42px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__subtitle {
|
||||||
|
font-size: 14px;
|
||||||
|
color: $u-main-color;
|
||||||
|
height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 40px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__weekdays {
|
||||||
|
@include flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
&__weekday {
|
||||||
|
font-size: 13px;
|
||||||
|
color: $u-main-color;
|
||||||
|
line-height: 30px;
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
// 设置月份数据
|
||||||
|
setMonth() {
|
||||||
|
// 月初是周几
|
||||||
|
const day = dayjs(this.date).date(1).day()
|
||||||
|
const start = day == 0 ? 6 : day - 1
|
||||||
|
|
||||||
|
// 本月天数
|
||||||
|
const days = dayjs(this.date).endOf('month').format('D')
|
||||||
|
|
||||||
|
// 上个月天数
|
||||||
|
const prevDays = dayjs(this.date).endOf('month').subtract(1, 'month').format('D')
|
||||||
|
|
||||||
|
// 日期数据
|
||||||
|
const arr = []
|
||||||
|
// 清空表格
|
||||||
|
this.month = []
|
||||||
|
|
||||||
|
// 添加上月数据
|
||||||
|
arr.push(
|
||||||
|
...new Array(start).fill(1).map((e, i) => {
|
||||||
|
const day = prevDays - start + i + 1
|
||||||
|
|
||||||
|
return {
|
||||||
|
value: day,
|
||||||
|
disabled: true,
|
||||||
|
date: dayjs(this.date).subtract(1, 'month').date(day).format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
// 添加本月数据
|
||||||
|
arr.push(
|
||||||
|
...new Array(days - 0).fill(1).map((e, i) => {
|
||||||
|
const day = i + 1
|
||||||
|
|
||||||
|
return {
|
||||||
|
value: day,
|
||||||
|
date: dayjs(this.date).date(day).format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
// 添加下个月
|
||||||
|
arr.push(
|
||||||
|
...new Array(42 - days - start).fill(1).map((e, i) => {
|
||||||
|
const day = i + 1
|
||||||
|
|
||||||
|
return {
|
||||||
|
value: day,
|
||||||
|
disabled: true,
|
||||||
|
date: dayjs(this.date).add(1, 'month').date(day).format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
// 分割数组
|
||||||
|
for (let n = 0; n < arr.length; n += 7) {
|
||||||
|
this.month.push(
|
||||||
|
arr.slice(n, n + 7).map((e, i) => {
|
||||||
|
e.index = i + n
|
||||||
|
|
||||||
|
// 自定义信息
|
||||||
|
const custom = this.customList.find((c) => c.date == e.date)
|
||||||
|
|
||||||
|
// 农历
|
||||||
|
if (this.lunar) {
|
||||||
|
const {
|
||||||
|
IDayCn,
|
||||||
|
IMonthCn
|
||||||
|
} = this.getLunar(e.date)
|
||||||
|
e.lunar = IDayCn == '初一' ? IMonthCn : IDayCn
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...e,
|
||||||
|
...custom
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
// 是否打乱键盘按键的顺序
|
||||||
|
random: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 输入一个中文后,是否自动切换到英文
|
||||||
|
autoChange: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
// 分组标题
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: uni.$u.props.cellGroup.title
|
||||||
|
},
|
||||||
|
// 是否显示外边框
|
||||||
|
border: {
|
||||||
|
type: Boolean,
|
||||||
|
default: uni.$u.props.cellGroup.border
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
percentage: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: uni.$u.props.circleProgress.percentage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
// 倒计时总秒数
|
||||||
|
seconds: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: uni.$u.props.code.seconds
|
||||||
|
},
|
||||||
|
// 尚未开始时提示
|
||||||
|
startText: {
|
||||||
|
type: String,
|
||||||
|
default: uni.$u.props.code.startText
|
||||||
|
},
|
||||||
|
// 正在倒计时中的提示
|
||||||
|
changeText: {
|
||||||
|
type: String,
|
||||||
|
default: uni.$u.props.code.changeText
|
||||||
|
},
|
||||||
|
// 倒计时结束时的提示
|
||||||
|
endText: {
|
||||||
|
type: String,
|
||||||
|
default: uni.$u.props.code.endText
|
||||||
|
},
|
||||||
|
// 是否在H5刷新或各端返回再进入时继续倒计时
|
||||||
|
keepRunning: {
|
||||||
|
type: Boolean,
|
||||||
|
default: uni.$u.props.code.keepRunning
|
||||||
|
},
|
||||||
|
// 为了区分多个页面,或者一个页面多个倒计时组件本地存储的继续倒计时变了
|
||||||
|
uniqueKey: {
|
||||||
|
type: String,
|
||||||
|
default: uni.$u.props.code.uniqueKey
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
// 标题选中时的样式
|
||||||
|
activeStyle: {
|
||||||
|
type: [String, Object],
|
||||||
|
default: () => ({
|
||||||
|
color: '#2979ff',
|
||||||
|
fontSize: '14px'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 标题未选中时的样式
|
||||||
|
inactiveStyle: {
|
||||||
|
type: [String, Object],
|
||||||
|
default: () => ({
|
||||||
|
color: '#606266',
|
||||||
|
fontSize: '14px'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 点击遮罩是否关闭菜单
|
||||||
|
closeOnClickMask: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
// 点击当前激活项标题是否关闭菜单
|
||||||
|
closeOnClickSelf: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
// 过渡时间
|
||||||
|
duration: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 300
|
||||||
|
},
|
||||||
|
// 标题菜单的高度
|
||||||
|
height: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 40
|
||||||
|
},
|
||||||
|
// 是否显示下边框
|
||||||
|
borderBottom: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 标题的字体大小
|
||||||
|
titleSize: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 14
|
||||||
|
},
|
||||||
|
// 下拉出来的内容部分的圆角值
|
||||||
|
borderRadius: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
// 菜单右侧的icon图标
|
||||||
|
menuIcon: {
|
||||||
|
type: String,
|
||||||
|
default: 'arrow-down'
|
||||||
|
},
|
||||||
|
// 菜单右侧图标的大小
|
||||||
|
menuIconSize: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 14
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||