Authored by 李奇

Merge remote-tracking branch 'origin/master' into feature/code-style

# Conflicts:
#	pages/zeroSell/detail.js
#	pages/zeroSell/index.wxml
... ... @@ -327,14 +327,14 @@ App({
},
isLogin: function () {
return this.globalData.userInfo.uid > 0 ? true : false
return this.globalData.userInfo.uid > 0;
},
getUid: function () {
let uid = this.globalData.userInfo.uid
if(!uid||uid===0){
this.getUserInfo();
uid = this.globalData.userInfo.uid
let uid = this.globalData.userInfo.uid;
if(!uid || uid === 0){
let userInfo = this.getUserInfo();
uid = userInfo.uid || 0
}
return uid;
},
... ...
import queryString from '../vendors/query-string';
import jumpMiniApp from '../router/jump-to-miniapp';
const GO_LIST = 'go.list';
const GO_PRODUCTPOOL = 'go.poollist';
... ... @@ -59,7 +58,20 @@ function jumpByUrl(jumpUrl,pageName){
} else if (GO_SHOP === action) {
path = "../goodsList/brandStore";
} else if (GO_DETAIL === action) {
path = "../goodsDetail/goodsDetail";
let actionType = '';
if (json.params && json.params.activity_type){
actionType = json.params.activity_type;
}
if (actionType && actionType === 'groupPurchase'){
return jumpMiniApp({
app: 'groupBuy',
page: 'detail',
data: {
activityId: json.params.activity_id,
productSkn: json.params.product_skn
}
});
}
} else if (GO_COUPON === action) {
path = "../page/subPackage/pages/couponList/couponList";
}else if (GO_NEW === action) {
... ...
... ... @@ -4,7 +4,9 @@ import ZeroSellService from '../service/zero-sell'
import CommonService from '../service/common'
import router from '../router/router'
var app = null;
const event = global.event;
var app = getApp();
Component({
/**
... ... @@ -42,8 +44,6 @@ Component({
ready() {
this.service = new ZeroSellService();
this.commonService = new CommonService();
app = getApp();
},
/**
... ... @@ -54,9 +54,9 @@ Component({
wx.showLoading({
mask: true
});
let userInfo = app.getUserInfo();
event.emit('user-is-login', {logged: this.logged.bind(this), loginSuccess: function(){}});
},
logged(userInfo) {
this.service.fetchCode({
shareUid: this.properties.shareUid,
uid: app.getUid(),
... ...
... ... @@ -5,8 +5,8 @@
</view>
<view class="desc-content">
<view class="banner" bindtap="_jumpBanner" wx:if="{{bannerSrc != null && bannerSrc !== ''}}">
<image class="banner-img" src="{{bannerSrc}}"></image>
<view class="banner" bindtap="jumpUrl" wx:if="{{bannerSrc != null && bannerSrc !== ''}}">
<image class="banner-img" src="{{bannerSrc}}" mode="widthFix"></image>
</view>
<block wx:for="{{list}}" wx:key="{{index}}">
<block wx:if="{{item.floor_type === 1}}">
... ...
... ... @@ -37,11 +37,10 @@
.banner {
font-size: 0;
width: 100%;
height: 234rpx;
}
.banner-img {
width: 100%;
height: 234rpx;
}
\ No newline at end of file
... ...
... ... @@ -53,7 +53,7 @@ const ACTION_BAR_STATUS = {
END: 6, // 活动结束
}
let app;
let app = getApp();
Page(Object.assign({
... ... @@ -65,7 +65,7 @@ Page(Object.assign({
show: false,
showAuth: false,
actPrizeId: '',
shareUid: '',
shareUid: 0,
scene: '',
participantCount: 0,
myPrizeCount: 0,
... ... @@ -162,8 +162,7 @@ Page(Object.assign({
});
setTimeout(() => {
app = app || getApp();
let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0;
let uid = app.getUid();
this.setData({
hasUnionID: app.globalData.WXUnion_ID !== null && app.globalData.WXUnion_ID !== '' && app.globalData.WXUnion_ID !== undefined ? true : false,
isLogin: app.isLogin(),
... ... @@ -461,14 +460,14 @@ Page(Object.assign({
if (this.data.bannerUrl == null) {
return;
}
jumpByUrl(that.data.bannerUrl);
jumpByUrl(this.data.bannerUrl);
},
_getDetailBanner() {
let commonService = this.commonService;
commonService.getResourceCode('ccc32dbedf164a52b4efa34383878860')
.then(data => {
this.setData({
bannerSrc: formatImageUrl(data.src, 340 * app.globalData.systemInfo.pixelRatio, 340 * app.globalData.systemInfo.pixelRatio, 2),
bannerSrc: formatImageUrl(data.src, 750, 140, 2),
bannerUrl: data.url
})
})
... ...
@import '../../vendors/zanui/actionsheet/index.wxss';
page {
font-size: 0;
}
.product {
display: block;
width: 100%;
... ... @@ -24,14 +28,12 @@
}
.bottom-banner {
/* position: fixed; */
/* padding-bottom: 88rpx; */
height: 234rpx;
width: 100%;
width: 750rpx;
}
.bottom-banner-img {
width: 100%;
width: 750rpx;
height: 234rpx;
}
... ...
{
"description": "项目配置文件。",
"setting": {
"urlCheck": false,
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
"newFeature": true,
"autoAudits": false
},
"compileType": "miniprogram",
"libVersion": "2.0.0",
... ...
import wx from '../utils/wx';
import {stringify} from '../vendors/query-string';
const appData = {
yohobuyLimitChannel: {
appId: 'wxed31f9e8705fb8d1',
page: {
limitProductList: 'pages/index/index'
}
},
groupBuy: { // 拼团
appId: 'wx207f18be42db9028',
page: {
home: '/pages/group/home',
detail: '/pages/group/detail',
}
}
};
export default function(params) {
let navigateToMiniParams = {
appId: appData[params.app].appId,
path: params.path || `${appData[params.app].page[params.page]}?${stringify(params.data)}`
};
return wx.navigateToMiniProgram(navigateToMiniParams);
}
... ...