b0e3f3ba by simon

no message

1 parent 41acdc68
......@@ -4,7 +4,7 @@
* ------------------------------------------------------------------
*/
var isFirst = false;
isFirst = true;
// isFirst = true;
var path = require('path');
var gulp = require('gulp');
......
......@@ -18,6 +18,7 @@ App({
router: router,
store: store,
globalData: {
isTest: false, //是否测试状态 测试状态可触发点击摇一摇
indexInfo: null,
userInfo: null,
wxcode: store.getItem("wxcode"),
......@@ -28,7 +29,8 @@ App({
giftData: null, // 实物奖 userTabel prizeDetail用
coopOptions: null, // 协作页 onload入参
},
onLaunch: function () {
onLaunch: function (options) {
console.log("app q:", decodeURIComponent(options.query.q));
this.share();
},
//重写分享方法
......
......@@ -9,7 +9,7 @@
</view>
</view>
<view class="btn-wrap">
<view bindtap="onRegisterHandler" class="btn btn1">丸美姐妹,马上注册</view>
<view bindtap="onRegisterHandler" class="btn btn1">丸美姐妹,马上登陆</view>
<view bindtap="hideMask" class="btn btn2">塑胶姐妹,残忍拒绝</view>
</view>
</view>
......
let app = getApp();
Component({
properties: {
// 这里定义了innerText属性,属性值可以在组件使用时指定
......@@ -28,6 +29,15 @@ Component({
this.triggerEvent('evtcomp', {
name: "_evt_shake"
});
},
// 触发摇一摇测试入口
onShakeHandlerTest() {
let isTest = app.globalData.isTest;
if (!isTest) {
return;
}
this.onShakeHandler();
}
}
})
......
<view class="comp-item">
<image bindtap="onShakeHandler" class="bg" src="../../image/oss/tips/tips-shake.png" mode="widthFix" />
<image bindtap="onShakeHandlerTest" class="bg" src="../../image/oss/tips/tips-shake.png" mode="widthFix" />
<view class="space1"></view>
<view class="shake">
<image class="image animated tada infinite" src="../../image/oss/tips/shake-c1.png" mode="widthFix" />
......
......@@ -79,7 +79,6 @@ Page({
}
})
this.initShake();
})
},
// 添加摇一摇
......@@ -138,9 +137,9 @@ Page({
return;
}
// 已经助力
if (wishInfo.isAssist == 1) {
return;
}
// if (wishInfo.isAssist == 1) {
// return;
// }
this.setData({
canShake: false
......@@ -191,7 +190,7 @@ Page({
// 助力失败
this.setData({
tipsCommonVisible: true,
tipsInnerText: "已经为好友助力过啦~"
tipsInnerText: `亲爱的女神,您已为${wishInfo.member.nickname}好友助力过,每人只能为一位好友助力噢!`
})
} else if (status == 3) {
this.setData({
......@@ -245,6 +244,16 @@ Page({
})
});
},
// 触发摇一摇测试入口
queryWishbillAssistTest() {
let isTest = app.globalData.isTest;
if (!isTest) {
return;
}
this.queryWishbillAssist();
},
hideMask() {
this.setData({
groupMemberCoopVisible: false,
......@@ -275,7 +284,7 @@ Page({
this.hideMask();
app.globalData.coopOptions = this.data.options;
app.router.push({
path: "register",
path: "login",
query: {
redirect: "coop"
}
......
......@@ -14,7 +14,7 @@
<!-- 摇一摇 -->
<!-- bindtap="queryWishbillAssist" -->
<!-- 点自己链接未助力 -->
<view bindtap="queryWishbillAssist" wx:if="{{wishInfo.isSelfWishBill == 1 || (status != 1 && wishInfo.isAssist != 1)}}" class="shake">
<view bindtap="queryWishbillAssistTest" wx:if="{{wishInfo.isSelfWishBill == 1 || wishInfo.isAssistThisBill == 0}}" class="shake">
<image class="ebg" mode="widthFix" src="../../image/oss/coop/coop-c2.png" />
<image class="coop-shake animated infinite {{animationPassVisible || !initComplete ?'':'tada'}}" mode="widthFix" src="../../image/oss/coop/coop-shake.png" />
<view class="space1"></view>
......
import {
getQueryByUrl
} from '../../utils/util';
let app = getApp();
Page({
data: {
......@@ -13,6 +17,12 @@ Page({
})
},
onLoad(options) {
// console.log("index q:", decodeURIComponent(options.q));
let q = decodeURIComponent(options.q);
if (q) {
let m = getQueryByUrl("m", q);
console.log("m:", m);
}
let sessionId = app.store.getItem('sessionId');
if (sessionId) {
app.queryIndex({
......
......@@ -72,18 +72,6 @@ Page({
data: data
}).then((result) => {
if (result.status == 1) {
// wx.showModal({
// title: "登陆成功",
// content: "继续生成我的心愿单",
// confirmText: "马上前往",
// showCancel: false,
// success(res) {
// app.router.push({
// openType: "redirectTo",
// path: _this.data.redirect
// })
// }
// })
app.router.push({
openType: "redirectTo",
path: _this.data.redirect
......@@ -179,7 +167,10 @@ Page({
toRegisterHandler() {
app.router.push({
openType: "redirectTo",
path: "register"
path: "register",
query: {
redirect: this.data.redirect
}
})
},
// 获取验证码
......
......@@ -44,7 +44,6 @@ Page({
let billCode = app.globalData.indexInfo.wishBillCode;
let wxShareTitle = nickname + `正在参加丸美眼霜节心愿单活动,需要你的倾情相助!`;
let wxCodePath = `pages/coop/coop?code=${billCode}&s=share`
console.log("wxCodePath:", wxCodePath);
this.setData({
wxCodePath: wxCodePath,
wxShareTitle: wxShareTitle
......
......@@ -5,6 +5,7 @@ import Date from '../../utils/date';
let app = getApp();
Page({
data: {
indexInfo: {},
hadAnswer: false,
questionList: [], // 题目列表
questionResult: {},
......@@ -18,7 +19,15 @@ Page({
this.initData();
},
initData() {
this.queryQuestionList();
app.queryIndex({
auth: false
}).then((result) => {
this.setData({
indexInfo: app.globalData.indexInfo
})
this.queryQuestionList();
})
},
/**
* 跳转至创建心愿单
......@@ -114,6 +123,21 @@ Page({
})
});
},
/**
* 复制公众号到粘贴板
*/
onGzhClipboardHandler() {
wx.setClipboardData({
data: 'MARUBI丸美',
success(res) {
// wx.getClipboardData({
// success(res) {
// console.log(res.data) // data
// }
// })
}
})
},
// 子组件事件
evtcomp(evt) {
let {
......
......@@ -77,7 +77,7 @@
margin-bottom: 28px;
}
.no{
.no {
// @extend .bb;
// padding-right: 4
margin-right: 4px;
......@@ -177,12 +177,18 @@
.tips {
// margin-top: 40px;
margin:24px 0 12px;
margin: 24px 0 0px;
text-align: center;
font-size: 24px;
color: #333333;
}
.subcribe {
view {
margin-bottom: 12px;
}
}
// 优惠券
.coupon {
width: 578px;
......@@ -253,6 +259,17 @@
}
}
}
.line {
height: 1px;
width: 520px;
margin: 32px auto 48px;
background-color: #eac2c4;
}
.gzh {
color: #ac0521;
}
}
.create-wish-btn {
......@@ -265,6 +282,15 @@
}
}
.result2 {
height: 826px;
.bg {
height: 826px;
}
}
}
}
}
......
......@@ -29,33 +29,64 @@
确认提交
</view>
<!-- 结果 -->
<view wx:else class="result">
<image class="d1" mode="widthFix" src="../../image/oss/question/question-d1.png" />
<image class="bg" mode="widthFix" src="../../image/oss/question/result-border.png" />
<image class="d2" mode="widthFix" src="../../image/oss/question/question-d2.png" />
<view class="cont">
<view class="space1"></view>
<view class="tit">测验结果:答对{{questionResult.right}}题,答错{{questionResult.wrong}}题</view>
<view class="ball">
<view class="t1">获得</view>
<view class="score">{{questionResult.elasticValue}}</view>
<view class="t1">弹力值</view>
<!-- <view wx:else> -->
<view>
<view wx:if="{{indexInfo.isSubcribe == 1}}" class="result">
<!-- 已经注册 -->
<image class="d1" mode="widthFix" src="../../image/oss/question/question-d1.png" />
<image class="bg" mode="widthFix" src="../../image/oss/question/result-border.png" />
<image class="d2" mode="widthFix" src="../../image/oss/question/question-d2.png" />
<view class="cont">
<view class="space1"></view>
<view class="tit">测验结果:答对{{questionResult.right}}题,答错{{questionResult.wrong}}题</view>
<view class="ball">
<view class="t1">获得</view>
<view class="score">{{questionResult.elasticValue}}</view>
<view class="t1">弹力值</view>
</view>
<view class="tips">到店购物即可使用,绝不要错过噢~</view>
<view class="coupon">
<view wx:for="{{questionResult.coupons}}" wx:key="{{index}}" class="coupon-item {{item.type==4?'coupon-item2':''}}">
<image wx:if="{{item.type==4}}" class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-2.png" />
<image wx:else class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-1.png" />
<view class="cont">
<view class="name">{{item.name}}</view>
<!-- <view class="detail">查看详情</view> -->
<view class="card-info card-no">劵码:{{item.couponCode}}</view>
<view class="card-info card-date">有效期:即日起至{{item.endDateStr}}</view>
</view>
</view>
</view>
</view>
<view class="tips">到店购物即可使用,绝不要错过噢~</view>
<view class="coupon">
<view wx:for="{{questionResult.coupons}}" wx:key="{{index}}" class="coupon-item {{item.type==4?'coupon-item2':''}}">
<image wx:if="{{item.type==4}}" class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-2.png" />
<image wx:else class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-1.png" />
<view class="cont">
<view class="name">{{item.name}}</view>
<!-- <view class="detail">查看详情</view> -->
<view class="card-info card-no">劵码:{{item.couponCode}}</view>
<view class="card-info card-date">有效期:即日起至{{item.endDateStr}}</view>
<view bindtap="onCreateWishHandler" class="create-wish-btn">马上创建心愿单</view>
</view>
<view wx:else class="result result2">
<image class="d1" mode="widthFix" src="../../image/oss/question/question-d1.png" />
<image class="bg" mode="widthFix" src="../../image/oss/tips/tips-border-big.png" />
<image class="d2" mode="widthFix" src="../../image/oss/question/question-d2.png" />
<view class="cont">
<view class="space1"></view>
<view class="tit">测验结果:答对{{questionResult.right}}题,答错{{questionResult.wrong}}题</view>
<view class="ball">
<view class="t1">获得</view>
<view class="score">{{questionResult.elasticValue}}</view>
<view class="t1">弹力值</view>
</view>
<view class="line"></view>
<!-- <view class="tips">恭喜获得新人福利</view> -->
<view class="tips subcribe">
<view>恭喜获得新人福利</view>
<view>20元无门槛代金券及眼部保养券</view>
<view>
您可
<span bindtap="onGzhClipboardHandler" class="gzh">【复制公众号】</span>
搜索并关注丸美公众号
</view>
<view>即可在“会员中心”中查看及使用卡券</view>
</view>
</view>
<view bindtap="onCreateWishHandler" class="create-wish-btn">马上创建心愿单</view>
</view>
<view bindtap="onCreateWishHandler" class="create-wish-btn">马上创建心愿单</view>
</view>
</view>
</view>
......
......@@ -93,22 +93,9 @@ Page({
data: data
}).then((result) => {
if (result.status == 1) {
// wx.showModal({
// title: "注册成功",
// content: "继续创建心愿单",
// confirmText: "马上前往",
// showCancel: false,
// success(res) {
// // 注册成功直接跳回创建心愿单页
// app.router.push({
// openType: "redirectTo",
// path: "createWish"
// })
// }
// })
app.router.push({
openType: "redirectTo",
path: "createWish"
path: _this.data.redirect
})
} else if (result.status == 2) {
this.setData({
......@@ -138,15 +125,15 @@ Page({
} else if (!this.data.birthday) {
this.showLog("请输入生日");
reject();
// } else if (!this.data.password) {
// this.showLog("请输入登陆密码");
// reject();
// } else if (!this.data.password) {
// this.showLog("请输入登陆密码");
// reject();
} else if (!this.data.verifyCode) {
this.showLog("请输入验证码");
reject();
// } else if (this.data.sex != 0 && this.data.sex != 1) {
// this.showLog("请选择性别");
// reject();
// } else if (this.data.sex != 0 && this.data.sex != 1) {
// this.showLog("请选择性别");
// reject();
} else if (!this.data.isPlzAuth) {
this.showLog("请完成拼图验证");
reject();
......@@ -171,7 +158,10 @@ Page({
toLoginHandler() {
app.router.push({
openType: "redirectTo",
path: "login"
path: "login",
query: {
redirect: this.data.redirect
}
})
},
// 获取验证码
......
......@@ -127,6 +127,15 @@ function formatWeek(week) {
return result;
}
/**
* 根据url获取参数
* @param {*} name
*/
function getQueryByUrl(name, url) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(url) || [, ""])[1].replace(/\+/g, '%20')) || null;
}
/**
* 获取点击传值
* @param {*} evt
......@@ -276,5 +285,6 @@ module.exports = {
getBindtapData: getBindtapData,
wxacodeGet: wxacodeGet,
getObjByListKeyValue: getObjByListKeyValue,
getLocalDistance: getLocalDistance
getLocalDistance: getLocalDistance,
getQueryByUrl: getQueryByUrl,
}
......