Showing
10 changed files
with
18 additions
and
75 deletions
@@ -10,7 +10,6 @@ import md5 from './vendors/md5'; | @@ -10,7 +10,6 @@ import md5 from './vendors/md5'; | ||
10 | var mta = require('./vendors/mta_analysis.js') | 10 | var mta = require('./vendors/mta_analysis.js') |
11 | import { wechatLoginAction } from './utils/login'; | 11 | import { wechatLoginAction } from './utils/login'; |
12 | import { isStringEmpty, getYHStorageSync} from './utils/util'; | 12 | import { isStringEmpty, getYHStorageSync} from './utils/util'; |
13 | -import './router/index'; | ||
14 | 13 | ||
15 | import { logEvent, | 14 | import { logEvent, |
16 | YB_LAUNCH_APP, | 15 | YB_LAUNCH_APP, |
@@ -20,5 +20,6 @@ export default { | @@ -20,5 +20,6 @@ export default { | ||
20 | "business_line": "miniapp", | 20 | "business_line": "miniapp", |
21 | "os_version": "yohobuy:h5", | 21 | "os_version": "yohobuy:h5", |
22 | "app_version": "2.8.3", | 22 | "app_version": "2.8.3", |
23 | - "app_build": "1032" | 23 | + "app_build": "1032", |
24 | + "mini_qr_type": 16 | ||
24 | } | 25 | } |
@@ -22,14 +22,10 @@ export const SERVICE_HOST = 'http://api-test3.dev.yohocorp.com'; | @@ -22,14 +22,10 @@ export const SERVICE_HOST = 'http://api-test3.dev.yohocorp.com'; | ||
22 | // export const API_HOST = 'https://apigray.yoho.cn'; | 22 | // export const API_HOST = 'https://apigray.yoho.cn'; |
23 | // export const SERVICE_HOST = 'https://apigray.yoho.cn'; | 23 | // export const SERVICE_HOST = 'https://apigray.yoho.cn'; |
24 | 24 | ||
25 | -//有货精选 | ||
26 | -export const MINI_APP_TYPE = '0'; | 25 | +export const MINI_APP_TYPE = 29; |
26 | +export const MINI_QR_TYPE = 16; | ||
27 | export const PAYMENT_CODE = '45'; | 27 | export const PAYMENT_CODE = '45'; |
28 | 28 | ||
29 | -//有货商城精选 | ||
30 | -// export const MINI_APP_TYPE = '1'; | ||
31 | -// export const PAYMENT_CODE = '48'; | ||
32 | - | ||
33 | export const OS_VERSION = 'yohobuy:h5'; | 29 | export const OS_VERSION = 'yohobuy:h5'; |
34 | 30 | ||
35 | export const APP_VERSION = '2.9.0'; | 31 | export const APP_VERSION = '2.9.0'; |
@@ -170,23 +170,13 @@ Component({ | @@ -170,23 +170,13 @@ Component({ | ||
170 | }); | 170 | }); |
171 | }, | 171 | }, |
172 | 172 | ||
173 | - //事件 | ||
174 | jumpToHome() { | 173 | jumpToHome() { |
175 | - wx.switchTab({ | ||
176 | - url: '/pages/index/index', | ||
177 | - }) | ||
178 | }, | 174 | }, |
179 | 175 | ||
180 | jumpToSearch() { | 176 | jumpToSearch() { |
181 | - wx.navigateTo({ | ||
182 | - url: '/pages/search/search', | ||
183 | - }) | ||
184 | }, | 177 | }, |
185 | 178 | ||
186 | jumpToShopCart() { | 179 | jumpToShopCart() { |
187 | - wx.switchTab({ | ||
188 | - url: '/pages/shopCart/shopCart', | ||
189 | - }) | ||
190 | }, | 180 | }, |
191 | 181 | ||
192 | backToTop() { | 182 | backToTop() { |
@@ -3,8 +3,14 @@ | @@ -3,8 +3,14 @@ | ||
3 | <view class="quicknavigation-content"> | 3 | <view class="quicknavigation-content"> |
4 | <view class="quicknavigation-menu" wx:if="{{isShowMenu}}"> | 4 | <view class="quicknavigation-menu" wx:if="{{isShowMenu}}"> |
5 | <view class="quicknavigation-menu-func"> | 5 | <view class="quicknavigation-menu-func"> |
6 | - <image class="img" id="home" animation="{{funcItemAnimation}}" bindtap="jumpToHome" src="/pages/quickNavigation/images/home@3x.png"> </image> | ||
7 | - <image class="img" id="search" animation="{{funcItemAnimation}}" bindtap="jumpToSearch" src="/pages/quickNavigation/images/search_ic@3x.png"> </image> | 6 | + <navigator target="miniProgram" app-id="wx084ab813d88c594b" path="/pages/index/index" version="develop" > |
7 | + <image class="img" id="home" animation="{{funcItemAnimation}}" src="/pages/quickNavigation/images/home@3x.png"> </image> | ||
8 | + </navigator> | ||
9 | + | ||
10 | + <navigator target="miniProgram" app-id="wx084ab813d88c594b" path="/pages/search/search" version="develop" > | ||
11 | + <image class="img" id="search" animation="{{funcItemAnimation}}" src="/pages/quickNavigation/images/search_ic@3x.png"> </image> | ||
12 | + </navigator> | ||
13 | + | ||
8 | <image class="img" id="shopcart" wx:if="{{isShowShopCart}}" animation="{{funcItemAnimation}}" bindtap="jumpToShopCart" src="/pages/quickNavigation/images/shopcart_ic@3x.png"> </image> | 14 | <image class="img" id="shopcart" wx:if="{{isShowShopCart}}" animation="{{funcItemAnimation}}" bindtap="jumpToShopCart" src="/pages/quickNavigation/images/shopcart_ic@3x.png"> </image> |
9 | <button class="appBtn" bindtap='goApp' id="appBtn" type="default" hover-class="none" open-type="launchApp" app-parameter="{{appParameter}}" binderror="launchAppError" wx:if="{{isGoApp}}" animation="{{funcItemAnimation}}"> | 15 | <button class="appBtn" bindtap='goApp' id="appBtn" type="default" hover-class="none" open-type="launchApp" app-parameter="{{appParameter}}" binderror="launchAppError" wx:if="{{isGoApp}}" animation="{{funcItemAnimation}}"> |
10 | <image class="appImg" src="/pages/quickNavigation/images/APP@3x.png" animation="{{funcItemAnimation}}"></image> | 16 | <image class="appImg" src="/pages/quickNavigation/images/APP@3x.png" animation="{{funcItemAnimation}}"></image> |
@@ -81,13 +81,13 @@ Page(Object.assign({ | @@ -81,13 +81,13 @@ Page(Object.assign({ | ||
81 | className: 'action-class', | 81 | className: 'action-class', |
82 | loading: false, | 82 | loading: false, |
83 | openType: 'share', | 83 | openType: 'share', |
84 | - image_src: '../../../../images/share_wechat@2x.png', | 84 | + image_src: '../../images/share_wechat@2x.png', |
85 | }, | 85 | }, |
86 | { | 86 | { |
87 | name: '分享到朋友圈', | 87 | name: '分享到朋友圈', |
88 | className: 'action-class', | 88 | className: 'action-class', |
89 | loading: false, | 89 | loading: false, |
90 | - image_src: '../../../../images/share_wxpeng@2x.png' | 90 | + image_src: '../../images/share_wxpeng@2x.png' |
91 | } | 91 | } |
92 | ] | 92 | ] |
93 | }, | 93 | }, |
@@ -36,13 +36,13 @@ Page(Object.assign({ | @@ -36,13 +36,13 @@ Page(Object.assign({ | ||
36 | className: 'action-class', | 36 | className: 'action-class', |
37 | loading: false, | 37 | loading: false, |
38 | openType: 'share', | 38 | openType: 'share', |
39 | - image_src: '../../../../images/share_wechat@2x.png', | 39 | + image_src: '../../images/share_wechat@2x.png', |
40 | }, | 40 | }, |
41 | { | 41 | { |
42 | name: '分享到朋友圈', | 42 | name: '分享到朋友圈', |
43 | className: 'action-class', | 43 | className: 'action-class', |
44 | loading: false, | 44 | loading: false, |
45 | - image_src: '../../../../images/share_wxpeng@2x.png' | 45 | + image_src: '../../images/share_wxpeng@2x.png' |
46 | }] | 46 | }] |
47 | }, | 47 | }, |
48 | }, | 48 | }, |
1 | 1 | ||
2 | 2 | ||
3 | import Service from './service' | 3 | import Service from './service' |
4 | -import { ACTIVITY_HOST, API_HOST} from '../../../libs/config'; | 4 | +import { ACTIVITY_HOST, API_HOST, MINI_QR_TYPE} from '../../../libs/config'; |
5 | 5 | ||
6 | const MODULE = '/activity/zerobuy'; | 6 | const MODULE = '/activity/zerobuy'; |
7 | 7 | ||
@@ -78,7 +78,7 @@ class ZeroSellService extends Service { | @@ -78,7 +78,7 @@ class ZeroSellService extends Service { | ||
78 | } | 78 | } |
79 | 79 | ||
80 | getQrCode(page_param) { | 80 | getQrCode(page_param) { |
81 | - return API_HOST + '/wechat/miniapp/img-check.jpg?param=' + JSON.stringify(page_param) + '&miniQrType=14'; | 81 | + return API_HOST + '/wechat/miniapp/img-check.jpg?param=' + JSON.stringify(page_param) + `&miniQrType=${MINI_QR_TYPE}`; |
82 | } | 82 | } |
83 | 83 | ||
84 | getUserProfile(data) { | 84 | getUserProfile(data) { |
router/index.js
deleted
100644 → 0
1 | -import jumpToMiniapp from './jump-to-miniapp'; | ||
2 | -import {parse, stringify} from '../vendors/query-string'; | ||
3 | - | ||
4 | -const MINI_APP_DOMAIN = 'miniapp.yohobuy.com'; | ||
5 | - | ||
6 | -global.router = { | ||
7 | - goUrl(url) { | ||
8 | - if (!url) { | ||
9 | - return Promise.reject('error url'); | ||
10 | - } | ||
11 | - | ||
12 | - const [uri, search] = url.split('?'); | ||
13 | - const path = uri.split(MINI_APP_DOMAIN)[1]; | ||
14 | - const qs = parse(search); | ||
15 | - | ||
16 | - if (qs.app && path) { | ||
17 | - return jumpToMiniapp({ | ||
18 | - app: qs.app, | ||
19 | - path: `${path}?${stringify(qs)}` | ||
20 | - }); | ||
21 | - } | ||
22 | - } | ||
23 | -}; |
router/jump-to-miniapp.js
deleted
100644 → 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 | - anotherApp: { | ||
12 | - appId: 'wx084ab813d88c594b', | ||
13 | - page: { | ||
14 | - home: '/pages/product/detail/detail' | ||
15 | - } | ||
16 | - }, | ||
17 | -}; | ||
18 | - | ||
19 | -export default function(params) { | ||
20 | - let navigateToMiniParams = { | ||
21 | - appId: appData[params.app].appId, | ||
22 | - path: params.path || `${appData[params.app].page[params.page]}?${stringify(params.data)}` | ||
23 | - }; | ||
24 | - | ||
25 | - return wx.navigateToMiniProgram(navigateToMiniParams); | ||
26 | -} |
-
Please register or login to post a comment