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({ @@ -327,14 +327,14 @@ App({
327 }, 327 },
328 328
329 isLogin: function () { 329 isLogin: function () {
330 - return this.globalData.userInfo.uid > 0 ? true : false 330 + return this.globalData.userInfo.uid > 0;
331 }, 331 },
332 332
333 getUid: function () { 333 getUid: function () {
334 - let uid = this.globalData.userInfo.uid  
335 - if(!uid||uid===0){  
336 - this.getUserInfo();  
337 - uid = this.globalData.userInfo.uid 334 + let uid = this.globalData.userInfo.uid;
  335 + if(!uid || uid === 0){
  336 + let userInfo = this.getUserInfo();
  337 + uid = userInfo.uid || 0
338 } 338 }
339 return uid; 339 return uid;
340 }, 340 },
1 -  
2 -  
3 import queryString from '../vendors/query-string'; 1 import queryString from '../vendors/query-string';
  2 +import jumpMiniApp from '../router/jump-to-miniapp';
4 3
5 const GO_LIST = 'go.list'; 4 const GO_LIST = 'go.list';
6 const GO_PRODUCTPOOL = 'go.poollist'; 5 const GO_PRODUCTPOOL = 'go.poollist';
@@ -59,7 +58,20 @@ function jumpByUrl(jumpUrl,pageName){ @@ -59,7 +58,20 @@ function jumpByUrl(jumpUrl,pageName){
59 } else if (GO_SHOP === action) { 58 } else if (GO_SHOP === action) {
60 path = "../goodsList/brandStore"; 59 path = "../goodsList/brandStore";
61 } else if (GO_DETAIL === action) { 60 } else if (GO_DETAIL === action) {
62 - path = "../goodsDetail/goodsDetail"; 61 + let actionType = '';
  62 + if (json.params && json.params.activity_type){
  63 + actionType = json.params.activity_type;
  64 + }
  65 + if (actionType && actionType === 'groupPurchase'){
  66 + return jumpMiniApp({
  67 + app: 'groupBuy',
  68 + page: 'detail',
  69 + data: {
  70 + activityId: json.params.activity_id,
  71 + productSkn: json.params.product_skn
  72 + }
  73 + });
  74 + }
63 } else if (GO_COUPON === action) { 75 } else if (GO_COUPON === action) {
64 path = "../page/subPackage/pages/couponList/couponList"; 76 path = "../page/subPackage/pages/couponList/couponList";
65 }else if (GO_NEW === action) { 77 }else if (GO_NEW === action) {
@@ -4,7 +4,9 @@ import ZeroSellService from '../service/zero-sell' @@ -4,7 +4,9 @@ import ZeroSellService from '../service/zero-sell'
4 import CommonService from '../service/common' 4 import CommonService from '../service/common'
5 import router from '../router/router' 5 import router from '../router/router'
6 6
7 -var app = null; 7 +const event = global.event;
  8 +
  9 +var app = getApp();
8 10
9 Component({ 11 Component({
10 /** 12 /**
@@ -42,8 +44,6 @@ Component({ @@ -42,8 +44,6 @@ Component({
42 ready() { 44 ready() {
43 this.service = new ZeroSellService(); 45 this.service = new ZeroSellService();
44 this.commonService = new CommonService(); 46 this.commonService = new CommonService();
45 -  
46 - app = getApp();  
47 }, 47 },
48 48
49 /** 49 /**
@@ -54,9 +54,9 @@ Component({ @@ -54,9 +54,9 @@ Component({
54 wx.showLoading({ 54 wx.showLoading({
55 mask: true 55 mask: true
56 }); 56 });
57 -  
58 - let userInfo = app.getUserInfo();  
59 - 57 + event.emit('user-is-login', {logged: this.logged.bind(this), loginSuccess: function(){}});
  58 + },
  59 + logged(userInfo) {
60 this.service.fetchCode({ 60 this.service.fetchCode({
61 shareUid: this.properties.shareUid, 61 shareUid: this.properties.shareUid,
62 uid: app.getUid(), 62 uid: app.getUid(),
@@ -99,7 +99,7 @@ Component({ @@ -99,7 +99,7 @@ Component({
99 url: '/pages/zeroSell/index?reload=0', 99 url: '/pages/zeroSell/index?reload=0',
100 100
101 }) 101 })
102 - 102 +
103 }, 103 },
104 104
105 cancelAlert() { 105 cancelAlert() {
@@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
5 </view> 5 </view>
6 6
7 <view class="desc-content"> 7 <view class="desc-content">
8 - <view class="banner" bindtap="_jumpBanner" wx:if="{{bannerSrc != null && bannerSrc !== ''}}">  
9 - <image class="banner-img" src="{{bannerSrc}}"></image> 8 + <view class="banner" bindtap="jumpUrl" wx:if="{{bannerSrc != null && bannerSrc !== ''}}">
  9 + <image class="banner-img" src="{{bannerSrc}}" mode="widthFix"></image>
10 </view> 10 </view>
11 <block wx:for="{{list}}" wx:key="{{index}}"> 11 <block wx:for="{{list}}" wx:key="{{index}}">
12 <block wx:if="{{item.floor_type === 1}}"> 12 <block wx:if="{{item.floor_type === 1}}">
@@ -37,11 +37,10 @@ @@ -37,11 +37,10 @@
37 37
38 38
39 .banner { 39 .banner {
  40 + font-size: 0;
40 width: 100%; 41 width: 100%;
41 - height: 234rpx;  
42 } 42 }
43 43
44 .banner-img { 44 .banner-img {
45 width: 100%; 45 width: 100%;
46 - height: 234rpx;  
47 } 46 }
@@ -53,7 +53,7 @@ const ACTION_BAR_STATUS = { @@ -53,7 +53,7 @@ const ACTION_BAR_STATUS = {
53 END: 6, // 活动结束 53 END: 6, // 活动结束
54 } 54 }
55 55
56 -let app; 56 +let app = getApp();
57 57
58 Page(Object.assign({ 58 Page(Object.assign({
59 59
@@ -65,7 +65,7 @@ Page(Object.assign({ @@ -65,7 +65,7 @@ Page(Object.assign({
65 show: false, 65 show: false,
66 showAuth: false, 66 showAuth: false,
67 actPrizeId: '', 67 actPrizeId: '',
68 - shareUid: '', 68 + shareUid: 0,
69 scene: '', 69 scene: '',
70 participantCount: 0, 70 participantCount: 0,
71 myPrizeCount: 0, 71 myPrizeCount: 0,
@@ -162,8 +162,7 @@ Page(Object.assign({ @@ -162,8 +162,7 @@ Page(Object.assign({
162 }); 162 });
163 setTimeout(() => { 163 setTimeout(() => {
164 app = app || getApp(); 164 app = app || getApp();
165 - let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0;  
166 - 165 + let uid = app.getUid();
167 this.setData({ 166 this.setData({
168 hasUnionID: app.globalData.WXUnion_ID !== null && app.globalData.WXUnion_ID !== '' && app.globalData.WXUnion_ID !== undefined ? true : false, 167 hasUnionID: app.globalData.WXUnion_ID !== null && app.globalData.WXUnion_ID !== '' && app.globalData.WXUnion_ID !== undefined ? true : false,
169 isLogin: app.isLogin(), 168 isLogin: app.isLogin(),
@@ -461,14 +460,14 @@ Page(Object.assign({ @@ -461,14 +460,14 @@ Page(Object.assign({
461 if (this.data.bannerUrl == null) { 460 if (this.data.bannerUrl == null) {
462 return; 461 return;
463 } 462 }
464 - jumpByUrl(that.data.bannerUrl); 463 + jumpByUrl(this.data.bannerUrl);
465 }, 464 },
466 _getDetailBanner() { 465 _getDetailBanner() {
467 let commonService = this.commonService; 466 let commonService = this.commonService;
468 commonService.getResourceCode('ccc32dbedf164a52b4efa34383878860') 467 commonService.getResourceCode('ccc32dbedf164a52b4efa34383878860')
469 .then(data => { 468 .then(data => {
470 this.setData({ 469 this.setData({
471 - bannerSrc: formatImageUrl(data.src, 340 * app.globalData.systemInfo.pixelRatio, 340 * app.globalData.systemInfo.pixelRatio, 2), 470 + bannerSrc: formatImageUrl(data.src, 750, 140, 2),
472 bannerUrl: data.url 471 bannerUrl: data.url
473 }) 472 })
474 }) 473 })
1 @import '../../vendors/zanui/actionsheet/index.wxss'; 1 @import '../../vendors/zanui/actionsheet/index.wxss';
2 2
  3 +page {
  4 + font-size: 0;
  5 +}
  6 +
3 .product { 7 .product {
4 display: block; 8 display: block;
5 width: 100%; 9 width: 100%;
@@ -24,14 +28,12 @@ @@ -24,14 +28,12 @@
24 } 28 }
25 29
26 .bottom-banner { 30 .bottom-banner {
27 - /* position: fixed; */  
28 - /* padding-bottom: 88rpx; */  
29 height: 234rpx; 31 height: 234rpx;
30 - width: 100%; 32 + width: 750rpx;
31 } 33 }
32 34
33 .bottom-banner-img { 35 .bottom-banner-img {
34 - width: 100%; 36 + width: 750rpx;
35 height: 234rpx; 37 height: 234rpx;
36 } 38 }
37 39
1 { 1 {
2 "description": "项目配置文件。", 2 "description": "项目配置文件。",
3 "setting": { 3 "setting": {
4 - "urlCheck": false, 4 + "urlCheck": true,
5 "es6": true, 5 "es6": true,
6 "postcss": true, 6 "postcss": true,
7 "minified": true, 7 "minified": true,
8 - "newFeature": true 8 + "newFeature": true,
  9 + "autoAudits": false
9 }, 10 },
10 "compileType": "miniprogram", 11 "compileType": "miniprogram",
11 "libVersion": "2.0.0", 12 "libVersion": "2.0.0",
  1 +import wx from '../utils/wx';
  2 +import {stringify} from '../vendors/query-string';
  3 +
  4 +const appData = {
  5 + yohobuyLimitChannel: {
  6 + appId: 'wxed31f9e8705fb8d1',
  7 + page: {
  8 + limitProductList: 'pages/index/index'
  9 + }
  10 + },
  11 + groupBuy: { // 拼团
  12 + appId: 'wx207f18be42db9028',
  13 + page: {
  14 + home: '/pages/group/home',
  15 + detail: '/pages/group/detail',
  16 + }
  17 + }
  18 +};
  19 +
  20 +export default function(params) {
  21 + let navigateToMiniParams = {
  22 + appId: appData[params.app].appId,
  23 + path: params.path || `${appData[params.app].page[params.page]}?${stringify(params.data)}`
  24 + };
  25 +
  26 + return wx.navigateToMiniProgram(navigateToMiniParams);
  27 +}