Commit cdb8ed86 authored by 刘文虎's avatar 刘文虎

完善下载逻辑

parent 20742af6
Pipeline #3335 canceled with stages
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"configurations": [{ "configurations": [{
"app-plus" : "app-plus" :
{ {
"launchtype" : "local" "launchtype" : "remote"
}, },
"default" : "default" :
{ {
......
This diff is collapsed.
...@@ -115,8 +115,8 @@ export default { ...@@ -115,8 +115,8 @@ export default {
}); });
try { try {
await this.$store.dispatch('App_get_provider'); await this.$store.dispatch('App_get_provider');
let code=await wxLogin() // let code=await wxLogin()
let res = await this.$store.dispatch('Auto_login', {code}); let res = await this.$store.dispatch('Auto_login', {});
this.showToast('登录成功', true); this.showToast('登录成功', true);
setTimeout(() => { setTimeout(() => {
if (this.returnUrl) { if (this.returnUrl) {
...@@ -233,7 +233,7 @@ export default { ...@@ -233,7 +233,7 @@ export default {
position: relative; position: relative;
width: 100%; width: 100%;
height: 104upx; height: 104upx;
border-radius: 52upx; border-radius: 16upx;
line-height: 104upx; line-height: 104upx;
color: #ffffff; color: #ffffff;
font-size: 32upx; font-size: 32upx;
...@@ -255,10 +255,11 @@ export default { ...@@ -255,10 +255,11 @@ export default {
} }
} }
.apple { .apple {
background: #458eff; border-radius: 16upx;
box-shadow: 0px 12upx 24upx 0px rgba(69, 142, 255, 0.32); background: $default-color;
box-shadow: 0px 12upx 24upx 0px rgba(2, 160, 116, 0.32);
&:active { &:active {
background: #83afff; background: rgb(2, 175, 126);
} }
} }
} }
......
<template> <template>
<view class="file-list"> <view class="file-list">
<view class="file-list-title" v-if="list.length">
全部文件
</view>
<view class="file" v-for="(item, index) in list" :key="item.createTime" @click="previewFile(item)"> <view class="file" v-for="(item, index) in list" :key="item.createTime" @click="previewFile(item)">
<view class="file-info"> <view class="file-info">
<view class="file-name">{{ fileName }}</view> <view class="file-name">{{ fileName }}</view>
...@@ -104,16 +107,20 @@ export default { ...@@ -104,16 +107,20 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.file-list { .file-list {
margin-top: 32rpx; margin-top: 32rpx;
&-title{
line-height: 64rpx;
font-size: 24rpx;
color: #8d8d8d;
}
.file { .file {
margin-bottom: 24rpx; margin-bottom: 24rpx;
background-color: #fff; background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
display: flex; display: flex;
align-items: center; align-items: center;
height: 88rpx;
width: 100%; width: 100%;
font-size: 24rpx; font-size: 24rpx;
padding: 0 24rpx; padding: 24rpx;
&-info { &-info {
flex: 1; flex: 1;
height: 100%; height: 100%;
...@@ -124,7 +131,7 @@ export default { ...@@ -124,7 +131,7 @@ export default {
&-name { &-name {
} }
&-time { &-time {
margin-top: 10rpx; margin-top: 4rpx;
color: #8d8d8d; color: #8d8d8d;
} }
&-delete { &-delete {
......
<template> <template>
<view class="download"> <view class="download">
<view class="download-icon" @click="downloadFile"><image :src="downloadImg" /></view> <view class="download-icon" @click="downloadFile"><image :src="downloadImg" /></view>
<view class="download-content" v-if="platform==='4'"> <view class="download-content" v-if="platform === '4'">
<view class="download-content-item">1. 点击图标,下载模板文件;</view> <view class="download-content-item">1. 点击图标,下载模板文件;</view>
<view class="download-content-item" v-if="isIOS">2. 文件右上角,选择存储到"文件";</view> <view class="download-content-item" v-if="isIOS">2. 文件右上角,选择存储到"文件";</view>
<view class="download-content-item" v-else>2. 打开文件进行编辑;</view> <view class="download-content-item" v-else>2. 打开文件进行编辑;</view>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<script> <script>
import { mineBaseUrl } from '@/utils/config.js'; import { mineBaseUrl } from '@/utils/config.js';
import { downLoadFile, saveFile, appDowloadFile } from '@/utils/download.js'; import { downLoadFile, saveFile, appDownloadFile, clickDownload } from '@/utils/download.js';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
data() { data() {
...@@ -27,14 +27,15 @@ export default { ...@@ -27,14 +27,15 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(['platform','isIOS']) ...mapGetters(['platform', 'isIOS'])
}, },
methods: { methods: {
async downloadFile() { async downloadFile() {
try { try {
let res = null; let res = null;
if (this.platform === '4') { if (this.platform === '4') {
appDowloadFile({ // appDownloadFile();
clickDownload({
url: this.filePath, url: this.filePath,
filename: 'zhangdan' filename: 'zhangdan'
}); });
...@@ -69,11 +70,11 @@ export default { ...@@ -69,11 +70,11 @@ export default {
} }
}); });
}, },
copy(){ copy() {
uni.setClipboardData({ uni.setClipboardData({
data: this.filePath, data: this.filePath,
success: ()=> { success: () => {
this.showToast("已复制到剪贴板") this.showToast('已复制到剪贴板');
} }
}); });
} }
...@@ -99,7 +100,7 @@ export default { ...@@ -99,7 +100,7 @@ export default {
&-item { &-item {
margin-bottom: 24rpx; margin-bottom: 24rpx;
} }
.undeline{ .undeline {
text-decoration: underline; text-decoration: underline;
} }
} }
......
...@@ -167,6 +167,9 @@ const actions = { ...@@ -167,6 +167,9 @@ const actions = {
} }
try { try {
let code="" let code=""
if(params&&!params.account){
code=await wxLogin()
}
let info = { let info = {
...loginInfo, ...loginInfo,
authType: authType, authType: authType,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "uni-id",
"version": "3.3.28",
"description": "uni-id for uniCloud",
"main": "index.js",
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
"repository": {
"type": "git",
"url": "git+https://gitee.com/dcloud/uni-id.git"
},
"author": "",
"license": "Apache-2.0",
"dependencies": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment