1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- "use strict";
- const app = getApp();
- Page({
- init: true,
- data: {
- selectVideo: [],
- showActionsheet: false,
- canIUseGetUserProfile: false,
- groups: [
- { text: '拍照', value: 1 },
- { text: '选择照片', value: 2 },
- ]
- },
- onLoad: function () {
- },
- onShow() {
- let p = {}
- let D = JSON.parse(wx.getStorageSync('generated') || "[]");
- if (D) {
- app.globalData.generate = D;
- p.selectVideo = D;
- }
- if (wx.getUserProfile)
- p.canIUseGetUserProfile = true
- this.setData(p);
- },
- tabsChange: function (id) {
- console.log("-->", id);
- },
- clickAdd: function () {
- this.init = false;
- this.setData({
- showActionsheet: true
- })
- },
- btnClick(e) {
- console.log("--------")
- let _this = this;
- let config = {
- count: 1,
- success: function () {
- _this.setData({
- showActionsheet: false
- }, () => {
- wx.showLoading({title:"人脸识别中..."})
- let time = setTimeout(() => {
- clearTimeout(time);
- wx.hideLoading()
- wx.navigateTo({
- url: "/pages/selectVideo/selectVideo"
- });
- }, Math.random() * 2000)
- })
- }
- }
- if (e.detail.value === 1) {
- config.sourceType = ['camera'];
- } else if (e.detail.value === 2) {
- config.sourceType = ['album'];
- }
- wx.chooseImage(config)
- }
- });
|