Browse Source

上传

master
前端-胡立永 7 months ago
parent
commit
f8522fcfd8
6 changed files with 13 additions and 17 deletions
  1. +1
    -1
      config.js
  2. +4
    -3
      pages_order/auth/wxLogin.vue
  3. BIN
      static/logo.png
  4. +3
    -9
      utils/oss-upload/oss/index.js
  5. +1
    -1
      utils/oss-upload/oss/web.js
  6. +4
    -3
      utils/position.js

+ 1
- 1
config.js View File

@ -23,7 +23,7 @@ const config = {
// 默认配置 // 默认配置
const defaultConfig = { const defaultConfig = {
// 生产环境地图XHJBZ-JNL3U-LOHVO-G5LSQ-SPQ4S-AWFN4 // 生产环境地图XHJBZ-JNL3U-LOHVO-G5LSQ-SPQ4S-AWFN4
mapKey : 'XHJBZ-JNL3U-LOHVO-G5LSQ-SPQ4S-AWFN4',
mapKey : 'XHJBZ-JNL3U-LOHVO-G5LSQ-SPQ4S-AWFN4',//已改成生产环境
aliOss : { aliOss : {
url : 'https://tennis-oss.xzaiyp.top/', url : 'https://tennis-oss.xzaiyp.top/',
config : { config : {


+ 4
- 3
pages_order/auth/wxLogin.vue View File

@ -1,7 +1,7 @@
<template> <template>
<view class="login"> <view class="login">
<view class="logo"> <view class="logo">
<!-- <image src="/static/image/login/logo.png" mode=""></image> -->
<image src="/static/logo.png" mode="aspectFill"></image>
</view> </view>
<view class="title"> <view class="title">
欢迎使用布周道 欢迎使用布周道
@ -94,8 +94,9 @@
background-color: #ddd; background-color: #ddd;
border-radius: 30rpx; border-radius: 30rpx;
image{ image{
width: 80rpx;
height: 80rpx;
width: 100%;
height: 100%;
border-radius: 30rpx;
} }
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }


BIN
static/logo.png View File

Before After
Width: 72  |  Height: 72  |  Size: 3.9 KiB Width: 132  |  Height: 132  |  Size: 41 KiB

+ 3
- 9
utils/oss-upload/oss/index.js View File

@ -3,9 +3,9 @@
*/ */
import OSSConfig from "@/utils/oss-upload/oss/OSSConfig.js" import OSSConfig from "@/utils/oss-upload/oss/OSSConfig.js"
//支持web端 //支持web端
import {
uploadFileToOSS
} from '@/utils/oss-upload/oss/web.js'
// import {
// uploadFileToOSS
// } from '@/utils/oss-upload/oss/web.js'
import ossConfig from '@/config.js' import ossConfig from '@/config.js'
/** /**
@ -93,9 +93,6 @@ export function ossUploadImage({
count: 1, count: 1,
sizeType, sizeType,
success(res) { success(res) {
// #ifdef H5
return uploadFileToOSS(res.tempFiles[0]).then(success).catch(fail)
// #endif
ossUpload(res.tempFilePaths[0], key, folder).then(success).catch(fail) ossUpload(res.tempFilePaths[0], key, folder).then(success).catch(fail)
}, },
fail fail
@ -123,9 +120,6 @@ export function ossUploadVideo({
maxDuration, maxDuration,
camera, camera,
success(res) { success(res) {
// #ifdef H5
return uploadFileToOSS(res.tempFile).then(success).catch(fail)
// #endif
ossUpload(res.tempFilePath, key, folder).then(success).catch(fail) ossUpload(res.tempFilePath, key, folder).then(success).catch(fail)
}, },
fail fail


+ 1
- 1
utils/oss-upload/oss/web.js View File

@ -1,5 +1,5 @@
// 此方法适用于web // 此方法适用于web
import OSS from "ali-oss"
// import OSS from "ali-oss"
import config from '@/config.js' import config from '@/config.js'
/** /**


+ 4
- 3
utils/position.js View File

@ -42,7 +42,8 @@ function getLocation(fn) { //获取用户经纬度
// }) // })
uni.getFuzzyLocation({ uni.getFuzzyLocation({
type: 'wgs84',
type: 'gcj02',
// type: 'wgs84',
success (res) { success (res) {
fn(res) fn(res)
} }
@ -149,8 +150,8 @@ function getUserAddressByIp(key) { //根据IP获取当前用户位置
//打开地图让用户选择位置 //打开地图让用户选择位置
function selectAddress(longitude, latitude, successCallback) { function selectAddress(longitude, latitude, successCallback) {
uni.chooseLocation({ uni.chooseLocation({
longitude, //经度
latitude, //纬度
// longitude, //经度
// latitude, //纬度
success: function(res) { success: function(res) {
successCallback && successCallback(res) successCallback && successCallback(res)
} }


Loading…
Cancel
Save