Merge branch 'master' of http://gitea.yxtsoft.com/yxt_group/mallplus
16
mallplusui-uniapp-app/.hbuilderx/launch.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"app-plus" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -418,6 +418,9 @@
|
||||
video {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,body,#app{
|
||||
height: 100%;
|
||||
}
|
||||
/* 骨架屏替代方案 */
|
||||
.Skeleton {
|
||||
background: #f3f3f3;
|
||||
|
||||
@@ -77,6 +77,8 @@ export default {
|
||||
memberTagList: 'single/user/memberTag/list', // 商户列表
|
||||
addStoreComment: 'single/store/addStoreComment', // 商户addStoreComment
|
||||
memberBlanceLogList: 'single/user/memberBlanceLog/list',
|
||||
mesList: 'sys/message/list',// GET 参数为空,获取用户消息通知列表,(需要先判断用户是已经登录状态)
|
||||
mesInfo: 'sys/message/info',// GET 参数为 id:消息ID,获取消息详情
|
||||
},
|
||||
build: {
|
||||
getBuildNoticeByPage: 'single/build/getBuildNoticeByPage', // 所有社区和房间
|
||||
|
||||
@@ -56,10 +56,10 @@
|
||||
},
|
||||
methods: {
|
||||
async acceptCoupon(item) {
|
||||
this.types =!this.types
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
this.types = !this.types
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
|
||||
let params = {
|
||||
couponId: item.id
|
||||
@@ -68,11 +68,17 @@
|
||||
console.log(data);
|
||||
if (data) {
|
||||
this.$api.msg(data);
|
||||
this.clickSubMethod(item)
|
||||
|
||||
}
|
||||
uni.hideLoading();
|
||||
|
||||
},
|
||||
async useCoupon(item){
|
||||
clickSubMethod(vel) {
|
||||
console.log('clickSubMethod')
|
||||
this.$emit('callParentMethod', JSON.stringify(vel))
|
||||
},
|
||||
async useCoupon(item) {
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
|
||||
@@ -38,6 +38,21 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"path": "pages/index/messageList",
|
||||
"style": {
|
||||
// "enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "消息列表"
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/messageDetail",
|
||||
"style": {
|
||||
// "enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "消息详情"
|
||||
|
||||
}
|
||||
}, {
|
||||
"path": "pages/search/search",
|
||||
"style": {
|
||||
@@ -60,7 +75,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
}, {
|
||||
"path": "pages/index/lease",
|
||||
"style": {
|
||||
"navigationBarTitleText": "农机租赁"
|
||||
@@ -813,10 +828,10 @@
|
||||
"text": "分类"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/index/nearbyBusiness",
|
||||
"iconPath": "static/fujin.png",
|
||||
"selectedIconPath": "static/fujin_.png",
|
||||
"text": "附近商家"
|
||||
"pagePath": "pages/index/messageList",
|
||||
"iconPath": "static/tab-message_.png",
|
||||
"selectedIconPath": "static/tab-message.png",
|
||||
"text": "消息"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/cart/cart",
|
||||
@@ -828,7 +843,7 @@
|
||||
"pagePath": "pages/index/user",
|
||||
"iconPath": "static/tab-my.png",
|
||||
"selectedIconPath": "static/tab-my-current.png",
|
||||
"text": "我的"
|
||||
"text": "我的云链"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
<template>
|
||||
<view class="content" style="display: flex;flex-direction: column;">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view style="width: 100%;position: fixed;top: 0;z-index: 99;background: #FFFFFF;" :style="{'height':statusBarHeight+'px' }"></view>
|
||||
<view class="getPosition" style="height: 90upx;position: fixed;z-index: 99;width: 100%" :style="{'top':statusBarHeight+'px' }">
|
||||
<view style="width: 100%;position: fixed;top: 0;z-index: 99;background: #FFFFFF;"
|
||||
:style="{'height':statusBarHeight+'px' }"></view>
|
||||
<view class="getPosition" style="height: 90upx;position: fixed;z-index: 99;width: 100%"
|
||||
:style="{'top':statusBarHeight+'px' }">
|
||||
<text>分类</text>
|
||||
</view>
|
||||
<view class="" @click="search()" style="background: #FFFFFF;height: 80upx;display: flex;justify-content: center;align-items: center;" :style="[{'margin-top': statusBarHeight+45+'px'}]">
|
||||
<input class="" type="text" value="" placeholder="输入关键字搜索" style="font-size: 28upx;background: #F5F5F5;height: 60upx;width: 90%;border-radius: 50upx;text-align: center;" />
|
||||
<view class="" @click="search()"
|
||||
style="background: #FFFFFF;height: 80upx;display: flex;justify-content: center;align-items: center;"
|
||||
:style="[{'margin-top': statusBarHeight+45+'px'}]">
|
||||
<input class="" type="text" value="" placeholder="输入关键字搜索"
|
||||
style="font-size: 28upx;background: #F5F5F5;height: 60upx;width: 90%;border-radius: 50upx;text-align: center;" />
|
||||
</view>
|
||||
<!-- 占位 -->
|
||||
<!-- <view class="" :style="[{'height': statusBarHeight+45+'px'}]"></view> -->
|
||||
@@ -17,19 +22,21 @@
|
||||
<input type="text" value="" placeholder="输入关键字搜索" class="input" style="font-size: 28upx;text-align: center;"/>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="" :style="{height: height + 'px'}" style="display: flex;flex-direction: row;">
|
||||
<view class="" style="display: flex;flex-direction: row;height: 100%;">
|
||||
<scroll-view scroll-y class="left-aside">
|
||||
<view v-for="item in flist" :key="item.id" class="f-item b-b" :class="{ active: item.id === currentId }" @click="tabtap(item)">{{ item.name }}</view>
|
||||
<view v-for="item in flist" :key="item.id" class="f-item b-b" :class="{ active: item.id === currentId }"
|
||||
@click="tabtap(item)">{{ item.name }}</view>
|
||||
</scroll-view>
|
||||
<scroll-view scroll-with-animation scroll-y class="right-aside" @scroll="asideScroll" :scroll-top="tabScrollTop">
|
||||
<scroll-view scroll-with-animation scroll-y class="right-aside" @scroll="asideScroll"
|
||||
:scroll-top="tabScrollTop">
|
||||
<view v-for="item in slist" :key="item.id" class="s-list" :id="'main-' + item.id">
|
||||
<text class="s-item">{{ item.name }}</text>
|
||||
<view class="t-list" >
|
||||
<view v-if="titem.pid === item.id" class="t-item" v-for="titem in tlist" :key="titem.id">
|
||||
<image :src="titem.pic" @click="navToDetailPage(titem)"></image>
|
||||
<text @click="navToDetailPage(titem)">{{titem.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="t-list">
|
||||
<view v-if="titem.pid === item.id" class="t-item" v-for="titem in tlist" :key="titem.id">
|
||||
<image :src="titem.pic" @click="navToDetailPage(titem)"></image>
|
||||
<text @click="navToDetailPage(titem)">{{titem.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@@ -39,200 +46,217 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
|
||||
import Api from '@/common/api';
|
||||
export default {
|
||||
components: {
|
||||
mallplusCopyright
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sizeCalcState: false,
|
||||
tabScrollTop: 0,
|
||||
currentId: 1,
|
||||
flist: [],
|
||||
slist: [],
|
||||
tlist: [],
|
||||
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
|
||||
import Api from '@/common/api';
|
||||
export default {
|
||||
components: {
|
||||
mallplusCopyright
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sizeCalcState: false,
|
||||
tabScrollTop: 0,
|
||||
currentId: 1,
|
||||
flist: [],
|
||||
slist: [],
|
||||
tlist: [],
|
||||
|
||||
height: '',
|
||||
statusBarHeight: '',
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
|
||||
this.height = uni.getSystemInfoSync().windowHeight - (this.statusBarHeight+80)
|
||||
height: '',
|
||||
statusBarHeight: '',
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
|
||||
this.height = uni.getSystemInfoSync().windowHeight - (this.statusBarHeight + 80)
|
||||
console.log("height", this.height);
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
|
||||
let list = this.$db.get('categoryList' )
|
||||
if(!list){
|
||||
let params = {};
|
||||
list = await Api.apiCall('get', Api.goods.typeGoodsList, params);
|
||||
this.$db.set('categoryList', list)
|
||||
}
|
||||
let list = this.$db.get('categoryList')
|
||||
if (!list) {
|
||||
let params = {};
|
||||
list = await Api.apiCall('get', Api.goods.typeGoodsList, params);
|
||||
this.$db.set('categoryList', list)
|
||||
}
|
||||
|
||||
if(list){
|
||||
list.forEach(item => {
|
||||
|
||||
if (item.level==0) {
|
||||
this.flist.push(item); //pid为父级id, 没有pid或者pid=0是一级分类
|
||||
} else if (item.level==1) {
|
||||
this.slist.push(item); //没有价格的是2级分类
|
||||
} else {
|
||||
this.tlist.push(item); //3级分类
|
||||
}
|
||||
if (list) {
|
||||
list.forEach(item => {
|
||||
|
||||
if (item.level == 0) {
|
||||
this.flist.push(item); //pid为父级id, 没有pid或者pid=0是一级分类
|
||||
} else if (item.level == 1) {
|
||||
this.slist.push(item); //没有价格的是2级分类
|
||||
} else {
|
||||
this.tlist.push(item); //3级分类
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
//一级分类点击
|
||||
tabtap(item) {
|
||||
if (!this.sizeCalcState) {
|
||||
this.calcSize();
|
||||
}
|
||||
|
||||
this.currentId = item.id;
|
||||
console.log(item.id);
|
||||
let index = this.slist.findIndex(sitem => sitem.pid === item.id);
|
||||
if (index >= 0) {
|
||||
this.tabScrollTop = this.slist[index].top;
|
||||
}
|
||||
|
||||
},
|
||||
//右侧栏滚动
|
||||
asideScroll(e) {
|
||||
if (!this.sizeCalcState) {
|
||||
this.calcSize();
|
||||
}
|
||||
let scrollTop = e.detail.scrollTop;
|
||||
let tabs = this.slist.filter(item => item.top <= scrollTop).reverse();
|
||||
if (tabs.length > 0) {
|
||||
this.currentId = tabs[0].pid;
|
||||
}
|
||||
},
|
||||
//计算右侧栏每个tab的高度等信息
|
||||
calcSize() {
|
||||
let h = 0;
|
||||
this.slist.forEach(item => {
|
||||
let view = uni.createSelectorQuery().select('#main-' + item.id);
|
||||
view.fields({
|
||||
size: true
|
||||
},
|
||||
data => {
|
||||
item.top = h;
|
||||
h += data.height;
|
||||
item.bottom = h;
|
||||
}
|
||||
).exec();
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
//一级分类点击
|
||||
tabtap(item) {
|
||||
if (!this.sizeCalcState) {
|
||||
this.calcSize();
|
||||
}
|
||||
|
||||
this.currentId = item.id;
|
||||
console.log(item.id);
|
||||
let index = this.slist.findIndex(sitem => sitem.pid === item.id);
|
||||
if(index>=0){
|
||||
this.tabScrollTop = this.slist[index].top;
|
||||
}
|
||||
|
||||
},
|
||||
//右侧栏滚动
|
||||
asideScroll(e) {
|
||||
if (!this.sizeCalcState) {
|
||||
this.calcSize();
|
||||
}
|
||||
let scrollTop = e.detail.scrollTop;
|
||||
let tabs = this.slist.filter(item => item.top <= scrollTop).reverse();
|
||||
if (tabs.length > 0) {
|
||||
this.currentId = tabs[0].pid;
|
||||
}
|
||||
},
|
||||
//计算右侧栏每个tab的高度等信息
|
||||
calcSize() {
|
||||
let h = 0;
|
||||
this.slist.forEach(item => {
|
||||
let view = uni.createSelectorQuery().select('#main-' + item.id);
|
||||
view.fields(
|
||||
{
|
||||
size: true
|
||||
},
|
||||
data => {
|
||||
item.top = h;
|
||||
h += data.height;
|
||||
item.bottom = h;
|
||||
}
|
||||
).exec();
|
||||
});
|
||||
this.sizeCalcState = true;
|
||||
},
|
||||
navToList(sid) {
|
||||
uni.navigateTo({
|
||||
url: `../../pagesA/product/list?sid=${sid}`
|
||||
});
|
||||
},
|
||||
//详情页
|
||||
navToDetailPage(item) {
|
||||
//测试数据没有写id,用title代替
|
||||
let id = item.id;
|
||||
uni.navigateTo({
|
||||
url: `../../pagesA/product/product?id=${id}`
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
this.sizeCalcState = true;
|
||||
},
|
||||
navToList(sid) {
|
||||
uni.navigateTo({
|
||||
url: `../../pagesA/product/list?sid=${sid}`
|
||||
});
|
||||
},
|
||||
//详情页
|
||||
navToDetailPage(item) {
|
||||
//测试数据没有写id,用title代替
|
||||
let id = item.id;
|
||||
uni.navigateTo({
|
||||
url: `../../pagesA/product/product?id=${id}`
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page,
|
||||
.content {
|
||||
height: 100%;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
page,
|
||||
.content {
|
||||
height: 100%;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
}
|
||||
.left-aside {
|
||||
flex-shrink: 0;
|
||||
width: 200upx;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.f-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100upx;
|
||||
font-size: 28upx;
|
||||
color: $font-color-base;
|
||||
position: relative;
|
||||
&.active {
|
||||
color: $base-color;
|
||||
background: #f8f8f8;
|
||||
&:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
height: 36upx;
|
||||
width: 8upx;
|
||||
background-color: $base-color;
|
||||
border-radius: 0 4px 4px 0;
|
||||
opacity: 0.8;
|
||||
.content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.left-aside {
|
||||
flex-shrink: 0;
|
||||
width: 200upx;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.f-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100upx;
|
||||
font-size: 28upx;
|
||||
color: $font-color-base;
|
||||
position: relative;
|
||||
|
||||
&.active {
|
||||
color: $base-color;
|
||||
background: #f8f8f8;
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
height: 36upx;
|
||||
width: 8upx;
|
||||
background-color: $base-color;
|
||||
border-radius: 0 4px 4px 0;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right-aside {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
padding-left: 20upx;
|
||||
}
|
||||
.s-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 70upx;
|
||||
padding-top: 8upx;
|
||||
font-size: 28upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
.t-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
padding-top: 12upx;
|
||||
&:after {
|
||||
content: '';
|
||||
flex: 99;
|
||||
height: 0;
|
||||
.right-aside {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
padding-left: 20upx;
|
||||
}
|
||||
}
|
||||
.t-item {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 176upx;
|
||||
font-size: 26upx;
|
||||
color: #666;
|
||||
padding-bottom: 20upx;
|
||||
|
||||
image {
|
||||
width: 140upx;
|
||||
height: 140upx;
|
||||
.s-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 70upx;
|
||||
padding-top: 8upx;
|
||||
font-size: 28upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
}
|
||||
.getPosition{
|
||||
|
||||
.t-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
padding-top: 12upx;
|
||||
|
||||
&:after {
|
||||
content: '';
|
||||
flex: 99;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.t-item {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 176upx;
|
||||
font-size: 26upx;
|
||||
color: #666;
|
||||
padding-bottom: 20upx;
|
||||
|
||||
image {
|
||||
width: 130upx;
|
||||
height: 130upx;
|
||||
}
|
||||
text{
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
|
||||
.getPosition {
|
||||
height: 100upx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
<image src="/static/shwz_icon.png"></image>
|
||||
<text>生活物资</text>
|
||||
</view>
|
||||
<view class="cate-item" @click="navToTabPage('../../pagesA/product/groupList')">
|
||||
<!-- <view class="cate-item" @click="navToTabPage('../../pagesA/product/groupList')">
|
||||
<image src="/static/temp/fabfa-dropbox.png"></image>
|
||||
<text>拼团特价</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="cate-item" @click="navToTabPage('/pagesU/notice/subjectList')">
|
||||
<image src="/static/njfw_icon.png"></image>
|
||||
<text>农机服务</text>
|
||||
@@ -65,7 +65,7 @@
|
||||
</view> -->
|
||||
|
||||
<!-- 秒杀楼层 https://s.click.taobao.com/Wds7c1w -->
|
||||
<view class="seckill-section m-t"
|
||||
<!-- <view class="seckill-section m-t"
|
||||
v-if="homeFlashPromotion.flashSessionInfoList && homeFlashPromotion.flashSessionInfoList.length > 0">
|
||||
<view class="s-header">
|
||||
<view class="" style="width: 80%;display: flex;flex-direction: row;align-items: center;">
|
||||
@@ -93,7 +93,7 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="f-header m-t" @click="navToTabPage('../../pagesC/store/storeList')">
|
||||
<image src="/static/temp/nav1.png"></image>
|
||||
<view class="tit-box">
|
||||
@@ -112,9 +112,10 @@
|
||||
</view> -->
|
||||
|
||||
<!-- 优惠券 https://s.click.taobao.com/OPh3c1w -->
|
||||
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#ff0000"></coupon>
|
||||
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#ff0000" ref="SubComponent"
|
||||
@callParentMethod="callParentMethod"></coupon>
|
||||
|
||||
<!-- 团购楼层 -->
|
||||
<!-- 团购楼层
|
||||
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/groupList')"
|
||||
v-if="groupHotGoodsList.length > 0">
|
||||
<image src="/static/temp/h1.png"></image>
|
||||
@@ -144,10 +145,10 @@
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 分类推荐楼层 -->
|
||||
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')" v-if="false">
|
||||
<!-- <view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')" v-if="false">
|
||||
<image src="/static/temp/h1.png"></image>
|
||||
<view class="tit-box">
|
||||
<text class="tit">分类精选</text>
|
||||
@@ -172,7 +173,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 新品推荐 -->
|
||||
<view v-if='homeNewProductList && homeNewProductList.length>0' class="f-header m-t"
|
||||
@@ -193,7 +194,7 @@
|
||||
<text class="title clamp">{{ item.productName }}</text>
|
||||
<view>
|
||||
<text class="price">惠农价¥{{ item.price }}</text>
|
||||
<!-- <text class="m-price"> 县区商超价¥{{ item.price }}</text> -->
|
||||
<text class="m-price">市场价¥{{ item.originalPrice }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -219,17 +220,19 @@
|
||||
<text class="title clamp">{{ item.productName }}</text>
|
||||
<view>
|
||||
<text class="price">惠农价¥{{ item.price }}</text>
|
||||
<!-- <text class="m-price">县区商超价¥{{ item.price }}</text> -->
|
||||
<text class="m-price">市场价¥{{ item.originalPrice }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 新品上市 -->
|
||||
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')">
|
||||
|
||||
<!-- <view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')"> -->
|
||||
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list?isFenxiao=1')">
|
||||
<image src="/static/temp/h1.png"></image>
|
||||
<view class="tit-box">
|
||||
<text class="tit">新品上市</text>
|
||||
<text class="tit">商品列表</text>
|
||||
</view>
|
||||
<text class="yticon icon-you"></text>
|
||||
</view>
|
||||
@@ -241,11 +244,14 @@
|
||||
<image :src="item.pic" mode="aspectFill"></image>
|
||||
</view>
|
||||
<text class="title clamp">{{ item.name }}</text>
|
||||
<!-- <text class="label">【{{ item.storeName }}】</text> -->
|
||||
<text class="price">惠农价¥{{ item.price }}</text>
|
||||
<view>
|
||||
<text class="price">惠农价¥{{ item.price }}</text>
|
||||
<text class="m-price">市场价¥{{ item.originalPrice }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<uni-load-more :status="loadingType"></uni-load-more>
|
||||
|
||||
</view>
|
||||
<uni-load-more :status="loadingType"></uni-load-more>
|
||||
<!-- <mallplusCopyright></mallplusCopyright> -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -355,6 +361,20 @@
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clickParentMethod() {
|
||||
console.log('clickParentMethod')
|
||||
this.$refs.SubComponent.callSubMethod()
|
||||
},
|
||||
callParentMethod(val) {
|
||||
console.log('callParentMethod: ' + val)
|
||||
// 默认去遍历list集合,将集合中的每个元素传入到function的item里,
|
||||
var index = this.couponList.findIndex(function(item) {
|
||||
return item.id == val.id;
|
||||
})
|
||||
this.couponList.splice(index, 1);
|
||||
|
||||
},
|
||||
|
||||
async sysInfoMethod() {
|
||||
let params = {};
|
||||
let list = this.$db.get('sysInfo')
|
||||
@@ -435,10 +455,10 @@
|
||||
async loadData() {
|
||||
|
||||
this.getBanner();
|
||||
this.getHotGoodsList();
|
||||
// this.getHotGoodsList();
|
||||
//this.getFlashPromotion();
|
||||
this.getCouponList();
|
||||
this.getStoreList();
|
||||
// this.getStoreList();
|
||||
this.homeNewProduct();
|
||||
this.homeRecommendProduct();
|
||||
|
||||
@@ -532,9 +552,16 @@
|
||||
} else {
|
||||
this.loadingType = 'more';
|
||||
}
|
||||
// let params = {
|
||||
// pageNum: this.pageNum
|
||||
// };
|
||||
let params = {
|
||||
pageNum: this.pageNum
|
||||
};
|
||||
pageNum: this.pageNum,
|
||||
productCategoryId: "",
|
||||
type: 1,
|
||||
productAttributeCategoryId: ""
|
||||
};;
|
||||
|
||||
let list = await Api.apiCall('get', Api.goods.goodsList, params);
|
||||
|
||||
let goodsList = list.records;
|
||||
@@ -1038,10 +1065,9 @@
|
||||
}
|
||||
|
||||
.m-price {
|
||||
font-size: $font-sm + 2upx;
|
||||
text-decoration: line-through;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-light;
|
||||
margin-left: 8upx;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1140,10 +1166,9 @@
|
||||
}
|
||||
|
||||
.m-price {
|
||||
font-size: $font-sm + 2upx;
|
||||
text-decoration: line-through;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-light;
|
||||
margin-left: 8upx;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
.pro-box {
|
||||
@@ -1207,16 +1232,15 @@
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 18px;
|
||||
font-size: 16px;
|
||||
color: $uni-color-primary;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.m-price {
|
||||
font-size: $font-sm + 2upx;
|
||||
text-decoration: line-through;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-light;
|
||||
margin-left: 8upx;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
.coupon_box {
|
||||
|
||||
99
mallplusui-uniapp-app/pages/index/messageDetail.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="introduce-section">
|
||||
<text class="title">{{ info.params }}</text>
|
||||
|
||||
<view class="bot-row">
|
||||
<text>{{ info.code }}</text>
|
||||
<text>{{ info.ctime | formatCreateTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="c-list">
|
||||
<text >{{ info.content }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Api from '@/common/api';
|
||||
import {
|
||||
formatDate
|
||||
} from '@/common/date';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
info: {
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
async onLoad() {
|
||||
|
||||
// 别问我啥意思。这是官方文档提供的
|
||||
this.page = this.getOpenerEventChannel();
|
||||
// 你可以在这里直接接受,这里不是$on
|
||||
this.page.on('sendTestValue', (data) => {
|
||||
// 这是data 就是上个页面传递的对象了
|
||||
console.log("消息", data)
|
||||
this.info = data.info
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'MM-dd')
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: $page-color-base;
|
||||
}
|
||||
|
||||
/* 标题简介 */
|
||||
.introduce-section {
|
||||
background: #fff;
|
||||
padding: 20upx 30upx;
|
||||
|
||||
.title {
|
||||
font-size: 32upx;
|
||||
color: $font-color-dark;
|
||||
height: 50upx;
|
||||
line-height: 50upx;
|
||||
}
|
||||
|
||||
.bot-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 50upx;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-light;
|
||||
|
||||
text {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.c-list {
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
height: 850px;
|
||||
font-size: 28px;
|
||||
padding: 20upx 30upx;
|
||||
background-color: #fff;
|
||||
|
||||
}
|
||||
</style>
|
||||
296
mallplusui-uniapp-app/pages/index/messageList.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="goods-list">
|
||||
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
|
||||
<view class="listcard" @click="navToDetailPage(item)">
|
||||
<view class="listcard-image">
|
||||
<image :src="item.code=='交易物流'?pic1:pic2" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="listcard-content">
|
||||
<view class="listcard-content_title">
|
||||
<text>{{item.code}}</text>
|
||||
<text class="text2">{{item.ctime | formatCreateTime }}</text>
|
||||
</view>
|
||||
<text class="listcard-content_title_text">{{item.params}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <uni-load-more :status="loadingType"></uni-load-more> -->
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Api from '@/common/api';
|
||||
import {
|
||||
formatDate
|
||||
} from '@/common/date';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageNum: 1,
|
||||
pic2: "https://desk-fd.zol-img.com.cn/t_s960x600c5/g1/M0B/03/06/ChMljl402K6IOTZbAARWayFg6S4AAQJPwFhuRIABFaD752.jpg",
|
||||
pic1: "https://ts1.cn.mm.bing.net/th/id/R-C.2ce48cd4a70b48403a56e9ea8c710355?rik=tU9CL%2fR0TMLEYA&riu=http%3a%2f%2fwww.kutoo8.com%2fupload%2fimage%2f63051471%2f4_1920x1080.jpg&ehk=wZm6BwD%2b8TIDXmqxTntxftDP8IzjD8g3hhI6bEwdb54%3d&risl=&pid=ImgRaw&r=0",
|
||||
goodsList: [
|
||||
// {
|
||||
// title: "交易物流",
|
||||
// pic: "https://desk-fd.zol-img.com.cn/t_s960x600c5/g1/M0B/03/06/ChMljl402K6IOTZbAARWayFg6S4AAQJPwFhuRIABFaD752.jpg",
|
||||
// createTime: "02-12",
|
||||
// content: "您的订单商品已经到取货点,请在7日内取出。",
|
||||
// },
|
||||
// {
|
||||
// title: "云链助手",
|
||||
// pic: "https://ts1.cn.mm.bing.net/th/id/R-C.2ce48cd4a70b48403a56e9ea8c710355?rik=tU9CL%2fR0TMLEYA&riu=http%3a%2f%2fwww.kutoo8.com%2fupload%2fimage%2f63051471%2f4_1920x1080.jpg&ehk=wZm6BwD%2b8TIDXmqxTntxftDP8IzjD8g3hhI6bEwdb54%3d&risl=&pid=ImgRaw&r=0",
|
||||
// createTime: "01-10",
|
||||
// content: "春天已经至,已到施肥时间。",
|
||||
// }
|
||||
]
|
||||
};
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
// #ifdef H5
|
||||
this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
|
||||
// #endif
|
||||
|
||||
// this.loadData();
|
||||
},
|
||||
onShow() {
|
||||
this.loadData();
|
||||
},
|
||||
onPageScroll(e) {
|
||||
//兼容iOS端下拉时顶部漂移
|
||||
// if (e.scrollTop >= 0) {
|
||||
// this.headerPosition = 'fixed';
|
||||
// } else {
|
||||
// this.headerPosition = 'absolute';
|
||||
// }
|
||||
},
|
||||
//下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.pageNum = this.pageNum + 1;
|
||||
this.loadData('refresh');
|
||||
},
|
||||
//加载更多
|
||||
onReachBottom() {
|
||||
this.pageNum = this.pageNum + 1;
|
||||
this.loadData();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'MM-dd')
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
//加载商品 ,带下拉刷新和上滑加载
|
||||
async loadData(type = 'add', loading) {
|
||||
//没有更多直接返回
|
||||
if (type === 'add') {
|
||||
if (this.loadingType === 'nomore') {
|
||||
return;
|
||||
}
|
||||
this.loadingType = 'loading';
|
||||
} else {
|
||||
this.loadingType = 'more';
|
||||
}
|
||||
let params = {};
|
||||
|
||||
|
||||
let list = await Api.apiCall('get', Api.member.mesList, params);
|
||||
console.log("消息列表", list)
|
||||
this.goodsList = list;
|
||||
// let goodsList = await this.$api.json('goodsList');
|
||||
// if (type === 'refresh') {
|
||||
// this.goodsList = [];
|
||||
// }
|
||||
|
||||
// this.goodsList = this.goodsList.concat(goodsList);
|
||||
|
||||
//判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了)
|
||||
this.loadingType = this.goodsList.length > list.total ? 'nomore' : 'more';
|
||||
if (type === 'refresh') {
|
||||
if (loading == 1) {
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
},
|
||||
//详情
|
||||
navToDetailPage(item) {
|
||||
console.log("消息>>>>", item)
|
||||
//测试数据没有写id,用title代替
|
||||
// let id = item.id;
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/messageDetail',
|
||||
// 版本2.8.9+ 支持
|
||||
success: (res) => {
|
||||
// 和上面其实没差什么,但是这种方式是可以的 这里不是$emit
|
||||
res.eventChannel.emit('sendTestValue', {
|
||||
info: item
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
stopPrevent() {}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page,
|
||||
.content {
|
||||
background: $page-color-base;
|
||||
}
|
||||
|
||||
.listcard {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
margin: 15px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 5px 1px rgba($color:#000000, $alpha:0.1);
|
||||
box-sizing: border-box;
|
||||
|
||||
.listcard-image {
|
||||
flex-shrink: 0;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.listcard-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10px;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
|
||||
.listcard-content_title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
line-height: 1.2;
|
||||
position: relative;
|
||||
|
||||
text {
|
||||
font-size: 22px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.text2 {
|
||||
color: #999;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.listcard-content_title_text {
|
||||
margin-top: 5px;
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.listcard-content_des {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 12px;
|
||||
|
||||
.listcard-content_des-label {
|
||||
display: flex;
|
||||
|
||||
.listcard-content_des-label-item {
|
||||
padding: 0 5px;
|
||||
margin-right: 5px;
|
||||
border-radius: 15px;
|
||||
color: #f00;
|
||||
border: 1px #f00 solid;
|
||||
}
|
||||
}
|
||||
|
||||
.listcard-content_des-browe {
|
||||
color: #999;
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.mode-column {
|
||||
.list-content {
|
||||
width: 100%;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.listcard-image {
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
|
||||
.listcard-image_item {
|
||||
margin-left: 10px;
|
||||
width: 100%;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.listcard-content_des {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&.mode-image {
|
||||
flex-direction: column;
|
||||
|
||||
.listcard-image {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.listcard-content {
|
||||
padding-left: 0;
|
||||
margin-top: 10px;
|
||||
|
||||
.listcard-content_des {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -100,7 +100,7 @@
|
||||
<!--<list-cell icon="icon-share" iconColor="#9789f7" title="分享" tips="邀请好友赢10万大礼"></list-cell>
|
||||
<list-cell icon="icon-pinglun-copy" iconColor="#ee883b" title="晒单" tips="晒单抢红包"></list-cell>-->
|
||||
<list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#54b4ef" title="我的收藏" @eventClick="navTo('../../pagesU/user/collect')"></list-cell>
|
||||
<list-cell
|
||||
<!-- <list-cell
|
||||
icon="icon-share cgtt"
|
||||
iconColor="#0e68d7"
|
||||
v-if="!userDetailInfo.storeId"
|
||||
@@ -128,7 +128,7 @@
|
||||
v-if="userDetailInfo.roomNums"
|
||||
title="社区主页"
|
||||
@eventClick="navTo('../../pagesA/build/community')"
|
||||
></list-cell>
|
||||
></list-cell> -->
|
||||
<!-- <list-cell
|
||||
icon="icon-pinglun-copy"
|
||||
iconColor="#0e68d7"
|
||||
|
||||
@@ -1,100 +1,104 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="left-bottom-sign"></view>
|
||||
<!-- <view class="left-bottom-sign"></view> -->
|
||||
<!-- <view class="back-btn yticon icon-zuojiantou-up" @click="navBack"></view> -->
|
||||
<view class="right-top-sign"></view>
|
||||
<!-- <view class="right-top-sign"></view> -->
|
||||
<!-- 设置白色背景防止软键盘把下部绝对定位元素顶上来盖住输入框等 -->
|
||||
<!-- <view class="left-top-sign">{{ sysInfo.name }}LOGIN</view> -->
|
||||
<view class="welcome">欢迎回来!汇融云链</view>
|
||||
|
||||
<view class="wrapper">
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="input-content">
|
||||
<view class="select_lay">
|
||||
|
||||
<text class="select_lay_text" :class="{'select_lay_text1':selectKey===0}" @click="selectType(0)">免密登录</text>
|
||||
<text class="select_lay_text" :class="{'select_lay_text1':selectKey===1}" @click="selectType(1)">账号登录</text>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="input-item">
|
||||
<text class="tit">手机号码</text>
|
||||
<input type="number" v-model="phone" maxlength="11" placeholder="请输入手机号码" />
|
||||
</view>
|
||||
<view class="input-item" v-if="show">
|
||||
<text class="tit">密码</text>
|
||||
<input type="password" placeholder="请输入密码" v-model="password" @confirm="toLogin" />
|
||||
</view>
|
||||
<view class="input-item" v-if="!show">
|
||||
<text class="tit">验证码</text>
|
||||
<view class="input-item-right">
|
||||
<input type="number" maxlength="6" placeholder="请输入验证码" v-model="code" @confirm="toLogin"
|
||||
style="width: 70%;" />
|
||||
<view class="codeText" v-if="coding == false" @click="getCode()">获取验证码</view>
|
||||
<view class="authTime" v-else>{{ auth_time }}秒</view>
|
||||
<view class="welcome">汇融云链欢迎您</view>
|
||||
|
||||
<view class="wrapper">
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="input-content">
|
||||
<view class="select_lay">
|
||||
|
||||
<text :class="{'select_lay_text1':selectKey===0}"
|
||||
@click="selectType(0)">账号登录</text>
|
||||
<text style="margin-left: 20px;" :class="{'select_lay_text1':selectKey===1}"
|
||||
@click="selectType(1)">短信登录</text>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="input-item">
|
||||
<text class="tit">手机号码</text>
|
||||
<input type="number" v-model="phone" maxlength="11" placeholder="请输入手机号码" />
|
||||
</view>
|
||||
<view class="input-item" v-if="show">
|
||||
<text class="tit">密码</text>
|
||||
<input type="password" placeholder="请输入密码" v-model="password" @confirm="toLogin" />
|
||||
</view>
|
||||
<view class="input-item" v-if="!show">
|
||||
<text class="tit">验证码</text>
|
||||
<view class="input-item-right">
|
||||
<input type="number" maxlength="6" placeholder="请输入验证码" v-model="code" @confirm="toLogin"
|
||||
style="width: 70%;" />
|
||||
<view class="codeText" v-if="coding == false" @click="getCode()">获取验证码</view>
|
||||
<view class="authTime" v-else>{{ auth_time }}秒</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="confirm-btn" @click="toLogin" :disabled="logining">登录</button>
|
||||
<view class="login_bot">
|
||||
<view class="forget-section" @click="toForget">忘记密码?</view>
|
||||
|
||||
<view class="register-section">
|
||||
还没有账号?
|
||||
<text @click="toRegist">马上注册</text>
|
||||
</view>
|
||||
</view>
|
||||
<br />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button class="confirm-btn" open-type="getUserInfo" @getuserinfo="wxGetUserInfo" withCredentials="true"
|
||||
v-if="isGetPhone == false">微信登录</button>
|
||||
<button class="confirm-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
|
||||
v-if="isGetPhone == true">获取手机号</button>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="input-content">
|
||||
<view class="select_lay">
|
||||
|
||||
<text :class="{'select_lay_text1':selectKey===0}" @click="selectType(0)">免密登录</text>
|
||||
<text class="select_lay_text" :class="{'select_lay_text1':selectKey===1}" @click="selectType(1)">账号登录</text>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="input-item">
|
||||
<text class="tit">手机号码</text>
|
||||
<input type="number" v-model="phone" maxlength="11" placeholder="请输入手机号码" />
|
||||
</view>
|
||||
<view class="input-item" v-if="show">
|
||||
<text class="tit">密码</text>
|
||||
<input type="password" placeholder="请输入密码" v-model="password" @confirm="toLogin" />
|
||||
</view>
|
||||
<view class="input-item" v-if="!show">
|
||||
<text class="tit">验证码</text>
|
||||
<view class="input-item-right">
|
||||
<input type="number" maxlength="6" placeholder="请输入验证码" v-model="code" @confirm="toLogin"
|
||||
style="width: 70%;" />
|
||||
<view class="codeText" v-if="coding == false" @click="getCode()">获取验证码</view>
|
||||
<view class="authTime" v-else>{{ auth_time }}秒</view>
|
||||
<button class="confirm-btn" @click="toLogin" :disabled="logining">登录</button>
|
||||
<view class="login_bot">
|
||||
<view class="forget-section" @click="toForget">忘记密码?</view>
|
||||
|
||||
<view class="register-section">
|
||||
还没有账号?
|
||||
<text @click="toRegist">马上注册</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="confirm-btn" @click="toLogin" :disabled="logining">登录</button>
|
||||
|
||||
<!-- <button v-if="isWeiXin == 1" class="confirm-btn" @click="wechatH5Login" :disabled="logining">微信授权登录</button> -->
|
||||
<view class="login_bot">
|
||||
<view class="forget-section" @click="toForget">忘记密码?</view>
|
||||
|
||||
<view class="register-section">
|
||||
还没有账号?
|
||||
<text @click="toRegist">马上注册</text>
|
||||
<br />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button class="confirm-btn" open-type="getUserInfo" @getuserinfo="wxGetUserInfo" withCredentials="true"
|
||||
v-if="isGetPhone == false">微信登录</button>
|
||||
<button class="confirm-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
|
||||
v-if="isGetPhone == true">获取手机号</button>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="input-content">
|
||||
<view class="select_lay">
|
||||
|
||||
<text :class="{'select_lay_text1':selectKey===0}"
|
||||
@click="selectType(0)">账号登录</text>
|
||||
|
||||
<text style="margin-left: 20px;" :class="{'select_lay_text1':selectKey===1}" @click="selectType(1)">短信登录</text>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="input-item">
|
||||
<text class="tit">手机号码</text>
|
||||
<input type="number" v-model="phone" maxlength="11" placeholder="请输入手机号码" />
|
||||
</view>
|
||||
<view class="input-item" v-if="show">
|
||||
<text class="tit">密码</text>
|
||||
<input type="password" placeholder="请输入密码" v-model="password" @confirm="toLogin" />
|
||||
</view>
|
||||
<view class="input-item" v-if="!show">
|
||||
<text class="tit">验证码</text>
|
||||
<view class="input-item-right">
|
||||
<input type="number" maxlength="6" placeholder="请输入验证码" v-model="code" @confirm="toLogin"
|
||||
style="width: 70%;" />
|
||||
<view class="codeText" v-if="coding == false" @click="getCode()">获取验证码</view>
|
||||
<view class="authTime" v-else>{{ auth_time }}秒</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="confirm-btn" @click="toLogin" :disabled="logining">登录</button>
|
||||
|
||||
<!-- <button v-if="isWeiXin == 1" class="confirm-btn" @click="wechatH5Login" :disabled="logining">微信授权登录</button> -->
|
||||
<view class="login_bot">
|
||||
<view class="forget-section" @click="toForget">忘记密码?</view>
|
||||
|
||||
<view class="register-section">
|
||||
还没有账号?
|
||||
<text @click="toRegist">马上注册</text>
|
||||
</view>
|
||||
</view>
|
||||
<br />
|
||||
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<br />
|
||||
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
<!-- <mallplusCopyright></mallplusCopyright> -->
|
||||
</view>
|
||||
@@ -114,8 +118,8 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
selectKey:0,
|
||||
show: true,
|
||||
selectKey: 0,
|
||||
code: '',
|
||||
coding: false,
|
||||
auth_time: 60,
|
||||
@@ -140,10 +144,10 @@
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['login']),
|
||||
selectType(index){
|
||||
this.selectKey=index
|
||||
selectType(index) {
|
||||
this.selectKey = index
|
||||
this.show = !this.show
|
||||
|
||||
|
||||
},
|
||||
inputChange(e) {
|
||||
const key = e.currentTarget.dataset.key;
|
||||
@@ -487,17 +491,17 @@
|
||||
async toLogin() {
|
||||
var that = this;
|
||||
let phoneReg = /^1[1-9][0-9]\d{8}$/;
|
||||
|
||||
if(that.selectKey==0){
|
||||
// 免密登录
|
||||
|
||||
if (that.selectKey == 1) {
|
||||
// 短信登录
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '暂不支持此登录方式'
|
||||
});
|
||||
return;
|
||||
}else{
|
||||
} else {
|
||||
// 账号登录
|
||||
|
||||
|
||||
try {
|
||||
if (this.phone == '') {
|
||||
throw '请填写手机号';
|
||||
@@ -523,7 +527,9 @@
|
||||
console.log("1111111111");
|
||||
if (data) {
|
||||
console.log(data);
|
||||
console.log("22222222222");
|
||||
that.login(data);
|
||||
console.log("33333333333333");
|
||||
uni.setStorageSync('userInfos', data.userInfo);
|
||||
uni.setStorageSync('token', data.tokenHead + data.token);
|
||||
// uni.setStorageSync('adminToken', data.tokenHead + data.token);
|
||||
@@ -533,7 +539,7 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
getuserinfoh5appwx() {
|
||||
var that = this;
|
||||
@@ -699,7 +705,7 @@
|
||||
align-items: center;
|
||||
|
||||
.select_lay_text {
|
||||
margin-left: 30upx;
|
||||
|
||||
}
|
||||
|
||||
.select_lay_text1 {
|
||||
@@ -790,7 +796,7 @@
|
||||
|
||||
.login_bot {
|
||||
display: flex;
|
||||
margin-top: 15upx;
|
||||
margin-top: 25upx;
|
||||
margin-left: 70upx;
|
||||
margin-right: 70upx;
|
||||
flex-direction: row;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<view class="input-content">
|
||||
<view class="input-item">
|
||||
<text class="tit">手机号码</text>
|
||||
<input type="number" v-model="phone" placeholder="请输入手机号码" />
|
||||
<input type="number" v-model="phone" maxlength="11" placeholder="请输入手机号码" />
|
||||
</view>
|
||||
<view class="input-item">
|
||||
<text class="tit">密码</text>
|
||||
@@ -21,9 +21,9 @@
|
||||
<input type="password" placeholder="请输入确认密码" v-model="confimpassword" @confirm="reg" />
|
||||
</view>
|
||||
<view class="input-item">
|
||||
<text class="tit">邀请码</text>
|
||||
<input type="number" v-model="invitecode" placeholder="请输入邀请码" />
|
||||
</view>
|
||||
<text class="tit">邀请码</text>
|
||||
<input type="number" v-model="invitecode" placeholder="请输入邀请码" />
|
||||
</view>
|
||||
</view>
|
||||
<button class="confirm-btn" @click="reg" :disabled="logining">注册</button>
|
||||
|
||||
@@ -39,218 +39,279 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations } from 'vuex';
|
||||
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
|
||||
import Api from '@/common/api';
|
||||
import {
|
||||
mapMutations,
|
||||
mapState
|
||||
} from 'vuex';
|
||||
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
|
||||
import Api from '@/common/api';
|
||||
import store from '@/store/index';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
mallplusCopyright
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
invitecode: '',
|
||||
phone: '',
|
||||
password: '',
|
||||
confimpassword: '',
|
||||
logining: false
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
computed: {
|
||||
...mapState(['hasLogin', 'userInfo'])
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['login']),
|
||||
|
||||
inputChange(e) {
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this[key] = e.detail.value;
|
||||
},
|
||||
navBack() {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
},
|
||||
toForget() {
|
||||
uni.navigateTo({
|
||||
url: '../../pagesU/user/forget'
|
||||
})
|
||||
},
|
||||
toRegist() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
});
|
||||
},
|
||||
async reg() {
|
||||
var that = this;
|
||||
let phoneReg = /^1[1-9][0-9]\d{8}$/;
|
||||
try {
|
||||
if (this.phone == '') {
|
||||
throw '请填写手机号';
|
||||
}
|
||||
if (!phoneReg.test(this.phone)) {
|
||||
throw '手机号格式有误';
|
||||
}
|
||||
if (this.password == '') {
|
||||
throw '请填写密码';
|
||||
}
|
||||
} catch (err) {
|
||||
this.$api.msg(err);
|
||||
return;
|
||||
}
|
||||
|
||||
let params;
|
||||
//有推荐码的话,带上
|
||||
var invitecode = this.$db.get('invitecode')
|
||||
if (invitecode) {
|
||||
data.invitecode = invitecode
|
||||
params = {
|
||||
phone: this.phone,
|
||||
password: this.password,
|
||||
confimpassword: this.confimpassword,
|
||||
source: 3,
|
||||
invitecode: invitecode
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
phone: this.phone,
|
||||
password: this.password,
|
||||
confimpassword: this.confimpassword,
|
||||
source: 3,
|
||||
invitecode: this.invitecode
|
||||
};
|
||||
}
|
||||
let data = await Api.apiCall('post', Api.index.simpleReg, params);
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
mallplusCopyright
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
invitecode:'',
|
||||
phone: '',
|
||||
password: '',
|
||||
confimpassword: '',
|
||||
logining: false
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
methods: {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/public/login'
|
||||
// });
|
||||
|
||||
// 注册成功 直接默认登录
|
||||
|
||||
let params2 = {
|
||||
phone: this.phone,
|
||||
password: this.password
|
||||
};
|
||||
let data2 = await Api.apiCall('post', Api.index.login, params2);
|
||||
//this.logining = false;
|
||||
console.log("1111111111");
|
||||
if (data2) {
|
||||
console.log(data2);
|
||||
that.login(data2);
|
||||
uni.setStorageSync('userInfos', data2.userInfo);
|
||||
uni.setStorageSync('token', data2.tokenHead + data2.token);
|
||||
// uni.setStorageSync('adminToken', data.tokenHead + data.token);
|
||||
console.log(uni.getStorageSync('token'));
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
});
|
||||
|
||||
inputChange(e) {
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this[key] = e.detail.value;
|
||||
},
|
||||
navBack() {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
},
|
||||
toForget(){
|
||||
uni.navigateTo({
|
||||
url: '../../pagesU/user/forget'
|
||||
})
|
||||
},
|
||||
toRegist() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
});
|
||||
},
|
||||
async reg() {
|
||||
let phoneReg = /^1[1-9][0-9]\d{8}$/;
|
||||
try {
|
||||
if (this.phone == '') {
|
||||
throw '请填写手机号';
|
||||
}
|
||||
if (!phoneReg.test(this.phone)) {
|
||||
throw '手机号格式有误';
|
||||
}
|
||||
if (this.password == '') {
|
||||
throw '请填写密码';
|
||||
}
|
||||
} catch (err) {
|
||||
this.$api.msg(err);
|
||||
return;
|
||||
}
|
||||
|
||||
let params ;
|
||||
//有推荐码的话,带上
|
||||
var invitecode = this.$db.get('invitecode')
|
||||
if (invitecode) {
|
||||
data.invitecode = invitecode
|
||||
params = { phone: this.phone, password: this.password, confimpassword: this.confimpassword ,source:3,invitecode:invitecode};
|
||||
}else {
|
||||
params = { phone: this.phone, password: this.password, confimpassword: this.confimpassword ,source:3,invitecode:this.invitecode};
|
||||
}
|
||||
let data = await Api.apiCall('post', Api.index.simpleReg, params);
|
||||
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
.container {
|
||||
padding-top: 115px;
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
height: 120vh;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
.wrapper {
|
||||
position: relative;
|
||||
z-index: 90;
|
||||
background: #fff;
|
||||
padding-bottom: 30upx;
|
||||
}
|
||||
.back-btn {
|
||||
position: absolute;
|
||||
left: 40upx;
|
||||
z-index: 9999;
|
||||
padding-top: var(--status-bar-height);
|
||||
top: 40upx;
|
||||
font-size: 40upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
.left-top-sign {
|
||||
font-size: 120upx;
|
||||
color: $page-color-base;
|
||||
position: relative;
|
||||
left: -16upx;
|
||||
}
|
||||
.right-top-sign {
|
||||
position: absolute;
|
||||
top: 80upx;
|
||||
right: -30upx;
|
||||
z-index: 95;
|
||||
&:before,
|
||||
&:after {
|
||||
display: block;
|
||||
content: '';
|
||||
width: 400upx;
|
||||
height: 80upx;
|
||||
background: #b4f3e2;
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
&:before {
|
||||
transform: rotate(50deg);
|
||||
border-radius: 0 50px 0 0;
|
||||
|
||||
.container {
|
||||
padding-top: 115px;
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
height: 120vh;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
&:after {
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
z-index: 90;
|
||||
background: #fff;
|
||||
padding-bottom: 30upx;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
position: absolute;
|
||||
right: -198upx;
|
||||
top: 0;
|
||||
transform: rotate(-50deg);
|
||||
border-radius: 50px 0 0 0;
|
||||
/* background: pink; */
|
||||
left: 40upx;
|
||||
z-index: 9999;
|
||||
padding-top: var(--status-bar-height);
|
||||
top: 40upx;
|
||||
font-size: 40upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
}
|
||||
.left-bottom-sign {
|
||||
position: absolute;
|
||||
left: -270upx;
|
||||
bottom: -320upx;
|
||||
border: 100upx solid #d0d1fd;
|
||||
border-radius: 50%;
|
||||
padding: 180upx;
|
||||
}
|
||||
.welcome {
|
||||
position: relative;
|
||||
left: 50upx;
|
||||
top: -90upx;
|
||||
font-size: 46upx;
|
||||
color: #555;
|
||||
text-shadow: 1px 0px 1px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.input-content {
|
||||
padding: 0 60upx;
|
||||
}
|
||||
.input-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding: 0 30upx;
|
||||
background: $page-color-light;
|
||||
height: 120upx;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 50upx;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
|
||||
.left-top-sign {
|
||||
font-size: 120upx;
|
||||
color: $page-color-base;
|
||||
position: relative;
|
||||
left: -16upx;
|
||||
}
|
||||
.tit {
|
||||
height: 50upx;
|
||||
line-height: 56upx;
|
||||
|
||||
.right-top-sign {
|
||||
position: absolute;
|
||||
top: 80upx;
|
||||
right: -30upx;
|
||||
z-index: 95;
|
||||
|
||||
&:before,
|
||||
&:after {
|
||||
display: block;
|
||||
content: '';
|
||||
width: 400upx;
|
||||
height: 80upx;
|
||||
background: #b4f3e2;
|
||||
}
|
||||
|
||||
&:before {
|
||||
transform: rotate(50deg);
|
||||
border-radius: 0 50px 0 0;
|
||||
}
|
||||
|
||||
&:after {
|
||||
position: absolute;
|
||||
right: -198upx;
|
||||
top: 0;
|
||||
transform: rotate(-50deg);
|
||||
border-radius: 50px 0 0 0;
|
||||
/* background: pink; */
|
||||
}
|
||||
}
|
||||
|
||||
.left-bottom-sign {
|
||||
position: absolute;
|
||||
left: -270upx;
|
||||
bottom: -320upx;
|
||||
border: 100upx solid #d0d1fd;
|
||||
border-radius: 50%;
|
||||
padding: 180upx;
|
||||
}
|
||||
|
||||
.welcome {
|
||||
position: relative;
|
||||
left: 50upx;
|
||||
top: -90upx;
|
||||
font-size: 46upx;
|
||||
color: #555;
|
||||
text-shadow: 1px 0px 1px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.input-content {
|
||||
padding: 0 60upx;
|
||||
}
|
||||
|
||||
.input-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding: 0 30upx;
|
||||
background: $page-color-light;
|
||||
height: 120upx;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 50upx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.tit {
|
||||
height: 50upx;
|
||||
line-height: 56upx;
|
||||
font-size: $font-sm + 2upx;
|
||||
color: $font-color-base;
|
||||
}
|
||||
|
||||
input {
|
||||
height: 60upx;
|
||||
font-size: $font-base + 2upx;
|
||||
color: $font-color-dark;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-btn {
|
||||
width: 630upx;
|
||||
height: 76upx;
|
||||
line-height: 76upx;
|
||||
border-radius: 50px;
|
||||
margin-top: 70upx;
|
||||
background: $uni-color-primary;
|
||||
color: #fff;
|
||||
font-size: $font-lg;
|
||||
|
||||
&:after {
|
||||
border-radius: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
.forget-section {
|
||||
font-size: $font-sm + 2upx;
|
||||
color: $font-color-spec;
|
||||
text-align: center;
|
||||
margin-top: 40upx;
|
||||
}
|
||||
|
||||
.register-section {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 40upx;
|
||||
width: 100%;
|
||||
font-size: $font-sm + 2upx;
|
||||
color: $font-color-base;
|
||||
}
|
||||
input {
|
||||
height: 60upx;
|
||||
font-size: $font-base + 2upx;
|
||||
color: $font-color-dark;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
text-align: center;
|
||||
|
||||
.confirm-btn {
|
||||
width: 630upx;
|
||||
height: 76upx;
|
||||
line-height: 76upx;
|
||||
border-radius: 50px;
|
||||
margin-top: 70upx;
|
||||
background: $uni-color-primary;
|
||||
color: #fff;
|
||||
font-size: $font-lg;
|
||||
&:after {
|
||||
border-radius: 100px;
|
||||
text {
|
||||
color: $font-color-spec;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.forget-section {
|
||||
font-size: $font-sm + 2upx;
|
||||
color: $font-color-spec;
|
||||
text-align: center;
|
||||
margin-top: 40upx;
|
||||
}
|
||||
.register-section {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 40upx;
|
||||
width: 100%;
|
||||
font-size: $font-sm + 2upx;
|
||||
color: $font-color-base;
|
||||
text-align: center;
|
||||
text {
|
||||
color: $font-color-spec;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
<text class="cell-tit">清除缓存</text>
|
||||
<text class="cell-more yticon icon-you"></text>
|
||||
</view>
|
||||
<view class="list-cell b-b" @click="navTo('关于Dcloud')" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<!-- <view class="list-cell b-b" @click="navTo('关于Dcloud')" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<text class="cell-tit">关于{{ sysInfo.name }}</text>
|
||||
<text class="cell-more yticon icon-you"></text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="list-cell" @click="updateApp()">
|
||||
<text class="cell-tit">检查更新</text>
|
||||
<!-- <text class="cell-tip">当前版本 {{sysInfo.version}}</text> -->
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<text class="title clamp">{{ item.name }}</text>
|
||||
<view class="price-box" >
|
||||
<text class="price">{{ item.price }}</text>
|
||||
<!-- <text>佣金 ¥{{ item.fenxiaoPrice }}</text> -->
|
||||
<text class="price2">市场价 ¥{{ item.originalPrice }}</text>
|
||||
</view>
|
||||
<!-- <view class="price-box" v-if="item.isVip == 1">
|
||||
<text class="price">会员价{{ item.vipPrice }}</text>
|
||||
@@ -465,6 +465,10 @@ page,
|
||||
font-size: 26upx;
|
||||
}
|
||||
}
|
||||
.price2{
|
||||
font-size: $font-sm ;
|
||||
color: $font-color-light;
|
||||
}
|
||||
}
|
||||
.goods-list-vertical {
|
||||
display: flex;
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
<view class="price-box">
|
||||
<!-- <text class="price-tip">惠农价</text> -->
|
||||
<text class="price" v-if="goods.vipPrice && goods.vipPrice > 0">惠农价¥{{ (goods.price * goods.memberRate) / 10 }}</text>
|
||||
<text class="price" v-else-if="!goods.vipPrice">惠农价¥{{ goods.price }}</text>
|
||||
<text class="m-price" v-if="!goods.vipPrice">县区商超价{{ goods.originalPrice }}</text>
|
||||
<text class="price" v-else-if="!goods.vipPrice">惠农价¥{{ goods.originalPrice }}</text>
|
||||
<text class="m-price" v-if="!goods.vipPrice">市场价¥{{ goods.price }}</text>
|
||||
<text class="m-price" v-else-if="goods.vipPrice && goods.vipPrice > 0">¥{{ goods.price }}</text>
|
||||
<text class="price">优惠¥{{ (goods.originalPrice- goods.price) | formatNumber}}</text>
|
||||
<text class="price">优惠¥{{ (goods.price - goods.originalPrice) | formatNumber}}</text>
|
||||
<text class="coupon-tip" v-if="goods.memberRate && goods.memberRate != 10">会员折扣{{ goods.memberRate }}折</text>
|
||||
</view>
|
||||
<view class="bot-row">
|
||||
@@ -656,7 +656,6 @@ page {
|
||||
.m-price {
|
||||
margin: 0 12upx;
|
||||
color: $font-color-light;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.coupon-tip {
|
||||
align-items: center;
|
||||
|
||||
@@ -3,31 +3,34 @@
|
||||
|
||||
<view class="row b-b">
|
||||
<text class="tit">联系人</text>
|
||||
<input class="input" type="text" v-model="addressData.name" placeholder="收货人姓名" placeholder-class="placeholder" />
|
||||
<input class="input" type="text" v-model="addressData.name" placeholder="收货人姓名"
|
||||
placeholder-class="placeholder" />
|
||||
</view>
|
||||
<view class="row b-b">
|
||||
<text class="tit">手机号</text>
|
||||
<input class="input" type="number" maxlength="11" v-model="addressData.phoneNumber" placeholder="收货人手机号码" placeholder-class="placeholder" />
|
||||
<input class="input" type="number" maxlength="11" v-model="addressData.phoneNumber" placeholder="收货人手机号码"
|
||||
placeholder-class="placeholder" />
|
||||
</view>
|
||||
|
||||
|
||||
<view class="row b-b">
|
||||
<text class="tit">城市</text>
|
||||
<input placeholder="请选择城市" disabled="true" :value="addressData.province + ' ' + addressData.city + ' ' + addressData.region" @click="lotusAddressData.visible = true" class="input">
|
||||
<lotus-address v-on:choseVal="choseValue" :lotusAddressData="lotusAddressData"></lotus-address>
|
||||
</input>
|
||||
<text class="tit">所在地</text>
|
||||
<view class="input" >
|
||||
<uni-data-select v-model="value" :localdata="range" @change="change"></uni-data-select>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- <view class="row b-b">
|
||||
<text class="tit">地图:</text>
|
||||
|
||||
|
||||
<input class="input" @click="openMap()" type="text" value="" v-model="mapAddressName"
|
||||
placeholder="在地图上搜索并选择地址" disabled="true" />
|
||||
<text class="yticon icon-shouhuodizhi"></text>
|
||||
</view>
|
||||
|
||||
</view> -->
|
||||
<view class="row b-b">
|
||||
<text class="tit">地图:</text>
|
||||
|
||||
|
||||
<input class="input" @click="openMap()" type="text" value="" v-model="mapAddressName" placeholder="在地图上搜索并选择地址" disabled="true" />
|
||||
<text class="yticon icon-shouhuodizhi"></text>
|
||||
|
||||
</view>
|
||||
<view class="row b-b">
|
||||
<text class="tit">详细</text>
|
||||
<input class="input" type="text" v-model="addressData.detailAddress" placeholder="街道、楼号、门牌" placeholder-class="placeholder" />
|
||||
<text class="tit">取货点</text>
|
||||
<text class="input">王宫村服务站</text>
|
||||
</view>
|
||||
|
||||
<view class="row default-row">
|
||||
@@ -39,12 +42,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Api from '@/common/api';
|
||||
import lotusAddress from "@/components/Winglau14-lotusAddress/Winglau14-lotusAddress.vue"
|
||||
import Api from '@/common/api';
|
||||
import lotusAddress from "@/components/Winglau14-lotusAddress/Winglau14-lotusAddress.vue"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mapAddressName: '',
|
||||
mapAddressName: '',
|
||||
addressData: {
|
||||
name: '',
|
||||
phoneNumber: '',
|
||||
@@ -55,17 +58,31 @@ import lotusAddress from "@/components/Winglau14-lotusAddress/Winglau14-lotusAdd
|
||||
defaultStatus: 0,
|
||||
def: false
|
||||
},
|
||||
lotusAddressData:{
|
||||
visible:false,
|
||||
provinceName:'',
|
||||
cityName:'',
|
||||
townName:'',
|
||||
lotusAddressData: {
|
||||
visible: false,
|
||||
provinceName: '',
|
||||
cityName: '',
|
||||
townName: '',
|
||||
},
|
||||
value: 0,
|
||||
range: [{
|
||||
value: '1',
|
||||
text: '王宫村'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
text: '土山村'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
text: '马庄村'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad(option){
|
||||
onLoad(option) {
|
||||
let title = '新增收货地址';
|
||||
if(option.type==='edit'){
|
||||
if (option.type === 'edit') {
|
||||
title = '编辑收货地址'
|
||||
this.addressData = JSON.parse(option.data)
|
||||
}
|
||||
@@ -75,36 +92,42 @@ import lotusAddress from "@/components/Winglau14-lotusAddress/Winglau14-lotusAdd
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
switchChange(e){
|
||||
this.addressData.defaultStatus = e.detail.value?1:0
|
||||
|
||||
change(res) {
|
||||
console.log('res', res);
|
||||
},
|
||||
|
||||
switchChange(e) {
|
||||
this.addressData.defaultStatus = e.detail.value ? 1 : 0
|
||||
this.addressData.def = e.detail.value
|
||||
},
|
||||
openMap() {
|
||||
var _this = this;
|
||||
uni.chooseLocation({
|
||||
|
||||
success: function(res) {
|
||||
console.log('res', res);
|
||||
openMap() {
|
||||
var _this = this;
|
||||
uni.chooseLocation({
|
||||
|
||||
_this.addressData.latitude = res.latitude;
|
||||
_this.addressData.longitude = res.longitude;
|
||||
_this.mapAddressName= res.address + res.name;
|
||||
_this.addressData.detailAddress = res.address + res.name;
|
||||
console.log('经度:' + res.longitude);
|
||||
console.log('详细地址:' + res.address);
|
||||
console.log('纬度:' + res.latitude);
|
||||
}
|
||||
});
|
||||
success: function(res) {
|
||||
console.log('res', res);
|
||||
|
||||
},
|
||||
choseValue(res){
|
||||
//res数据源包括已选省市区与省市区code
|
||||
this.lotusAddressData.visible = false;//visible为显示与关闭组件标识true显示false隐藏
|
||||
if(res.isChose){
|
||||
_this.addressData.latitude = res.latitude;
|
||||
_this.addressData.longitude = res.longitude;
|
||||
_this.mapAddressName = res.address + res.name;
|
||||
_this.addressData.detailAddress = res.address + res.name;
|
||||
console.log('经度:' + res.longitude);
|
||||
console.log('详细地址:' + res.address);
|
||||
console.log('纬度:' + res.latitude);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
choseValue(res) {
|
||||
//res数据源包括已选省市区与省市区code
|
||||
this.lotusAddressData.visible = false; //visible为显示与关闭组件标识true显示false隐藏
|
||||
if (res.isChose) {
|
||||
console.log(res)
|
||||
this.lotusAddressData.provinceName = res.provice;//省
|
||||
this.lotusAddressData.cityName = res.city;//市
|
||||
this.lotusAddressData.townName = res.town;//区
|
||||
this.lotusAddressData.provinceName = res.provice; //省
|
||||
this.lotusAddressData.cityName = res.city; //市
|
||||
this.lotusAddressData.townName = res.town; //区
|
||||
|
||||
//赋值到addressData
|
||||
this.addressData.province = res.provice
|
||||
@@ -115,96 +138,102 @@ import lotusAddress from "@/components/Winglau14-lotusAddress/Winglau14-lotusAdd
|
||||
},
|
||||
|
||||
//提交
|
||||
async confirm(){
|
||||
async confirm() {
|
||||
const that = this
|
||||
let data = this.addressData;
|
||||
if(!data.name){
|
||||
if (!data.name) {
|
||||
this.$api.msg('请填写收货人姓名');
|
||||
return;
|
||||
}
|
||||
if(!/(^1[3|4|5|7|8][0-9]{9}$)/.test(data.phoneNumber)){
|
||||
if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(data.phoneNumber)) {
|
||||
that.$api.msg('请输入正确的手机号码');
|
||||
return
|
||||
}
|
||||
if (!data.province) {
|
||||
that.$api.msg('请选择省市区');
|
||||
return
|
||||
}
|
||||
if (!data.city) {
|
||||
that.$api.msg('请选择二级城市')
|
||||
return
|
||||
}
|
||||
if (!data.region) {
|
||||
that.$api.msg('请选择三级区或县')
|
||||
return
|
||||
}
|
||||
if(!data.detailAddress){
|
||||
that.$api.msg('请输入详细地址');
|
||||
return
|
||||
}
|
||||
// if (!data.province) {
|
||||
// that.$api.msg('请选择省市区');
|
||||
// return
|
||||
// }
|
||||
// if (!data.city) {
|
||||
// that.$api.msg('请选择二级城市')
|
||||
// return
|
||||
// }
|
||||
// if (!data.region) {
|
||||
// that.$api.msg('请选择三级区或县')
|
||||
// return
|
||||
// }
|
||||
// if (!data.detailAddress) {
|
||||
// that.$api.msg('请输入详细地址');
|
||||
// return
|
||||
// }
|
||||
|
||||
let data1 = await Api.apiCall('post', Api.goods.addressSave, that.addressData);
|
||||
if (data1) {
|
||||
this.$api.msg(`保存成功`);
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
})
|
||||
this.$api.msg(`保存成功`);
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
|
||||
}, 800);
|
||||
} else {
|
||||
this.$api.msg(`保存失败`);
|
||||
}
|
||||
}, 800);
|
||||
} else {
|
||||
this.$api.msg(`保存失败`);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
components:{
|
||||
"lotus-address":lotusAddress
|
||||
components: {
|
||||
"lotus-address": lotusAddress
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page{
|
||||
page {
|
||||
background: $page-color-base;
|
||||
padding-top: 16upx;
|
||||
}
|
||||
|
||||
.row{
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
padding:0 30upx;
|
||||
padding: 0 30upx;
|
||||
height: 110upx;
|
||||
background: #fff;
|
||||
|
||||
.tit{
|
||||
.tit {
|
||||
flex-shrink: 0;
|
||||
width: 120upx;
|
||||
font-size: 30upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
.input{
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
font-size: 30upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
.icon-shouhuodizhi{
|
||||
|
||||
.icon-shouhuodizhi {
|
||||
font-size: 36upx;
|
||||
color: $font-color-light;
|
||||
}
|
||||
}
|
||||
.default-row{
|
||||
|
||||
.default-row {
|
||||
margin-top: 16upx;
|
||||
.tit{
|
||||
|
||||
.tit {
|
||||
flex: 1;
|
||||
}
|
||||
switch{
|
||||
|
||||
switch {
|
||||
transform: translateX(16upx) scale(.9);
|
||||
}
|
||||
}
|
||||
.add-btn{
|
||||
|
||||
.add-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
|
||||
<view class="row b-b">
|
||||
<text class="tit">联系人</text>
|
||||
<input class="input" type="text" v-model="addressData.name" placeholder="收货人姓名"
|
||||
placeholder-class="placeholder" />
|
||||
</view>
|
||||
<view class="row b-b">
|
||||
<text class="tit">手机号</text>
|
||||
<input class="input" type="number" maxlength="11" v-model="addressData.phoneNumber" placeholder="收货人手机号码"
|
||||
placeholder-class="placeholder" />
|
||||
</view>
|
||||
|
||||
<view class="row b-b">
|
||||
<text class="tit">城市</text>
|
||||
<input placeholder="请选择城市" disabled="true"
|
||||
:value="addressData.province + ' ' + addressData.city + ' ' + addressData.region"
|
||||
@click="lotusAddressData.visible = true" class="input">
|
||||
<lotus-address v-on:choseVal="choseValue" :lotusAddressData="lotusAddressData"></lotus-address>
|
||||
</input>
|
||||
<text class="yticon icon-shouhuodizhi"></text>
|
||||
</view>
|
||||
<view class="row b-b">
|
||||
<text class="tit">地图:</text>
|
||||
|
||||
|
||||
<input class="input" @click="openMap()" type="text" value="" v-model="mapAddressName"
|
||||
placeholder="在地图上搜索并选择地址" disabled="true" />
|
||||
<text class="yticon icon-shouhuodizhi"></text>
|
||||
|
||||
</view>
|
||||
<view class="row b-b">
|
||||
<text class="tit">详细</text>
|
||||
<input class="input" type="text" v-model="addressData.detailAddress" placeholder="街道、楼号、门牌"
|
||||
placeholder-class="placeholder" />
|
||||
</view>
|
||||
|
||||
<view class="row default-row">
|
||||
<text class="tit">设为默认</text>
|
||||
<switch :checked="addressData.defaultStatus" color="#fa436a" @change="switchChange" />
|
||||
</view>
|
||||
<button class="add-btn" @click="confirm">提交</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Api from '@/common/api';
|
||||
import lotusAddress from "@/components/Winglau14-lotusAddress/Winglau14-lotusAddress.vue"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mapAddressName: '',
|
||||
addressData: {
|
||||
name: '',
|
||||
phoneNumber: '',
|
||||
province: '',
|
||||
city: '',
|
||||
region: '',
|
||||
detailAddress: '',
|
||||
defaultStatus: 0,
|
||||
def: false
|
||||
},
|
||||
lotusAddressData: {
|
||||
visible: false,
|
||||
provinceName: '',
|
||||
cityName: '',
|
||||
townName: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
let title = '新增收货地址';
|
||||
if (option.type === 'edit') {
|
||||
title = '编辑收货地址'
|
||||
this.addressData = JSON.parse(option.data)
|
||||
}
|
||||
this.manageType = option.type;
|
||||
uni.setNavigationBarTitle({
|
||||
title
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
switchChange(e) {
|
||||
this.addressData.defaultStatus = e.detail.value ? 1 : 0
|
||||
this.addressData.def = e.detail.value
|
||||
},
|
||||
openMap() {
|
||||
var _this = this;
|
||||
uni.chooseLocation({
|
||||
|
||||
success: function(res) {
|
||||
console.log('res', res);
|
||||
|
||||
_this.addressData.latitude = res.latitude;
|
||||
_this.addressData.longitude = res.longitude;
|
||||
_this.mapAddressName = res.address + res.name;
|
||||
_this.addressData.detailAddress = res.address + res.name;
|
||||
console.log('经度:' + res.longitude);
|
||||
console.log('详细地址:' + res.address);
|
||||
console.log('纬度:' + res.latitude);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
choseValue(res) {
|
||||
//res数据源包括已选省市区与省市区code
|
||||
this.lotusAddressData.visible = false; //visible为显示与关闭组件标识true显示false隐藏
|
||||
if (res.isChose) {
|
||||
console.log(res)
|
||||
this.lotusAddressData.provinceName = res.provice; //省
|
||||
this.lotusAddressData.cityName = res.city; //市
|
||||
this.lotusAddressData.townName = res.town; //区
|
||||
|
||||
//赋值到addressData
|
||||
this.addressData.province = res.provice
|
||||
this.addressData.city = res.city
|
||||
this.addressData.region = res.town
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
//提交
|
||||
async confirm() {
|
||||
const that = this
|
||||
let data = this.addressData;
|
||||
if (!data.name) {
|
||||
this.$api.msg('请填写收货人姓名');
|
||||
return;
|
||||
}
|
||||
if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(data.phoneNumber)) {
|
||||
that.$api.msg('请输入正确的手机号码');
|
||||
return
|
||||
}
|
||||
if (!data.province) {
|
||||
that.$api.msg('请选择省市区');
|
||||
return
|
||||
}
|
||||
if (!data.city) {
|
||||
that.$api.msg('请选择二级城市')
|
||||
return
|
||||
}
|
||||
if (!data.region) {
|
||||
that.$api.msg('请选择三级区或县')
|
||||
return
|
||||
}
|
||||
if (!data.detailAddress) {
|
||||
that.$api.msg('请输入详细地址');
|
||||
return
|
||||
}
|
||||
|
||||
let data1 = await Api.apiCall('post', Api.goods.addressSave, that.addressData);
|
||||
if (data1) {
|
||||
this.$api.msg(`保存成功`);
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
|
||||
}, 800);
|
||||
} else {
|
||||
this.$api.msg(`保存失败`);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
components: {
|
||||
"lotus-address": lotusAddress
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: $page-color-base;
|
||||
padding-top: 16upx;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
padding: 0 30upx;
|
||||
height: 110upx;
|
||||
background: #fff;
|
||||
|
||||
.tit {
|
||||
flex-shrink: 0;
|
||||
width: 120upx;
|
||||
font-size: 30upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
font-size: 30upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
|
||||
.icon-shouhuodizhi {
|
||||
font-size: 36upx;
|
||||
color: $font-color-light;
|
||||
}
|
||||
}
|
||||
|
||||
.default-row {
|
||||
margin-top: 16upx;
|
||||
|
||||
.tit {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
switch {
|
||||
transform: translateX(16upx) scale(.9);
|
||||
}
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 690upx;
|
||||
height: 80upx;
|
||||
margin: 60upx auto;
|
||||
font-size: $font-lg;
|
||||
color: #fff;
|
||||
background-color: $base-color;
|
||||
border-radius: 10upx;
|
||||
box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
|
||||
}
|
||||
</style>
|
||||
@@ -31,7 +31,7 @@
|
||||
import {
|
||||
formatDate
|
||||
} from '@/common/date';
|
||||
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -288,7 +288,7 @@ import Api from '@/common/api';
|
||||
/* #ifdef H5 || MP-WEIXIN*/
|
||||
width: 100% !important;
|
||||
/* #endif */
|
||||
width: 94%;
|
||||
width: 100%;
|
||||
height: 95upx;
|
||||
padding: 0 3%;
|
||||
border-bottom: solid 1upx #dedede;
|
||||
|
||||
@@ -1,190 +1,217 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="list-cell b-b m-t" @click="upImg" :hover-stay-time="50" style="display: flex;align-items: center;">
|
||||
<text class="cell-tit">我的头像</text>
|
||||
<view class="" style="display: flex;align-items: center;justify-content: center;height: 80upx;line-height: 80upx;">
|
||||
<image v-if="userInfos && userInfos.icon" :src="userInfos.icon" style="border-radius: 50%;width: 100upx;height: 100upx;"></image>
|
||||
<text class="cell-more yticon icon-you"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="list-cell b-b m-t" @click="inputShowModal('nickname')" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<text class="cell-tit" v-if="userInfos && userInfos.nickname">修改昵称:{{userInfos.nickname|| ''}}</text>
|
||||
<view class="container">
|
||||
<view class="list-cell b-b m-t" @click="upImg" :hover-stay-time="50" style="display: flex;align-items: center;">
|
||||
<text class="cell-tit">我的头像</text>
|
||||
<view class=""
|
||||
style="display: flex;align-items: center;justify-content: center;height: 80upx;line-height: 80upx;">
|
||||
<image v-if="userInfos && userInfos.icon" :src="userInfos.icon"
|
||||
style="border-radius: 50%;width: 100upx;height: 100upx;"></image>
|
||||
<text class="cell-more yticon icon-you"></text>
|
||||
</view>
|
||||
<view class="list-cell b-b" @click="genderShowModal" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<text class="cell-tit">修改性别</text>
|
||||
<text class="cell-more yticon icon-you"></text>
|
||||
</view>
|
||||
|
||||
<neil-modal :show="inputShow" @close="cancel" title="编辑" @cancel="cancel" @confirm="confirm">
|
||||
<input v-model="inputContent" style="margin:20upx" placeholder="请输入..." />
|
||||
</neil-modal>
|
||||
<neil-modal :show="genderShow" @close="cancel" title="选择性别" @cancel="cancel" @confirm="confirmGender">
|
||||
<view>
|
||||
<radio-group style="text-align:center" @change="genderRadioChange">
|
||||
<label v-for="(item, index) in genders" :key="item.value">
|
||||
<radio :value="item.value" :checked="index === current" style="margin:10upx" />
|
||||
{{ item.name }}
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</neil-modal>
|
||||
</view>
|
||||
|
||||
<view class="list-cell b-b m-t" @click="inputShowModal('nickname')" hover-class="cell-hover"
|
||||
:hover-stay-time="50">
|
||||
<text class="cell-tit" v-if="userInfos && userInfos.nickname">修改昵称:{{userInfos.nickname|| ''}}</text>
|
||||
<text class="cell-more yticon icon-you"></text>
|
||||
</view>
|
||||
<view class="list-cell b-b" @click="genderShowModal" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<text class="cell-tit">修改性别</text>
|
||||
<text class="cell-more yticon icon-you"></text>
|
||||
</view>
|
||||
|
||||
<neil-modal :show="inputShow" @close="cancel" title="编辑" @cancel="cancel" @confirm="confirm">
|
||||
<input v-model="inputContent" style="margin:20upx" placeholder="请输入..." />
|
||||
</neil-modal>
|
||||
<neil-modal :show="genderShow" @close="cancel" title="选择性别" @cancel="cancel" @confirm="confirmGender">
|
||||
<view>
|
||||
<radio-group style="text-align:center" @change="genderRadioChange">
|
||||
<label v-for="(item, index) in genders" :key="item.value">
|
||||
<radio :value="item.value" :checked="index === current" style="margin:10upx" />
|
||||
{{ item.name }}
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</neil-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
|
||||
import Api from '@/common/api';
|
||||
import neilModal from '@/components/neil-modal.vue';
|
||||
import { mapState, mapMutations } from 'vuex';
|
||||
export default {
|
||||
components: {
|
||||
neilModal
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inputShow: false,
|
||||
feild: undefined,
|
||||
inputContent: '',
|
||||
genderShow: false,
|
||||
gender: undefined,
|
||||
genders: [{ name: '保密', value: 0 }, { name: '男', value: 1 }, { name: '女', value: 2 }],
|
||||
|
||||
userInfos: {},
|
||||
sourceTypeIndex: 0,
|
||||
sourceType: ['拍照', '相册', '拍照或相册'],
|
||||
sizeTypeIndex: 0,
|
||||
sizeType: ['压缩', '原图', '压缩或原图'],
|
||||
};
|
||||
},
|
||||
async onShow() {
|
||||
let params = { };
|
||||
let data = await Api.apiCall('get', Api.index.userSampleInfo, params);
|
||||
this.userInfos=data;
|
||||
console.log(this.userInfos);
|
||||
},
|
||||
async onLoad() {
|
||||
let params = { };
|
||||
let data = await Api.apiCall('get', Api.index.userSampleInfo, params);
|
||||
this.userInfos=data;
|
||||
console.log(this.userInfos);
|
||||
},
|
||||
methods: {
|
||||
upImg(){
|
||||
this.$otherApi.uploadFiles(res => {
|
||||
if (res.code == 200) {
|
||||
this.userInfos.icon = res.data;
|
||||
let obj = {
|
||||
id:1,
|
||||
icon: res.data
|
||||
};
|
||||
Api.apiCall('post', Api.member.updateMember, obj);
|
||||
that.$api.msg('修改成功');
|
||||
} else {
|
||||
this.$common.errorToShow(res.msg)
|
||||
}
|
||||
})
|
||||
|
||||
import Api from '@/common/api';
|
||||
import neilModal from '@/components/neil-modal.vue';
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex';
|
||||
export default {
|
||||
components: {
|
||||
neilModal
|
||||
},
|
||||
cancel() {
|
||||
this.inputShow = false;
|
||||
this.genderShow = false;
|
||||
},
|
||||
inputShowModal(feild) {
|
||||
this.feild = feild;
|
||||
this.inputShow = true;
|
||||
this.inputContent = '';
|
||||
},
|
||||
genderShowModal() {
|
||||
this.genderShow = true;
|
||||
this.gender = undefined;
|
||||
},
|
||||
confirm() {
|
||||
const that = this;
|
||||
if (!that.inputContent) {
|
||||
that.$api.msg('输入不能为空');
|
||||
return;
|
||||
}
|
||||
let obj = { id:1};
|
||||
obj[that.feild] = that.inputContent;
|
||||
Api.apiCall('post', Api.member.updateMember, obj);
|
||||
that.$api.msg('修改成功');
|
||||
that.userInfos[that.feild] = that.inputContent
|
||||
|
||||
},
|
||||
genderRadioChange(e) {
|
||||
this.gender = parseInt(e.detail.value);
|
||||
},
|
||||
confirmGender() {
|
||||
const that = this;
|
||||
if (that.gender === undefined) {
|
||||
that.$api.msg('请选择性别');
|
||||
return;
|
||||
}
|
||||
let obj = {
|
||||
id:1,
|
||||
gender: that.gender
|
||||
data() {
|
||||
return {
|
||||
inputShow: false,
|
||||
feild: undefined,
|
||||
inputContent: '',
|
||||
genderShow: false,
|
||||
gender: undefined,
|
||||
genders: [{
|
||||
name: '保密',
|
||||
value: 0
|
||||
}, {
|
||||
name: '男',
|
||||
value: 1
|
||||
}, {
|
||||
name: '女',
|
||||
value: 2
|
||||
}],
|
||||
current: 0,
|
||||
userInfos: {},
|
||||
sourceTypeIndex: 0,
|
||||
sourceType: ['拍照', '相册', '拍照或相册'],
|
||||
sizeTypeIndex: 0,
|
||||
sizeType: ['压缩', '原图', '压缩或原图'],
|
||||
};
|
||||
Api.apiCall('post', Api.member.updateMember, obj);
|
||||
that.$api.msg('修改成功');
|
||||
},
|
||||
async onShow() {
|
||||
let params = {};
|
||||
let data = await Api.apiCall('get', Api.index.userSampleInfo, params);
|
||||
this.userInfos = data;
|
||||
console.log(this.userInfos);
|
||||
},
|
||||
async onLoad() {
|
||||
let params = {};
|
||||
let data = await Api.apiCall('get', Api.index.userSampleInfo, params);
|
||||
this.userInfos = data;
|
||||
console.log(this.userInfos);
|
||||
},
|
||||
methods: {
|
||||
upImg() {
|
||||
this.$otherApi.uploadFiles(res => {
|
||||
if (res.code == 200) {
|
||||
this.userInfos.icon = res.data;
|
||||
let obj = {
|
||||
id: 1,
|
||||
icon: res.data
|
||||
};
|
||||
Api.apiCall('post', Api.member.updateMember, obj);
|
||||
that.$api.msg('修改成功');
|
||||
} else {
|
||||
this.$common.errorToShow(res.msg)
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
cancel() {
|
||||
this.inputShow = false;
|
||||
this.genderShow = false;
|
||||
},
|
||||
inputShowModal(feild) {
|
||||
this.feild = feild;
|
||||
this.inputShow = true;
|
||||
this.inputContent = '';
|
||||
},
|
||||
genderShowModal() {
|
||||
this.genderShow = true;
|
||||
this.gender = undefined;
|
||||
},
|
||||
confirm() {
|
||||
const that = this;
|
||||
if (!that.inputContent) {
|
||||
that.$api.msg('输入不能为空');
|
||||
return;
|
||||
}
|
||||
let obj = {
|
||||
id: 1
|
||||
};
|
||||
obj[that.feild] = that.inputContent;
|
||||
Api.apiCall('post', Api.member.updateMember, obj);
|
||||
that.$api.msg('修改成功');
|
||||
that.userInfos[that.feild] = that.inputContent
|
||||
|
||||
},
|
||||
genderRadioChange(e) {
|
||||
this.gender = parseInt(e.detail.value);
|
||||
},
|
||||
confirmGender() {
|
||||
const that = this;
|
||||
if (that.gender === undefined) {
|
||||
that.$api.msg('请选择性别');
|
||||
return;
|
||||
}
|
||||
let obj = {
|
||||
id: 1,
|
||||
gender: that.gender
|
||||
};
|
||||
Api.apiCall('post', Api.member.updateMember, obj);
|
||||
that.$api.msg('修改成功');
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: $page-color-base;
|
||||
}
|
||||
page {
|
||||
background: $page-color-base;
|
||||
}
|
||||
|
||||
page {
|
||||
background: $page-color-base;
|
||||
}
|
||||
|
||||
.list-cell {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
padding: 20upx;
|
||||
line-height: 60upx;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
justify-content: center;
|
||||
|
||||
&.log-out-btn {
|
||||
margin-top: 40upx;
|
||||
|
||||
.cell-tit {
|
||||
color: $uni-color-primary;
|
||||
text-align: center;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.cell-hover {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
&.b-b:after {
|
||||
left: 30upx;
|
||||
}
|
||||
|
||||
&.m-t {
|
||||
margin-top: 16upx;
|
||||
}
|
||||
|
||||
.cell-more {
|
||||
align-self: baseline;
|
||||
font-size: $font-lg;
|
||||
color: $font-color-light;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
page {
|
||||
background: $page-color-base;
|
||||
}
|
||||
.list-cell {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
padding: 20upx;
|
||||
line-height: 60upx;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
justify-content: center;
|
||||
&.log-out-btn {
|
||||
margin-top: 40upx;
|
||||
.cell-tit {
|
||||
color: $uni-color-primary;
|
||||
text-align: center;
|
||||
margin-right: 0;
|
||||
flex: 1;
|
||||
font-size: $font-base + 2upx;
|
||||
color: $font-color-dark;
|
||||
margin-right: 10upx;
|
||||
}
|
||||
|
||||
.cell-tip {
|
||||
font-size: $font-base;
|
||||
color: $font-color-light;
|
||||
}
|
||||
|
||||
switch {
|
||||
transform: translateX(16upx) scale(0.84);
|
||||
}
|
||||
}
|
||||
&.cell-hover {
|
||||
background: #fafafa;
|
||||
}
|
||||
&.b-b:after {
|
||||
left: 30upx;
|
||||
}
|
||||
&.m-t {
|
||||
margin-top: 16upx;
|
||||
}
|
||||
.cell-more {
|
||||
align-self: baseline;
|
||||
font-size: $font-lg;
|
||||
color: $font-color-light;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
.cell-tit {
|
||||
flex: 1;
|
||||
font-size: $font-base + 2upx;
|
||||
color: $font-color-dark;
|
||||
margin-right: 10upx;
|
||||
}
|
||||
.cell-tip {
|
||||
font-size: $font-base;
|
||||
color: $font-color-light;
|
||||
}
|
||||
switch {
|
||||
transform: translateX(16upx) scale(0.84);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 54 KiB |
BIN
mallplusui-uniapp-app/static/logo1.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 4.9 MiB |
BIN
mallplusui-uniapp-app/static/tab-message.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
mallplusui-uniapp-app/static/tab-message_.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
@@ -6,14 +6,14 @@ Vue.use(Vuex)
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
hasLogin: false,
|
||||
userInfo:''
|
||||
userInfo: ''
|
||||
},
|
||||
mutations: {
|
||||
login(state, provider) {
|
||||
console.log(provider);
|
||||
if (provider && provider!=undefined){
|
||||
state.hasLogin = true;
|
||||
uni.setStorage({//缓存用户登陆状态
|
||||
console.log(provider);
|
||||
if (provider && provider != undefined) {
|
||||
state.hasLogin = true;
|
||||
uni.setStorage({ //缓存用户登陆状态
|
||||
key: 'userInfo',
|
||||
data: provider.userInfo
|
||||
})
|
||||
@@ -26,8 +26,8 @@ const store = new Vuex.Store({
|
||||
state.hasLogin = false;
|
||||
state.userInfo = '';
|
||||
uni.removeStorage({
|
||||
key: 'userInfo'
|
||||
})
|
||||
key: 'userInfo'
|
||||
})
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
## 1.0.5(2023-02-03)
|
||||
- 修复 禁用时会显示清空按钮
|
||||
## 1.0.4(2023-02-02)
|
||||
- 优化 查询条件短期内多次变更只查询最后一次变更后的结果
|
||||
- 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue
|
||||
## 1.0.3(2023-01-16)
|
||||
- 修复 不关联服务空间报错的问题
|
||||
## 1.0.2(2023-01-14)
|
||||
- 新增 属性 `format` 可用于格式化显示选项内容
|
||||
## 1.0.1(2022-12-06)
|
||||
- 修复 当where变化时,数据不会自动更新的问题
|
||||
## 0.1.9(2022-09-05)
|
||||
- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框
|
||||
## 0.1.8(2022-08-29)
|
||||
- 修复 点击的位置不准确
|
||||
## 0.1.7(2022-08-12)
|
||||
- 新增 支持 disabled 属性
|
||||
## 0.1.6(2022-07-06)
|
||||
- 修复 pc端宽度异常的bug
|
||||
## 0.1.5
|
||||
- 修复 pc端宽度异常的bug
|
||||
## 0.1.4(2022-07-05)
|
||||
- 优化 显示样式
|
||||
## 0.1.3(2022-06-02)
|
||||
- 修复 localdata 赋值不生效的 bug
|
||||
- 新增 支持 uni.scss 修改颜色
|
||||
- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用)
|
||||
## 0.1.2(2022-05-08)
|
||||
- 修复 当 value 为 0 时选择不生效的 bug
|
||||
## 0.1.1(2022-05-07)
|
||||
- 新增 记住上次的选项(仅 collection 存在时有效)
|
||||
## 0.1.0(2022-04-22)
|
||||
- 初始化
|
||||
@@ -0,0 +1,502 @@
|
||||
<template>
|
||||
<view class="uni-stat__select">
|
||||
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ':'}}</span>
|
||||
<view class="uni-stat-box" :class="{'uni-stat__actived': current}">
|
||||
<view class="uni-select" :class="{'uni-select--disabled':disabled}">
|
||||
<view class="uni-select__input-box" @click="toggleSelector">
|
||||
<view v-if="current" class="uni-select__input-text">{{current}}</view>
|
||||
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
|
||||
<uni-icons v-if="current && clear && !disabled" type="clear" color="#c0c4cc" size="24" @click="clearVal" />
|
||||
<uni-icons v-else :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
|
||||
</view>
|
||||
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
|
||||
<view class="uni-select__selector" v-if="showSelector">
|
||||
<view class="uni-popper__arrow"></view>
|
||||
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
|
||||
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
|
||||
<text>{{emptyTips}}</text>
|
||||
</view>
|
||||
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index"
|
||||
@click="change(item)">
|
||||
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* DataChecklist 数据选择器
|
||||
* @description 通过数据渲染的下拉框组件
|
||||
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
|
||||
* @property {String} value 默认值
|
||||
* @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
|
||||
* @property {Boolean} clear 是否可以清空已选项
|
||||
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
|
||||
* @property {String} label 左侧标题
|
||||
* @property {String} placeholder 输入框的提示文字
|
||||
* @property {Boolean} disabled 是否禁用
|
||||
* @event {Function} change 选中发生变化触发
|
||||
*/
|
||||
|
||||
export default {
|
||||
name: "uni-stat-select",
|
||||
mixins: [uniCloud.mixinDatacom || {}],
|
||||
props: {
|
||||
localdata: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择'
|
||||
},
|
||||
emptyTips: {
|
||||
type: String,
|
||||
default: '无选项'
|
||||
},
|
||||
clear: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
defItem: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
|
||||
format: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showSelector: false,
|
||||
current: '',
|
||||
mixinDatacomResData: [],
|
||||
apps: [],
|
||||
channels: [],
|
||||
cacheKey: "uni-data-select-lastSelectedValue",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.debounceGet = this.debounce(() => {
|
||||
this.query();
|
||||
}, 300);
|
||||
if (this.collection && !this.localdata.length) {
|
||||
this.debounceGet();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
typePlaceholder() {
|
||||
const text = {
|
||||
'opendb-stat-app-versions': '版本',
|
||||
'opendb-app-channels': '渠道',
|
||||
'opendb-app-list': '应用'
|
||||
}
|
||||
const common = this.placeholder
|
||||
const placeholder = text[this.collection]
|
||||
return placeholder ?
|
||||
common + placeholder :
|
||||
common
|
||||
},
|
||||
valueCom(){
|
||||
// #ifdef VUE3
|
||||
return this.modelValue;
|
||||
// #endif
|
||||
// #ifndef VUE3
|
||||
return this.value;
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
localdata: {
|
||||
immediate: true,
|
||||
handler(val, old) {
|
||||
if (Array.isArray(val) && old !== val) {
|
||||
this.mixinDatacomResData = val
|
||||
}
|
||||
}
|
||||
},
|
||||
valueCom(val, old) {
|
||||
this.initDefVal()
|
||||
},
|
||||
mixinDatacomResData: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
if (val.length) {
|
||||
this.initDefVal()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
debounce(fn, time = 100){
|
||||
let timer = null
|
||||
return function(...args) {
|
||||
if (timer) clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
fn.apply(this, args)
|
||||
}, time)
|
||||
}
|
||||
},
|
||||
// 执行数据库查询
|
||||
query(){
|
||||
this.mixinDatacomEasyGet();
|
||||
},
|
||||
// 监听查询条件变更事件
|
||||
onMixinDatacomPropsChange(){
|
||||
if (this.collection) {
|
||||
this.debounceGet();
|
||||
}
|
||||
},
|
||||
initDefVal() {
|
||||
let defValue = ''
|
||||
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
|
||||
defValue = this.valueCom
|
||||
} else {
|
||||
let strogeValue
|
||||
if (this.collection) {
|
||||
strogeValue = this.getCache()
|
||||
}
|
||||
if (strogeValue || strogeValue === 0) {
|
||||
defValue = strogeValue
|
||||
} else {
|
||||
let defItem = ''
|
||||
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
|
||||
defItem = this.mixinDatacomResData[this.defItem - 1].value
|
||||
}
|
||||
defValue = defItem
|
||||
}
|
||||
if (defValue || defValue === 0) {
|
||||
this.emit(defValue)
|
||||
}
|
||||
}
|
||||
const def = this.mixinDatacomResData.find(item => item.value === defValue)
|
||||
this.current = def ? this.formatItemName(def) : ''
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {[String, Number]} value
|
||||
* 判断用户给的 value 是否同时为禁用状态
|
||||
*/
|
||||
isDisabled(value) {
|
||||
let isDisabled = false;
|
||||
|
||||
this.mixinDatacomResData.forEach(item => {
|
||||
if (item.value === value) {
|
||||
isDisabled = item.disable
|
||||
}
|
||||
})
|
||||
|
||||
return isDisabled;
|
||||
},
|
||||
|
||||
clearVal() {
|
||||
this.emit('')
|
||||
if (this.collection) {
|
||||
this.removeCache()
|
||||
}
|
||||
},
|
||||
change(item) {
|
||||
if (!item.disable) {
|
||||
this.showSelector = false
|
||||
this.current = this.formatItemName(item)
|
||||
this.emit(item.value)
|
||||
}
|
||||
},
|
||||
emit(val) {
|
||||
this.$emit('change', val)
|
||||
this.$emit('input', val)
|
||||
this.$emit('update:modelValue', val)
|
||||
if (this.collection) {
|
||||
this.setCache(val);
|
||||
}
|
||||
},
|
||||
toggleSelector() {
|
||||
if (this.disabled) {
|
||||
return
|
||||
}
|
||||
|
||||
this.showSelector = !this.showSelector
|
||||
},
|
||||
formatItemName(item) {
|
||||
let {
|
||||
text,
|
||||
value,
|
||||
channel_code
|
||||
} = item
|
||||
channel_code = channel_code ? `(${channel_code})` : ''
|
||||
|
||||
if (this.format) {
|
||||
// 格式化输出
|
||||
let str = "";
|
||||
str = this.format;
|
||||
for (let key in item) {
|
||||
str = str.replace(new RegExp(`{${key}}`,"g"),item[key]);
|
||||
}
|
||||
return str;
|
||||
} else {
|
||||
return this.collection.indexOf('app-list') > 0 ?
|
||||
`${text}(${value})` :
|
||||
(
|
||||
text ?
|
||||
text :
|
||||
`未命名${channel_code}`
|
||||
)
|
||||
}
|
||||
},
|
||||
// 获取当前加载的数据
|
||||
getLoadData(){
|
||||
return this.mixinDatacomResData;
|
||||
},
|
||||
// 获取当前缓存key
|
||||
getCurrentCacheKey(){
|
||||
return this.collection;
|
||||
},
|
||||
// 获取缓存
|
||||
getCache(name=this.getCurrentCacheKey()){
|
||||
let cacheData = uni.getStorageSync(this.cacheKey) || {};
|
||||
return cacheData[name];
|
||||
},
|
||||
// 设置缓存
|
||||
setCache(value, name=this.getCurrentCacheKey()){
|
||||
let cacheData = uni.getStorageSync(this.cacheKey) || {};
|
||||
cacheData[name] = value;
|
||||
uni.setStorageSync(this.cacheKey, cacheData);
|
||||
},
|
||||
// 删除缓存
|
||||
removeCache(name=this.getCurrentCacheKey()){
|
||||
let cacheData = uni.getStorageSync(this.cacheKey) || {};
|
||||
delete cacheData[name];
|
||||
uni.setStorageSync(this.cacheKey, cacheData);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
$uni-base-color: #6a6a6a !default;
|
||||
$uni-main-color: #333 !default;
|
||||
$uni-secondary-color: #909399 !default;
|
||||
$uni-border-3: #e5e5e5;
|
||||
|
||||
|
||||
/* #ifndef APP-NVUE */
|
||||
@media screen and (max-width: 500px) {
|
||||
.hide-on-phone {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.uni-stat__select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// padding: 15px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.uni-stat-box {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.uni-stat__actived {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
// outline: 1px solid #2979ff;
|
||||
}
|
||||
|
||||
.uni-label-text {
|
||||
font-size: 25px;
|
||||
font-weight: bold;
|
||||
color: $uni-base-color;
|
||||
margin: auto 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.uni-select {
|
||||
font-size: 25px;
|
||||
// border: 1px solid $uni-border-3;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
padding: 0 5px;
|
||||
padding-left: 10px;
|
||||
position: relative;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
user-select: none;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
// border-bottom: solid 1px $uni-border-3;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
height: 35px;
|
||||
|
||||
&--disabled {
|
||||
background-color: #f5f7fa;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
.uni-select__label {
|
||||
font-size: 25px;
|
||||
// line-height: 22px;
|
||||
height: 35px;
|
||||
padding-right: 10px;
|
||||
color: $uni-secondary-color;
|
||||
}
|
||||
|
||||
.uni-select__input-box {
|
||||
height: 35px;
|
||||
position: relative;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex: 1;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.uni-select__input {
|
||||
flex: 1;
|
||||
font-size: 25x;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.uni-select__input-plac {
|
||||
font-size: 25px;
|
||||
color: $uni-secondary-color;
|
||||
}
|
||||
|
||||
.uni-select__selector {
|
||||
/* #ifndef APP-NVUE */
|
||||
box-sizing: border-box;
|
||||
/* #endif */
|
||||
position: absolute;
|
||||
top: calc(100% + 12px);
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #EBEEF5;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
z-index: 3;
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
.uni-select__selector-scroll {
|
||||
/* #ifndef APP-NVUE */
|
||||
max-height: 500px;
|
||||
box-sizing: border-box;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.uni-select__selector-empty,
|
||||
.uni-select__selector-item {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
/* #endif */
|
||||
line-height: 55px;
|
||||
font-size: 25px;
|
||||
text-align: center;
|
||||
/* border-bottom: solid 1px $uni-border-3; */
|
||||
padding: 0px 10px;
|
||||
}
|
||||
|
||||
.uni-select__selector-item:hover {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.uni-select__selector-empty:last-child,
|
||||
.uni-select__selector-item:last-child {
|
||||
/* #ifndef APP-NVUE */
|
||||
border-bottom: none;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.uni-select__selector__disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* picker 弹出层通用的指示小三角 */
|
||||
.uni-popper__arrow,
|
||||
.uni-popper__arrow::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-width: 6px;
|
||||
}
|
||||
|
||||
.uni-popper__arrow {
|
||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||
top: -6px;
|
||||
left: 10%;
|
||||
margin-right: 3px;
|
||||
border-top-width: 0;
|
||||
border-bottom-color: #EBEEF5;
|
||||
}
|
||||
|
||||
.uni-popper__arrow::after {
|
||||
content: " ";
|
||||
top: 1px;
|
||||
margin-left: -6px;
|
||||
border-top-width: 0;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
|
||||
.uni-select__input-text {
|
||||
// width: 280px;
|
||||
width: 100%;
|
||||
color: $uni-main-color;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.uni-select__input-placeholder {
|
||||
color: $uni-base-color;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.uni-select--mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"id": "uni-data-select",
|
||||
"displayName": "uni-data-select 下拉框选择器",
|
||||
"version": "1.0.5",
|
||||
"description": "通过数据驱动的下拉框选择器",
|
||||
"keywords": [
|
||||
"uni-ui",
|
||||
"select",
|
||||
"uni-data-select",
|
||||
"下拉框",
|
||||
"下拉选"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.1"
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||
"type": "component-vue"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": ["uni-load-more"],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "u",
|
||||
"app-nvue": "n"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u",
|
||||
"京东": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
## DataSelect 下拉框选择器
|
||||
> **组件名:uni-data-select**
|
||||
> 代码块: `uDataSelect`
|
||||
|
||||
当选项过多时,使用下拉菜单展示并选择内容
|
||||
|
||||
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select)
|
||||
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
||||
19
mallplusui-uniapp-app/uni_modules/uni-load-more/changelog.md
Normal file
@@ -0,0 +1,19 @@
|
||||
## 1.3.3(2022-01-20)
|
||||
- 新增 showText属性 ,是否显示文本
|
||||
## 1.3.2(2022-01-19)
|
||||
- 修复 nvue 平台下不显示文本的bug
|
||||
## 1.3.1(2022-01-19)
|
||||
- 修复 微信小程序平台样式选择器报警告的问题
|
||||
## 1.3.0(2021-11-19)
|
||||
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
|
||||
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-load-more](https://uniapp.dcloud.io/component/uniui/uni-load-more)
|
||||
## 1.2.1(2021-08-24)
|
||||
- 新增 支持国际化
|
||||
## 1.2.0(2021-07-30)
|
||||
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||
## 1.1.8(2021-05-12)
|
||||
- 新增 组件示例地址
|
||||
## 1.1.7(2021-03-30)
|
||||
- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug
|
||||
## 1.1.6(2021-02-05)
|
||||
- 调整为uni_modules目录规范
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"uni-load-more.contentdown": "Pull up to show more",
|
||||
"uni-load-more.contentrefresh": "loading...",
|
||||
"uni-load-more.contentnomore": "No more data"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import en from './en.json'
|
||||
import zhHans from './zh-Hans.json'
|
||||
import zhHant from './zh-Hant.json'
|
||||
export default {
|
||||
en,
|
||||
'zh-Hans': zhHans,
|
||||
'zh-Hant': zhHant
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"uni-load-more.contentdown": "上拉显示更多",
|
||||
"uni-load-more.contentrefresh": "正在加载...",
|
||||
"uni-load-more.contentnomore": "没有更多数据了"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"uni-load-more.contentdown": "上拉顯示更多",
|
||||
"uni-load-more.contentrefresh": "正在加載...",
|
||||
"uni-load-more.contentnomore": "沒有更多數據了"
|
||||
}
|
||||
86
mallplusui-uniapp-app/uni_modules/uni-load-more/package.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"id": "uni-load-more",
|
||||
"displayName": "uni-load-more 加载更多",
|
||||
"version": "1.3.3",
|
||||
"description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
|
||||
"keywords": [
|
||||
"uni-ui",
|
||||
"uniui",
|
||||
"加载更多",
|
||||
"load-more"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": ""
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"前端组件",
|
||||
"通用组件"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": ["uni-scss"],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "y"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "y",
|
||||
"百度": "y",
|
||||
"字节跳动": "y",
|
||||
"QQ": "y"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
mallplusui-uniapp-app/uni_modules/uni-load-more/readme.md
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
### LoadMore 加载更多
|
||||
> **组件名:uni-load-more**
|
||||
> 代码块: `uLoadMore`
|
||||
|
||||
|
||||
用于列表中,做滚动加载使用,展示 loading 的各种状态。
|
||||
|
||||
|
||||
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more)
|
||||
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
||||
|
||||
|
||||
8
mallplusui-uniapp-app/uni_modules/uni-scss/changelog.md
Normal file
@@ -0,0 +1,8 @@
|
||||
## 1.0.3(2022-01-21)
|
||||
- 优化 组件示例
|
||||
## 1.0.2(2021-11-22)
|
||||
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
|
||||
## 1.0.1(2021-11-22)
|
||||
- 修复 vue3中scss语法兼容问题
|
||||
## 1.0.0(2021-11-18)
|
||||
- init
|
||||
1
mallplusui-uniapp-app/uni_modules/uni-scss/index.scss
Normal file
@@ -0,0 +1 @@
|
||||
@import './styles/index.scss';
|
||||
82
mallplusui-uniapp-app/uni_modules/uni-scss/package.json
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"id": "uni-scss",
|
||||
"displayName": "uni-scss 辅助样式",
|
||||
"version": "1.0.3",
|
||||
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
|
||||
"keywords": [
|
||||
"uni-scss",
|
||||
"uni-ui",
|
||||
"辅助样式"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"JS SDK",
|
||||
"通用 SDK"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "u"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "y",
|
||||
"百度": "y",
|
||||
"字节跳动": "y",
|
||||
"QQ": "y"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "n",
|
||||
"联盟": "n"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
4
mallplusui-uniapp-app/uni_modules/uni-scss/readme.md
Normal file
@@ -0,0 +1,4 @@
|
||||
`uni-sass` 是 `uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。
|
||||
|
||||
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass)
|
||||
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
||||
@@ -0,0 +1,7 @@
|
||||
@import './setting/_variables.scss';
|
||||
@import './setting/_border.scss';
|
||||
@import './setting/_color.scss';
|
||||
@import './setting/_space.scss';
|
||||
@import './setting/_radius.scss';
|
||||
@import './setting/_text.scss';
|
||||
@import './setting/_styles.scss';
|
||||
@@ -0,0 +1,3 @@
|
||||
.uni-border {
|
||||
border: 1px $uni-border-1 solid;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐
|
||||
// @mixin get-styles($k,$c) {
|
||||
// @if $k == size or $k == weight{
|
||||
// font-#{$k}:#{$c}
|
||||
// }@else{
|
||||
// #{$k}:#{$c}
|
||||
// }
|
||||
// }
|
||||
$uni-ui-color:(
|
||||
// 主色
|
||||
primary: $uni-primary,
|
||||
primary-disable: $uni-primary-disable,
|
||||
primary-light: $uni-primary-light,
|
||||
// 辅助色
|
||||
success: $uni-success,
|
||||
success-disable: $uni-success-disable,
|
||||
success-light: $uni-success-light,
|
||||
warning: $uni-warning,
|
||||
warning-disable: $uni-warning-disable,
|
||||
warning-light: $uni-warning-light,
|
||||
error: $uni-error,
|
||||
error-disable: $uni-error-disable,
|
||||
error-light: $uni-error-light,
|
||||
info: $uni-info,
|
||||
info-disable: $uni-info-disable,
|
||||
info-light: $uni-info-light,
|
||||
// 中性色
|
||||
main-color: $uni-main-color,
|
||||
base-color: $uni-base-color,
|
||||
secondary-color: $uni-secondary-color,
|
||||
extra-color: $uni-extra-color,
|
||||
// 背景色
|
||||
bg-color: $uni-bg-color,
|
||||
// 边框颜色
|
||||
border-1: $uni-border-1,
|
||||
border-2: $uni-border-2,
|
||||
border-3: $uni-border-3,
|
||||
border-4: $uni-border-4,
|
||||
// 黑色
|
||||
black:$uni-black,
|
||||
// 白色
|
||||
white:$uni-white,
|
||||
// 透明
|
||||
transparent:$uni-transparent
|
||||
) !default;
|
||||
@each $key, $child in $uni-ui-color {
|
||||
.uni-#{"" + $key} {
|
||||
color: $child;
|
||||
}
|
||||
.uni-#{"" + $key}-bg {
|
||||
background-color: $child;
|
||||
}
|
||||
}
|
||||
.uni-shadow-sm {
|
||||
box-shadow: $uni-shadow-sm;
|
||||
}
|
||||
.uni-shadow-base {
|
||||
box-shadow: $uni-shadow-base;
|
||||
}
|
||||
.uni-shadow-lg {
|
||||
box-shadow: $uni-shadow-lg;
|
||||
}
|
||||
.uni-mask {
|
||||
background-color:$uni-mask;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
@mixin radius($r,$d:null ,$important: false){
|
||||
$radius-value:map-get($uni-radius, $r) if($important, !important, null);
|
||||
// Key exists within the $uni-radius variable
|
||||
@if (map-has-key($uni-radius, $r) and $d){
|
||||
@if $d == t {
|
||||
border-top-left-radius:$radius-value;
|
||||
border-top-right-radius:$radius-value;
|
||||
}@else if $d == r {
|
||||
border-top-right-radius:$radius-value;
|
||||
border-bottom-right-radius:$radius-value;
|
||||
}@else if $d == b {
|
||||
border-bottom-left-radius:$radius-value;
|
||||
border-bottom-right-radius:$radius-value;
|
||||
}@else if $d == l {
|
||||
border-top-left-radius:$radius-value;
|
||||
border-bottom-left-radius:$radius-value;
|
||||
}@else if $d == tl {
|
||||
border-top-left-radius:$radius-value;
|
||||
}@else if $d == tr {
|
||||
border-top-right-radius:$radius-value;
|
||||
}@else if $d == br {
|
||||
border-bottom-right-radius:$radius-value;
|
||||
}@else if $d == bl {
|
||||
border-bottom-left-radius:$radius-value;
|
||||
}
|
||||
}@else{
|
||||
border-radius:$radius-value;
|
||||
}
|
||||
}
|
||||
|
||||
@each $key, $child in $uni-radius {
|
||||
@if($key){
|
||||
.uni-radius-#{"" + $key} {
|
||||
@include radius($key)
|
||||
}
|
||||
}@else{
|
||||
.uni-radius {
|
||||
@include radius($key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@each $direction in t, r, b, l,tl, tr, br, bl {
|
||||
@each $key, $child in $uni-radius {
|
||||
@if($key){
|
||||
.uni-radius-#{"" + $direction}-#{"" + $key} {
|
||||
@include radius($key,$direction,false)
|
||||
}
|
||||
}@else{
|
||||
.uni-radius-#{$direction} {
|
||||
@include radius($key,$direction,false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
|
||||
@mixin fn($space,$direction,$size,$n) {
|
||||
@if $n {
|
||||
#{$space}-#{$direction}: #{$size*$uni-space-root}px
|
||||
} @else {
|
||||
#{$space}-#{$direction}: #{-$size*$uni-space-root}px
|
||||
}
|
||||
}
|
||||
@mixin get-styles($direction,$i,$space,$n){
|
||||
@if $direction == t {
|
||||
@include fn($space, top,$i,$n);
|
||||
}
|
||||
@if $direction == r {
|
||||
@include fn($space, right,$i,$n);
|
||||
}
|
||||
@if $direction == b {
|
||||
@include fn($space, bottom,$i,$n);
|
||||
}
|
||||
@if $direction == l {
|
||||
@include fn($space, left,$i,$n);
|
||||
}
|
||||
@if $direction == x {
|
||||
@include fn($space, left,$i,$n);
|
||||
@include fn($space, right,$i,$n);
|
||||
}
|
||||
@if $direction == y {
|
||||
@include fn($space, top,$i,$n);
|
||||
@include fn($space, bottom,$i,$n);
|
||||
}
|
||||
@if $direction == a {
|
||||
@if $n {
|
||||
#{$space}:#{$i*$uni-space-root}px;
|
||||
} @else {
|
||||
#{$space}:#{-$i*$uni-space-root}px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@each $orientation in m,p {
|
||||
$space: margin;
|
||||
@if $orientation == m {
|
||||
$space: margin;
|
||||
} @else {
|
||||
$space: padding;
|
||||
}
|
||||
@for $i from 0 through 16 {
|
||||
@each $direction in t, r, b, l, x, y, a {
|
||||
.uni-#{$orientation}#{$direction}-#{$i} {
|
||||
@include get-styles($direction,$i,$space,true);
|
||||
}
|
||||
.uni-#{$orientation}#{$direction}-n#{$i} {
|
||||
@include get-styles($direction,$i,$space,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
/* #ifndef APP-NVUE */
|
||||
|
||||
$-color-white:#fff;
|
||||
$-color-black:#000;
|
||||
@mixin base-style($color) {
|
||||
color: #fff;
|
||||
background-color: $color;
|
||||
border-color: mix($-color-black, $color, 8%);
|
||||
&:not([hover-class]):active {
|
||||
background: mix($-color-black, $color, 10%);
|
||||
border-color: mix($-color-black, $color, 20%);
|
||||
color: $-color-white;
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
@mixin is-color($color) {
|
||||
@include base-style($color);
|
||||
&[loading] {
|
||||
@include base-style($color);
|
||||
&::before {
|
||||
margin-right:5px;
|
||||
}
|
||||
}
|
||||
&[disabled] {
|
||||
&,
|
||||
&[loading],
|
||||
&:not([hover-class]):active {
|
||||
color: $-color-white;
|
||||
border-color: mix(darken($color,10%), $-color-white);
|
||||
background-color: mix($color, $-color-white);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@mixin base-plain-style($color) {
|
||||
color:$color;
|
||||
background-color: mix($-color-white, $color, 90%);
|
||||
border-color: mix($-color-white, $color, 70%);
|
||||
&:not([hover-class]):active {
|
||||
background: mix($-color-white, $color, 80%);
|
||||
color: $color;
|
||||
outline: none;
|
||||
border-color: mix($-color-white, $color, 50%);
|
||||
}
|
||||
}
|
||||
@mixin is-plain($color){
|
||||
&[plain] {
|
||||
@include base-plain-style($color);
|
||||
&[loading] {
|
||||
@include base-plain-style($color);
|
||||
&::before {
|
||||
margin-right:5px;
|
||||
}
|
||||
}
|
||||
&[disabled] {
|
||||
&,
|
||||
&:active {
|
||||
color: mix($-color-white, $color, 40%);
|
||||
background-color: mix($-color-white, $color, 90%);
|
||||
border-color: mix($-color-white, $color, 80%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.uni-btn {
|
||||
margin: 5px;
|
||||
color: #393939;
|
||||
border:1px solid #ccc;
|
||||
font-size: 16px;
|
||||
font-weight: 200;
|
||||
background-color: #F9F9F9;
|
||||
// TODO 暂时处理边框隐藏一边的问题
|
||||
overflow: visible;
|
||||
&::after{
|
||||
border: none;
|
||||
}
|
||||
|
||||
&:not([type]),&[type=default] {
|
||||
color: #999;
|
||||
&[loading] {
|
||||
background: none;
|
||||
&::before {
|
||||
margin-right:5px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
&[disabled]{
|
||||
color: mix($-color-white, #999, 60%);
|
||||
&,
|
||||
&[loading],
|
||||
&:active {
|
||||
color: mix($-color-white, #999, 60%);
|
||||
background-color: mix($-color-white,$-color-black , 98%);
|
||||
border-color: mix($-color-white, #999, 85%);
|
||||
}
|
||||
}
|
||||
|
||||
&[plain] {
|
||||
color: #999;
|
||||
background: none;
|
||||
border-color: $uni-border-1;
|
||||
&:not([hover-class]):active {
|
||||
background: none;
|
||||
color: mix($-color-white, $-color-black, 80%);
|
||||
border-color: mix($-color-white, $-color-black, 90%);
|
||||
outline: none;
|
||||
}
|
||||
&[disabled]{
|
||||
&,
|
||||
&[loading],
|
||||
&:active {
|
||||
background: none;
|
||||
color: mix($-color-white, #999, 60%);
|
||||
border-color: mix($-color-white, #999, 85%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:not([hover-class]):active {
|
||||
color: mix($-color-white, $-color-black, 50%);
|
||||
}
|
||||
|
||||
&[size=mini] {
|
||||
font-size: 16px;
|
||||
font-weight: 200;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
&.uni-btn-small {
|
||||
font-size: 14px;
|
||||
}
|
||||
&.uni-btn-mini {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
&.uni-btn-radius {
|
||||
border-radius: 999px;
|
||||
}
|
||||
&[type=primary] {
|
||||
@include is-color($uni-primary);
|
||||
@include is-plain($uni-primary)
|
||||
}
|
||||
&[type=success] {
|
||||
@include is-color($uni-success);
|
||||
@include is-plain($uni-success)
|
||||
}
|
||||
&[type=error] {
|
||||
@include is-color($uni-error);
|
||||
@include is-plain($uni-error)
|
||||
}
|
||||
&[type=warning] {
|
||||
@include is-color($uni-warning);
|
||||
@include is-plain($uni-warning)
|
||||
}
|
||||
&[type=info] {
|
||||
@include is-color($uni-info);
|
||||
@include is-plain($uni-info)
|
||||
}
|
||||
}
|
||||
/* #endif */
|
||||
@@ -0,0 +1,24 @@
|
||||
@mixin get-styles($k,$c) {
|
||||
@if $k == size or $k == weight{
|
||||
font-#{$k}:#{$c}
|
||||
}@else{
|
||||
#{$k}:#{$c}
|
||||
}
|
||||
}
|
||||
|
||||
@each $key, $child in $uni-headings {
|
||||
/* #ifndef APP-NVUE */
|
||||
.uni-#{$key} {
|
||||
@each $k, $c in $child {
|
||||
@include get-styles($k,$c)
|
||||
}
|
||||
}
|
||||
/* #endif */
|
||||
/* #ifdef APP-NVUE */
|
||||
.container .uni-#{$key} {
|
||||
@each $k, $c in $child {
|
||||
@include get-styles($k,$c)
|
||||
}
|
||||
}
|
||||
/* #endif */
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
// @use "sass:math";
|
||||
@import '../tools/functions.scss';
|
||||
// 间距基础倍数
|
||||
$uni-space-root: 2 !default;
|
||||
// 边框半径默认值
|
||||
$uni-radius-root:5px !default;
|
||||
$uni-radius: () !default;
|
||||
// 边框半径断点
|
||||
$uni-radius: map-deep-merge(
|
||||
(
|
||||
0: 0,
|
||||
// TODO 当前版本暂时不支持 sm 属性
|
||||
// 'sm': math.div($uni-radius-root, 2),
|
||||
null: $uni-radius-root,
|
||||
'lg': $uni-radius-root * 2,
|
||||
'xl': $uni-radius-root * 6,
|
||||
'pill': 9999px,
|
||||
'circle': 50%
|
||||
),
|
||||
$uni-radius
|
||||
);
|
||||
// 字体家族
|
||||
$body-font-family: 'Roboto', sans-serif !default;
|
||||
// 文本
|
||||
$heading-font-family: $body-font-family !default;
|
||||
$uni-headings: () !default;
|
||||
$letterSpacing: -0.01562em;
|
||||
$uni-headings: map-deep-merge(
|
||||
(
|
||||
'h1': (
|
||||
size: 32px,
|
||||
weight: 300,
|
||||
line-height: 50px,
|
||||
// letter-spacing:-0.01562em
|
||||
),
|
||||
'h2': (
|
||||
size: 28px,
|
||||
weight: 300,
|
||||
line-height: 40px,
|
||||
// letter-spacing: -0.00833em
|
||||
),
|
||||
'h3': (
|
||||
size: 24px,
|
||||
weight: 400,
|
||||
line-height: 32px,
|
||||
// letter-spacing: normal
|
||||
),
|
||||
'h4': (
|
||||
size: 20px,
|
||||
weight: 400,
|
||||
line-height: 30px,
|
||||
// letter-spacing: 0.00735em
|
||||
),
|
||||
'h5': (
|
||||
size: 16px,
|
||||
weight: 400,
|
||||
line-height: 24px,
|
||||
// letter-spacing: normal
|
||||
),
|
||||
'h6': (
|
||||
size: 14px,
|
||||
weight: 500,
|
||||
line-height: 18px,
|
||||
// letter-spacing: 0.0125em
|
||||
),
|
||||
'subtitle': (
|
||||
size: 12px,
|
||||
weight: 400,
|
||||
line-height: 20px,
|
||||
// letter-spacing: 0.00937em
|
||||
),
|
||||
'body': (
|
||||
font-size: 14px,
|
||||
font-weight: 400,
|
||||
line-height: 22px,
|
||||
// letter-spacing: 0.03125em
|
||||
),
|
||||
'caption': (
|
||||
'size': 12px,
|
||||
'weight': 400,
|
||||
'line-height': 20px,
|
||||
// 'letter-spacing': 0.03333em,
|
||||
// 'text-transform': false
|
||||
)
|
||||
),
|
||||
$uni-headings
|
||||
);
|
||||
|
||||
|
||||
|
||||
// 主色
|
||||
$uni-primary: #2979ff !default;
|
||||
$uni-primary-disable:lighten($uni-primary,20%) !default;
|
||||
$uni-primary-light: lighten($uni-primary,25%) !default;
|
||||
|
||||
// 辅助色
|
||||
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
|
||||
$uni-success: #18bc37 !default;
|
||||
$uni-success-disable:lighten($uni-success,20%) !default;
|
||||
$uni-success-light: lighten($uni-success,25%) !default;
|
||||
|
||||
$uni-warning: #f3a73f !default;
|
||||
$uni-warning-disable:lighten($uni-warning,20%) !default;
|
||||
$uni-warning-light: lighten($uni-warning,25%) !default;
|
||||
|
||||
$uni-error: #e43d33 !default;
|
||||
$uni-error-disable:lighten($uni-error,20%) !default;
|
||||
$uni-error-light: lighten($uni-error,25%) !default;
|
||||
|
||||
$uni-info: #8f939c !default;
|
||||
$uni-info-disable:lighten($uni-info,20%) !default;
|
||||
$uni-info-light: lighten($uni-info,25%) !default;
|
||||
|
||||
// 中性色
|
||||
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
|
||||
$uni-main-color: #3a3a3a !default; // 主要文字
|
||||
$uni-base-color: #6a6a6a !default; // 常规文字
|
||||
$uni-secondary-color: #909399 !default; // 次要文字
|
||||
$uni-extra-color: #c7c7c7 !default; // 辅助说明
|
||||
|
||||
// 边框颜色
|
||||
$uni-border-1: #F0F0F0 !default;
|
||||
$uni-border-2: #EDEDED !default;
|
||||
$uni-border-3: #DCDCDC !default;
|
||||
$uni-border-4: #B9B9B9 !default;
|
||||
|
||||
// 常规色
|
||||
$uni-black: #000000 !default;
|
||||
$uni-white: #ffffff !default;
|
||||
$uni-transparent: rgba($color: #000000, $alpha: 0) !default;
|
||||
|
||||
// 背景色
|
||||
$uni-bg-color: #f7f7f7 !default;
|
||||
|
||||
/* 水平间距 */
|
||||
$uni-spacing-sm: 8px !default;
|
||||
$uni-spacing-base: 15px !default;
|
||||
$uni-spacing-lg: 30px !default;
|
||||
|
||||
// 阴影
|
||||
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default;
|
||||
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default;
|
||||
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default;
|
||||
|
||||
// 蒙版
|
||||
$uni-mask: rgba($color: #000000, $alpha: 0.4) !default;
|
||||
@@ -0,0 +1,19 @@
|
||||
// 合并 map
|
||||
@function map-deep-merge($parent-map, $child-map){
|
||||
$result: $parent-map;
|
||||
@each $key, $child in $child-map {
|
||||
$parent-has-key: map-has-key($result, $key);
|
||||
$parent-value: map-get($result, $key);
|
||||
$parent-type: type-of($parent-value);
|
||||
$child-type: type-of($child);
|
||||
$parent-is-map: $parent-type == map;
|
||||
$child-is-map: $child-type == map;
|
||||
|
||||
@if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){
|
||||
$result: map-merge($result, ( $key: $child ));
|
||||
}@else {
|
||||
$result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) ));
|
||||
}
|
||||
}
|
||||
@return $result;
|
||||
};
|
||||
31
mallplusui-uniapp-app/uni_modules/uni-scss/theme.scss
Normal file
@@ -0,0 +1,31 @@
|
||||
// 间距基础倍数
|
||||
$uni-space-root: 2;
|
||||
// 边框半径默认值
|
||||
$uni-radius-root:5px;
|
||||
// 主色
|
||||
$uni-primary: #2979ff;
|
||||
// 辅助色
|
||||
$uni-success: #4cd964;
|
||||
// 警告色
|
||||
$uni-warning: #f0ad4e;
|
||||
// 错误色
|
||||
$uni-error: #dd524d;
|
||||
// 描述色
|
||||
$uni-info: #909399;
|
||||
// 中性色
|
||||
$uni-main-color: #303133;
|
||||
$uni-base-color: #606266;
|
||||
$uni-secondary-color: #909399;
|
||||
$uni-extra-color: #C0C4CC;
|
||||
// 背景色
|
||||
$uni-bg-color: #f5f5f5;
|
||||
// 边框颜色
|
||||
$uni-border-1: #DCDFE6;
|
||||
$uni-border-2: #E4E7ED;
|
||||
$uni-border-3: #EBEEF5;
|
||||
$uni-border-4: #F2F6FC;
|
||||
|
||||
// 常规色
|
||||
$uni-black: #000000;
|
||||
$uni-white: #ffffff;
|
||||
$uni-transparent: rgba($color: #000000, $alpha: 0);
|
||||
62
mallplusui-uniapp-app/uni_modules/uni-scss/variables.scss
Normal file
@@ -0,0 +1,62 @@
|
||||
@import './styles/setting/_variables.scss';
|
||||
// 间距基础倍数
|
||||
$uni-space-root: 2;
|
||||
// 边框半径默认值
|
||||
$uni-radius-root:5px;
|
||||
|
||||
// 主色
|
||||
$uni-primary: #2979ff;
|
||||
$uni-primary-disable:mix(#fff,$uni-primary,50%);
|
||||
$uni-primary-light: mix(#fff,$uni-primary,80%);
|
||||
|
||||
// 辅助色
|
||||
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
|
||||
$uni-success: #18bc37;
|
||||
$uni-success-disable:mix(#fff,$uni-success,50%);
|
||||
$uni-success-light: mix(#fff,$uni-success,80%);
|
||||
|
||||
$uni-warning: #f3a73f;
|
||||
$uni-warning-disable:mix(#fff,$uni-warning,50%);
|
||||
$uni-warning-light: mix(#fff,$uni-warning,80%);
|
||||
|
||||
$uni-error: #e43d33;
|
||||
$uni-error-disable:mix(#fff,$uni-error,50%);
|
||||
$uni-error-light: mix(#fff,$uni-error,80%);
|
||||
|
||||
$uni-info: #8f939c;
|
||||
$uni-info-disable:mix(#fff,$uni-info,50%);
|
||||
$uni-info-light: mix(#fff,$uni-info,80%);
|
||||
|
||||
// 中性色
|
||||
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
|
||||
$uni-main-color: #3a3a3a; // 主要文字
|
||||
$uni-base-color: #6a6a6a; // 常规文字
|
||||
$uni-secondary-color: #909399; // 次要文字
|
||||
$uni-extra-color: #c7c7c7; // 辅助说明
|
||||
|
||||
// 边框颜色
|
||||
$uni-border-1: #F0F0F0;
|
||||
$uni-border-2: #EDEDED;
|
||||
$uni-border-3: #DCDCDC;
|
||||
$uni-border-4: #B9B9B9;
|
||||
|
||||
// 常规色
|
||||
$uni-black: #000000;
|
||||
$uni-white: #ffffff;
|
||||
$uni-transparent: rgba($color: #000000, $alpha: 0);
|
||||
|
||||
// 背景色
|
||||
$uni-bg-color: #f7f7f7;
|
||||
|
||||
/* 水平间距 */
|
||||
$uni-spacing-sm: 8px;
|
||||
$uni-spacing-base: 15px;
|
||||
$uni-spacing-lg: 30px;
|
||||
|
||||
// 阴影
|
||||
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5);
|
||||
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2);
|
||||
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5);
|
||||
|
||||
// 蒙版
|
||||
$uni-mask: rgba($color: #000000, $alpha: 0.4);
|
||||