Authored by huangyi

页面跳转优化

... ... @@ -8,6 +8,13 @@ Component({
type: Boolean,
value: false,
observer: '_propertyChange'
},
text: {
type: String,
value: "",
observer: function(value){
this.setData({_text:value})
}
}
},
... ... @@ -15,6 +22,7 @@ Component({
* 组件的初始数据
*/
data: {
_text:'',
_show: false
},
... ...
<zero-alert wx:if="{{_show}}">
<view class="content">
<view class="content" wx:if="{{!_text}}">
<view>微信搜索公众号</view>
<view><text style="font-weight: bolder;">“潮流有货”</text>并关注,发送</view>
<view>关键词<text style="font-weight: bolder;">“开奖”</text>查询中奖信息</view>
</view>
<view wx:else class="text">{{_text}}</view>
<view class="foot" bindtap="onConfirm">确定</view>
</zero-alert>
... ...
... ... @@ -21,4 +21,11 @@
font-weight: bolder;
text-align: center;
border-top: 1rpx solid #E0E0E0;
}
.text {
font-size: 28rpx;
line-height: 40rpx;
margin:68rpx;
text-align:center;
}
\ No newline at end of file
... ...
... ... @@ -20,16 +20,20 @@ Component({
* 组件的初始数据
*/
data: {
show: false
show: false,
text: ''
},
/**
* 组件的方法列表
*/
methods: {
goFellow() {
goFellow(e) {
let text = JSON.parse(e.target.dataset.text || "{}");
debugger;
this.setData({
show: true
show: true,
text:text.miniapp || ''
})
},
goShare() {
... ...
... ... @@ -9,7 +9,7 @@
<view class="product-name" >{{item.name}}</view>
<block wx:if="{{item.status === 4}}">
<view class="btn" catchtap="goFellow">查看中奖信息</view>
<view class="btn" catchtap="goFellow" data-text="{{item.lottery_info}}">查看中奖信息</view>
</block>
<block wx:elif="{{item.status === 3}}">
... ... @@ -28,4 +28,4 @@
</view>
<fellow-alert show="{{show}}" bindok="onOk"></fellow-alert>
\ No newline at end of file
<fellow-alert show="{{show}}" text="{{text}}" bindok="onOk"></fellow-alert>
\ No newline at end of file
... ...
... ... @@ -23,7 +23,7 @@
抽奖价 ¥
<text class="lucky">0</text>
</view>
<view class="product_price">{{product.price}}</view>
<view class="product_price">原价:<text class="line">{{product.price}}</text></view>
</view>
<view wx:if="{{product.status !== 2}}" class="product_time">{{helper.formatTime(product.start_time,
product.end_time)}}
... ...
... ... @@ -20,7 +20,7 @@
display: flex;
flex-direction: row;
align-items: baseline;
justify-content: center;
justify-content: space-between;
margin-left: 32rpx;
margin-right: 32rpx;
}
... ... @@ -30,6 +30,10 @@
font-size: 24rpx;
font-weight: bold;
margin-left: 20rpx;
}
.line {
text-decoration: line-through;
}
... ...
... ... @@ -111,6 +111,7 @@ Page(Object.assign({
*/
onLoad: function (options) {
app = getApp();
wx.hideShareMenu();
this.service = new ZeroSellService();
this.commonService = new CommonService();
... ... @@ -125,8 +126,6 @@ Page(Object.assign({
data.actPrizeId = options.actPrizeId;
}
console.log('options=>', options);
if (options.scene && options.scene.length === 32) {
data.scene = options.scene;
}
... ... @@ -219,8 +218,6 @@ Page(Object.assign({
},
goToGroupMiniApp(e) {
console.log(e);
console.log(e.detail);
wx.navigateToMiniProgram({
appId: 'wx207f18be42db9028',
path: `pages/group/detail?productSkn=${e.detail.product_skn}&activityId=${e.detail.activity_id}&page_param=${e.detail.activity_id}`,
... ... @@ -261,7 +258,6 @@ Page(Object.assign({
let query = wx.createSelectorQuery();
query.select('.code-list-item-container').boundingClientRect();
query.exec((res) => {
console.log(res[0].height)
animation.height(res[0].height - 63).step();
this.setData({
animation: animation.export()
... ... @@ -403,7 +399,6 @@ Page(Object.assign({
}
}
console.log('step=>', step)
this.setData({
step: step
});
... ... @@ -467,7 +462,6 @@ Page(Object.assign({
let commonService = this.commonService;
commonService.getResourceCode('ccc32dbedf164a52b4efa34383878860')
.then(data => {
// console.log(data)
this.setData({
bannerSrc: formatImageUrl(data.src, 340 * app.globalData.systemInfo.pixelRatio, 340 * app.globalData.systemInfo.pixelRatio, 2),
bannerUrl: data.url
... ... @@ -541,10 +535,10 @@ Page(Object.assign({
};
}
},
goList() {
router.go('index');
goList(e) {
let tab = e.target.dataset.index
router.go('index', {tabIndex: tab || 0,reload:0});
},
getUserInfo: function (e) {
var that = this;
if (e.detail.errMsg === 'getUserInfo:ok') {
... ... @@ -634,10 +628,8 @@ Page(Object.assign({
if (res.confirm) {
wx.openSetting({
success: (res) => {
// console.log(res.authSetting["scope.userInfo"])
if (res.authSetting["scope.userInfo"] !== null && res.authSetting["scope.userInfo"] !== undefined && res.authSetting["scope.userInfo"] === true) {
getUnionID(app.getWechatThirdSession(), function (response) {
// console.log(response)
})
}
}
... ...
... ... @@ -24,7 +24,7 @@
</view>
<image class="shadow" src="https://img11.static.yhbimg.com/yhb-img01/2018/12/27/19/0140fa3243af949068d2aabeedb0ea0666.png" mode="widthFix" wx:if="{{index == 2 && codeList.length>3 }}"></image>
</view>
<image src="./images/down.png" mode="widthFix" class="down" wx:if="{{codeList.length>3}}"></image>
<image src="./images/down.png" bindtap="goList" data-index="3" mode="widthFix" class="down" wx:if="{{codeList.length>3}}"></image>
</view>
</view>
</view>
... ...