新增部分注释优化一些代码
parent
dd0c7259e6
commit
3d74e3d907
5
App.vue
5
App.vue
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -394,12 +394,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "restPassword",
|
||||
"style": {
|
||||
"navigationBarTitleText": "重设密码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "article",
|
||||
"style": {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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: "",
|
||||
// 请求文章接口后存储文章信息
|
||||
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,
|
||||
});
|
||||
|
|
|
@ -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 {
|
|||
},
|
||||
};
|
||||
},
|
||||
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||
// 必须要在onReady生命周期setRules,因为onLoad生命周期组件可能尚未创建完毕
|
||||
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: "正在获取验证码",
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<div class="wrapper">
|
||||
<!-- 楼层装修组件 -->
|
||||
<tpl />
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -17,8 +17,7 @@ export default {
|
|||
modelNavigateTo,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -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-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>
|
|
@ -9,6 +9,7 @@
|
|||
import { modelNavigateTo } from "./tpl";
|
||||
|
||||
export default {
|
||||
title:"单行图片模块",
|
||||
data() {
|
||||
return {
|
||||
modelNavigateTo,
|
||||
|
|
|
@ -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-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 {
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {modelNavigateTo} from './tpl'
|
||||
export default {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<script>
|
||||
import {modelNavigateTo} from './tpl'
|
||||
export default {
|
||||
title:"五列菜单",
|
||||
props: ["res"],
|
||||
data () {
|
||||
return {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
</template>
|
||||
<script>
|
||||
export default {
|
||||
title:"搜索栏",
|
||||
props: ["res"],
|
||||
methods: {
|
||||
handleSearch() {
|
||||
|
|
|
@ -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"],
|
||||
};
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<div class="layout">
|
||||
<div class="background">
|
||||
<div class="title" :style="{ color: res.list[0].color }">
|
||||
|
||||
{{ res.list[0].title }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,18 +9,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
export default {
|
||||
title: "标题栏",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
|
||||
},
|
||||
};
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./tpl.scss";
|
||||
|
||||
.background {
|
||||
@import "./tpl.scss";
|
||||
.background {
|
||||
background: url("/static/title.png") no-repeat;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
|
@ -30,9 +26,9 @@
|
|||
background-position-x: center;
|
||||
background-position-y: center;
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.layout {
|
||||
.layout {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
height: 84rpx;
|
||||
|
@ -41,11 +37,11 @@
|
|||
justify-content: center;
|
||||
|
||||
background: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
.title {
|
||||
line-height: 84rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -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: "您已经关闭相机权限,去设置",
|
||||
|
|
Loading…
Reference in New Issue