Commit bd13d3c8 by 李伟康

commit 提交

1 parent f8a73771
...@@ -10,10 +10,10 @@ const configModule = 'app-tape' ...@@ -10,10 +10,10 @@ const configModule = 'app-tape'
const configUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=${configModule}&env=${env}`; const configUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=${configModule}&env=${env}`;
/**获取mock数据 */ /**获取mock数据 */
const getMockData = async () => { const getMockData = async (immediate = false) => {
const MOCKDATA = uni.$storage.get('mock_data') const MOCKDATA = uni.$storage.get('mock_data')
try { try {
if (MOCKDATA && Date.now() - MOCKDATA.createTime < 5 * 60e3) { if (!immediate && MOCKDATA && Date.now() - MOCKDATA.createTime < 5 * 60e3) {
return Promise.resolve(MOCKDATA); return Promise.resolve(MOCKDATA);
} else { } else {
if (!serverConfig.mockRequestCount) { if (!serverConfig.mockRequestCount) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
>文件夹</view> >文件夹</view>
<template v-for="(i,index) in data"> <template v-for="(i,index) in data">
<view <view
:class="['item', {active: i.id == id} ]" :class="['item', {active: i[idKey] == id} ]"
:key="index" :key="index"
@click="jump(i)" @click="jump(i)"
> >
...@@ -60,7 +60,11 @@ export default { ...@@ -60,7 +60,11 @@ export default {
type: String, type: String,
data: Array, data: Array,
id: [String, Number], id: [String, Number],
showPayBtn: Boolean showPayBtn: Boolean,
idKey: {
type: String,
default: 'id'
}
}, },
data () { data () {
return { return {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<template v-if="type != 'preview'"> <template v-if="type != 'preview'">
<tool-box <tool-box
ref="toolRef" ref="toolRef"
:data="media" :data="toolList"
:type="type" :type="type"
@choose="choose" @choose="choose"
@finish="open" @finish="open"
...@@ -60,9 +60,7 @@ ...@@ -60,9 +60,7 @@
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view> <view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view>
</view> </view>
</template> </template>
<pay-pop <pay-pop ref="pay"></pay-pop>
ref="pay"
></pay-pop>
<finish-step <finish-step
ref="stepRef" ref="stepRef"
@submit="done" @submit="done"
...@@ -92,7 +90,8 @@ export default { ...@@ -92,7 +90,8 @@ export default {
type: { type: {
type: String, type: String,
default: 'preview' default: 'preview'
} },
toolList: Array
}, },
data () { data () {
return { return {
......
...@@ -19,11 +19,17 @@ ...@@ -19,11 +19,17 @@
:style="i.style" :style="i.style"
@click="toDetail(i)" @click="toDetail(i)"
> >
<template v-if="i.showTitle">
<view class="item-text flex">{{i.title}}</view>
</template>
<template v-else>
<image <image
class="item-img" class="item-img"
:src="i.thumbnail" :src="i.thumbnail"
mode="scaleToFill" mode="scaleToFill"
@error="errorImg(index)"
/> />
</template>
</view> </view>
</template> </template>
</view> </view>
...@@ -32,6 +38,7 @@ ...@@ -32,6 +38,7 @@
:id.sync="id" :id.sync="id"
:media="moduleList" :media="moduleList"
:type.sync="type" :type.sync="type"
:toolList="toolList"
@back="back" @back="back"
@done="done" @done="done"
ref="detail" ref="detail"
...@@ -55,6 +62,7 @@ export default { ...@@ -55,6 +62,7 @@ export default {
data () { data () {
return { return {
moduleList: [], moduleList: [],
toolList: [],
id: "", id: "",
type: "", type: "",
chooseItem: {}, chooseItem: {},
...@@ -111,8 +119,7 @@ export default { ...@@ -111,8 +119,7 @@ export default {
}, },
// 查询素材 // 查询素材
async getSoure () { async getSoure () {
let moduleList = await uni.$api.commonApi.findSoureList(); let { moduleList, toolList } = await uni.$api.systemApi.getMockData(true);
//
moduleList.map((e, index) => { moduleList.map((e, index) => {
if (index == 3) e.class = 'vertical' if (index == 3) e.class = 'vertical'
else if (index == 2) e.class = 'square' else if (index == 2) e.class = 'square'
...@@ -126,9 +133,14 @@ export default { ...@@ -126,9 +133,14 @@ export default {
6: 'display:none;' 6: 'display:none;'
}[index] }[index]
} }
e.showTitle = false
}); });
console.log(moduleList) console.log(moduleList)
this.moduleList = moduleList; this.moduleList = moduleList
this.toolList = toolList
},
errorImg (index) {
this.moduleList[index].showTitle = true
}, },
async start () { async start () {
const result = await this.$permision.requestAndroidPermission( const result = await this.$permision.requestAndroidPermission(
...@@ -234,8 +246,8 @@ export default { ...@@ -234,8 +246,8 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.module-box { .module-box {
padding-top: 44rpx; padding-top: 44rpx;
&::after{ &::after {
content: ''; content: "";
display: block; display: block;
clear: both; clear: both;
} }
...@@ -243,12 +255,19 @@ export default { ...@@ -243,12 +255,19 @@ export default {
float: left; float: left;
border-radius: 48rpx; border-radius: 48rpx;
overflow: hidden; overflow: hidden;
margin:0 48rpx 48rpx 0; margin: 0 48rpx 48rpx 0;
&-img { &-img {
width: 100%; width: 100%;
height: 100%; height: 100%;
vertical-align: top; vertical-align: top;
} }
&-text {
width: 100%;
height: 100%;
background: #999;
justify-content: center;
color: #fff;
}
} }
.landscape { .landscape {
height: 312rpx; height: 312rpx;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!