森蓝小程序
This commit is contained in:
286
pages/display/display.vue
Normal file
286
pages/display/display.vue
Normal file
@@ -0,0 +1,286 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="title" :style="{'top': uniMenuInfo.top + 6 + 'px'}">照片展示</view>
|
||||
<view class="back" @tap="goBack()" :style="{'top' : uniMenuInfo.top - 12 + 'px'}"></view>
|
||||
<view class="content" :style="{'top': uniMenuInfo.top + 50 + 'px'}" >
|
||||
<view v-if="wait">
|
||||
<view class="img_loading">
|
||||
<image src="https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/img_%E5%8A%A0%E8%BD%BD%402x.png" mode="aspectFit" class="img_1" />
|
||||
</view>
|
||||
<view class="loading">
|
||||
<text class="tip">请稍候,照片生成中...</text>
|
||||
<zero-loading type="atom" position="absolute"></zero-loading>
|
||||
</view>
|
||||
<!-- <view class="progressBar">
|
||||
<liu-progressbar :progress="jdt" color="#FFFFFF" :height="'25rpx'" :borderRadius="'40rpx'" />
|
||||
</view> -->
|
||||
<view class="wait_box">
|
||||
<text class="wait_1">当前第 {{waitIdx}} 位/共 {{waitTotal}} 位</text>
|
||||
<text class="wait_2">预计需要等候 {{waitTime}} 分钟</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_show" v-if="!wait">
|
||||
<image class="showImage" :src="showImage" mode="aspectFill" @tap="previewImage(showImage)"/>
|
||||
<view class="printTip" v-if="buyType == 2">{{ printScreenTip }}</view>
|
||||
<view class="upload-btn" @tap="saveImage()">保存到手机</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const getNowTime = require('../../utils/timeUtil/timeUtil.js')
|
||||
let pageNumber = 4;
|
||||
let startTime = '';
|
||||
let destroyTime = '';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
uniMenuInfo: {},
|
||||
wait: true,
|
||||
showImage: '',
|
||||
code: '',
|
||||
waitIdx: 0,
|
||||
waitTotal: 0,
|
||||
waitTime: 0,
|
||||
jdt: 0,
|
||||
templateId: 0,
|
||||
mchId: 0,
|
||||
downloading: false,
|
||||
buyType: 0,
|
||||
printCode: '',
|
||||
printScreenTip: ''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
var _this = this;
|
||||
uni.showLoading({
|
||||
title: '正在加载...',
|
||||
mask: true
|
||||
})
|
||||
this.uniMenuInfo = uni.getStorageSync('uniMenuInfo');
|
||||
this.code = option.code;
|
||||
this.templateId = Number(option.templateId);
|
||||
this.mchId = Number(option.mchId);
|
||||
this.buyType = Number(option.buyType);
|
||||
this.firstGetPhoto(_this.code);
|
||||
this.getPhoto(this.code);
|
||||
},
|
||||
onShow() {
|
||||
startTime = getNowTime();
|
||||
},
|
||||
onHide() {
|
||||
if(uni.getStorageSync('userInfo').id) {
|
||||
this.logRecord();
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
if(uni.getStorageSync('userInfo').id) {
|
||||
this.logRecord();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
logRecord() {
|
||||
var _this = this;
|
||||
destroyTime = getNowTime();
|
||||
let reqData = {
|
||||
"startTime": startTime,
|
||||
"destroyTime": destroyTime,
|
||||
"pageNumber": pageNumber,
|
||||
"qrcodeScenicId": uni.getStorageSync('scanQrcodeInfo').scenicId,
|
||||
"qrcodeMchId": uni.getStorageSync('scanQrcodeInfo').mchId,
|
||||
"qrcodeId": uni.getStorageSync('scanQrcodeInfo').qrcodeId,
|
||||
"userId": uni.getStorageSync('userInfo').id,
|
||||
"appType": 5,
|
||||
"photoId": _this.templateId,
|
||||
"mchId": _this.mchId,
|
||||
};
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/logRecord',
|
||||
method: 'POST',
|
||||
data: reqData,
|
||||
success(res) {}
|
||||
})
|
||||
},
|
||||
uploadImage () {
|
||||
var _this = this;
|
||||
uni.getImageInfo({
|
||||
src: _this.showImage,
|
||||
success: function(image) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: image.path,
|
||||
success: function() {
|
||||
uni.showToast({
|
||||
title: '照片保存成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
},
|
||||
complete: (env) => {
|
||||
uni.hideLoading()
|
||||
_this.downloading = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('err', err)
|
||||
uni.hideLoading()
|
||||
_this.downloading = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImage() {
|
||||
var _this = this;
|
||||
if(!_this.downloading) {
|
||||
_this.downloading = true;
|
||||
uni.showLoading({
|
||||
title: '请稍候',
|
||||
mark: true
|
||||
})
|
||||
wx.getSetting({
|
||||
success: (res) => {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
// 用户未授权,需要请求授权
|
||||
wx.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success: () => {
|
||||
// 用户已授权,可以进行保存图片操作
|
||||
console.log('已授权')
|
||||
_this.uploadImage();
|
||||
},
|
||||
fail: () => {
|
||||
// 用户拒绝授权,需要引导用户去设置页面手动授权
|
||||
uni.hideLoading()
|
||||
_this.downloading = false;
|
||||
wx.showModal({
|
||||
title: '需要保存图片权限',
|
||||
content: '请在设置中打开保存图片到相册权限',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 用户点击确定,跳转到设置页面
|
||||
wx.openSetting({
|
||||
success: (res) => {
|
||||
// 检查是否授权
|
||||
// if (res.authSetting['scope.writePhotosAlbum']) {
|
||||
// // 授权成功,可以进行保存图片操作
|
||||
// _this.uploadImage();
|
||||
// }
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
_this.uploadImage();
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err)
|
||||
uni.showToast({
|
||||
title: '获取设置失败'
|
||||
})
|
||||
uni.hideLoading()
|
||||
_this.downloading = false;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getPhoto(code) {
|
||||
var _this = this;
|
||||
// 获取照片制作状态
|
||||
var stateInterval = setInterval(function() {
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/getSingleTemplateSynthesisPhoto',
|
||||
method: 'POST',
|
||||
data: {
|
||||
"code": code,
|
||||
"mchId": _this.mchId,
|
||||
"print": _this.buyType
|
||||
},
|
||||
success(res) {
|
||||
console.log('res', res)
|
||||
if(res.data.code == 200) {
|
||||
let resData = res.data.data;
|
||||
_this.waitIdx = resData.waitIdx == -1?1:resData.waitIdx;
|
||||
_this.waitTotal = resData.waitTotal;
|
||||
_this.waitTime = resData.waitTotal * 1;
|
||||
console.log('url', resData.url)
|
||||
// 判断是否拿到照片路径
|
||||
if(resData.url) {
|
||||
clearInterval(stateInterval)
|
||||
let url = resData.url.replace(/\[|\]/g, "");
|
||||
_this.showImage = 'https://oss.humengfilms.com/' + url;
|
||||
// 判断是否有打印码
|
||||
if(resData.printCode != null) {
|
||||
_this.printCode = resData.printCode;
|
||||
let text = uni.getStorageSync('aiPhotoTemplate').printScreenTip;
|
||||
_this.printScreenTip = text.replace("*", resData.printCode);
|
||||
}
|
||||
pageNumber = 5;
|
||||
_this.wait = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 5000);
|
||||
},
|
||||
firstGetPhoto(code) {
|
||||
var _this = this;
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/getSingleTemplateSynthesisPhoto',
|
||||
method: 'POST',
|
||||
data: {
|
||||
"code": code
|
||||
},
|
||||
success(res) {
|
||||
console.log('res', res)
|
||||
if(res.data.code == 200) {
|
||||
let resData = res.data.data;
|
||||
_this.waitIdx = resData.waitIdx == -1?1:resData.waitIdx;
|
||||
_this.waitTotal = resData.waitTotal == 0?1:resData.waitTotal;
|
||||
_this.waitTime = resData.waitTotal * 1;
|
||||
if(res.data.url) {
|
||||
let url = res.data.data.replace(/\[|\]/g, "");
|
||||
_this.showImage = 'https://oss.humengfilms.com/' + url;
|
||||
_this.wait = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
previewImage(url) {
|
||||
// 预览图片
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
longPressActions: {
|
||||
itemList: ['发送给朋友', '保存图片', '收藏'],
|
||||
success: function(data) {
|
||||
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log(err.errMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/css/common.css';
|
||||
@import './index.css';
|
||||
</style>
|
||||
137
pages/display/index.css
Normal file
137
pages/display/index.css
Normal file
@@ -0,0 +1,137 @@
|
||||
.page {
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/bg_%E4%B8%BB%E8%83%8C%E6%99%AF%402x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.back {
|
||||
position: absolute;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
left: 0;
|
||||
background-image: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/humeng/vlog/lv2_icon_backBlack%402x.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
color: #454F63;
|
||||
z-index: 999;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.img_loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.img_1 {
|
||||
width: 300rpx;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.loading {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
.tip{
|
||||
text-align: center;
|
||||
font-family: '苹方';
|
||||
font-size:25rpx;
|
||||
color:#006d9f;
|
||||
animation: opp 2.7s infinite linear;
|
||||
}
|
||||
|
||||
@keyframes opp{
|
||||
0%{
|
||||
opacity: 1;
|
||||
}
|
||||
40%{
|
||||
opacity: 1;
|
||||
}
|
||||
60%{
|
||||
opacity: 0;
|
||||
}
|
||||
100%{
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.box_show {
|
||||
display: flex;
|
||||
/* justify-content: center; */
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
margin-top: 50rpx;
|
||||
height: 75vh;
|
||||
}
|
||||
|
||||
.showImage {
|
||||
border: #fff 1px solid;
|
||||
height: 60vh;
|
||||
width: 80%;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.printTip {
|
||||
width: 80%;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.upload-btn {
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/btn%403x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
width: 80%;
|
||||
margin-top: 20rpx;
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
font-size: 16px;
|
||||
font-family: 'Microsoft YaHei', 'Microsoft Yahei', Arial, sans-serif;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.wait_box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wait_1, .wait_2 {
|
||||
color: #505C73 ;
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
font-family: "Microsoft YaHei", sans-serif;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.progressBar {
|
||||
width: 80%;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
444
pages/home/home.vue
Normal file
444
pages/home/home.vue
Normal file
@@ -0,0 +1,444 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="title" :style="{'top': uniMenuInfo.top + 6 + 'px'}">{{ headline }}</view>
|
||||
<!-- <view class="back" v-if="!scanQRCodes" @tap="goBack()" :style="{'top' : uniMenuInfo.top - 12 + 'px'}"></view> -->
|
||||
<!-- 切换商户 -->
|
||||
<view class="root" v-if="!scanQRCodes" :style="{'top': uniMenuInfo.top + 40 + 'px'}">
|
||||
<ren-dropdown-filter ref="root" :filterData='filterData' :defaultIndex='defaultIndex'
|
||||
@onSelected='onSelected' @dateChange='dateChange'></ren-dropdown-filter>
|
||||
</view>
|
||||
<view class="box_1 flex-col" :style="{'top': uniMenuInfo.top + boxTop + 'px'}">
|
||||
<view class="box_3 flex-col" v-for="item1 in templateSet" :key="item1.id">
|
||||
<view class="text-wrapper_2 flex-row">
|
||||
<text class="text_4">{{item1.name}}</text>
|
||||
</view>
|
||||
<scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="false" :enhanced="true">
|
||||
<view id="demo1" class="scroll-view-item_H" @tap="shareToggle(item2, item1)" v-for="(item2, idx) in item1.templates" :key="item2.id">
|
||||
<image class="img_1" :src="item2.coverPicture" mode="aspectFill"></image>
|
||||
<view :class="item2.paymentType == 1? 'text-wrapper_5 flex-col':item2.paymentType == 2? 'text-wrapper_6 flex-col':'text-wrapper_3 flex-col'">
|
||||
<text class="text_5" >{{item2.paymentType == 1?'付费':item2.paymentType == 2?'已购':'限免'}}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_4 flex-col" >
|
||||
<text class="text_6">{{item2.templateName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 隐私授权弹窗 -->
|
||||
<zero-privacy ref="privacy" @agree='handleAgree' @disagree='handleDisagree'></zero-privacy>
|
||||
<!-- 底部导航 -->
|
||||
<view class="section_8 flex-row justify-between">
|
||||
<custom-tab-bar :selected="0" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const uploadFile= require('../../utils/uploadToAliOss/uploadAliyun.js');
|
||||
const getNowTime = require('../../utils/timeUtil/timeUtil.js')
|
||||
import CustomTabBar from "@/components/customTabBar/customTabBar.vue"
|
||||
import RenDropdownFilter from '@/components/ren-dropdown-filter/ren-dropdown-filter.vue'
|
||||
let pageNumber = 2;
|
||||
let startTime = '';
|
||||
let destroyTime = '';
|
||||
export default {
|
||||
components: {
|
||||
CustomTabBar,
|
||||
RenDropdownFilter
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uniMenuInfo: {},
|
||||
selectTemplateImg: '',
|
||||
templateSet: [],
|
||||
selectTemplateId: 0,
|
||||
headline: '森蓝富拉格',
|
||||
scanQRCodes: false,
|
||||
qrcodeId: 0,
|
||||
userInfo: {},
|
||||
init: true,
|
||||
filterData:[
|
||||
[
|
||||
{ text: '选择景区', value: 0, select: false}
|
||||
]
|
||||
],
|
||||
defaultIndex:[0],
|
||||
boxTop: 90
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(option)
|
||||
var _this = this;
|
||||
uni.showLoading({
|
||||
title: '正在加载...',
|
||||
mask: true
|
||||
});
|
||||
this.uniMenuInfo = uni.getMenuButtonBoundingClientRect();
|
||||
uni.setStorageSync('uniMenuInfo', this.uniMenuInfo);
|
||||
if (option.scene) {
|
||||
let data_arr = decodeURIComponent(option.scene).split('&');
|
||||
let _data = {};
|
||||
for (let i = 0; i < data_arr.length; i++) {
|
||||
let temp_arr = data_arr[i].split("=");
|
||||
_data[temp_arr[0]] = temp_arr[1]
|
||||
}
|
||||
_this.qrcodeId = Number(_data['qrcodeId']);
|
||||
_this.scanQRCodes = true;
|
||||
_this.boxTop = 40;
|
||||
}
|
||||
uni.removeStorageSync('mchId');
|
||||
if(_this.qrcodeId != 0) {
|
||||
_this.init = false;
|
||||
uni.removeStorageSync('userInfo');
|
||||
new Promise(function(resolve,reject) {
|
||||
_this.getQrcodeInfo(resolve, _this.qrcodeId);
|
||||
}).then(function() {
|
||||
_this.getPrivacySetting();
|
||||
})
|
||||
} else {
|
||||
_this.getMchList();
|
||||
_this.getPrivacySetting();
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
if(this.init && uni.getStorageSync('mchId')) {
|
||||
this.initialize();
|
||||
}
|
||||
startTime = getNowTime();
|
||||
},
|
||||
onHide() {
|
||||
if(uni.getStorageSync('userInfo').id) {
|
||||
this.logRecord();
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
if(uni.getStorageSync('userInfo').id) {
|
||||
this.logRecord();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getMchList() {
|
||||
var _this = this;
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/getMchList',
|
||||
method: 'POST',
|
||||
data: {
|
||||
appletType: 2
|
||||
},
|
||||
success(res) {
|
||||
console.log('商户列表', res.data.data)
|
||||
let mchList = res.data.data;
|
||||
_this.filterData = [
|
||||
[
|
||||
{ text: '选择景区', value: 0, select: false}
|
||||
]
|
||||
]
|
||||
mchList.forEach((el)=>{
|
||||
_this.filterData[0].push({
|
||||
text: el.mchName,
|
||||
value: el.id,
|
||||
select: false
|
||||
})
|
||||
})
|
||||
_this.$refs.root.updateFilterData(_this.filterData);
|
||||
}
|
||||
})
|
||||
},
|
||||
onSelected(res){
|
||||
console.log(res[0][0].value)
|
||||
uni.setStorageSync('mchId', res[0][0].value)
|
||||
if(res[0][0].value == 0) {
|
||||
this.headline = '森蓝富拉格'
|
||||
} else {
|
||||
this.headline = res[0][0].text
|
||||
}
|
||||
this.initialize()
|
||||
},
|
||||
dateChange(d){
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
title:d
|
||||
})
|
||||
},
|
||||
logRecord() {
|
||||
var _this = this;
|
||||
destroyTime = getNowTime();
|
||||
let reqData = {
|
||||
"startTime": startTime,
|
||||
"destroyTime": destroyTime,
|
||||
"pageNumber": pageNumber,
|
||||
"qrcodeScenicId": uni.getStorageSync('scanQrcodeInfo').scenicId,
|
||||
"qrcodeMchId": uni.getStorageSync('scanQrcodeInfo').mchId,
|
||||
"qrcodeId": uni.getStorageSync('scanQrcodeInfo').qrcodeId,
|
||||
"userId": uni.getStorageSync('userInfo').id,
|
||||
"appType": 5,
|
||||
"mchId": uni.getStorageSync('scanQrcodeInfo').mchId
|
||||
};
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/logRecord',
|
||||
method: 'POST',
|
||||
data: reqData,
|
||||
success(res) {}
|
||||
})
|
||||
},
|
||||
handleDisagree() {
|
||||
console.log('拒绝隐私授权');
|
||||
var _this = this;
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '拒绝授权部分功能将无法使用,是否退出小程序',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
wx.exitMiniProgram({
|
||||
success: (res) => {
|
||||
console.log('退出小程序', res)
|
||||
}})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
_this.getPrivacySetting();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleAgree() {
|
||||
console.log('同意隐私授权');
|
||||
var _this = this;
|
||||
uni.showLoading({
|
||||
title: '正在加载...',
|
||||
mask: true
|
||||
});
|
||||
_this.getUserInfo();
|
||||
},
|
||||
getQrcodeInfo(resolve, qrcodeId) {
|
||||
var _this = this;
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/getQrcodeInfo',
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: qrcodeId
|
||||
},
|
||||
success(res) {
|
||||
if(res.data.data) {
|
||||
let mchId = res.data.data.mchId;
|
||||
_this.headline = res.data.data.mchName;
|
||||
uni.setStorageSync('mchId', mchId);
|
||||
let scanQrcodeInfo = {
|
||||
qrcodeId: qrcodeId,
|
||||
mchId: mchId,
|
||||
scenicId: 0
|
||||
}
|
||||
uni.setStorageSync('scanQrcodeInfo', scanQrcodeInfo)
|
||||
resolve('ok')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserInfo() {
|
||||
var _this = this;
|
||||
uni.getUserInfo({
|
||||
desc: '用于完善会员资料',
|
||||
lang: 'zh_CN',
|
||||
success: (user) => {
|
||||
// >>当用户同意授权后, 获取到用户信息user
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: loginRes => {
|
||||
let userInfo = JSON.parse(user.rawData);
|
||||
userInfo.code = loginRes.code;
|
||||
userInfo.appletType = 2;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
userInfo.model = res.model
|
||||
userInfo.edition = res.version
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/codeGetUserInfo',
|
||||
method: "POST",
|
||||
data: userInfo,
|
||||
success(res) {
|
||||
if(res.data.code == 200) {
|
||||
userInfo = res.data.data;
|
||||
_this.userInfo = userInfo;
|
||||
uni.setStorageSync('userInfo', userInfo);
|
||||
if(uni.getStorageSync('mchId')) {
|
||||
_this.initialize();
|
||||
}
|
||||
}
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
getPrivacySetting() {
|
||||
var _this = this;
|
||||
wx.getPrivacySetting({
|
||||
success: res => {
|
||||
console.log(res)
|
||||
if (res.needAuthorization) {
|
||||
// 需要弹出隐私协议
|
||||
console.log('需要弹出隐私协议', res)
|
||||
_this.$refs.privacy.open(res.privacyContractName);
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
_this.getUserInfo();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getToday() {
|
||||
var now = new Date();
|
||||
var year = now.getFullYear();
|
||||
var month = now.getMonth() + 1;
|
||||
var day = now.getDate();
|
||||
month = month.toString().padStart(2, '0');
|
||||
day = day.toString().padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
syntheticImage(url) {
|
||||
var _this = this;
|
||||
let dir = 'smartcamera/' + _this.getToday() + '/';
|
||||
var match = url[0].match(/\.([^.]+)$/);
|
||||
let promise = Promise.all(
|
||||
url.map((tempFilePath, index) => {
|
||||
return new Promise(function(resolve, reject) {
|
||||
uploadFile({
|
||||
filePath: tempFilePath,
|
||||
dir: dir,
|
||||
type: match[0],
|
||||
success: function(res) {
|
||||
// console.log('上传成功---', res);
|
||||
resolve(res);
|
||||
},
|
||||
fail: function(res) {
|
||||
// console.log('上传失败---', res);
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '上传失败,请重试!',
|
||||
icon: 'none',
|
||||
duration: 4000
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
).then((res) => {
|
||||
let code = _this.generateCode(32);
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/synthesisAiPhoto',
|
||||
method: 'POST',
|
||||
data: {
|
||||
'code': code,
|
||||
'templateId': _this.selectTemplateId,
|
||||
'photo': res[0],
|
||||
'userId': uni.getStorageSync('userInfo').id
|
||||
},
|
||||
success: (res) => {
|
||||
console.log('aiphotoRes', res)
|
||||
if(res.data.code == 200) {
|
||||
uni.hideLoading();
|
||||
_this.$refs.popup.close();
|
||||
uni.navigateTo({
|
||||
url: "../display/display?code=" + code
|
||||
})
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.log('err', err)
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
generateCode(length) {
|
||||
let code = '';
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const charactersLength = characters.length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
code += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return code;
|
||||
},
|
||||
initialize() {
|
||||
uni.showLoading({
|
||||
title: '正在加载...',
|
||||
mask: true
|
||||
});
|
||||
var _this = this;
|
||||
_this.init = true;
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/getTemplateSetList',
|
||||
method: 'POST',
|
||||
data: {
|
||||
mchId: uni.getStorageSync('mchId'),
|
||||
userId: uni.getStorageSync('userInfo').id
|
||||
},
|
||||
success(res) {
|
||||
console.log('getTemplateSetAll', res)
|
||||
if(res.data.code == 200) {
|
||||
_this.templateSet = res.data.data;
|
||||
uni.setStorageSync('templateSets', _this.templateSet);
|
||||
setTimeout(()=> {
|
||||
uni.hideLoading();
|
||||
}, 500)
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.log('error', err)
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
selectImage(data) {
|
||||
var _this = this;
|
||||
let img = data.item;
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '是否开始制作',
|
||||
confirmColor: '#6b99fb',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
});
|
||||
_this.syntheticImage(img);
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
scroll(e) {
|
||||
// console.log(e)
|
||||
},
|
||||
shareToggle(template, templateSet) {
|
||||
uni.navigateTo({
|
||||
url: '../selectPhoto/selectPhoto?templateId=' + template.id + '&templateSetId=' + templateSet.id
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import '@/css/common.css';
|
||||
@import './index.css';
|
||||
</style>
|
||||
172
pages/home/index.css
Normal file
172
pages/home/index.css
Normal file
@@ -0,0 +1,172 @@
|
||||
.page {
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/bg_%E4%B8%BB%E8%83%8C%E6%99%AF%402x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.back {
|
||||
position: absolute;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
left: 0;
|
||||
background-image: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/humeng/vlog/lv2_icon_backBlack%402x.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
color: #454F63;
|
||||
z-index: 999;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.root {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.box_1 {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-bottom: 30%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.box_3 {
|
||||
padding: 20rpx 0 10rpx 24rpx;
|
||||
}
|
||||
|
||||
.text-wrapper_2 {
|
||||
margin: 10rpx 10rpx 0 0;
|
||||
}
|
||||
|
||||
.text_4 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(38, 47, 64, 1);
|
||||
font-size: 32rpx;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 900;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.text-wrapper_3 {
|
||||
position: absolute;
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/img_%E5%85%8D%E8%B4%B9%402x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
margin-left: 168rpx;
|
||||
padding: 8rpx 12rpx 8rpx 24rpx;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.text-wrapper_5 {
|
||||
position: absolute;
|
||||
background: url(https://res.oss.humengfilms.com/hm_aigc/applet/img_%E4%BB%98%E8%B4%B9%402x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
margin-left: 168rpx;
|
||||
padding: 8rpx 12rpx 8rpx 24rpx;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.text-wrapper_6 {
|
||||
position: absolute;
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/img_%E5%B7%B2%E8%B4%AD%402x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
margin-left: 168rpx;
|
||||
padding: 8rpx 12rpx 8rpx 24rpx;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.text_5 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
font-size: 24rpx;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 24rpx;
|
||||
}
|
||||
|
||||
.text-wrapper_4 {
|
||||
position: absolute;
|
||||
bottom: 5rpx;
|
||||
background-size: 100% 100%;
|
||||
/* margin-top: 208rpx; */
|
||||
/* padding: 40rpx 144rpx 24rpx 24rpx; */
|
||||
height: 40rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.text_6 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
font-size: 28rpx;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
line-height: 40rpx;
|
||||
width: 95%;
|
||||
overflow: hidden;
|
||||
/* margin-left: 5%; */
|
||||
}
|
||||
|
||||
.img_1 {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 11px;
|
||||
}
|
||||
|
||||
.scroll-view_H {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
margin-top: 25rpx;
|
||||
}
|
||||
|
||||
.scroll-view-item_H {
|
||||
display: inline-block;
|
||||
width: 249rpx;
|
||||
height: 330rpx;
|
||||
line-height: 300rpx;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
margin-right: 20px;
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.section_8 {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 130rpx;
|
||||
background: #ffffff
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 14px 72px 4px 72px;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.box_3:last-child {
|
||||
margin-bottom: 220rpx;
|
||||
}
|
||||
173
pages/mine/index.css
Normal file
173
pages/mine/index.css
Normal file
@@ -0,0 +1,173 @@
|
||||
.page {
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center; /* 垂直居中 */
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/bg_%E4%B8%BB%E8%83%8C%E6%99%AF%402x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
color: #454F63;
|
||||
z-index: 999;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.section_8 {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 130rpx;
|
||||
background: #ffffff
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 14px 72px 4px 72px;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.box_1 {
|
||||
position: relative;
|
||||
border-radius: 40rpx 40rpx 0 0;
|
||||
width: 85%;
|
||||
height: 240rpx;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(to bottom, rgba(42, 156, 249, 0.6) 10%, rgba(42, 156, 249, 0.5) 30%, rgba(42, 156, 249, 0.4) 60%);
|
||||
display: block;
|
||||
align-items: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.head-img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
left: 40rpx;
|
||||
top: 50rpx;
|
||||
}
|
||||
|
||||
.nickname {
|
||||
position: absolute;
|
||||
left: 180rpx;
|
||||
top: 80rpx;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #30334B;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.box_2 {
|
||||
position: relative;
|
||||
background-color: #ffffff;
|
||||
/* height: 530rpx; */
|
||||
width: 85%;
|
||||
border-radius: 40rpx;
|
||||
margin-top: -40rpx;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.orders{
|
||||
width: 90%;
|
||||
height: 100rpx;
|
||||
border-bottom: 1px solid rgba(192, 196, 202, 0.3);
|
||||
position: relative;
|
||||
left: 5%;
|
||||
}
|
||||
|
||||
.orders-name{
|
||||
text-align: left;
|
||||
line-height: 100rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: #333333;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.coupons {
|
||||
width: 90%;
|
||||
height: 100rpx;
|
||||
border-bottom: 1px solid rgba(192, 196, 202, 0.3);
|
||||
position: relative;
|
||||
left: 5%;
|
||||
}
|
||||
|
||||
.coupons-name {
|
||||
text-align: left;
|
||||
line-height: 100rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: #333333;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.yjfk {
|
||||
width: 90%;
|
||||
height: 100rpx;
|
||||
position: relative;
|
||||
left: 5%;
|
||||
border-bottom: 1px solid rgba(192, 196, 202, 0.3);;
|
||||
}
|
||||
|
||||
.yjfk-name {
|
||||
text-align: left;
|
||||
line-height: 100rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: #333333;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.kfhh::after{
|
||||
background:none;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.kfhh {
|
||||
width: 90%;
|
||||
height: 100rpx;
|
||||
position: relative;
|
||||
left: 5%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background:none;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.kfhh-name {
|
||||
text-align: left;
|
||||
line-height: 100rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: #333333;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.coupons-icon,.yjfk-icon,.kfhh-icon,.myOrders-icon {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
width: 30rpx;
|
||||
top: 34rpx;
|
||||
height: 30rpx;
|
||||
background-image: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/humeng/vlog/ly_icon_listNext%402x.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
181
pages/mine/mine.vue
Normal file
181
pages/mine/mine.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="title" :style="{'top': uniMenuInfo.top + 6 + 'px'}">个人中心</view>
|
||||
<view class="content" :style="{'top' : uniMenuInfo.top + 60 + 'px'}">
|
||||
<view class="box_1">
|
||||
<view>
|
||||
<image class="head-img" src="/static/center/user_img2.png"></image>
|
||||
<view class="nickname">
|
||||
<text>用户编号: {{ userNumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_2">
|
||||
<view class="orders" @tap="menuClick(1)">
|
||||
<view class="orders-name">我的写真</view>
|
||||
<view class="myOrders-icon"></view>
|
||||
</view>
|
||||
<view class="yjfk" @tap="menuClick(3)">
|
||||
<view class="yjfk-name">意见反馈</view>
|
||||
<view class="yjfk-icon"></view>
|
||||
</view>
|
||||
<button class="kfhh" open-type="contact">
|
||||
<view class="kfhh-name">联系微信客服</view>
|
||||
<view class="kfhh-icon"></view>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section_8 flex-row justify-between">
|
||||
<custom-tab-bar :selected="1" />
|
||||
</view>
|
||||
<!-- 隐私授权弹窗 -->
|
||||
<zero-privacy ref="privacy" @agree='handleAgree' @disagree='handleDisagree'></zero-privacy>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CustomTabBar from "@/components/customTabBar/customTabBar.vue"
|
||||
export default {
|
||||
components: {
|
||||
CustomTabBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uniMenuInfo: {},
|
||||
userNumber: '',
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
var _this = this;
|
||||
uni.getUserInfo({
|
||||
desc: '用于完善会员资料',
|
||||
lang: 'zh_CN',
|
||||
success: (user) => {
|
||||
// >>当用户同意授权后, 获取到用户信息user
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: loginRes => {
|
||||
let userInfo = JSON.parse(user.rawData);
|
||||
userInfo.code = loginRes.code;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
userInfo.model = res.model
|
||||
userInfo.edition = res.version
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/codeGetUserInfo',
|
||||
method: "POST",
|
||||
data: userInfo,
|
||||
success(res) {
|
||||
if(res.data.code == 200) {
|
||||
userInfo = res.data.data;
|
||||
_this.userInfo = userInfo;
|
||||
_this.userNumber = _this.userInfo.openId.slice(-6);
|
||||
uni.setStorageSync('userInfo', userInfo);
|
||||
}
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDisagree() {
|
||||
console.log('拒绝隐私授权');
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '拒绝授权部分功能将无法使用,是否退出小程序',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
wx.exitMiniProgram({
|
||||
success: (res) => {
|
||||
console.log('退出小程序', res)
|
||||
}})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
uni.switchTab({
|
||||
url: '../home/home'
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleAgree() {
|
||||
var _this = this;
|
||||
uni.showLoading({
|
||||
title: '正在加载...',
|
||||
mask: true
|
||||
});
|
||||
_this.getUserInfo();
|
||||
},
|
||||
getPrivacySetting() {
|
||||
var _this = this;
|
||||
wx.getPrivacySetting({
|
||||
success: res => {
|
||||
if (res.needAuthorization) {
|
||||
_this.$refs.privacy.open(res.privacyContractName);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
menuClick(e){
|
||||
console.log(e);
|
||||
if(e == 1) {
|
||||
uni.navigateTo({
|
||||
url: '../myPhoto/myPhoto'
|
||||
})
|
||||
} else if(e ==2) {
|
||||
uni.navigateTo({
|
||||
url: '../myVideo/myVideo'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '该功能正在完善中!',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
},
|
||||
goHome() {
|
||||
uni.navigateTo({
|
||||
url: '../home/home'
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
var _this = this;
|
||||
if (typeof this.$mp.page.getTabBar === 'function' && this.$mp.page.getTabBar()) {
|
||||
this.$mp.page.getTabBar().setData({
|
||||
selected: 1
|
||||
})
|
||||
}
|
||||
if(!uni.getStorageSync('userInfo')) {
|
||||
_this.getPrivacySetting();
|
||||
} else {
|
||||
_this.userInfo = uni.getStorageSync('userInfo');
|
||||
_this.userNumber = _this.userInfo.openId.slice(-6);
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
var _this = this;
|
||||
_this.uniMenuInfo = uni.getStorageSync('uniMenuInfo');
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/css/common.css';
|
||||
@import './index.css';
|
||||
</style>
|
||||
62
pages/myPhoto/index.css
Normal file
62
pages/myPhoto/index.css
Normal file
@@ -0,0 +1,62 @@
|
||||
.page {
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
/* justify-content: center; */
|
||||
align-items: center;
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/bg_%E4%B8%BB%E8%83%8C%E6%99%AF%402x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
color: #454F63;
|
||||
z-index: 999;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.back {
|
||||
position: absolute;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
left: 0;
|
||||
background-image: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/humeng/vlog/lv2_icon_backBlack%402x.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
overflow-y: scroll;
|
||||
position: absolute;
|
||||
bottom: 93px;
|
||||
width: 100vw;
|
||||
align-content: baseline;
|
||||
}
|
||||
|
||||
.img {
|
||||
position: relative;
|
||||
width: 45%;
|
||||
left: calc((100vw - 96%)/2);
|
||||
height: 420rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.02);
|
||||
margin: 20rpx 10rpx 0 10rpx;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.center :last-child {
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
72
pages/myPhoto/myPhoto.vue
Normal file
72
pages/myPhoto/myPhoto.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="title" :style="{'top': uniMenuInfo.top + 6 + 'px'}">我的写真</view>
|
||||
<view class="back" @tap="goBack()" :style="{'top' : uniMenuInfo.top - 12 + 'px'}"></view>
|
||||
<view class="center" v-if="uniMenuInfo.bottom"
|
||||
:style="{'height': 'calc(100vh - ' + (uniMenuInfo.bottom + 10) + 'px)', 'top': uniMenuInfo.top + 35 + 'px'}">
|
||||
<view class="img" v-for="(item, idx) in imgUrlList" @tap="previewImage(item.aiPhoto)" :key="item.id">
|
||||
<image :src="item.aiPhoto+'?x-oss-process=image/resize,m_lfit,h_800,w_800'" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
uniMenuInfo: {},
|
||||
imgUrlList: [],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.showLoading({
|
||||
title: '正在加载...',
|
||||
mask: true
|
||||
});
|
||||
this.uniMenuInfo = uni.getStorageSync('uniMenuInfo');
|
||||
this.initializeLoading();
|
||||
},
|
||||
methods: {
|
||||
previewImage(url) {
|
||||
let previewImageList = [];
|
||||
previewImageList.push(url);
|
||||
uni.previewImage({
|
||||
urls: previewImageList,
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
initializeLoading() {
|
||||
var _this = this;
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/getMyAiPhoto',
|
||||
method: 'POST',
|
||||
data: {
|
||||
userId: uni.getStorageSync('userInfo').id
|
||||
},
|
||||
success(res) {
|
||||
console.log('用户生成ai照片', res)
|
||||
if(res.data.code == 200) {
|
||||
_this.imgUrlList = res.data.data;
|
||||
_this.imgUrlList.forEach((el, idx)=> {
|
||||
el.aiPhoto = 'https://oss.humengfilms.com/' + el.aiPhoto
|
||||
})
|
||||
}
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import url("@/pages/myPhoto/index.css");
|
||||
@import url("@/css/common.css");
|
||||
</style>
|
||||
119
pages/selectPhoto/index.css
Normal file
119
pages/selectPhoto/index.css
Normal file
@@ -0,0 +1,119 @@
|
||||
.page {
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/bg_%E4%B8%BB%E8%83%8C%E6%99%AF%402x.png) 100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.back {
|
||||
position: absolute;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
left: 0;
|
||||
background-image: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/humeng/vlog/lv2_icon_backBlack%402x.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
color: #454F63;
|
||||
z-index: 999;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
height: 95%;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.img_1 {
|
||||
height: 55%;
|
||||
width: 80%;
|
||||
margin-top: 40rpx;
|
||||
border-radius: 11px;
|
||||
}
|
||||
|
||||
.tries-limit {
|
||||
margin-top: 20rpx;
|
||||
font-size: 18px;
|
||||
color: rgba(134, 137, 139, 0.8);
|
||||
}
|
||||
|
||||
.section_11 {
|
||||
align-self: center;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
.section_8 {
|
||||
background-color: rgba(244, 249, 253, 1);
|
||||
border-radius: 10px;
|
||||
padding: 12px 30px 12px 32px;
|
||||
margin-right: 20rpx;
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.image-text_7 {}
|
||||
|
||||
.label_1 {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: 0 23px 0 21px;
|
||||
}
|
||||
|
||||
.text-group_3 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(80, 92, 115, 1);
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 14px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.section_9 {
|
||||
background-color: rgba(244, 249, 253, 1);
|
||||
border-radius: 10px;
|
||||
padding: 17px 45px 12px 45px;
|
||||
margin-left: 20rpx;
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.image-text_8 {}
|
||||
|
||||
.label_2 {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.text-group_4 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(80, 92, 115, 1);
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 14px;
|
||||
margin-top: 17px;
|
||||
}
|
||||
368
pages/selectPhoto/selectPhoto.vue
Normal file
368
pages/selectPhoto/selectPhoto.vue
Normal file
@@ -0,0 +1,368 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="title" :style="{'top': uniMenuInfo.top + 6 + 'px'}">{{template.templateName}}</view>
|
||||
<view class="back" @tap="goBack()" :style="{'top' : uniMenuInfo.top - 12 + 'px'}"></view>
|
||||
<view class="content" :style="{'top' : uniMenuInfo.top + 40 + 'px'}">
|
||||
<image class="img_1" mode="aspectFill" :src="template.coverPicture" />
|
||||
<view class="tries-limit" v-if="template.paymentType == 2 && residues != 0">
|
||||
此模板剩余使用次数: {{ residues }}
|
||||
</view>
|
||||
<view class="tries-limit" v-if="template.paymentType == 1">
|
||||
付费 {{ template.fee }} 元 体验{{ template.triesLimit }} 次
|
||||
</view>
|
||||
<view class="section_11 flex-row">
|
||||
<view class="section_8 flex-row" @tap="chooseImage('album')">
|
||||
<view class="image-text_7 flex-col">
|
||||
<image
|
||||
class="label_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/icon_%E6%8B%8D%E6%91%84%E7%85%A7%E7%89%87%402x.png"
|
||||
/>
|
||||
<text class="text-group_3">选择相册图片</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="section_9 flex-row" @tap="chooseImage('camera')">
|
||||
<view class="image-text_8 flex-col">
|
||||
<image
|
||||
class="label_2"
|
||||
referrerpolicy="no-referrer"
|
||||
src="https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/icon_%E7%9B%B8%E5%86%8C%E7%85%A7%E7%89%87%402x.png"
|
||||
/>
|
||||
<text class="text-group_4">拍摄照片</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 支付弹窗 -->
|
||||
<view>
|
||||
<uni-popup ref="share" type="share" safeArea backgroundColor="#fff">
|
||||
<uni-popup-pay ref="pay" @select="toPay"></uni-popup-pay>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const uploadFile= require('../../utils/uploadToAliOss/uploadAliyun.js');
|
||||
import { mul } from "@/utils/calculate/calculate.js"
|
||||
const getNowTime = require('../../utils/timeUtil/timeUtil.js')
|
||||
let pageNumber = 3;
|
||||
let startTime = '';
|
||||
let destroyTime = '';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
uniMenuInfo: {},
|
||||
templateSets: [],
|
||||
templateSet: {},
|
||||
template: {},
|
||||
residues: 0,
|
||||
imgs: '',
|
||||
templateId: '',
|
||||
payId: -1,
|
||||
buyType: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
logRecord() {
|
||||
var _this = this;
|
||||
destroyTime = getNowTime();
|
||||
let reqData = {
|
||||
"startTime": startTime,
|
||||
"destroyTime": destroyTime,
|
||||
"pageNumber": pageNumber,
|
||||
"qrcodeScenicId": uni.getStorageSync('scanQrcodeInfo').scenicId,
|
||||
"qrcodeMchId": uni.getStorageSync('scanQrcodeInfo').mchId,
|
||||
"qrcodeId": uni.getStorageSync('scanQrcodeInfo').qrcodeId,
|
||||
"userId": uni.getStorageSync('userInfo').id,
|
||||
"appType": 5,
|
||||
"photoId": _this.template.id,
|
||||
"mchId": _this.template.mchId,
|
||||
};
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/logRecord',
|
||||
method: 'POST',
|
||||
data: reqData,
|
||||
success(res) {}
|
||||
})
|
||||
},
|
||||
getPayment() {
|
||||
var _this = this;
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/getUserIsPay',
|
||||
method: 'POST',
|
||||
data: {
|
||||
user_id: uni.getStorageSync('userInfo').id,
|
||||
template_id: _this.templateId
|
||||
},
|
||||
success(res) {
|
||||
console.log('res', res)
|
||||
if(res.data.data.code == 200) {
|
||||
_this.residues = res.data.data.residualUse;
|
||||
_this.payId = res.data.data.payId;
|
||||
if(_this.residues <= 0 && _this.template.paymentType == 2) {
|
||||
_this.template.paymentType = 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
toPay(e) {
|
||||
uni.showLoading({
|
||||
title: '请稍候',
|
||||
mask: true
|
||||
})
|
||||
var _this = this;
|
||||
console.log('支付类型', e)
|
||||
_this.buyType = e;
|
||||
let totalFee = e == 2?mul(_this.template.printFee,100):mul(_this.template.fee,100);
|
||||
let triesLimit = e == 2?1:_this.template.triesLimit;
|
||||
if(totalFee == 0) {
|
||||
_this.syntheticImage(_this.imgs);
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
open_id: uni.getStorageSync('userInfo').openId,
|
||||
user_id: uni.getStorageSync('userInfo').id,
|
||||
total_fee: totalFee,
|
||||
merchant_id: _this.templateSet.mchId,
|
||||
template_id: _this.template.id,
|
||||
template_name: _this.template.templateName,
|
||||
payment_type: _this.template.paymentType,
|
||||
tries_limit: triesLimit
|
||||
};
|
||||
console.log('支付参数', data)
|
||||
if (e != 0) {
|
||||
console.log('data', data)
|
||||
uni.request({
|
||||
url: _this.pay_http_url + '/wxpay/pay',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
success: res => {
|
||||
console.log('pay request success', res);
|
||||
if (res.statusCode !== 200) {
|
||||
uni.showModal({
|
||||
content: '支付失败,请重试!',
|
||||
showCancel: false,
|
||||
success() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (res.data.code == 'pay') {
|
||||
console.log('res', res.data)
|
||||
let payId = res.data.order_id;
|
||||
uni.requestPayment({
|
||||
timeStamp: res.data.timeStamp,
|
||||
nonceStr: res.data.nonceStr,
|
||||
package: res.data.package,
|
||||
signType: 'MD5',
|
||||
paySign: res.data.paySign,
|
||||
success: res => {
|
||||
console.log('res', res)
|
||||
_this.payId = payId;
|
||||
_this.$refs.share.close();
|
||||
_this.template.paymentType = e!=2?2:1;
|
||||
_this.residues = _this.template.triesLimit;
|
||||
_this.syntheticImage(_this.imgs);
|
||||
},
|
||||
fail() {
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: "error",
|
||||
mask: true
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
generateCode(length) {
|
||||
let code = '';
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const charactersLength = characters.length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
code += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return code;
|
||||
},
|
||||
getToday() {
|
||||
var now = new Date();
|
||||
var year = now.getFullYear();
|
||||
var month = now.getMonth() + 1;
|
||||
var day = now.getDate();
|
||||
month = month.toString().padStart(2, '0');
|
||||
day = day.toString().padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
syntheticImage(url) {
|
||||
var _this = this;
|
||||
let dir = 'smartcamera/' + _this.getToday() + '/';
|
||||
var match = url[0].match(/\.([^.]+)$/);
|
||||
let promise = Promise.all(
|
||||
url.map((tempFilePath, index) => {
|
||||
return new Promise(function(resolve, reject) {
|
||||
uploadFile({
|
||||
filePath: tempFilePath,
|
||||
dir: dir,
|
||||
type: match[0],
|
||||
success: function(res) {
|
||||
// console.log('上传成功---', res);
|
||||
resolve(res);
|
||||
},
|
||||
fail: function(res) {
|
||||
// console.log('上传失败---', res);
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '上传失败,请重试!',
|
||||
icon: 'none',
|
||||
duration: 4000
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
).then((res) => {
|
||||
let code = _this.generateCode(24);
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/synthesisAiPhoto',
|
||||
method: 'POST',
|
||||
data: {
|
||||
'code': code,
|
||||
'templateId': _this.template.id,
|
||||
'photo': res[0],
|
||||
'userId': uni.getStorageSync('userInfo').id,
|
||||
'payId': _this.payId,
|
||||
'mchId': _this.templateSet.mchId,
|
||||
'buyType': _this.buyType,
|
||||
'appletType': 2
|
||||
},
|
||||
success: (res) => {
|
||||
console.log('aiphotoRes', res)
|
||||
if(res.data.code == 200) {
|
||||
uni.navigateTo({
|
||||
url: "../display/display?code=" + code + "&templateId=" + _this.template.id
|
||||
+ "&mchId=" + _this.template.mchId +"&buyType=" + _this.buyType,
|
||||
success() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '图片含有多个人脸或无人脸,请重新上传!',
|
||||
icon: 'none',
|
||||
duration: 5000
|
||||
})
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.log('err', err)
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
selectImage(img) {
|
||||
var _this = this;
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '是否开始制作',
|
||||
confirmColor: '#6b99fb',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
if((_this.template.paymentType == 1 || _this.template.paymentType == 2) && _this.residues <= 0) {
|
||||
_this.$refs.pay.setTemplate(_this.template);
|
||||
_this.$refs.share.open();
|
||||
_this.imgs = img;
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
});
|
||||
_this.syntheticImage(img);
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseImage(type) {
|
||||
var _this = this
|
||||
uni.chooseMedia({
|
||||
count: 1,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: [type],
|
||||
camera: 'front',
|
||||
success: function (res) {
|
||||
let img = [res.tempFiles[0].tempFilePath];
|
||||
_this.selectImage(img);
|
||||
}
|
||||
});
|
||||
},
|
||||
getTemplate(setId, templateId) {
|
||||
var _this = this;
|
||||
_this.templateSets.forEach((set, idx)=> {
|
||||
if(set.id == setId) {
|
||||
_this.templateSet = set;
|
||||
set.templates.forEach((tem, idx)=> {
|
||||
if(tem.id == templateId) {
|
||||
_this.template = tem;
|
||||
uni.setStorageSync('aiPhotoTemplate', tem)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
var _this = this;
|
||||
_this.uniMenuInfo = uni.getStorageSync('uniMenuInfo');
|
||||
_this.templateSets = uni.getStorageSync('templateSets');
|
||||
_this.templateId = option.templateId;
|
||||
_this.getTemplate(option.templateSetId, option.templateId);
|
||||
},
|
||||
onShow() {
|
||||
if(this.template.paymentType == 1 || this.template.paymentType == 2) {
|
||||
this.getPayment();
|
||||
}
|
||||
startTime = getNowTime();
|
||||
},
|
||||
onHide() {
|
||||
if(uni.getStorageSync('userInfo').id) {
|
||||
this.logRecord();
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
if(uni.getStorageSync('userInfo').id) {
|
||||
this.logRecord();
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import url("@/css/common.css");
|
||||
@import url("@/pages/selectPhoto/index.css");
|
||||
</style>
|
||||
Reference in New Issue
Block a user