| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- Page({
- data: {
- },
- onLoad: function () {
- wx.hideShareMenu();
- var that = this;
- that.setData({
- Containnerheight: main.getWindowHeight(),
- });
- },
- upload:function(){
- wx.chooseImage({
- count: 1,
- sizeType: ['original', 'compressed'],
- sourceType: ['album', 'camera'],
- success(res) {
- // tempFilePath可以作为img标签的src属性显示图片
- const tempFilePaths = res.tempFilePaths;
- var url = common.Encrypt("MiaoguoUploadFile");
- wx.uploadFile({
- url: app.globalData.serverUrlLocalhost +url, // 仅为示例,非真实的接口地址
- filePath: tempFilePaths[0],
- name: 'file',
- formData: {
- filename: 'test'
- },
- success(res) {
-
- }
- })
- }
- });
- },
- });
|