2 Star 1 Fork 0

唐寅/房象小程序

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
App.vue 15.84 KB
一键复制 编辑 原始数据 按行查看 历史
唐寅 提交于 2020-12-24 16:46 . 第一次
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
<script>
export default {
onLaunch() {
// 获取店铺配置信息 全局只请求一次
this.$api.shopConfig(res => {
this.$store.commit('config', res)
// #ifdef H5
//百度统计
if (res.statistics) {
var script = document.createElement("script");
script.innerHTML = res.statistics;
document.getElementsByTagName("body")[0].appendChild(script);
}
// #endif
})
//获取地区信息
this.$api.getAreaList({}, res => {
if (res.status) {
this.$db.set('areaList', res.data)
}
});
// #ifdef APP-PLUS || APP-PLUS-NVUE
this.checkVersion()
// #endif
},
onShow: function() {
//console.log('App Show')
},
onHide: function() {
//console.log('App Hide')
},
methods: {
// #ifdef APP-PLUS || APP-PLUS-NVUE
// app更新检测
checkVersion() {
// 获取应用版本号
let version = plus.runtime.version;
//检测当前平台,如果是安卓则启动安卓更新
uni.getSystemInfo({
success: res => {
this.updateHandler(res.platform, version);
}
})
},
// 更新操作
updateHandler(platform, version) {
let data = {
platform: platform,
version: version
}
let _this = this;
this.$api.getAppVersion(data,
res => {
if (res.status && res.data[0].version) {
const info = res.data[0];
if (info.version !== '' && info.version > version) {
uni.showModal({
//提醒用户更新
title: '更新提示',
content: info.note,
success: res => {
if (res.confirm) {
plus.runtime.openURL(info.download_url)
}
}
})
}
}
}
)
}
// #endif
}
}
</script>
<style lang="scss">
/*每个页面公共css */
// @import './static/css/style.css';
body {
background-color: #f8f8f8;
font-size: 28upx;
}
view {
box-sizing: border-box;
}
/* #ifdef MP-ALIPAY */
image {
background-size: 100% 100%;
}
button {
height: auto;
border: none;
line-height: 2.55555556;
padding: 0 28upx;
}
input {
background: none;
padding: 0;
}
shared-checkbox {
border-radius: 50%;
}
shared-checkbox {
border-radius: 50%;
height: 36rpx;
width: 36rpx;
margin-top: -4rpx;
border: 1rpx solid #d1d1d1;
color: #FF7159;
}
shared-checkbox:checked {
background-color: #000;
color: #000;
}
._radio {
border-radius: 50%;
/* 圆角 */
width: 36rpx;
height: 36rpx;
margin-top: -4rpx;
border: 1rpx solid #d1d1d1;
}
/* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */
._radio:checked {
border: 1rpx solid #FF7159;
background: #FF7159;
}
/* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */
._radio:checked::before {
border-radius: 50%;
/* 圆角 */
width: 36rpx;
/* 选中后对勾大小,不要超过背景的尺寸 */
height: 36rpx;
/* 选中后对勾大小,不要超过背景的尺寸 */
line-height: 36rpx;
text-align: center;
font-size: 28rpx;
/* 对勾大小 30rpx */
color: #fff;
/* 对勾颜色 白色 */
background: transparent;
transform: translate(-50%, -50%) scale(1);
-webkit-transform: translate(-50%, -50%) scale(1);
}
/* #endif */
uni-toast .uni-toast {
font-size: 24upx;
border-radius: 10px;
background: rgba(17, 17, 17, .5);
}
.content-top {
margin-bottom: 116upx;
}
.have-none {
background-color: #f3f3f3;
}
.color-o {
color: #FF7159 !important;
}
.color-f {
color: #fff !important;
}
.color-d {
color: #ddd !important;
}
.color-3 {
color: #333 !important;
}
.color-6 {
color: #666 !important;
}
.color-9 {
color: #999 !important;
}
.fsz24 {
font-size: 24upx !important;
}
.fsz26 {
font-size: 26upx !important;
}
.fsz28 {
font-size: 28upx !important;
}
.fsz30 {
font-size: 30upx !important;
}
.fsz32 {
font-size: 32upx !important;
}
.fsz34 {
font-size: 34upx !important;
}
.fsz36 {
font-size: 36upx !important;
}
.fsz38 {
font-size: 38upx !important;
}
.fsz50 {
font-size: 50upx !important;
}
.search {
width: 100%;
height: 104upx;
padding: 16upx 26upx;
background-color: rgba(255, 255, 255, 1);
z-index: 999;
transition: all .5s;
}
.search-c {
width: 100%;
height: 100%;
position: relative;
display: flex;
align-items: center;
border-radius: 50upx;
background-color: #E9E9E9;
padding: 0 20rpx;
}
.search-input {
width: 100%;
height: 100%;
box-sizing: border-box;
line-height: 52upx;
padding: 10upx;
font-size: 24upx;
transition: all .5s;
}
.search-input-p {
color: #999;
width: 100%;
height: 100%;
}
.search-input-p-c {
position: relative;
top: 50%;
transform: translateY(-50%);
}
.search-icon {
z-index: 99;
}
.swiper-c {
height: 100%;
}
.swiper-c image {
height: 100%;
width: 100%;
}
.btn {
display: inline-block;
box-sizing: border-box;
border-radius: 0;
font-size: 28upx;
transform: scale(1);
transition: all .5s;
}
/*按钮按下缩小变色*/
.btn-hover {
transform: scale(.90);
transition: all .5s;
opacity: .8;
}
/*按钮按下只变色*/
.btn-hover2 {
/* transform: scale(.95); */
transition: all .1s;
opacity: .6;
}
.btn::after {
border: none;
}
.btn-circle {
padding: 0upx 20upx;
height: 60upx;
line-height: 60upx;
min-width: 140upx;
font-size: 22upx;
}
.btn-square {
padding: 0upx 40upx;
height: 90upx;
line-height: 90upx;
min-width: 150upx;
border: none !important;
}
.btn-fillet {
border-radius: 50upx;
}
.btn-c {
background-color: #f7f7f7;
}
.btn-w {
border: 2upx solid #333;
color: #333;
background-color: #fff;
}
.btn-g {
border: 2upx solid #E0E0E0;
color: #999;
background-color: #fff;
}
.btn-b {
border: 2upx solid #333;
background-color: #333;
color: #fff;
}
.btn-o {
border: 2upx solid #FF7159;
background-color: #FF7159;
color: #fff;
}
.btn-half {
width: 50%;
}
.btn-all {
width: 100%;
}
.img-grids {
overflow: hidden;
}
.img-grids-item {
width: 336rpx;
height: 476rpx;
margin: 26rpx;
display: inline-block;
background-color: #fff;
float: left;
min-height: 130upx;
/* #ifdef MP-ALIPAY */
width: 330rpx;
margin: 25rpx;
min-height: 130rpx;
/* #endif */
}
.swiper-list .img-grids-item {
height: 350rpx !important;
}
.img-grids-item:nth-child(2n-1) {
margin-right: 0;
}
.img-grids-item-t {
width: 336upx;
height: 336upx;
/* #ifdef MP-ALIPAY */
width: 330rpx;
height: 330rpx;
/* #endif */
}
.img-grids-item-b {
padding: 0 10upx 10upx;
}
.goods-name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
word-wrap: break-word;
overflow: hidden;
color: #333;
width: 100%;
/* #ifdef MP-ALIPAY */
min-height: 20px;
/* #endif */
}
.grids-goods-name {
font-size: 26upx;
}
.goods-item-c {
overflow: hidden;
margin-top: 10upx;
}
.goods-price {
min-width: 120upx;
min-height: 40upx;
color: #333;
font-size: 28upx;
display: inline-block;
float: left;
}
.red-price {
color: #FF7159 !important;
}
.img-list-item {
padding: 30upx 26upx;
background-color: #fff;
margin-bottom: 2upx;
overflow: hidden;
}
.img-list-item-l {
width: 250upx;
height: 250upx;
display: inline-block;
float: left;
}
.img-list-item-r {
width: 410upx;
min-height: 250upx;
display: inline-block;
margin-left: 26upx;
float: left;
padding: 10upx 0;
position: relative;
}
.list-goods-name {
font-size: 28upx;
}
.img-list-item .goods-item-c {
width: 100%;
margin-top: 0;
}
.img-list-item .goods-price {
min-width: 150upx;
min-height: 50upx;
font-size: 38upx;
float: none;
}
.goods-buy {
overflow: hidden;
}
.goods-salesvolume {
min-width: 100upx;
height: 30upx;
font-size: 20upx;
color: #999;
display: inline-block;
}
.goods-cart {
width: 40upx;
height: 40upx;
float: right;
}
.medium-img {
width: 196upx;
height: 196upx;
}
.little-img {
width: 140upx;
height: 140upx;
}
.small-img {
width: 120upx;
height: 120upx;
}
.medium-right {
width: 340upx;
min-height: 140upx;
}
.little-right {
width: 520upx;
min-height: 140upx;
padding: 0;
}
.small-right {
width: 540upx;
height: 120upx;
padding: 0;
min-height: 60upx;
}
.little-right-t {
overflow: hidden;
}
.little-right .list-goods-name {
float: left;
width: 360upx;
margin-bottom: 6upx;
}
.small-right .list-goods-name {
width: 100%;
}
.little-right .goods-price {
float: right;
font-size: 28upx;
text-align: right;
min-width: 120upx;
max-width: 150upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
min-height: 40upx;
}
.goods-num {
float: right;
color: #999;
font-size: 24upx;
height: 30upx;
min-width: 50upx;
}
.goods-numbox {
float: right;
}
.little-right .goods-salesvolume {
font-size: 24upx;
}
.cell-group {
background-color: #fff;
}
.cell-item {
padding: 20upx 26upx 20upx 0;
width: 724upx;
margin-left: 26upx;
border-bottom: 2upx solid #f3f3f3;
position: relative;
background-color: #fff;
color: #333;
display: flex;
min-height: 90upx;
align-items: center;
justify-content: space-between;
}
.cell-item-mid {
justify-content: flex-start;
}
.cell-item:last-child {
border: none;
}
.cell-item-hd {
display: flex;
/* vertical-align: middle; */
align-items: center;
font-size: 28upx;
position: relative;
}
.cell-item-bd-block {
display: block !important;
}
.cell-hd-icon {
width: 40upx;
height: 40upx;
display: inline-block;
/* float: left; */
margin-right: 8upx;
}
.cell-hd-title {
/* float: left; */
display: inline-block;
position: relative;
/* #ifdef MP-ALIPAY */
top: 4upx;
/* #endif */
}
.cell-item-bd {
display: flex;
margin-left: 20upx;
min-height: 30upx;
overflow: hidden;
align-items: center;
padding-right: 50upx;
}
.cell-bd-view {
position: relative;
/* overflow: hidden; */
display: flex;
}
.cell-bd-text {
/* float: left; */
position: relative;
font-size: 24upx;
}
.cell-bd-text-right {
float: right;
}
.cell-bd-input {
display: inline-block;
float: left;
font-size: 26upx;
}
.cell-item-ft {
display: flex;
align-items: center;
}
.right-img .cell-item-ft {
right: 8upx;
height: 50upx;
position: absolute;
}
.cell-ft-view {
position: relative;
overflow: hidden;
color: #666;
font-size: 28upx;
text-align: right;
}
.cell-ft-p {
font-size: 24upx;
color: #666;
}
.cell-ft-text {
font-size: 28upx;
float: right;
position: relative;
line-height: 50upx;
}
.cell-ft-next {
float: right;
}
.margin-cell-group {
margin: 20upx 0;
}
.bottom-cell-group {
margin-bottom: 20upx;
}
.min-cell-group {
margin-bottom: 1px;
padding: 20upx 0;
}
.min-cell-group .cell-item {
border-bottom: none;
min-height: 50upx;
padding: 0 26upx 0 0;
}
.icon {
width: 50upx;
height: 50upx;
/* #ifdef MP-ALIPAY */
background-size: 100% 100%;
/* #endif */
}
.swiper-grids .swiper-list {
white-space: nowrap;
width: 100%;
min-height: 200upx;
}
.swiper-grids .img-grids-item {
float: none;
margin-right: 0;
width: 255upx;
margin-top: 0;
}
.swiper-grids .img-grids-item:last-child {
margin-right: 26upx;
}
.swiper-grids .img-grids-item-t {
width: 255upx;
height: 255upx;
}
.swiper-grids .goods-name {
white-space: normal;
}
.member-grid {
padding: 20upx 26upx;
width: 100%;
display: flex;
}
.member-item {
flex: 1;
text-align: center;
position: relative;
}
/*会员中心图标按下事件*/
.member-item:active {
transform: scale(.90);
transition: all .5s;
opacity: .8;
}
.member-item-icon {
width: 50upx;
height: 50upx;
display: block;
margin: 0 auto;
}
.member-item-text {
font-size: 24upx;
color: #666;
display: block;
}
.cart-checkbox {
position: relative;
height: 100%;
}
.cart-checkbox-c {
display: inline-block;
position: absolute;
top: 50%;
left: 26upx;
transform: translateY(-50%);
z-index: 99;
}
.cart-list .img-list-item {
padding-left: 90upx;
}
.cart-list .little-right {
width: 468upx;
}
.cart-list .little-right .list-goods-name {
width: 300upx;
}
.uni-checkbox-input {
border-radius: 50% !important;
color: #fff !important;
}
uni-radio .uni-radio-input,
uni-checkbox .uni-checkbox-input {
width: 36upx;
height: 36upx;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked,
.uni-radio-input.uni-radio-input-checked {
background-color: #FF7159 !important;
border-color: #FF7159 !important;
width: 36upx;
height: 36upx;
}
uni-checkbox.checkboxNo .uni-checkbox-input {
background-color: #e1e1e1 !important;
border-color: #e1e1e1 !important;
}
uni-radio.radioNo .uni-radio-input {
background-color: #e1e1e1 !important;
border-color: #e1e1e1 !important;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before {
font-size: 36rpx;
}
.login-item-i-p {
color: #999;
}
.two-line {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.badge {
display: inline-block;
position: absolute;
min-width: 13px;
height: 13px;
line-height: 13px;
background-color: #FF7159;
color: #fff;
font-size: 12px;
border-radius: 50upx;
padding: 0 3px;
z-index: 99;
}
.button-bottom {
background-color: #fff;
position: fixed;
bottom: 0;
height: 90upx;
width: 100%;
display: flex;
z-index: 66;
box-shadow: 0 0 10px #ccc;
}
.button-bottom .btn {
flex: 1;
}
.romotion-tip {
overflow: hidden;
}
.romotion-tip-item {
display: inline-block;
float: left;
margin-right: 10upx;
margin-bottom: 4upx;
background-color: #FF7159;
color: #fff;
height: 34upx;
font-size: 24upx;
line-height: 34upx;
padding: 0 10upx;
}
.bg-gray {
background-color: #D0D0D0;
}
/* #ifdef MP */
checkbox .wx-checkbox-input {
border-radius: 50%;
height: 36rpx;
width: 36rpx;
margin-top: -4rpx;
border: 1rpx solid #d1d1d1;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
width: 36rpx;
height: 36rpx;
line-height: 36rpx;
border-radius: 50%;
text-align: center;
font-size: 28rpx;
color: #fff;
background: transparent;
transform: translate(-50%, -50%) scale(1);
-webkit-transform: translate(-50%, -50%) scale(1);
background-color: #FF7159;
border: 1rpx solid #FF7159;
}
radio .wx-radio-input {
border-radius: 50%;
/* 圆角 */
width: 36rpx;
height: 36rpx;
margin-top: -4rpx;
border: 1rpx solid #d1d1d1;
}
/* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */
radio .wx-radio-input.wx-radio-input-checked {
border: 1rpx solid #FF7159;
background: #FF7159;
}
/* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */
radio .wx-radio-input.wx-radio-input-checked::before {
border-radius: 50%;
/* 圆角 */
width: 36rpx;
/* 选中后对勾大小,不要超过背景的尺寸 */
height: 36rpx;
/* 选中后对勾大小,不要超过背景的尺寸 */
line-height: 36rpx;
text-align: center;
font-size: 28rpx;
/* 对勾大小 30rpx */
color: #fff;
/* 对勾颜色 白色 */
background: transparent;
transform: translate(-50%, -50%) scale(1);
-webkit-transform: translate(-50%, -50%) scale(1);
}
/* #endif */
.goods-bottom {
z-index: 97;
}
.btn-small {
padding: 0 10rpx;
height: 36rpx;
line-height: 32rpx;
font-size: 24rpx;
margin: 0 10rpx;
}
.gift {
font-size: 24rpx;
color: #FF7159;
}
.bgf {
background: #FFF;
}
.flc {
display: flex;
justify-content: space-between;
align-items: center;
}
.flc-inline {
display: inline-flex;
align-items: center;
}
.g5 {
color: $g5;
}
.fz12 {
font-size: $fz12;
}
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lifeforgames/room-elephant-program.git
[email protected]:lifeforgames/room-elephant-program.git
lifeforgames
room-elephant-program
房象小程序
master

搜索帮助