体验官修改

This commit is contained in:
2023-07-31 17:27:05 +08:00
parent a0399a8944
commit c41b852aaf
26 changed files with 1568 additions and 124 deletions

View File

@@ -86,6 +86,7 @@ Page({
uploadPhoto() {
wx.chooseMedia({
count : 1,
mediaType: ['image'],
sourceType: ['camera'],
camera : 'front',
success : path => {

View File

@@ -112,6 +112,7 @@ Page({
uploadPhoto() {
wx.chooseMedia({
count : 1,
mediaType: ['image'],
sourceType: ['camera'],
camera : 'front',
success : path => {

View File

@@ -1,10 +1,16 @@
// pages/recruit/index.js
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
userLogin : false,
barHeight : getApp().globalData.barHeight, // 状态栏高度
isOfficial : getApp().globalData.isOfficial, //公众号-场景值
recruitData : '',
type : 'flowPath', //flowPath 参与流程 clockIn 打卡

View File

@@ -414,15 +414,34 @@
</block>
<!-- 打卡 end -->
<!-- 关注漂浮窗 -->
<block wx:if="{{userLogin}}">
<view class="floating">
<navigator hover-class="none" url="/pages/recruit/poster/poster" class="shareFloat">
<image class="floating-img" src="https://cdn.shuiganying.com/images/2023/07/31/f9ff6ae69e773f265da11c6125017060.png" mode="widthFix"></image>
<view class="floating-name">分享体验官</view>
</navigator>
<view class="followFloat" bindtap="followHide" wx:if="{{!recruitData.is_subscribe}}">
<image class="floating-img" src="https://cdn.shuiganying.com/images/2023/07/14/43ab4bc418a12de6183e11d91cf3e518.png" mode="widthFix"></image>
<view class="floating-name">关注公众号</view>
</view>
</view>
</block>
<!-- 公众号弹出 -->
<view class="followPop {{followState ? 'active' : ''}}" catchtouchmove='true'></view>
<view class="followCont {{followState ? 'active' : ''}}" catchtouchmove='true'>
<view class="followText">
<view class="followOfficial" wx:if="{{isOfficial}}">
<official-account style="width:100%;height:168rpx;"></official-account>
<image class="weChat-close" src="/static/icons/uricacidClose.png" bindtap="tapGo" mode="widthFix"></image>
</view>
<view class="followText" wx:else>
<view class="weChat-title">关注公众号</view>
<image class="weChat-close" src="/static/icons/uricacidClose.png" bindtap="tapGo"></image>
<image class="weChat-img" src="{{recruitData.official_code}}" mode="widthFix"></image>
<image class="weChat-img" src="{{recruitData.official_code}}" mode="widthFix" show-menu-by-longpress="true"></image>
<view class="weChat-text"><text>请关注”水感应“公众号</text><text>以便收到活动通知</text></view>
<view class="weChat-tips"><text>请截图保存二维码识别关注</text></view>
<view class="weChat-tips"><text>请长按识别二维码关注公众号</text></view>
</view>
</view>
@@ -473,12 +492,4 @@
</view>
</form>
</view>
</view>
<!-- 关注漂浮窗 -->
<block wx:if="{{userLogin}}">
<view class="floating" bindtap="followHide" wx:if="{{!recruitData.is_subscribe}}">
<image class="floating-img" src="https://cdn.shuiganying.com/images/2023/07/14/43ab4bc418a12de6183e11d91cf3e518.png" mode="widthFix"></image>
<view class="floating-name">关注公众号</view>
</view>
</block>
</view>

View File

@@ -287,13 +287,36 @@
display: block;
}
.followOfficial {
position: relative;
left: 50%;
top: 50%;
width: 600rpx;
margin-left: -300rpx;
margin-top: -300rpx;
border-radius: 20rpx;
overflow: hidden;
background-color: #ffffff;
text-align: center;
padding: 80rpx 20rpx 20rpx;
box-sizing: border-box;
height: 260rpx;
}
.followOfficial-close {
position: absolute;
bottom: 0;
left: 0;
width: 40rpx;
}
.followText {
position: absolute;
left: 50%;
top: 50%;
width: 500rpx;
margin-left: -250rpx;
margin-top: -260rpx;
width: 600rpx;
margin-left: -300rpx;
margin-top: -300rpx;
border-radius: 20rpx;
overflow: hidden;
background-color: #ffffff;
@@ -919,18 +942,36 @@
/* 关注漂浮窗 */
.floating {
width: 100%;
position: fixed;
right: -4rpx;
bottom: 10%;
right: 0;
z-index: 9;
padding: 20rpx 15rpx;
text-align: right;
width: 70rpx;
}
.followFloat {
text-align: center;
border-radius: 20rpx 0 0 20rpx;
width: 40rpx;
padding: 20rpx 15rpx;
color: #c6501e;
font-weight: 600;
background-image: linear-gradient(to top, #feddc7, #feddc7);
border: 4rpx solid #ffffff;
border-radius: 20rpx 0 0 20rpx;
}
.shareFloat {
margin-bottom: 30rpx;
text-align: center;
width: 40rpx;
padding: 20rpx 15rpx;
color: #000000;
font-weight: 600;
background-image: linear-gradient(to top, #ffcf3b, #ffcf3b);
border: 4rpx solid #ffa749;
border-radius: 20rpx 0 0 20rpx;
}
.floating-img {

View File

@@ -0,0 +1,301 @@
Page({
/**
* 页面的初始数据
*/
data: {
shareSee: false, // 分享弹出
inviteCode: '', // 二维码
currentBgIndex: 0, // 轮播图数量
styleShow: false, // 是否展示图片查看并选择
styleType:'', // 二维码 切换 还是背景图
qrcodes:[], // 城市二维码数组
currentCodeIndex:0,//
//海报
loading : true,
codeType : 'city',
posterDatas : {}, // 定位
posterDatasLists: [],// 海报数据返回
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
wx.showLoading({
title: '请求中...',
})
},
// 切换城市
changeCity(){
this.setData({
styleType:'qcode',
styleShow:true
})
},
// 轮播图滚动
swiperChange(e) {
let index = e.detail.current
if(this.data.codeType == 'city'){
wx.setNavigationBarTitle({
title: `城市体验官(${this.data.posterDatasLists[index].name})`,
})
this.setData({
inviteCode:this.data.posterDatasLists[index].code
})
}
this.setData({
posterDatas: this.data.posterDatasLists[index],
currentBgIndex: index
})
this.initCanvas()
},
// 选择上面图切换轮播
selectBgIndex(e) {
let index = e.currentTarget.dataset.index
if (index != this.data.currentBgIndex) {
this.setData({
currentBgIndex: index
})
}
},
// 切换上面二维码图片
selectCodeIndex(e) {
let index = e.currentTarget.dataset.index
let qrcodes = this.data.qrcodes
if (index != this.data.currentCodeIndex) {
this.setData({
currentCodeIndex: index,
inviteCode: qrcodes[index].code
})
wx.setNavigationBarTitle({
title: `城市体验官(${qrcodes[index].name})`,
})
}
},
// 展示或者隐藏样式
changeStyle() {
this.setData({
styleShow: !this.data.styleShow,
styleType:''
})
},
onShow() {
this.ShareInfo();
},
//生成海报初始化
initCanvas() {
var that = this;
var posterDatas = that.data.posterDatas
const query = wx.createSelectorQuery()
query.select('#firstCanvas').fields({
node: true,
size: true
},
function (res) {
const canvas = res.node
const ctx = canvas.getContext('2d')
const dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = posterDatas.width * dpr
canvas.height = posterDatas.height * dpr
ctx.scale(dpr, dpr)
posterDatas.canvas = canvas
posterDatas.ctx = ctx
posterDatas.dpr = dpr
//存储
that.setData({
posterDatas
})
}).exec()
wx.hideLoading()
},
/**
* 小程序码
*/
ShareInfo() {
wx.$api.recruit.posters({
size: 200,
path: '/pages/recruit/index'
}).then(res2 => {
this.setData({
loading: false,
qrcodes:res2.data.qrcodes,
inviteCode: res2.data.qrcodes[0].code,
})
wx.setNavigationBarTitle({
title: `城市体验官(${res2.data.qrcodes[0].name})`,
})
wx.getSystemInfo({
success: (res) => {
let windowWidth = res.windowWidth // 当前设备宽
let windowHeight = res.windowHeight // 当前设备高
this.setData({
windowWidth: windowWidth,
windowHeight: windowHeight
})
let lists = [] //
let posters = res2.data.qrcodes
posters.map(item => {
item.position.newx = windowWidth / item.width * item.position.x.toFixed(2)
item.position.newy = windowHeight / item.height * item.position.y.toFixed(2)
item.position.newSize = windowWidth / item.width * item.position.size.toFixed(2)
item.show = true, // 显示隐藏海报弹窗
item.success = false, // 是否成功生成过海报
item.canvas = null, // 画布的节点
item.ctx = null, // 画布的上下文
item.dpr = 1, // 设备的像素比
lists.push(item)
})
this.setData({
posterDatasLists: lists,
posterDatas: lists[0]
})
// 数据处理完,初始化 canvas
this.initCanvas()
}
})
}).catch(err => {})
},
//海报生成 //画布 生成 海报[海报]
saveImg() {
var that = this;
var posterDatas = that.data.posterDatas
var canvas = posterDatas.canvas
var ctx = posterDatas.ctx
wx.showLoading({
title: '海报生成中',
mask: true
});
//二维码
var codeImg = new Promise(function (resolve, reject) {
const photo = canvas.createImage();
photo.src = that.data.inviteCode;
photo.onload = (e) => {
resolve(photo);
}
});
//背景素材
var backImg = new Promise(function (resolve, reject) {
const photo = canvas.createImage();
photo.src = posterDatas.cover;
photo.onload = (e) => {
resolve(photo);
}
});
Promise.all([codeImg, backImg]).then(res => {
// 绘制背景
ctx.drawImage(res[1], 0, 0, posterDatas.width, posterDatas.height);
// 绘制[二维码-白色背景]
ctx.fillStyle = "white";
ctx.fillRect(posterDatas.position.x + 10, posterDatas.position.y + 10, posterDatas.position.size, posterDatas.position.size);
ctx.fillRect(posterDatas.position.x + 10, posterDatas.position.y + 10, posterDatas.position.size, posterDatas.position.size);
// 绘制[二维码]
ctx.drawImage(res[0], posterDatas.position.x + 10, posterDatas.position.y + 10, posterDatas.position.size, posterDatas.position.size);
// 关闭loading
wx.hideLoading();
//显示海报
posterDatas.success = true;
that.setData({
posterDatas
})
this.onDownloadImges();
}).catch(err => {})
},
//下载图片[海报]
onDownloadImges() {
wx.showLoading({
title: '保存中',
mask: true
});
var that = this;
var posterDatas = that.data.posterDatas;
if (!posterDatas.pic) {
that.onCanvasBuildImges();
return;
}
//可写成函数调用 这里不做解释
wx.saveImageToPhotosAlbum({
filePath: posterDatas.pic,
success(res) {
wx.hideLoading();
wx.showToast({
icon: 'none',
title: '已保存到相册,快去分享吧',
})
that.setData({
posterDatas,
shareSee: !that.data.shareSee,
styleShow: false
})
},
fail() {
wx.hideLoading();
wx.showToast({
icon: 'none',
title: '进入设置页,开启“保存到相册”',
})
that.setData({
posterDatas,
styleShow: false
})
return;
}
})
},
//画布 转 图片[海报]
onCanvasBuildImges() {
var that = this;
var posterDatas = that.data.posterDatas;
wx.canvasToTempFilePath({
canvas: posterDatas.canvas,
width: posterDatas.width,
height: posterDatas.height,
destWidth: posterDatas.width * 3,
destHeight: posterDatas.height * 3,
success: res => {
posterDatas["pic"] = res.tempFilePath;
that.setData({
posterDatas
})
that.onDownloadImges();
},
fail() {
wx.hideLoading();
wx.showToast({
icon: 'none',
title: 'sorry 保存失败,请稍后再试.',
})
return;
}
});
},
/**
* 分享弹出
*/
shareTap() {
this.setData({
shareSee: !this.data.shareSee
})
}
})

View File

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

View File

@@ -0,0 +1,59 @@
<view class="changeBgFixed" bindtap="changeStyle">
{{codeType == 'city' && !styleShow ?'切换城市':styleShow ?'关闭切换':'切换背景'}}
</view>
<view class="changeBg" wx:if="{{styleShow}}">
<block wx:if="{{styleType == 'qcode'}}">
<view class="changeBgItem changeBgItem-qcode" wx:for="{{qrcodes}}" wx:key="*this" data-index='{{index}}' bindtap="selectCodeIndex">
<image class="changeCover changeCoverCode {{currentCodeIndex == index?'selected':''}}" src="{{item.code}}"/>
<span>{{item.name}}</span>
</view>
</block>
<block wx:else>
<view class="changeBgItem" wx:for="{{posterDatasLists}}" wx:key="*this" data-index='{{index}}' bindtap="selectBgIndex">
<image class="changeCover {{currentBgIndex == index?'selected':''}}" src="{{item.cover}}"/>
</view>
</block>
</view>
<swiper indicator-dots="{{true}}" class="swiper" bindchange='swiperChange' circular='{{true}}' current='{{currentBgIndex}}'>
<block wx:for="{{posterDatasLists}}" wx:key="index">
<swiper-item>
<view class="swiper-item">
<view class="code">
<image src="{{item.cover}}" class="code-back" />
<view class="code-cont" style="left: {{item.position.newx}}px;top: {{item.position.newy}}px;">
<view class="code-img">
<image class="code-image" style="width: {{item.position.newSize}}px;" src="{{inviteCode}}" mode="widthFix" />
</view>
</view>
<view class="code-share" bindtap="shareTap" wx:if="{{item.show}}">
<image src="https://cdn.shuiganying.com/images/2023/03/28/ee2911df7a5e3f9959d5d320cd966146.png" />
<view class="code-share-name">分 享</view>
</view>
</view>
</view>
</swiper-item>
</block>
</swiper>
<!-- 海报canvas -->
<canvas type="2d" id="firstCanvas" class="canvasImg" style="width:{{posterDatas.width}}px;height:{{posterDatas.height}}px;"></canvas>
<!-- 分享弹出 -->
<view class="sharePop {{shareSee ? 'active' : ''}}">
<view class="shareCont">
<view class="shareCont-label" bindtap="saveImg">
<image src="https://cdn.shuiganying.com/images/2023/03/28/cfe0efbb53eaf7911ea5211923859c65.png" />保存二维码
</view>
</view>
<view class="shareCancel" bindtap="shareTap">取消</view>
</view>
<view class="pack-center pages-hint pages-load" wx:if="{{loading}}">
<image src="/static/icons/loadingGif.gif"></image>
<view>数据加载中...</view>
</view>

View File

@@ -0,0 +1,199 @@
.code {
width: 100vw;
height: 100vh;
position: relative;
}
.code-back {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.code-cont {
position: absolute;
z-index: 9;
text-align: center;
}
.code-img{
margin: 0 auto 20rpx;
overflow: hidden;
/* width: 260rpx;
height: 260rpx; */
/* border: 4rpx solid #144592; */
padding: 10rpx;
box-sizing: border-box;
}
.code-img image{
background-color: #ffffff;
/* border: 4rpx solid #144592; */
/* border-radius: 50%; */
}
.code-img image {
width: 100%;
}
.code-text {
color: #144592;
font-size: 28rpx;
font-weight: 600;
}
.code-share {
position: absolute;
z-index: 10;
left: 0;
bottom: 13%;
background: linear-gradient(to right, rgb(1, 66, 104), rgba(5, 81, 126, 1));
width: 50rpx;
text-align: center;
border-radius: 0 26rpx 26rpx 0;
padding: 30rpx 15rpx 30rpx 12rpx;
box-shadow: 0 0 6rpx 6rpx rgba(0, 0, 0, .2);
}
.code-share-city{
bottom: 26% !important;
}
.code-share-name {
writing-mode:vertical-rl;
font-size: 30rpx;
padding-left: 4rpx;
color: #fff;
letter-spacing: 1px;
}
.code-share image {
width: 36rpx;
height: 36rpx;
margin-bottom: 5rpx;
}
.sharePop {
position: fixed;
width: 100%;
z-index: 99;
left: 0;
bottom: 0;
background-color: #0a1930;
display: none;
}
.sharePop.active {
display: block;
}
.shareCont-label image {
width: 60rpx;
height: 60rpx;
display: block;
margin: 0 auto 10rpx;
}
.shareCancel {
border-top: 2rpx solid #0e2c58;
color: #ffffff;
width: 100%;
text-align: center;
line-height: 100rpx;
}
.shareCont{
display: flex;
padding: 30rpx 0;
}
.shareCont-label {
color: #ffffff;
flex: 2;
text-align: center;
font-size: 28rpx;
}
.codeShare-button {
background-color: transparent;
padding: 0;
font-weight: normal;
}
/* canvas */
.canvasImg {
position: absolute;
left: -100000%;
height: 800px;
width: 375px;
}
/* 轮播图 */
.swiper{
width: 100vw;
height: 100vh;
position: relative;
}
.swiper-item{
height: 100vh;
}
/* 切换背景图 */
.changeBg{
width: 100%;
background-color: #fff;
overflow-x: scroll;
display: flex;
box-sizing: border-box;
padding: 30rpx 20rpx;
box-sizing: border-box;
}
.changeBgItem{
padding: 20rpx 20rpx 20rpx 10rpx;
white-space:nowrap;
flex-direction: column;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.changeBgItem-qcode span{
color: #144592;
margin-top: 20rpx;
}
.changeBgItem .changeCover{
width: 160rpx;
height: 250rpx;
position: relative;
padding: 10rpx;
box-sizing: border-box;
border: solid 1rpx #0e2c5801;
box-shadow: 0 0 2rpx 2rpx rgba(0, 0, 0, .1);
border-radius: 10rpx;
}
.changeBgItem .changeCoverCode{
height: 160rpx;
}
.selected{
border: solid 2rpx #0e2c5830 !important;
box-shadow: 0 0 4rpx 4rpx rgba(5, 81, 126, 0.445) !important;
}
.changeBgFixed{
position: fixed;
z-index: 10;
right: 30rpx;
top: 0;
background: linear-gradient(to right, rgba(5, 81, 126, 0.8), rgba(5, 81, 126, 0.6));
width: 50rpx;
text-align: center;
border-radius: 0 0 26rpx 26rpx ;
padding: 30rpx 15rpx 30rpx 12rpx;
box-shadow: 0 0 6rpx 6rpx rgba(0, 0, 0, .2);
color: #fff;
}
.pages-load {
z-index: 1000000;
background-color: #f9f9f9;
}

View File

@@ -0,0 +1,159 @@
// pages/recruit/referto/referto.js
Page({
/**
* 页面的初始数据
*/
data: {
notice : '', //地区提示
areaData : '', //地区数据
paySuccess : false,
experienceId: '',
typesArr : [],
typesIndex : 0,
refertoStatus: false,
checkStatus : false,
region : [],
regionsVal: "",
// 市级选择
cityArr : [],
cityId : 0,
cityIndex : 0,
// 区域选择
regiArr : [],
regiId : 0,
regiIndex : 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
experienceId: options.id
})
// 获取申请前置接口
this.recruitInfo(options.id);
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
// 省市区三联动
bindRegionChange (e) {
console.log(e)
let { value, postcode } = e.detail
this.setData({
regions : value,
regionsVal: value[0] + "-" + value[1] + "-" + value[2]
})
},
/**
* 申请前置接口
*/
recruitInfo(id) {
wx.$api.recruit.Enroll(id, {
experience_area_id: getApp().globalData.experienceAreaId
}).then(res => {
console.log(res)
// let areas = [
// {
// city: "请选择城市",
// city_id: null,
// experience_area_id: null,
// surplus: null
// }
// ]
this.setData({
areaData : res.data.areas,
notice : res.data.experience_notice,
typesArr : [{experience_type_id: null, name: "请选择体验内容"}, ...res.data.types],
// cityArr : [...areas, ...res.data.areas],
paySuccess : false
})
// 获取区级列表
// this.regilist(res.data.areas[this.data.cityIndex].city_id)
}).catch(err => {})
},
/**
* 体验内容筛选
*/
tasteDrop(e) {
let newIndex = e.detail.value
this.setData({
typesIndex : newIndex
})
},
/**
* 提交表单
*/
siteform(e) {
let value = e.detail.value
let errMsg = ''
// let newRegions= this.data.regions.join('')
if(this.data.regionsVal === '') {
errMsg = "请选择省市区"
}
if(this.data.typesArr[this.data.typesIndex].experience_type_id === null) errMsg = "请选择体验内容"
if(errMsg != ''){
wx.showToast({
title: errMsg,
icon : 'none'
})
return
}
let data = {
name : value.name,
address : value.address,
region_names : this.data.regions,
experience_id : this.data.experienceId,
experience_area_id : this.data.areaData.experience_area_id,
experience_type_id : this.data.typesArr[this.data.typesIndex].experience_type_id,
invite : getApp().globalData.inviteText
}
this.setData({
disabled: true
})
wx.$api.recruit.recruitAdd(data).then(res => {
this.setData({
checkStatus: true,
disabled: false
})
}).catch(() =>{
this.setData({
disabled: false
})
})
},
/**
* 关闭弹框,跳转首页
*/
refertoTap() {
this.setData({
refertoStatus: false
})
wx.switchTab({
url: '/pages/recruit/index'
})
},
/**
* 申请体验官成功后,弹出
*/
checkTap() {
this.setData({
refertoStatus: true,
checkStatus: false
})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "申请体验官"
}

View File

@@ -0,0 +1,84 @@
<image class="referto-img" src="https://cdn.shuiganying.com/images/2023/07/07/80b66f6a79ff3ef3dc6b32ae1b9d1abf.png" mode="widthFix"></image>
<view class="referto-cont">
<view class="referto-blue">
<view class="referto-drop"><text></text><text></text><text></text>
<image src="/static/icons/refertoEdit.png" mode="widthFix"></image>
</view>
<view class="referto-white">
<view class="referto-title">
<view class="referto-title-name"><text>活动报名</text></view>
<view class="referto-title-tips">activity</view>
</view>
<view class="referto-tips" wx:if="{{notice != ''}}">
<view class="referto-tips-name"><image src="https://cdn.shuiganying.com/images/2023/07/20/d0a4bd7fb4f923d4d1de8e868736dfa3.png" mode="widthFix"></image>温馨提示:</view>
<view>{{notice}}</view>
</view>
<form bindsubmit="siteform" class="site-form">
<view class="picker-remark">
<label>体验类型</label>
<picker bindchange="tasteDrop" value="{{typesIndex}}" range="{{typesArr}}" range-key="name" class="conneColor">
<view class="picker">
{{ typesArr[typesIndex].name }}
</view>
<view class="picker-text" wx:if="{{typesArr[typesIndex].remark}}">{{ typesArr[typesIndex].remark }}</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
</view>
<view class="site-input">
<label>姓名</label>
<input placeholder="请输入姓名" name="name" type="text"></input>
</view>
<view class="site-input">
<label>收货地址 <text wx:if="{{areaData.surplus > 0}}">({{'此地区剩余名额' + areaData.surplus + '人'}})</text></label>
<!-- 单城市选择 -->
<!-- <picker bindchange="cityDrop" value="{{cityIndex}}" range="{{cityArr}}" range-key="city" class="conneColor">
<view class="picker">
{{ cityArr[cityIndex].city }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker> -->
<!-- 省市区三联动 -->
<!-- 050011 -->
<picker bindchange="bindRegionChange" value="{{regions}}" mode="region" class="conneColor">
<view class="picker">
{{ regionsVal || '选择省市区' }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
</view>
<view class="site-input">
<input placeholder="请输入详细的收货地址" name="address" type="text"></input>
</view>
<view class="site-btn" wx:if="{{areaData.surplus != 0}}">
<button form-type="submit" size="mini" disabled="{{disabled}}">提交申请</button>
</view>
<view class="site-btn active" wx:else>
<text>改地区剩余名额为{{areaData.surplus}},不可申请</text>
</view>
</form>
<image class="referto-back" src="https://cdn.shuiganying.com/images/2023/07/07/5a376e923d0ba914c307d7f33da2ab7d.png" mode="widthFix"></image>
</view>
</view>
</view>
<view class="refertoEject {{refertoStatus ? 'active' : ''}}" catchtouchmove='true'></view>
<view class="refertoCont {{refertoStatus ? 'active' : ''}}" catchtouchmove='true'>
<image class="refertoCont-img" src="https://cdn.shuiganying.com/images/2023/07/07/0a62178990571065b1332066abdfa09f.png" mode="widthFix"></image>
<navigator class="refertoCont-name" hover-class="none" url="/pages/index/assess/assess?type=1" open-type="redirectTo">
<image src="https://cdn.shuiganying.com/images/2023/07/17/8c076f5414184d5fa0fac84cde307980.png" mode="widthFix"></image>
</navigator>
<image class="refertoCont-close" bindtap="refertoTap" src="https://cdn.shuiganying.com/images/2023/07/07/f9975891c1efa9b5fcd59fe33a75ed60.png" mode="widthFix"></image>
</view>
<view class="checkEject {{checkStatus ? 'active' : ''}}" catchtouchmove='true'></view>
<view class="checkCont {{checkStatus ? 'active' : ''}}" catchtouchmove='true'>
<image class="checkCont-img" src="https://cdn.shuiganying.com/images/2023/07/18/fc2b4bf3d54efc69805ecd5b5a2fe357.png" mode="widthFix"></image>
<view class="checkCont-name" hover-class="none" url="/pages/index/assess/assess?type=1" open-type="redirectTo">
<image src="https://cdn.shuiganying.com/images/2023/07/18/fd090a84d2439655de52104ff75efc0a.png" mode="widthFix"></image>
<view class="checkCont-text">
<view class="checkCont-text-title">恭喜您,申请成功</view>
<view class="checkCont-text-tips">水漾肌肤天然滋润,足量使用,效果更佳!</view>
<view class="checkCont-text-go" bindtap="checkTap">知道了</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,375 @@
page {
background-image: linear-gradient(to top, #6fbaf0, #6fbaf0);
padding-bottom: 50rpx;
}
.referto-img {
width: 100%;
}
.referto-cont {
padding: 0 30rpx;
box-sizing: border-box;
}
.referto-blue {
background-color: #0e55ad;
border-radius: 20rpx;
position: relative;
top: -20rpx;
z-index: 9;
}
.referto-blue::after,
.referto-blue::before {
position: absolute;
content: '';
background-color: rgba(14, 85, 173, .2);
left: 20rpx;
border-radius: 20rpx 20rpx 0 0;
}
.referto-blue::after {
z-index: -2;
width: calc(100% - 40rpx);
left: 20rpx;
top: -20rpx;
height: 20rpx;
}
.referto-blue::before {
z-index: -1;
width: calc(100% - 80rpx);
left: 40rpx;
top: -40rpx;
height: 40rpx;
}
.referto-drop {
padding: 30rpx;
box-sizing: border-box;
position: relative;
}
.referto-drop image {
width: 40rpx;
position: absolute;
right: 30rpx;
}
.referto-drop text {
display: inline-block;
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background-color: #ffaf59;
margin-right: 20rpx;
}
.referto-drop text:nth-child(2) {
background-color: #7fe2ff;
}
.referto-drop text:nth-child(3) {
background-color: #ffffff;
}
.referto-white {
background: white;
border-radius: 20rpx;
padding: 30rpx;
position: relative;
}
.referto-back {
position: absolute;
bottom: 0;
right: 0;
width: 50%;
}
.referto-title {
margin-bottom: 30rpx;
display: flex;
}
.referto-title-name {
flex: 1;
display: inline-block;
}
.referto-title-name text {
background-color: #1e6dce;
padding: 0 30rpx;
line-height: 68rpx;
font-size: 34rpx;
border-radius: 20rpx 0 20rpx 0;
color: #fff;
display: inline-block;
}
.referto-title-tips {
text-transform: uppercase;
font-size: 44rpx;
line-height: 68rpx;
color: #eef6ff;
}
.site-form {
display: block;
}
.site-input {
position: relative;
line-height: 90rpx;
margin-bottom: 30rpx;
}
.site-input label text {
color: #ee291b;
}
.picker-text {
color: #ee291b;
font-size: 26rpx;
margin-top: 20rpx;
}
.picker-remark picker {
position: relative;
width: 100%;
background-color: #f9fcff;
padding: 30rpx 80rpx 30rpx 30rpx;
box-sizing: border-box;
margin-top: 30rpx;
}
.picker-remark image {
width: 44rpx;
height: 44rpx;
position: absolute;
right: 20rpx;
top: calc(50% - 22rpx);
}
.site-input input,
.site-input picker {
width: 100%;
height: 90rpx;
background-color: #f9fcff;
padding: 0 30rpx;
box-sizing: border-box;
}
.site-input image {
width: 44rpx;
height: 44rpx;
position: absolute;
right: 20rpx;
top: calc(50% + 22rpx);
}
.site-btn {
padding: 20rpx 30rpx;
margin: 60rpx 0;
text-align: center;
position: relative;
z-index: 2;
}
.site-btn button[size="mini"],
.site-btn text {
display: inline-block;
background: #1e6dce;
border-radius: 80rpx;
height: 88rpx;
line-height: 88rpx;
font-size: 30rpx;
color: white;
padding: 0 80rpx;
}
.site-btn.active text {
background: #b4b4b4;
}
.site-btn button[disabled] {
background: #7789ff !important;
color: #fff !important;
}
.site-switch {
font-size: 32rpx;
margin: 30rpx;
display: flex;
line-height: 40rpx;
}
.site-switch text {
flex: 1;
}
.site-switch-active {
color: #797979;
}
.site-input textarea {
background-color: #f9fcff;
padding: 30rpx;
width: 100%;
box-sizing: border-box;
min-height: 40rpx;
}
.refertoEject {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .6);
z-index: 1000;
display: none;
}
.refertoEject.active {
display: block;
}
.refertoCont {
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 10000;
padding: 0 10%;
box-sizing: border-box;
text-align: center;
display: none;
}
.refertoCont.active {
display: -webkit-box;
}
.refertoCont-name {
width: 100%;
/* background-image: linear-gradient(to bottom, #ffb70a, #ff7e1c);
color: #fff; */
display: inline-block;
margin-bottom: 50rpx;
/* padding: 0 60rpx; */
/* border: 4rpx solid #ffffff; */
line-height: 80rpx;
/* border-radius: 90rpx; */
/* font-size: 34rpx; */
}
.refertoCont-name image,
.refertoCont-img {
width: 100%;
}
.refertoCont-close {
width: 68rpx;
display: block;
margin: 0 auto;
}
/* 申请成功弹出 */
.checkEject {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .6);
z-index: 1000;
display: none;
}
.checkEject.active {
display: block;
}
.checkCont {
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 10000;
box-sizing: border-box;
text-align: center;
display: none;
}
.checkCont.active {
display: -webkit-box;
}
.checkCont-img,
.checkCont-name {
position: absolute;
width: 80%;
left: 10%;
top: 30%;
}
.checkCont-name {
z-index: 9;
padding: 120rpx 140rpx;
box-sizing: border-box;
}
.checkCont-name image {
width: 70%;
}
.checkCont-text {
margin-top: 20rpx;
}
.checkCont-text-title {
font-weight: 600;
font-size: 34rpx;
}
.checkCont-text-tips {
color: #666666;
line-height: 44rpx;
margin: 25rpx 0;
}
.checkCont-text-go {
background-color: #ff4751;
color: #fff;
border-radius: 80rpx;
line-height: 74rpx;
}
.referto-tips-name {
font-weight: 600;
margin-bottom: 10rpx;
line-height: 44rpx;
display: flex;
}
.referto-tips-name image {
width: 30rpx;
margin: 8rpx 10rpx 0 0;
}
.referto-tips {
font-size: 28rpx;
line-height: 40rpx;
text-align: justify;
margin-bottom: 40rpx;
color: #db0000;
}

View File

@@ -6,22 +6,28 @@ Page({
*/
data: {
notice : '', //地区提示
areaData : '', //地区数据
paySuccess : false,
experienceId: '',
typesArr : [],
typesIndex : 0,
refertoStatus: false,
checkStatus : false,
// 省份选择
areasArr : [],
areaId : 0,
areaIndex : 0,
// 市级选择
cityArr : [],
cityId : 0,
cityIndex : 0,
// 区域选择
regiArr : [],
regiId : 0,
regiIndex : 0
regiIndex : 0,
},
/**
@@ -33,47 +39,77 @@ Page({
})
// 获取申请前置接口
this.recruitInfo(options.id);
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取省市区列表
this.createInfo();
},
/**
* 生命周期函数--监听页面显示
* 省市区列表
*/
onShow() { },
createInfo() {
wx.$api.site.create().then(res => {
let areas = res.data,
areaIndex = this.data.areaIndex
/**
* 申请前置接口
*/
recruitInfo(id) {
wx.$api.recruit.Enroll(id, {
experience_area_id: getApp().globalData.experienceAreaId
}).then(res => {
let areas = [
{
city: "请选择城市",
city_id: null,
experience_area_id: null,
surplus: null
}
]
this.setData({
notice : res.data.experience_notice,
typesArr : [{experience_type_id: null, name: "请选择体验内容"}, ...res.data.types],
cityArr : [...areas, ...res.data.areas],
paySuccess : false
})
areasArr : areas,
areaId : areas[areaIndex].id,
// 获取区级列表
this.regilist(res.data.areas[this.data.cityIndex].city_id)
})
this.citylist(areas[areaIndex].id)
}).catch(err => {})
},
/**
* 所在省份-下拉
*/
areasChange(e) {
let area = this.data.areasArr,
index = e.detail.value,
atcode = area[index].id
if (index != this.data.areaIndex) {
this.setData({
areaIndex : index,
areaId : atcode
})
// 获取市级列表
this.citylist(atcode)
}
},
/**
* 市级列表
*/
citylist(cityId) {
wx.$api.site.create({
parent_id: cityId
}).then(res=>{
let cityArr = res.data
this.setData({
cityId : cityArr[0].id,
cityIndex : 0,
cityArr : cityArr
})
// 获取区级列表
this.regilist(cityArr[0].id)
})
},
/**
* 市级下拉筛选
*/
cityDrop(e) {
let city = this.data.cityArr,
index = e.detail.value,
citycode = city[index].city_id
citycode = city[index].id
if (index != this.data.cityIndex) {
this.setData({
cityIndex : index,
@@ -84,7 +120,7 @@ Page({
this.regilist(citycode)
}
},
/**
* 区列表
*/
@@ -93,8 +129,8 @@ Page({
parent_id: areaId
}).then(res=>{
this.setData({
regiArr : [{id: null, name: "请选择区域", parent_id: null}, ...res.data],
regiId : null,
regiArr : res.data,
regiId : res.data[0].id,
regiIndex : 0
})
})
@@ -111,6 +147,22 @@ Page({
})
},
/**
* 申请前置接口
*/
recruitInfo(id) {
wx.$api.recruit.Enroll(id, {
experience_area_id: getApp().globalData.experienceAreaId
}).then(res => {
this.setData({
areaData : res.data.areas,
notice : res.data.experience_notice,
typesArr : [{experience_type_id: null, name: "请选择体验内容"}, ...res.data.types],
paySuccess : false
})
}).catch(err => {})
},
/**
* 体验内容筛选
*/
@@ -127,10 +179,7 @@ Page({
siteform(e) {
let value = e.detail.value
let errMsg = ''
// if(this.data.regiId === null) errMsg = "请选择区域"
if(this.data.cityId === null || this.data.cityArr[this.data.cityIndex].experience_area_id === null) errMsg = "请选择城市"
if(this.data.typesArr[this.data.typesIndex].experience_type_id === null) errMsg = "请选择体验内容"
if(errMsg != ''){
wx.showToast({
title: errMsg,
@@ -138,16 +187,19 @@ Page({
})
return
}
let data = {
name : value.name,
address : value.address,
province_id : this.data.areaId,
city_id : this.data.cityId,
// district_id : this.data.regiId,
district_id : this.data.regiId,
experience_id : this.data.experienceId,
experience_area_id : this.data.cityArr[this.data.cityIndex].experience_area_id,
experience_area_id : this.data.areaData.experience_area_id,
experience_type_id : this.data.typesArr[this.data.typesIndex].experience_type_id,
invite : getApp().globalData.inviteText
}
console.log(data)
this.setData({
disabled: true
})

View File

@@ -29,32 +29,43 @@
<input placeholder="请输入姓名" name="name" type="text"></input>
</view>
<view class="site-input">
<label>选择城市 <text wx:if="{{cityIndex > 0}}">({{'此地区剩余名额' + cityArr[cityIndex].surplus + '人'}})</text></label>
<picker bindchange="cityDrop" value="{{cityIndex}}" range="{{cityArr}}" range-key="city" class="conneColor">
<view class="picker">
{{ cityArr[cityIndex].city }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
<!-- <label>收货地址 <text wx:if="{{areaData.surplus > 0}}">({{'此地区剩余名额' + areaData.surplus + '人'}})</text></label> -->
<view class="site-input">
<label>所在省份</label>
<picker bindchange="areasChange" value="{{areaIndex}}" range="{{areasArr}}" range-key="name">
<view class="picker">
{{ areasArr[areaIndex].name }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
</view>
<view class="site-input">
<label>所在城市 <text wx:if="{{areaData.surplus > 0}}">({{'此地区剩余名额' + areaData.surplus + '人'}})</text></label>
<picker bindchange="cityDrop" value="{{cityIndex}}" range="{{cityArr}}" range-key="name" class="conneColor">
<view class="picker">
{{ cityArr[cityIndex].name }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
</view>
<view class="site-input">
<label>所在区域</label>
<picker bindchange="regiDrop" value="{{regiIndex}}" range="{{regiArr}}" range-key="name" class="conneColor">
<view class="picker">
{{ regiArr[regiIndex].name }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
</view>
</view>
<!-- <view class="site-input">
<label>选择区域</label>
<picker bindchange="regiDrop" value="{{regiIndex}}" range="{{regiArr}}" range-key="name" class="conneColor">
<view class="picker">
{{ regiArr[regiIndex].name }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
</view> -->
<view class="site-input">
<label>收货地址</label>
<input placeholder="请输入详细的收货地址" name="address" type="text"></input>
</view>
<view class="site-btn" wx:if="{{cityArr[cityIndex].surplus != 0}}">
<view class="site-btn" wx:if="{{areaData.surplus != 0}}">
<button form-type="submit" size="mini" disabled="{{disabled}}">提交申请</button>
</view>
<view class="site-btn active" wx:else>
<text>剩余名额为0,不可申请</text>
<text>改地区剩余名额为{{areaData.surplus}},不可申请</text>
</view>
</form>
<image class="referto-back" src="https://cdn.shuiganying.com/images/2023/07/07/5a376e923d0ba914c307d7f33da2ab7d.png" mode="widthFix"></image>

View File

@@ -12,16 +12,21 @@ Page({
typesIndex : 0,
refertoStatus: false,
checkStatus : false,
// 市级选择
cityArr : [],
//省份选择
areas : [],
areaId : '',
areaIndex : 0,
//市级选择
cityList : [],
cityId : 0,
cityIndex : 0,
// 区域选择
regiArr : [],
//区域选择
regiList : [],
regiId : 0,
regiIndex : 0
regiIndex : 0,
},
/**
@@ -45,32 +50,124 @@ Page({
*/
eitInfo(id) {
wx.$api.recruit.Edit(id).then(res => {
let typeValue = res.data.types.findIndex(val=> val.experience_type_id == res.data.enroll.experience_type.experience_type_id),
cityValue = res.data.areas.findIndex(val=> val.city_id == res.data.enroll.experience_area.city_id)
console.log(res)
let typeValue = res.data.types.findIndex(val=> val.experience_type_id == res.data.enroll.experience_type.experience_type_id)
let areasValue = res.data.provinces.findIndex(val=> val.name == res.data.province.name),
cityValue = res.data.cities.findIndex(val=> val.name == res.data.city.name),
regiValue = res.data.districts.findIndex(val=> val.name == res.data.district.name)
this.setData({
enrollData: res.data.enroll,
typesIndex: typeValue,
cityIndex : cityValue,
typesArr : res.data.types,
cityArr : res.data.areas,
enrollData : res.data.enroll,
typesIndex : typeValue,
typesArr : res.data.types,
areas : res.data.provinces,
cityList : res.data.cities,
regiList : res.data.districts,
areaIndex : areasValue,
cityIndex : cityValue,
regiIndex : regiValue,
areaId : res.data.province.region_id,
cityId : res.data.city.region_id,
regiId : res.data.district.region_id,
})
}).catch(err => {})
},
/**
* 省市区列表
*/
createInfo() {
wx.$api.site.create().then(res => {
let areas = res.data,
areaIndex = this.data.areaIndex
this.setData({
areas : areas,
areaId : areas[areaIndex].id,
})
this.citylist(areas[areaIndex].id)
}).catch(err => {})
},
/**
* 所在省份-下拉
*/
areasChange(e) {
let area = this.data.areas,
index = e.detail.value,
atcode = area[index].id
if (index != this.data.areaIndex) {
this.setData({
areaIndex : index,
areaId : atcode
})
// 获取市级列表
this.citylist(atcode)
}
},
/**
* 市级列表
*/
citylist(cityId) {
wx.$api.site.create({
parent_id: cityId
}).then(res=>{
let cityArr = res.data
this.setData({
cityId : cityArr[0].id,
cityIndex : 0,
cityList : cityArr
})
// 获取区级列表
this.regilist(cityArr[0].id)
})
},
/**
* 市级下拉筛选
*/
cityDrop(e) {
let city = this.data.cityArr,
let city = this.data.cityList,
index = e.detail.value,
citycode = city[index].city_id
citycode = city[index].id
if (index != this.data.cityIndex) {
this.setData({
cityIndex : index,
cityId : citycode
cityId : citycode
})
// 获取区列表
this.regilist(citycode)
}
},
/**
* 区列表
*/
regilist(areaId) {
wx.$api.site.create({
parent_id: areaId
}).then(res=>{
this.setData({
regiList : res.data,
regiId : res.data[0].id,
regiIndex : 0
})
})
},
/**
* 区下拉筛选
*/
regiDrop(e) {
let newIndex = e.detail.value
this.setData({
regiIndex : newIndex,
regiId : this.data.regiList[newIndex].id
})
},
/**
* 体验内容筛选

View File

@@ -9,9 +9,11 @@
<view class="referto-title-name"><text>活动报名</text></view>
<view class="referto-title-tips">activity</view>
</view>
<view class="referto-tips" wx:if="{{notice != ''}}">
<view class="referto-tips-name"><image src="https://cdn.shuiganying.com/images/2023/07/20/d0a4bd7fb4f923d4d1de8e868736dfa3.png" mode="widthFix"></image>温馨提示:</view>
<view>{{notice}}</view>
<view class="referto-tips" wx:if="{{enrollData.experience.experience_notice != ''}}">
<view class="referto-tips-name">
<image src="https://cdn.shuiganying.com/images/2023/07/20/d0a4bd7fb4f923d4d1de8e868736dfa3.png" mode="widthFix"></image>温馨提示:
</view>
<view>{{enrollData.experience.experience_notice}}</view>
</view>
<form bindsubmit="siteform" class="site-form">
<view class="picker-remark">
@@ -29,27 +31,37 @@
<input placeholder="请输入姓名" name="name" type="text" value="{{enrollData.express.name}}"></input>
</view>
<view class="site-input">
<label>所选城市 <text wx:if="{{cityIndex > 0}}">({{'此地区剩余名额' + cityArr[cityIndex].surplus + '人'}})</text></label>
<picker bindchange="cityDrop" value="{{cityIndex}}" range="{{cityArr}}" range-key="city" class="conneColor" disabled>
<view class="picker" style="color: #999;">
{{ cityArr[cityIndex].city }}
</view>
</picker>
</view>
<!-- <view class="site-input">
<label>选择区域</label>
<picker bindchange="regiDrop" value="{{regiIndex}}" range="{{regiArr}}" range-key="name" class="conneColor">
<label>所在省份</label>
<picker bindchange="areasChange" value="{{areaIndex}}" range="{{areas}}" range-key="name" name="region_id">
<view class="picker">
{{ regiArr[regiIndex].name }}
{{ areas[areaIndex].name }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
</view> -->
</view>
<view class="site-input">
<label>所在城市</label>
<picker bindchange="cityDrop" value="{{cityIndex}}" range="{{cityList}}" range-key="name" class="conneColor" name="city_id">
<view class="picker">
{{ cityList[cityIndex].name }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
</view>
<view class="site-input">
<label>所在区域</label>
<picker bindchange="regiDrop" value="{{regiIndex}}" range="{{regiList}}" range-key="name" class="conneColor" name="district_id">
<view class="picker">
{{ regiList[regiIndex].name }}
</view>
<image src="/static/icons/orderArrow.png"></image>
</picker>
</view>
<view class="site-input">
<label>收货地址</label>
<input placeholder="请输入详细的收货地址" name="address" type="text" value="{{enrollData.express.address}}"></input>
</view>
<view class="site-btn" wx:if="{{cityArr[cityIndex].surplus != 0}}">
<view class="site-btn" wx:if="{{enrollData.experience_area.surplus != 0}}">
<button form-type="submit" size="mini" disabled="{{disabled}}">提交申请</button>
</view>
<view class="site-btn active" wx:else>
@@ -66,7 +78,7 @@
<image class="checkCont-img" src="https://cdn.shuiganying.com/images/2023/07/18/fc2b4bf3d54efc69805ecd5b5a2fe357.png" mode="widthFix"></image>
<view class="checkCont-name" hover-class="none" url="/pages/index/assess/assess?type=1" open-type="redirectTo">
<image src="https://cdn.shuiganying.com/images/2023/07/18/fd090a84d2439655de52104ff75efc0a.png" mode="widthFix"></image>
<view class="checkCont-text">
<view class="checkCont-text">
<view class="checkCont-text-title">修改成功,等待审核</view>
<view class="checkCont-text-tips">水漾肌肤天然滋润,足量使用,效果更佳!</view>
<view class="checkCont-text-go" bindtap="checkTap">知道了</view>

View File

@@ -24,8 +24,8 @@
</view>
</view>
<view class="frame-write" style="margin-top: 50rpx;" wx:if="{{signDayNumber == 10}}">
<view class="frame-write-name">#产品建议#</view>
<textarea class="frame-write-text" placeholder="请输入您对本产品的建议" placeholder-style="color: #cde0ff; font-size: 26rpx" bindinput="bidinput"></textarea>
<view class="frame-write-name">#产品评价#</view>
<textarea class="frame-write-text" placeholder="请输入您对本产品的评价或提出相关建议" placeholder-style="color: #cde0ff; font-size: 26rpx" bindinput="bidinput"></textarea>
</view>
</view>
</view>

View File

@@ -59,6 +59,7 @@ Page({
this.setData({
areasArr : areas,
areaId : areas[areaIndex].id,
})
this.citylist(areas[areaIndex].id)
}).catch(err => {})

View File

@@ -70,7 +70,7 @@ Page({
if(type == 'avatar') {
wx.chooseMedia({
count : 1,
mediaType: 'image',
mediaType: ['image'],
success : path => {
// 上传图片
wx.$api.file.uploadImg(path.tempFiles[0].tempFilePath, {}).then(res=>{