新增部分注释优化一些代码

master
lemon橪 2021-05-24 15:49:22 +08:00
parent dd0c7259e6
commit 3d74e3d907
28 changed files with 209 additions and 752 deletions

View File

@ -31,19 +31,18 @@ export default {
onShow() {
// #ifndef H5
this.getClipboard();
// #endif
},
methods: {
// 广
// TODO 广
launch() {
try {
// launchFlag 广
const value = uni.getStorageSync("launchFlag");
if (!value) {
this.$u.route("/pages/index/agreement");
// this.$u.route("/pages/index/agreement");
} else {
//app广
var w = plus.webview.open(

View File

@ -18,9 +18,9 @@ import config from "@/config/config";
export default {
data() {
return {
config,
weChat: false,
logo: require("@/icon.png"),
config, //
weChat: false, // true
logo: require("@/icon.png"), //logo
};
},
mounted() {
@ -36,11 +36,16 @@ export default {
// #endif
},
methods: {
/**
* 跳转到下载app页面
*/
downloadApp() {
setTimeout(function () {
window.location.href = config.downloadLink;
}, 2000);
},
/**
* 打开app 仅在h5生效 使用ifream唤醒app
*/

View File

@ -3,7 +3,6 @@
<div class="index">
<u-modal v-model="show" :show-title="false" :show-confirm-button="false" mask-close-able>
<view class="slot-content">
<image @click="downLoad()" class="img" :src="imgUrl" />
<div class="canvas-hide">
<!-- #ifdef MP-WEIXIN -->
@ -19,21 +18,20 @@
</div>
</template>
<script>
//
import DrawPoster from "@/js_sdk/u-draw-poster";
export default {
data: () => ({
imgUrl: "",
width: "",
height: "",
show: false,
dp: {},
logo: require("@/pages/passport/static/logo-title.png"),
imgUrl: "", //
show: false, //
dp: {}, //dp
logo: require("@/pages/passport/static/logo-title.png"), //logo
}),
props: {
/**
* 封装组件
* 父级传参的数据
*/
res: {
type: null,
@ -54,8 +52,10 @@ export default {
st2: (size) => size,
// #endif
/**
* 保存图片
*/
downLoad() {
uni.saveImageToPhotosAlbum({
filePath: this.imgUrl,
success: function () {

View File

@ -18,8 +18,8 @@
<view class="city-head-title">{{ headTitle }}</view>
<icon
type="clear"
v-if="rightIcon"
class="rightIcon"
v-if="clearRightIcon"
class="clearRightIcon"
size="20"
color="#cccccc"
@click="hide"
@ -105,17 +105,21 @@ export default {
},
data() {
return {
rightIcon: true,
clearRightIcon: true, //icon
scrollLeft: 500, //
scrollTop: 0,
enableScroll: true,
scrollTop: 0, //0
enableScroll: true, //
tabCurrentIndex: 0, //
tabbars: this.provinceData,
pickersize: this.pickerSize,
showPicker: false,
tabbars: this.provinceData, //id
pickersize: this.pickerSize, //tab 4
showPicker: false, //
};
},
methods: {
/**
* 显示选择器
*/
show() {
this.showPicker = true;
if (this.tabbars[0].children.length == 0) {
@ -126,10 +130,17 @@ export default {
windowWidth = uni.getSystemInfoSync().windowWidth;
},
/**
* 关闭选择器
*/
hide() {
this.showPicker = false;
},
//tab
/**
* tab切换
*/
changeTab(e) {
let index = e;
this.setScroll(index);
@ -139,7 +150,10 @@ export default {
this.getScroll("show" + index);
}, 10);
},
//size
/**
* 获得元素的大小
*/
getElSize(id) {
return new Promise((res, rej) => {
let el = uni
@ -158,6 +172,10 @@ export default {
).exec();
});
},
/**
* 点击城市后回调
*/
async changCity(index, item) {
if (this.tabbars[index].id != item.id) {
this.tabbars[index].localName = item.name;
@ -165,14 +183,14 @@ export default {
if (index < this.tabbars.length - 1) {
this.tabbars.splice(index + 1, this.tabbars.length - index - 1);
}
if (this.tabbars.length < this.pickersize) {
let data = await getRegionsById(item.id);
//
if (data.data.result.length == 0) {
this.$emit("funcValue", this.tabbars);
this.hide();
} else {
//
var current = {
localName: "请选择",
id: "",
@ -181,6 +199,7 @@ export default {
this.tabbars.push(current);
this.tabCurrentIndex++;
//
this.scrollTop = 0;
}
} else {
@ -189,6 +208,10 @@ export default {
}
}
},
/**
* 获取当前tab中滚动的距离
*/
async setScroll(index) {
let width = 0;
let nowWidth = 0;
@ -205,6 +228,10 @@ export default {
this.scrollLeft = 0;
}
},
/**
* 计算当前的滚动距离
*/
getScroll(id) {
uni
.createSelectorQuery()
@ -229,7 +256,7 @@ export default {
</script>
<style lang="scss" scoped>
/* 优惠券面板 */
.mask {
visibility: hidden;
position: fixed;
@ -275,7 +302,7 @@ export default {
text-align: center;
/* #endif */
}
.rightIcon {
.clearRightIcon {
position: absolute;
right: 15px;
top: 12px;

View File

@ -1,7 +1,7 @@
<template>
<view class="serach">
<view class="left-box" @tap="onClickLeft">
<uni-icons style="line-height:70rpx" :color="color" type="back" size="24" />
<uni-icons style="line-height:70rpx" type="back" size="24" />
</view>
<view class="content" :style="{ 'border-radius': radius + 'px' }">
<!-- HM修改 增加进入输入状态的点击范围 -->
@ -10,21 +10,17 @@
<!-- HM修改 增加placeholder input confirm-type confirm-->
<input style="width:100%; " :placeholder="placeholder" placeholder-class="placeholder-color" @input="inputChange" confirm-type="search" @confirm="triggerConfirm" class="input"
:class="{ center: !active && mode === 2 }" :focus="isFocus" v-model="inputVal" @focus="focus" @blur="blur" />
<!-- <view v-if="!active && mode === 2" class="input sub" @click="getFocus"></view> -->
<!-- HM修改 @click换成@click.stop阻止冒泡 -->
<text v-if="isDelShow" class="icon icon-del" @click.stop="clear"></text>
<u-icon name="close" v-if="isDelShow" style="padding:0 30rpx;" @click="clear"></u-icon>
</view>
<view v-show="(active && show && button === 'inside') || (isDelShow && button === 'inside')" class="serachBtn" @click="search"></view>
</view>
<view v-if="button === 'outside'" class="button" :class="{ active: show || active }">
<!-- @click="search" -->
<view v-if="isShowSeachGoods !=true" class="button-item">
<div @click="out()"></div>
</view>
<view v-else class="button-item">
<!-- {{ !show ? searchName : '搜索' }} -->
<u-icon name="grid-fill" size="50" @click="handelListClass()" v-if="!isListClass"></u-icon>
<u-icon name="grid-fill" size="50" @click="handelListClass()" v-if="!switchLayout"></u-icon>
<u-icon v-else @click="handelListClass()" name="list-dot" size="50"></u-icon>
</view>
</view>
@ -36,9 +32,6 @@ import uniStatusBar from "../uni-status-bar/uni-status-bar.vue";
import uniIcons from "../uni-icons/uni-icons.vue";
export default {
watch: {},
mounted() {},
components: {
uniStatusBar,
uniIcons,
@ -61,37 +54,17 @@ export default {
value: String,
default: "outside",
},
//
show: {
value: Boolean,
default: true,
},
leftText: {
type: String,
default: "",
},
color: {
type: String,
},
statusBar: {
type: [Boolean, String],
default: false,
},
rightText: {
type: String,
default: "",
},
leftIcon: {
type: String,
default: "",
},
rightIcon: {
type: String,
default: "",
},
// 60
radius: {
value: String,
default: 60,
},
//
isFocusVal: {
value: Boolean,
default: true,
@ -99,46 +72,36 @@ export default {
},
data() {
return {
isShowSeachGoods: false,
//
nums: 0,
iconParams: false,
active: false,
inputVal: "",
searchName: "取消",
isDelShow: false,
isFocus: false,
isListClass: true,
isShowSeachGoods: false, //
active: false, //
inputVal: "", //Input
isDelShow: false, //icon
isFocus: false, //
switchLayout: true, //
};
},
mounted() {
this.isFocus = this.isFocusVal;
},
methods: {
ddType() {
this.isShowSeachGoods = true;
},
//
out() {
uni.reLaunch({
url: "/pages/tabbar/home/index"
url: "/pages/tabbar/home/index",
});
},
//
handelListClass() {
this.isListClass = !this.isListClass;
this.switchLayout = !this.switchLayout;
this.$emit("SwitchType");
},
//HM confirm
triggerConfirm() {
this.nums++;
this.$emit("confirm", false);
uni.hideKeyboard();
this.isShowSeachGoods = true;
},
//HM input
inputChange(event) {
this.nums++;
var keyword = event.detail.value;
this.$emit("input", keyword);
if (this.inputVal) {
@ -168,17 +131,19 @@ export default {
this.$emit("input", "");
//this.$emit('search', '');//HM
},
getFocus() {
if (!this.isFocus) {
this.isFocus = true;
}
},
/**
* 回退到上一级
*/
onClickLeft() {
uni.navigateBack();
},
/**
* 内容为空时输入默认关键字
*/
search() {
this.nums++;
//HM 退
if (!this.inputVal) {
if (!this.show && this.searchName == "取消") {
uni.hideKeyboard();
@ -191,24 +156,17 @@ export default {
},
},
watch: {
/**
* 监听当前是否有值 是否显示清除图标
*/
inputVal(newVal) {
if (newVal) {
this.searchName = "搜索";
//this.isDelShow = true; //HM
} else {
this.searchName = "取消";
this.isDelShow = false;
}
},
//HM
value(val) {
this.inputVal = val;
newVal ? (this.isDelShow = true) : (this.isDelShow = false);
},
},
};
</script>
<style lang="scss">
<style lang="scss" scoped>
.serach {
display: flex;
width: 100%;
@ -233,14 +191,10 @@ export default {
background: #eee;
overflow: hidden;
transition: all 0.2s linear;
// border-radius: 30px;
.content-box {
width: 100%;
display: flex;
align-items: center;
&.center {
justify-content: center;
}
@ -248,14 +202,6 @@ export default {
.icon {
padding: 0 15rpx;
&.icon-del {
font-size: 38rpx;
&:before {
content: "\e644";
}
}
&.icon-serach:before {
content: "\e61c";
}

View File

@ -394,12 +394,6 @@
}
}
},
{
"path": "restPassword",
"style": {
"navigationBarTitleText": "重设密码"
}
},
{
"path": "article",
"style": {

View File

@ -2,6 +2,7 @@
<view class="content">
<u-navbar :background="navObj" :is-back="false">
<!-- mSearch组件 如果使用原样式删除组件元素-->
<mSearch ref="mSearch" class="mSearch-input-box" @clickLeft="back" :mode="2" :placeholder="defaultKeyword" @search="doSearch(false)" @input="inputChange" @confirm="doSearch(false)"
@SwitchType="doSearchSwitch()" v-model="keyword" :isFocusVal="!isShowSeachGoods"></mSearch>
</u-navbar>

View File

@ -5,7 +5,6 @@
<view class="u-skeleton" v-if="!articleData">
<u-empty text="文章暂无内容" mode="list"></u-empty>
</view>
<!-- <h3>{{routers.title}}</h3> -->
<u-parse v-else :html="articleData"></u-parse>
</view>
</view>
@ -16,18 +15,20 @@ import { getArticleDetail } from "@/api/article.js";
export default {
data() {
return {
loading: true,
routers: "",
//
routers: "",
//
articleData: "",
};
},
onLoad(val) {
this.routers = val;
getArticleDetail(val.id).then((res) => {
if (res.data.result) {
//
this.articleData = res.data.result.content;
}
// NavigationBar()
uni.setNavigationBarTitle({
title: val.title,
});

View File

@ -36,15 +36,15 @@ export default {
return {
uuid,
flage: false, //
codeFlag: true, //
codeFlag: true, //
codeForm: {
mobile: "", //
code: "", //
},
tips: "", //
tips: "", //
clientType: "", //
seconds: 60,
seconds: 60, //
//
codeRules: {
//
mobile: [
@ -69,7 +69,7 @@ export default {
},
};
},
// onReadyonLoad
// onReadysetRulesonLoad
mounted() {
this.$refs.validateCodeForm.setRules(this.codeRules);
/**
@ -86,7 +86,7 @@ export default {
flage(val) {
if (val) {
if (this.$refs.uCode.canGetCode) {
//
//
uni.showLoading({
title: "正在获取验证码",
});

View File

@ -26,11 +26,10 @@
font-size: 24upx;
color: #999;
text-align: center;
position: absolute;
margin-top: 360rpx;
width: 100%;
display: flex;
justify-content: center;
bottom: 50rpx;
}
span {
color: $aider-light-color;

View File

@ -1,185 +0,0 @@
<template>
<view class="container">
<view class="wrapper">
<view class="input-content">
<view class="input-item" v-if="step === 0">
<view class="input-item-title">
<image src="/static/login/user.png"></image>
</view>
<input type="text" v-model="form.account" placeholder="请输入账户名" placeholder-class="input-empty" maxlength="11"
/>
</view>
<view class="input-item" v-if="step === 0">
<view class="input-item-title">
<image class="img-code-icon" src="/static/login/code.png"></image>
</view>
<input v-model="form.img_code" placeholder="请输入图片验证码" placeholder-class="input-empty" maxlength="4"
@confirm="toLogin" />
<image :src="validate_url" class="img_code" mode="" @click="getValidImgUrl"></image>
</view>
<view class="input-item" v-if="step === 1">
<view class="input-item-title">
<image src="/static/login/user.png"></image>
<view class="phone-number">+86</view>
<image class="vertical" src="/static/vertical-line.svg"></image>
</view>
<input type="mobile" v-model="form.mobile" disabled="true" placeholder="请输入手机号码" placeholder-class="input-empty" maxlength="11"
/>
</view>
<view class="input-item" v-if="step === 1">
<view class="input-item-title">
<image class="img-code-icon" src="/static/login/code.png"></image>
</view>
<input v-model="form.img_code_phone" placeholder="请输入图片验证码" placeholder-class="input-empty"
maxlength="4" @confirm="toLogin" />
<image :src="validate_url" class="img_code" mode="" @click="getValidImgUrl"></image>
</view>
<view class="input-item" v-if="step === 1">
<view class="input-item-title">
<image src="/static/login/pwd2.png"></image>
</view>
<input v-model="form.sms_code" placeholder="请输入验证码" placeholder-class="input-empty" maxlength="4"
@confirm="toLogin" />
<view class="get-captcha" @click="handleGetCapcha">{{ sendTime === 0 ? '' : sendTime + 's' }}</view>
</view>
<view class="input-item" v-if="step === 2">
<view class="input-item-title">
<image src="/static/login/pwd2.png"></image>
</view>
<input type="password" v-model="form.password" placeholder="请输入新密码" placeholder-class="input-empty" maxlength="20"
@confirm="toLogin" />
</view>
<view class="input-item" v-if="step === 2">
<view class="input-item-title">
<image src="/static/login/pwd2.png"></image>
</view>
<input type="password" v-model="form.rep_password" placeholder="请再次输入密码" placeholder-class="input-empty" maxlength="20"
@confirm="toLogin" />
</view>
<button class="confirm-btn" @click="toNext">{{ step === 0 ? '' : (step==1?'':'') }}</button>
</view>
</view>
</view>
</template>
<script>
import {
validAccount,
sendFindPasswordSms,
validFindPasswordSms,
changePassword
} from '@/api/passport.js';
import {
getValidateCodeUrl
} from '@/api/common.js';
import * as RegExp from '@/utils/RegExp.js';
export default {
data() {
return {
validate_url: '',
sendTime: 0,
form: {},
step: 0,
}
},
onLoad() {
this.$nextTick(this.getValidImgUrl)
},
methods: {
handleGetCapcha() {
if (this.sendTime == 0) {
sendFindPasswordSms(this.form.uuid,this.form.img_code_phone).then(res => { //
if (res.statusCode == 200) {
this.sendTime = 60;
let timer = setInterval(() => {
this.sendTime--;
if (this.sendTime === 0) {
clearInterval(timer);
}
}, 1000);
}
})
}
},
getValidImgUrl() { //
const uuid = this.step === 0 ? '' : this.form.uuid
this.validate_url = getValidateCodeUrl('FIND_PASSWORD',uuid)
},
toNext() {
// TODO
if (this.step === 0) {
const { account,img_code } = this.form
validAccount(img_code, account).then(res=>{
if(res.statusCode==200){
this.step = 1
this.form.mobile = res.data.mobile
this.form.uname = res.data.uname
this.form.uuid = res.data.uuid
this.getValidImgUrl()
}
});
} else if (this.step == 1) {
const { uuid, sms_code } = this.form
validFindPasswordSms(uuid,sms_code).then((res) => {
if(res.statusCode==200){
this.step = 2;
this.sendTime = 0;
this.getValidImgUrl()
}
})
}else{
const { password,uuid,rep_password } = this.form
if(!password){
this.$api.msg('请输入密码')
return;
}
if(!RegExp.password.test(password)){
this.$api.msg('密码应为6-20位英文或数字')
return ;
}
if(password!=rep_password){
this.$api.msg('两次输入密码不一致')
return;
}
changePassword(password,uuid).then(res=>{
if(res.statusCode==200){
this.$api.msg('修改密码成功!')
setTimeout(function() {
uni.reLaunch({
url:"/pages/passport/login"
})
}, 500);
}
})
}
}
}
}
</script>
<style lang="scss" scoped>
@import './login.scss';
.container {
padding-top: 0;
.img_code {
width: 140rpx;
height: 48rpx;
margin-right: 20rpx;
}
.img-code-icon {
width: 44rpx;
height: 35rpx;
}
.input-content {
margin-top: 300rpx;
}
}
</style>

View File

@ -1,185 +0,0 @@
<template>
<view class="content">
<view class="con" :style="{width: windowWidth + 'px',height: windowHeight + 'px' }"><image :src="imgSrc" mode="scaleToFill" > </image></view>
<view class="btn" id="timer">
<view id="info"> </view>
<view class="circleProgress_wrapper btn">
<view class="wrapper right"><view class="circleProgress rightcircle"></view></view>
<view class="wrapper left"><view class="circleProgress leftcircle"></view></view>
</view>
</view>
</view>
</template>
<script>
import { getAdvertisement } from '@/api/home.js';
function getRandom(start, end, fixed = 0) {
let differ = end - start;
let random = Math.random();
return (start + differ * random).toFixed(fixed);
}
export default {
data() {
return {
imgSrc: '',
windowWidth: 0,
windowHeight: 0
};
},
onLoad() {
const res = uni.getSystemInfoSync();
this.windowWidth = res.windowWidth;
this.windowHeight = res.windowHeight;
this.init();
},
methods: {
init() {
getAdvertisement().then(res => {
if (res.statusCode === 200) {
const ads = res.data[getRandom(0, res.data.length - 1)];
this.imgSrc = ads.pic_url;
console.warn(this.imgSrc);
}
});
}
}
};
</script>
<style lang="less" scoped>
.content {
width: 100%;
height: 100%;
.con {
display: flex;
align-items: center;
image {
width: 100%;
height: 100%;
}
}
}
#timer {
display: inline-block;
position: fixed;
top: 40px;
right: 10px;
}
#info {
position: absolute;
top: 0;
left: 0;
width: 36px;
height: 36px;
line-height: 36px;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.3);
text-align: center;
color: #ffffff;
font-size: 12px;
}
.circleProgress_wrapper {
width: 36px;
height: 36px;
position: relative;
}
.wrapper {
width: 18px;
height: 36px;
position: absolute;
top: 0;
overflow: hidden;
}
.right {
right: 0;
}
.left {
left: 0;
}
.circleProgress {
width: 32px;
height: 32px;
border: 2px solid #ffffff;
border-radius: 50%;
position: absolute;
top: 0;
-webkit-transform: rotate(45deg);
}
.rightcircle {
border-top: 2px solid #03a9f4;
border-right: 2px solid #03a9f4;
right: 0;
-webkit-animation: circleProgressLoad_right 4s linear;
/*动画停留在最后一帧*/
animation-fill-mode: forwards;
-moz-animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
-o-animation-fill-mode: forwards;
}
.leftcircle {
border-bottom: 2px solid #03a9f4;
border-left: 2px solid #03a9f4;
left: 0;
-webkit-animation: circleProgressLoad_left 4s linear;
/*动画停留在最后一帧*/
animation-fill-mode: forwards;
-moz-animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
-o-animation-fill-mode: forwards;
}
@-webkit-keyframes circleProgressLoad_right {
0% {
border-top: 2px solid #03a9f4;
border-right: 2px solid #03a9f4;
-webkit-transform: rotate(45deg);
}
50% {
border-top: 2px solid #03a9f4;
border-right: 2px solid #03a9f4;
border-left: 2px solid #ffffff;
border-bottom: 2px solid #ffffff;
-webkit-transform: rotate(225deg);
}
100% {
border-left: 2px solid #ffffff;
border-bottom: 2px solid #ffffff;
-webkit-transform: rotate(225deg);
}
}
@-webkit-keyframes circleProgressLoad_left {
0% {
border-bottom: 2px solid #03a9f4;
border-left: 2px solid #03a9f4;
-webkit-transform: rotate(45deg);
}
50% {
border-bottom: 2px solid #03a9f4;
border-left: 2px solid #03a9f4;
border-top: 2px solid #ffffff;
border-right: 2px solid #ffffff;
-webkit-transform: rotate(45deg);
}
100% {
border-top: 2px solid #ffffff;
border-right: 2px solid #ffffff;
-webkit-transform: rotate(225deg);
}
}
</style>

View File

@ -1,118 +0,0 @@
<template>
<view class="container">
<view class="status_bar"><!-- 这里是状态栏 --></view>
<view class="header">{{ agreement.article_name }}</view>
<view class="u-update-content">
<view class="about-us"><view v-html="agreement.content"></view></view>
</view>
<view class="bottom-btn">
<view class="disagree-btn">不同意</view>
<view class="agree-btn" @click="closeModal"></view>
</view>
<u-loading mode="flower" size="100" :show="loading"></u-loading>
</view>
</template>
<script>
0;
import { getArticleDetail } from '@/api/article.js';
export default {
data() {
return {
show: true,
loading: true,
agreement: {}
};
},
onReady() {
this.show = true;
},
onLoad(options) {
this.init();
},
methods: {
init() {
getArticleDetail(111).then(res => {
if (res.statusCode === 200) {
this.agreement = res.data;
this.loading = false;
}
});
},
cancel() {
this.closeModal();
},
confirm() {
this.closeModal();
},
closeModal() {
uni.setStorage({
key: 'launchFlag',
data: true
});
uni.switchTab({
url: '/pages/tabbar/home/index'
});
}
}
};
</script>
<style scoped lang="scss">
.container {
background-color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
}
.status_bar {
position: fixed;
top: 0px;
height: var(--status-bar-height);
width: 100%;
background: #1abc9c;
}
.header {
width: 100%;
margin-top: var(--status-bar-height);
display: flex;
justify-content: center;
align-items: center;
font-size: 34rpx;
font-weight: 400;
height: 100rpx;
}
.u-full-content {
background-color: #00c777;
}
.bottom-btn {
position: fixed;
z-index: 999;
bottom: 0px;
left: 0px;
width: 100%;
height: 100rpx;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
view {
width: 50%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.agree-btn {
background-color: #1abc9c;
color: #ffffff;
}
}
.u-update-content {
padding: 10rpx;
font-size: 26rpx;
}
</style>

View File

@ -1,5 +1,6 @@
<template>
<div class="wrapper">
<!-- 楼层装修组件 -->
<tpl />
</div>
</template>

View File

@ -17,8 +17,7 @@ export default {
modelNavigateTo,
};
},
mounted() {
},
mounted() {},
};
</script>
<style lang="scss" scoped>

View File

@ -1,27 +1,23 @@
<template>
<div class="layout">
<u-image height="175rpx" width="175rpx" @click="modelNavigateTo(item)" class="image-mode" :src="item.img" v-for="(item,index) in res.list" :key="index" >
<u-loading slot="loading"></u-loading>
</u-image>
<u-image height="175rpx" width="175rpx" @click="modelNavigateTo(item)" class="image-mode" :src="item.img" v-for="(item,index) in res.list" :key="index">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
</template>
<script>
import {modelNavigateTo} from './tpl'
import { modelNavigateTo } from "./tpl";
export default {
title: "四列单行图片模块",
props: ["res"],
data () {
data() {
return {
modelNavigateTo,
}
};
},
mounted() {
}
mounted() {},
};
</script>
<style lang="scss" scoped>
@ -33,7 +29,7 @@ export default {
justify-content: center;
background-size: cover;
}
img{
img {
width: 84px;
}
</style>

View File

@ -9,6 +9,7 @@
import { modelNavigateTo } from "./tpl";
export default {
title:"单行图片模块",
data() {
return {
modelNavigateTo,

View File

@ -1,31 +1,18 @@
<template>
<div class="layout">
<div class="goods-cell-title">
<div
class="goods-item-title"
:class="{ 'selected-title': selected.index == index }"
@click="handleClickTitle(title, index)"
v-for="(title, index) in res.list[0].titleWay"
:key="index"
>
<div class="goods-item-title" :class="{ 'selected-title': selected.index == index }" @click="handleClickTitle(title, index)" v-for="(title, index) in res.list[0].titleWay" :key="index">
<h4 class="h4">{{ title.title }}</h4>
<div>{{ title.desc }}</div>
</div>
</div>
<div class="goods-list">
<div
v-if="selected.val == item.type"
@click="handleClick(item)"
class="goods-item"
v-for="(item, item_index) in res.list[0].listWay"
:key="item_index"
>
<div v-if="selected.val == item.type" @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in res.list[0].listWay" :key="item_index">
<div class="goods-img">
<u-image :src="item.img" height="350rpx" mode="aspectFit" width="100%">
<u-loading slot="loading"></u-loading
></u-image>
<u-image :src="item.img" height="350rpx" mode="aspectFit" width="100%">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-desc">
<div class="goods-title">
@ -42,6 +29,7 @@
<script>
import uImage from "@/uview-ui/components/u-image/u-image.vue";
export default {
title: "商品分类以及商品",
components: { uImage },
data() {
return {
@ -55,7 +43,6 @@ export default {
mounted() {},
methods: {
handleClick(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
});
@ -102,7 +89,6 @@ $w_94: 94%;
> h4 {
font-size: 32rpx;
}
> div {
@ -130,7 +116,7 @@ $w_94: 94%;
margin: 0 auto;
// width: 158px;
width: $w_94;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;

View File

@ -3,18 +3,12 @@
<div class="join-list">
<div class="join-title">
<div>{{ res.list[0].title }}</div>
<div>更多</div>
</div>
<div class="join-box">
<div class="join-item" @click="modelNavigateTo(item)" v-for="item in 4" :key="item">
<div class="item-img-box">
<img
class="item-img"
src="https://picsum.photos/id/268/200/200"
alt
/>
<img class="item-img" src="https://picsum.photos/id/268/200/200" alt />
</div>
<div class="item-price">
<span>120.00</span>
@ -28,19 +22,19 @@
</div>
</template>
<script>
import {modelNavigateTo} from './tpl'
// TODO
import { modelNavigateTo } from "./tpl";
export default {
props: ["res"],
data () {
title: "拼团",
data() {
return {
modelNavigateTo,
}
};
},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
@import './advertising.scss';
@import "./advertising.scss";
</style>

View File

@ -3,18 +3,12 @@
<div class="join-list">
<div class="join-title">
<div>{{ res.list[0].title }}</div>
<div>更多</div>
</div>
<div class="join-box">
<div class="join-item" v-for="item in 4" :key="item">
<div class="item-img-box">
<img
class="item-img"
src="https://picsum.photos/id/268/200/200"
alt
/>
<img class="item-img" src="https://picsum.photos/id/268/200/200" alt />
</div>
<div class="item-price">
<span>20积分</span>
@ -28,7 +22,9 @@
</div>
</template>
<script>
// TODO
export default {
title:"积分商品",
props: ["res"],
};
</script>

View File

@ -3,7 +3,6 @@
<div class="join-list">
<div class="join-title">
<div>{{ res.list[0].title }}</div>
<div>更多</div>
</div>
<div class="join-box">
@ -28,8 +27,10 @@
</div>
</template>
<script>
// TODO
export default {
props: ["res"],
title:"团购"
};
</script>
<style lang="scss" scoped>

View File

@ -20,7 +20,6 @@
</div>
</div>
</template>
<script>
import {modelNavigateTo} from './tpl'
export default {

View File

@ -20,6 +20,7 @@
<script>
import {modelNavigateTo} from './tpl'
export default {
title:"五列菜单",
props: ["res"],
data () {
return {

View File

@ -8,6 +8,7 @@
</template>
<script>
export default {
title:"搜索栏",
props: ["res"],
methods: {
handleSearch() {

View File

@ -3,13 +3,11 @@
<div class="join-list">
<div class="join-title">
<div>{{ res.list[0].title }}</div>
<div>更多</div>
</div>
<div class="join-box">
<div class="join-item" v-for="item in 4" :key="item">
<div class="item-img-box">
<img
class="item-img"
src="https://picsum.photos/id/268/200/200"
@ -28,6 +26,7 @@
</div>
</template>
<script>
// TODO
export default {
props: ["res"],
};

View File

@ -1,51 +1,47 @@
<template>
<div class="layout">
<div class="background">
<div class="title" :style="{ color: res.list[0].color }">
{{ res.list[0].title }}
</div>
</div>
</div>
<div class="layout">
<div class="background">
<div class="title" :style="{ color: res.list[0].color }">
{{ res.list[0].title }}
</div>
</div>
</div>
</template>
<script>
export default {
title: "标题栏",
props: ["res"],
mounted() {
},
};
export default {
title: "标题栏",
props: ["res"],
mounted() {},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
@import "./tpl.scss";
.background {
background: url("/static/title.png") no-repeat;
position: absolute;
z-index: 2;
width: 100%;
height: 84rpx;
background-position-x: center;
background-position-y: center;
background-size: cover;
}
.background {
background: url("/static/title.png") no-repeat;
position: absolute;
z-index: 2;
width: 100%;
height: 84rpx;
background-position-x: center;
background-position-y: center;
background-size: cover;
}
.layout {
text-align: center;
position: relative;
height: 84rpx;
display: flex;
align-items: center;
justify-content: center;
.layout {
text-align: center;
position: relative;
height: 84rpx;
display: flex;
align-items: center;
justify-content: center;
background: #ffffff;
}
background: #ffffff;
}
.title {
line-height: 84rpx;
font-size: 30rpx;
font-weight: bold;
}
.title {
line-height: 84rpx;
font-size: 30rpx;
font-weight: bold;
}
</style>

View File

@ -2,7 +2,8 @@
<div class="wrapper">
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
<div v-for="(item,index) in pageData.list" :key="index">
<u-navbar class="navbar" v-if="item.type == 'search'" :is-back="false">
<!-- 搜索栏如果在楼层装修顶部则会自动浮动否则不浮动 -->
<u-navbar class="navbar" v-if="item.type == 'search'" :is-back="false" :is-fixed="index ===1 ? false : true">
<search style="width:100%" :res="item.options" />
<!-- #ifndef H5 -->
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode -->
@ -23,12 +24,13 @@
<flexTwo v-if="item.type == 'flexTwo'" :res="item.options" />
<textPicture v-if="item.type == 'textPicture'" :res="item.options" />
<menuLayout v-if="item.type == 'menu'" :res="item.options" />
<joinGroup v-if="item.type == 'joinGroup'" :res="item.options" />
<flexOne v-if="item.type == 'flexOne'" :res="item.options" />
<goods v-if="item.type == 'goods'" :res="item.options" />
<integral v-if="item.type == 'integral'" :res="item.options" />
<spike v-if="item.type == 'spike'" :res="item.options" />
<group v-if="item.type == 'group'" :res="item.options" />
<!-- <joinGroup v-if="item.type == 'joinGroup'" :res="item.options" /> -->
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
</div>
<u-no-network></u-no-network>
</div>
@ -36,34 +38,35 @@
<script>
//
import tpl_banner from "@/pages/tabbar/home/template/tpl_banner";
import tpl_title from "@/pages/tabbar/home/template/tpl_title";
import tpl_left_one_right_two from "@/pages/tabbar/home/template/tpl_left_one_right_two";
import tpl_left_two_right_one from "@/pages/tabbar/home/template/tpl_left_two_right_one";
import tpl_top_one_bottom_two from "@/pages/tabbar/home/template/tpl_top_one_bottom_two";
import tpl_top_two_bottom_one from "@/pages/tabbar/home/template/tpl_top_two_bottom_one";
import tpl_flex_one from "@/pages/tabbar/home/template/tpl_flex_one";
import tpl_flex_two from "@/pages/tabbar/home/template/tpl_flex_two";
import tpl_flex_three from "@/pages/tabbar/home/template/tpl_flex_three";
import tpl_flex_five from "@/pages/tabbar/home/template/tpl_flex_five";
import tpl_flex_four from "@/pages/tabbar/home/template/tpl_flex_four";
import tpl_text_picture from "@/pages/tabbar/home/template/tpl_text_picture";
import tpl_menu from "@/pages/tabbar/home/template/tpl_menu";
import tpl_search from "@/pages/tabbar/home/template/tpl_search";
import tpl_join_group from "@/pages/tabbar/home/template/tpl_join_group";
import tpl_integral from "@/pages/tabbar/home/template/tpl_integral";
import tpl_spike from "@/pages/tabbar/home/template/tpl_spike";
import tpl_group from "@/pages/tabbar/home/template/tpl_group";
import tpl_goods from "@/pages/tabbar/home/template/tpl_goods";
import tpl_banner from "@/pages/tabbar/home/template/tpl_banner"; //
import tpl_title from "@/pages/tabbar/home/template/tpl_title"; //
import tpl_left_one_right_two from "@/pages/tabbar/home/template/tpl_left_one_right_two"; //
import tpl_left_two_right_one from "@/pages/tabbar/home/template/tpl_left_two_right_one"; //
import tpl_top_one_bottom_two from "@/pages/tabbar/home/template/tpl_top_one_bottom_two"; //
import tpl_top_two_bottom_one from "@/pages/tabbar/home/template/tpl_top_two_bottom_one"; //
import tpl_flex_one from "@/pages/tabbar/home/template/tpl_flex_one"; //
import tpl_flex_two from "@/pages/tabbar/home/template/tpl_flex_two"; //
import tpl_flex_three from "@/pages/tabbar/home/template/tpl_flex_three"; //
import tpl_flex_five from "@/pages/tabbar/home/template/tpl_flex_five"; //
import tpl_flex_four from "@/pages/tabbar/home/template/tpl_flex_four"; //
import tpl_text_picture from "@/pages/tabbar/home/template/tpl_text_picture"; //
import tpl_menu from "@/pages/tabbar/home/template/tpl_menu"; //
import tpl_search from "@/pages/tabbar/home/template/tpl_search"; //
import tpl_group from "@/pages/tabbar/home/template/tpl_group"; //
import tpl_goods from "@/pages/tabbar/home/template/tpl_goods"; //
//
import { getFloorData } from "@/api/home";
import { getFloorData } from "@/api/home"; //
import permision from "@/js_sdk/wa-permission/permission.js"; //
// TODO
// import tpl_join_group from "@/pages/tabbar/home/template/tpl_join_group";
// import tpl_integral from "@/pages/tabbar/home/template/tpl_integral";
// import tpl_spike from "@/pages/tabbar/home/template/tpl_spike";
import { modelNavigateTo } from "./template/tpl.js"; //
import permision from "@/js_sdk/wa-permission/permission.js"; //
export default {
data() {
return {
pageData: "",
pageData: "", //
};
},
components: {
@ -80,17 +83,15 @@ export default {
textPicture: tpl_text_picture,
menuLayout: tpl_menu,
search: tpl_search,
joinGroup: tpl_join_group,
flexOne: tpl_flex_one,
goods: tpl_goods,
integral: tpl_integral,
spike: tpl_spike,
group: tpl_group,
// spike: tpl_spike,
// joinGroup: tpl_join_group,
// integral: tpl_integral,
},
mounted() {
this.init();
},
methods: {
@ -110,11 +111,12 @@ export default {
* 没权限去申请权限有权限获取扫码功能
*/
scan() {
if (permision.judgeIosPermission("camera")) {
uni.scanCode({
success: function (res) {
let path = encodeURIComponent(res.result);
// TODO
// webview
setTimeout(() => {
uni.navigateTo({
url: "/pages/tabbar/home/web-view?src=" + path,
@ -123,6 +125,7 @@ export default {
},
});
} else {
//
uni.showModal({
title: "提示",
content: "您已经关闭相机权限,去设置",