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