Commit 49a80735 by 张晓玮

Merge branch 'v3.0' into 'zhangxw_dev_3.0'

V3.0

See merge request !46
2 parents 981b118d 39d4ccbc
......@@ -8,9 +8,11 @@ Page({
sumbitScore: ''
},
toSumbitData() {
let { sumbitScore } = this.data
let { sumbitScore,withdrawalScore } = this.data
if (!sumbitScore) return wx.$api.showToast('请输入有效的积分值')
if (sumbitScore == 0) return wx.$api.showToast('请输入有效的积分值')
if(sumbitScore<0.3) return wx.$api.showToast('至少提现0.3')
if(Number(sumbitScore)>Number(withdrawalScore)) return wx.$api.showToast('请输入有效的积分值')
Dialog.confirm({
title: '提示',
message: `请确认是否将${sumbitScore}积分进行提现`,
......@@ -20,7 +22,7 @@ Page({
wx.hideLoading();
if (res.code == 0) {
wx.$eventbus.emit('REFRESH_WITHDRALWAL')
wx.$router.go('packageMine.withdrawalSuccess.index')
wx.$router.redirectTo('packageMine.withdrawalSuccess.index')
} else {
wx.$api.showToast(res.message)
}
......
......@@ -19,7 +19,7 @@
<view class="input_wrapper">
<view class="title">输入提现的积分值</view>
<view class="int_widget flex_scb">
<input type="digit" bindblur="checkNum" value="{{sumbitScore}}" focus="{{true}}" bindinput="toFillCount" class="intClass" maxlength="20" placeholder="请输入整数" placeholder-class="input-placeholder"/>
<input type="digit" bindblur="checkNum" value="{{sumbitScore}}" focus="{{true}}" bindinput="toFillCount" class="intClass" maxlength="20" placeholder="请输入" placeholder-class="input-placeholder"/>
<view class="btn flex_cc" bind:tap="toTixianAll">全部提现</view>
</view>
</view>
......
......@@ -18,7 +18,7 @@
<view class="line"></view>
<view class="date_wrap flex_scb">
<view class="dateText">申请时间:{{item.withdrawalTime}}</view>
<view wx:if="{{item.iconType}}" class="dateText">完成时间:{{item.successTime || ''}}</view>
<view wx:if="{{item.iconType==1}}" class="dateText">完成时间:{{item.successTime || ''}}</view>
</view>
</view>
</view>
......
......@@ -58,15 +58,24 @@ Page({
detail
}) {
if (!detail.code) return
wx.showLoading()
USERAPI.authUserPhone(detail, this.loginToken).then(({
code,
data,
message,
errId
}) => {
if (code == '0'){
wx.$router.go('/pages/authentication/registerSuccess/registerSuccess',{type:0})
}else if(errId=='30990103'){
wx.hideLoading()
if (code == '0' || errId=='30990103'){
let target = null
if(code == '0' && data.loginUserInfoList?.length){
let {loginUserInfoList} = data
target = loginUserInfoList.find(item => item.merchantId== this.data.linkParams.merchantId)
}
if(target){
wx.$router.go('/pages/authentication/registerSuccess/registerSuccess',{type:0})
return;
}
let params = {...this.data.linkParams}
if(this.data.linkParams.type==1){
wx.$router.go('/pages/authentication/registerInfo/registerInfo',params)
......@@ -86,12 +95,13 @@ Page({
this.register(regParmas)
}
}else{
wx.hideLoading()
wx.$api.showToast(message || '系统异常')
}
}).catch(({
errMsg
}) => {
wx.$api.showToast(message || '系统异常')
wx.$api.showToast('系统异常')
})
},
register(params){
......
......@@ -86,17 +86,17 @@ Page({
wx.getImageInfo({
src: img,
success:(res)=> {
ActivityApi.getActivityVisitorList({
actNum, activeNavIdx
}).then(response => {
let imgW = res.width/5, imgH =res.height/5;
let imgW = res.width/5, imgH =res.height/5;
let drawFun = new Draw({
width: imgW,
height: imgH
});
// ActivityApi.getActivityVisitorList({
// actNum, activeNavIdx
// }).then(response => {
this.setData({
imgH: (imgH/imgW)*450
})
let drawFun = new Draw({
width: imgW,
height: imgH
});
let arr = [456,222,0,496]
let imgList = [
{
......@@ -106,13 +106,13 @@ Page({
height: imgH,
url: img,
},
{
x:imgW-64,
y: imgH-arr[actNum]-64,
width: 64,
height: 64,
url: response, //二维码
},
// {
// x:imgW-64,
// y: imgH-arr[actNum]-64,
// width: 64,
// height: 64,
// url: response, //二维码
// },
];
drawFun.begin({
imageList: imgList,
......@@ -123,8 +123,7 @@ Page({
});
wx.hideLoading()
})
console.log(response,'response')
})
// })
}
})
}
......@@ -172,14 +171,18 @@ Page({
});
},
onRoute(options) {
console.log("options: ", options);
let { actNum,activeNavIdx,fromLocal } = options
this.setData({
actNum,
activeNavIdx,
fromLocal
wx.nextTick(()=>{
let { actNum,activeNavIdx,fromLocal } = this.options
this.shareQuery = `actNum=${actNum}&activeNavIdx=${activeNavIdx}`
console.log(" this.options: ", this.options);
this.setData({
actNum,
activeNavIdx,
fromLocal
})
this.createImg()
})
this.createImg()
},
noPageAuth : true,
......@@ -187,7 +190,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options,'onLoad')
},
/**
......@@ -199,6 +202,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow(options) {},
onShareTimeline() {},
/**
* 生命周期函数--监听页面隐藏
......
......@@ -6,7 +6,7 @@
<product actNum="{{actNum}}" navIdx="{{activeNavIdx}}" senceData="{{senceData}}" isShare="{{true}}"/>
<!-- 分享弹框 -->
<view class="share-wrap" wx:if="{{isShow}}">
<view class="share-wrap" wx:if="{{isShow && fromLocal==1}}">
<view class="img-wrap" wx:if="{{posterUrl}}">
<image class="img" style="height:{{imgH}}rpx" src="{{posterUrl}}" bindload="onloadFn" />
<!-- <block wx:for="{{imgList}}" wx:key="*this">
......
......@@ -15,8 +15,8 @@ class Router {
wx.onAppRoute(e => {
let thisPage = this.getPageInstance()
if (thisPage) {
thisPage.options = this[_query]
thisPage.setData({ IMGURL: IMG_URL })
if(Object.keys(this[_query]).length) thisPage.options = this[_query]
this.setNavigationBarTitleText(thisPage)
let onRoute = thisPage.onRoute
typeof onRoute === 'function' && onRoute(this[_query])
......
......@@ -4,8 +4,16 @@
* @param {*} shareImage 分享图片 不传默认当前页面截图
* @param {*} shareQuery 分享页面参数
* @param {*} noPageAuth 分享页面是否需要登录拦截
* @param {*} shareFun 分享页面
* @param {*} shareTrackData 分享埋点数据
* @param {*} onViewTrack 开启浏览埋点
* @returns
*/
// import {
// reportData
// } from '~/api/index.js'
// import USERAPI from '~/api/usersApi/index'
class Share {
constructor() {
console.log('---------------- 分享初始化 ----------------')
......@@ -23,22 +31,31 @@ class Share {
}
}
}
/**设置全局分享 */
pageLeaveProxy(page) {
const onLoad = page.onLoad,
that = this
if (page.onShareAppMessage) {
const that = this
page.onShareAppMessage = function () {
let {
shareTitle,
sharePath,
shareImage,
shareQuery,
noPageAuth=true
noPageAuth,
shareFun,
shareTrackData
} = this,
path = `/${this.route}`
if (sharePath) path = `/${sharePath}`
// path += that.setCommonShareQuery()
if (shareQuery) path += `?${shareQuery}`
console.log('::', path)
if (!noPageAuth) path = `/login/loading/loading?url=${encodeURIComponent(path)}`
console.log(path)
if (shareFun) shareFun()
// if (shareTrackData) that.reportShareData(shareTrackData)
return {
path,
title: shareTitle,
......@@ -46,7 +63,62 @@ class Share {
}
}
}
if (page.onShareTimeline) {
page.onShareTimeline = function () {
let {
shareTitle,
shareImage,
shareQuery,
shareFun,
shareTrackData
} = this
if (shareFun) shareFun()
// if (shareTrackData) that.reportShareData(shareTrackData)
// shareQuery = that.setCommonShareQuery(shareQuery)
console.log(shareQuery)
return {
query: shareQuery,
title: shareTitle,
imageUrl: shareImage
}
}
}
}
getCommonData() {
const WXUSERINFO = wx.$storage.get('wx_user_info'),
USERINFO = wx.$storage.get('userInfo')
return {
WXUSERINFO,
USERINFO
}
}
setCommonShareQuery(query) {
const {
WXUSERINFO,
USERINFO
} = this.getCommonData()
query = `${query? `?${query}&`:'?'}merchantId=${USERINFO.merchantId}&shareOpenId=${WXUSERINFO.openId}`
if (USERINFO.phone) query += `&sharePhone=${USERINFO.phone}`
return query
}
reportShareData(shareTrackData) {
const {
WXUSERINFO,
USERINFO
} = this.getCommonData(),
thisPage = wx.$router.getPageInstance()
reportData({
openId: WXUSERINFO.openId || '',
unionId: WXUSERINFO.unionId || '',
nickName: WXUSERINFO.nickName || '',
avatar: WXUSERINFO.avatarUrl || '',
phone: USERINFO.phone || '',
merchantId: thisPage.merchantId || USERINFO.merchantId || '',
shareOpenId: thisPage.shareOpenId || WXUSERINFO.openId || '',
sharePhone: thisPage.sharePhone || USERINFO.phone || '',
...shareTrackData
})
}
}
new Share()
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!