corala 3 년 전
부모
커밋
e9ee7f7af0
11개의 변경된 파일132개의 추가작업 그리고 26개의 파일을 삭제
  1. +14
    -1
      app.js
  2. +6
    -2
      app.json
  3. +0
    -3
      pages/AR/crsClient.js
  4. +3
    -14
      pages/AR/index.js
  5. +2
    -5
      pages/AR/index.wxml
  6. +1
    -1
      pages/index/index.wxss
  7. +99
    -0
      pages/middle/index.js
  8. +3
    -0
      pages/middle/index.json
  9. +3
    -0
      pages/middle/index.wxml
  10. +0
    -0
      pages/middle/index.wxss
  11. +1
    -0
      utils/umtrack-wx.js

+ 14
- 1
app.js 파일 보기

@@ -1,11 +1,24 @@
// app.js
import './utils/umtrack-wx';
// import "./components/umtrack-wx";
// require('umtrack-wx');
App({
umengConfig: {
appKey: '6260d691d024421570c69177', //由友盟分配的APP_KEY
// 使用Openid进行统计,此项为false时将使用友盟+uuid进行用户统计。
// 使用Openid来统计微信小程序的用户,会使统计的指标更为准确,对系统准确性要求高的应用推荐使用Openid。
useOpenid: true,
// 使用openid进行统计时,是否授权友盟自动获取Openid,
// 如若需要,请到友盟后台"设置管理-应用信息"(https://mp.umeng.com/setting/appset)中设置appId及secret
autoGetOpenid: false,
debug: true, //是否打开调试模式
uploadUserInfo: true // 自动上传用户信息,设为false取消上传,默认为false
},
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)

// 登录
wx.login({
success: res => {


+ 6
- 2
app.json 파일 보기

@@ -1,9 +1,10 @@
{
"pages": [
"pages/middle/index",
"pages/index/index",
"pages/rank/index",
"pages/out/index",
"pages/login/index",
"pages/rank/index",
"pages/AR/index",
"components/loading/loading"
],
@@ -15,5 +16,8 @@
},
"style": "v2",
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
"lazyCodeLoading": "requiredComponents",
"navigateToMiniProgramAppIdList": [
"wx889437c94c0bcc90"
]
}

+ 0
- 3
pages/AR/crsClient.js 파일 보기

@@ -3,13 +3,11 @@ export class CrsClient {
* @param config { {cloudKey: string, token: string, clientHost: string, jpegQuality: number} }
* @param canvas { HTMLCanvasElement }
*/

constructor(config, canvas) {
this.config = config;
this.canvas = canvas;
this.context = canvas.getContext('2d');
}
/**
* 发起一次CRS请求
* @param frame { {data: ArrayBuffer, height: number, width: number} } 相机帧
@@ -28,7 +26,6 @@ export class CrsClient {
this.context.putImageData(ctxImageData, 0, 0); //#1
let dataUrl = this.canvas.toDataURL("image/jpeg", this.config.quality); //#2
let base64 = dataUrl.substr(23); //#2 去除dataURL头,留下文件内容

const params = { //#3 添加cloudKey参数
image: base64,
notracking: "true",


+ 3
- 14
pages/AR/index.js 파일 보기

@@ -28,18 +28,16 @@ Page({
},
//识别到这个数组中的ID就触发内容
targetIds: [
"TODO 云识别管理 - 某个图库 - 识别图 - 某个识别图的ID",
"",
"79014ee9-60c7-4a0c-81ed-0d5889a7ecc9"
],
showLoading: false,
showLoadingText: "",
},

/** @type {CameraFrameListener} 相机帧回调 */
listener: undefined,
/** @type {HTMLCanvasElement} canvas对象 */
canvas: undefined,

/** @type {boolean} 是否需要持续识别,在点击“识别体验”之后和识别成功之前为true */
runningCrs: undefined,
/** @type {boolean} 当前是否正在进行CRS请求 */
@@ -50,8 +48,6 @@ Page({
last: undefined,

onLoad: function () {
let base64 ='aHR0cHM6Ly93d3cuYmFpZHUuY29tLw=='
},
onReady: function () {
if (systemInfo.platform === "devtools") { //开发工具不会触发initdone事件,于是在onReady手动触发
@@ -140,6 +136,7 @@ Page({
this.hideLoading();
let base64 = result.target.meta
let web = this.base64_decode(base64)
// 解析跳转链接
wx.navigateTo({
url: '../out/index?web=' + web + '&index=2',
})
@@ -202,7 +199,6 @@ Page({
});
},
queryToken: function() { // 获取token
let that = this
return new Promise((resolve, reject) => {
wx.request({
url: 'https://cktest.2weisou.com/meta/ar/ar/getToken',
@@ -212,14 +208,7 @@ Page({
'content-type': 'application/json'
},
success: res => resolve(res.data),
fail: err => reject(err),
// success: res => {
// that.data.config.token = res.data
// console.log(that.data.config.token);
// },
// fail: err =>{
// console.log(err,'失败');
// }
fail: err => reject(err)
});
});
},


+ 2
- 5
pages/AR/index.wxml 파일 보기

@@ -6,21 +6,18 @@
resolution="high"
flash="off"/>
<!-- canvas组件,用于进行图片压缩,位置在屏幕外,不可见 -->

<canvas type="2d"
id="capture"
style="width:1px; height: 1px;"/>

<view id="overlay" wx:if="{{showOverlay}}">
<!-- <view id="overlay" wx:if="{{showOverlay}}">
<view id="overlay-bottom">
<image id="scan" class="primary-button" src="https://static.quhouse.com/6f94c30051fb46cd9f03c886e63a34fc.png" bind:tap="scan"></image>
</view>
</view>
</view> -->
<view id="loading" wx:if="{{showLoading}}">
<image id="logoscan" src="https://static.quhouse.com/fecdef9ed6a045aaade3d48980e33a35.png"></image>
<loading text="{{showLoadingText}}"></loading>
</view>

<!-- <view id="content" wx:if="{{showContent}}">
<view wx:if="{{SELECT_TYPE.IMAGE === selectType}}">
<image src="/images/namecard.jpg" style="width: 500rpx; height: 300rpx;"></image>


+ 1
- 1
pages/index/index.wxss 파일 보기

@@ -1,6 +1,6 @@
/**index.wxss**/
.container{
background: url('https://static.quhouse.com/ded3b09063114cc0b87321c790f813d1.png') no-repeat;
background: url('https://static.quhouse.com/a182a4a222f84d6b9ea346908ddfcf76.png') no-repeat;
width: 750rpx;
height: 1624rpx;
background-size: 750rpx 1624rpx;


+ 99
- 0
pages/middle/index.js 파일 보기

@@ -0,0 +1,99 @@
// pages/out/index.js
Page({

/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// wx.navigateTo({
// url: '/pages/login/index'
// })
wx.showModal({
title: '温馨提示',
content: '确定进入该小程序吗',
showCancel: false,//是否显示取消按钮
// cancelText: "取消",//默认是“取消”
// cancelColor: '#000000',//取消文字的颜色
// confirmText: "确定",//默认是“确定”
// confirmColor: '#3cc51f',//确定文字的颜色
success: function (res) {
if (res.cancel) {
//点击取消,wx.navigateBack
} else {
// 使用wx.navigateToMiniProgram跳转到小程序
wx.navigateToMiniProgram({
appId: 'wx889437c94c0bcc90',
path: '/pages/WebView/shark?projcode=625e0e37e4b021f087a016c8.json&locMode=1011&userRisk=1&scrollTo=&activityId=204&channelId=SHYX',
extraData: {
},
envVersion: 'trial',
success(res) {
// 打开成功
}
})
}
},
fail: function (res) {
//接口调用失败的回调函数,wx.navigateBack
},
complete: function (res) {
//接口调用结束的回调函数(调用成功、失败都会执行)
},
})
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})

+ 3
- 0
pages/middle/index.json 파일 보기

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

+ 3
- 0
pages/middle/index.wxml 파일 보기

@@ -0,0 +1,3 @@
<view class="container">

</view>

+ 0
- 0
pages/middle/index.wxss 파일 보기


+ 1
- 0
utils/umtrack-wx.js
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


불러오는 중...
취소
저장