diff --git a/common/tools.js b/common/tools.js index d5989ea..ee623c3 100644 --- a/common/tools.js +++ b/common/tools.js @@ -30,7 +30,7 @@ var tools = { uni.setStorageSync('promotionUnlocked', true) return true } - uni.removeStorageSync('promotionUnlocked') + uni.setStorageSync('promotionUnlocked', false) return false }, setPromotionBridgeSkip: function(path) { @@ -57,11 +57,7 @@ var tools = { return false }, clearLoginStorage: function() { - const promotionUnlocked = this.getPromotionUnlocked() uni.clearStorageSync() - if (promotionUnlocked) { - this.setPromotionUnlocked(true) - } }, //图片地址拼接 oss: function(url) { diff --git a/components/bottom-nav/bottom-nav.vue b/components/bottom-nav/bottom-nav.vue new file mode 100644 index 0000000..bdd4140 --- /dev/null +++ b/components/bottom-nav/bottom-nav.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/components/taoke/source/classify-source.vue b/components/taoke/source/classify-source.vue new file mode 100644 index 0000000..5f0b20d --- /dev/null +++ b/components/taoke/source/classify-source.vue @@ -0,0 +1,313 @@ + + + + + diff --git a/components/taoke/source/home-source.vue b/components/taoke/source/home-source.vue new file mode 100644 index 0000000..d61f4ed --- /dev/null +++ b/components/taoke/source/home-source.vue @@ -0,0 +1,1702 @@ + + + + + diff --git a/components/taoke/source/rank-source.vue b/components/taoke/source/rank-source.vue new file mode 100644 index 0000000..418d52f --- /dev/null +++ b/components/taoke/source/rank-source.vue @@ -0,0 +1,753 @@ + + + + + diff --git a/components/taoke/tab-classify.vue b/components/taoke/tab-classify.vue new file mode 100644 index 0000000..22d0f89 --- /dev/null +++ b/components/taoke/tab-classify.vue @@ -0,0 +1,13 @@ + + + diff --git a/components/taoke/tab-home.vue b/components/taoke/tab-home.vue new file mode 100644 index 0000000..5180a01 --- /dev/null +++ b/components/taoke/tab-home.vue @@ -0,0 +1,13 @@ + + + diff --git a/components/taoke/tab-rank.vue b/components/taoke/tab-rank.vue new file mode 100644 index 0000000..d931b5c --- /dev/null +++ b/components/taoke/tab-rank.vue @@ -0,0 +1,13 @@ + + + diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index 53df352..22c6a0c 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -30,22 +30,19 @@ const promotionList = [ pagePath: '/pages/tabbar/index', iconPath: '/static/images/icon_sy.png', selectedIconPath: '/static/images/icon_syf.png', - text: '首页', - h5Url: 'https://point.agrimedia.cn/affiliate-activity/pages/index/index' + text: '首页' }, { pagePath: '/pages/tabbar/shop', iconPath: '/static/images/icon_gwc.png', selectedIconPath: '/static/images/icon_gwcf.png', - text: '榜单', - h5Url: 'https://point.agrimedia.cn/affiliate-activity/pages/rank/rank' + text: '榜单' }, { pagePath: '/pages/tabbar/sort', iconPath: '/static/images/icon_fl.png', selectedIconPath: '/static/images/icon_flf.png', - text: '分类', - h5Url: 'https://point.agrimedia.cn/affiliate-activity/pages/classify/classify' + text: '分类' }, { pagePath: '/pages/tabbar/me', @@ -227,15 +224,6 @@ Component({ if (!item) { return } - if (!isPromotionUnlocked && item.h5Url) { - const pages = getCurrentPages() - const currentPage = pages[pages.length - 1] - const from = currentPage && currentPage.route ? `/${currentPage.route}` : '' - wx.navigateTo({ - url: `/pages/h5/bridge?url=${encodeURIComponent(item.h5Url)}&from=${encodeURIComponent(from)}` - }) - return - } setTabbarSelectedPath(item.pagePath) this.setData({ selected: selectedPath, diff --git a/main.js b/main.js index fcf9e89..33cf07d 100644 --- a/main.js +++ b/main.js @@ -9,14 +9,29 @@ const inter = require('common/interceptor.js') import interceptor from '@/common/interceptor.js' -import common from '@/common/common.js' - -Vue.prototype.$tools = tools ;//工具类 -Vue.prototype.$amapwx = amapwx;//高德地图类 -// 混入代码 -Vue.mixin(mixin) -Vue.mixin(inter) -Vue.use(uView) +import common from '@/common/common.js' + +Vue.prototype.$tools = tools ;//工具类 +Vue.prototype.$amapwx = amapwx;//高德地图类 +Vue.prototype.$estimateCoupon = function(tkmoney = 0, percentage = 0.3) { + const amount = Number(tkmoney || 0) * Number(percentage || 0) + return amount.toFixed(2) +} +Vue.prototype.$store = Vue.prototype.$store || { + state: { + isThirdParty: false + }, + getters: { + currentUid: '', + relationId: '', + pid: '', + isThirdParty: false + } +} +// 混入代码 +Vue.mixin(mixin) +Vue.mixin(inter) +Vue.use(uView) // 工具类 diff --git a/pageOne/mes/member.vue b/pageOne/mes/member.vue new file mode 100644 index 0000000..c818c27 --- /dev/null +++ b/pageOne/mes/member.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/pages.json b/pages.json index 0d53483..19caaea 100644 --- a/pages.json +++ b/pages.json @@ -40,6 +40,55 @@ "navigationBarTitleText": "", "navigationStyle": "default" } + }, + { + "path": "pages/detail/detail", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "商品详情" + } + }, + { + "path": "pages/category/category", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "商品分类" + } + }, + { + "path": "pages/category/category_detail", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "商品分类详情" + } + }, + { + "path": "pages/search/search", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "搜索" + } + }, + { + "path": "pages/special-sale/choicen", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "精选品牌" + } + }, + { + "path": "pages/special-sale/details", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "品牌详情" + } + }, + { + "path": "pages/save-money/save-money", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "省钱攻略" + } } ], "subPackages": [{ @@ -157,18 +206,25 @@ "navigationBarBackgroundColor": "#fff" } }, - { - "path": "mes/collection", - "style": { - "navigationBarTitleText": "我的收藏", - "navigationBarBackgroundColor": "#fff" - } - }, - { - "path": "mes/service", - "style": { - "navigationBarTitleText": "联系客服", - "navigationBarBackgroundColor": "#F3C0C3" + { + "path": "mes/collection", + "style": { + "navigationBarTitleText": "我的收藏", + "navigationBarBackgroundColor": "#fff" + } + }, + { + "path": "mes/member", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "mes/service", + "style": { + "navigationBarTitleText": "联系客服", + "navigationBarBackgroundColor": "#F3C0C3" } }, { @@ -276,24 +332,24 @@ "color": "#666", "selectedColor": "#ee4237", "backgroundColor": "#FFFFFF", - "list": [{ - "pagePath": "pages/tabbar/index", - "iconPath": "/static/images/icon_sy.png", - "selectedIconPath": "/static/images/icon_syf.png", - "text": "首页" - }, { - "pagePath": "pages/tabbar/sort", - "iconPath": "/static/images/icon_fl.png", - "selectedIconPath": "/static/images/icon_flf.png", - "text": "分类" - }, { - "pagePath": "pages/tabbar/shop", - "iconPath": "/static/images/icon_gwc.png", - "selectedIconPath": "/static/images/icon_gwcf.png", - "text": "购物车" - }, { - "pagePath": "pages/tabbar/me", - "iconPath": "/static/images/icon_wd.png", + "list": [{ + "pagePath": "pages/tabbar/index", + "iconPath": "/static/images/icon_sy.png", + "selectedIconPath": "/static/images/icon_syf.png", + "text": "首页" + }, { + "pagePath": "pages/tabbar/shop", + "iconPath": "/static/images/icon_gwc.png", + "selectedIconPath": "/static/images/icon_gwcf.png", + "text": "榜单" + }, { + "pagePath": "pages/tabbar/sort", + "iconPath": "/static/images/icon_fl.png", + "selectedIconPath": "/static/images/icon_flf.png", + "text": "分类" + }, { + "pagePath": "pages/tabbar/me", + "iconPath": "/static/images/icon_wd.png", "selectedIconPath": "/static/images/icon_wdf.png", "text": "我的" }] diff --git a/pages/category/category.vue b/pages/category/category.vue new file mode 100644 index 0000000..2c1c4eb --- /dev/null +++ b/pages/category/category.vue @@ -0,0 +1,671 @@ + + + + + diff --git a/pages/category/category_detail.vue b/pages/category/category_detail.vue new file mode 100644 index 0000000..8a25af5 --- /dev/null +++ b/pages/category/category_detail.vue @@ -0,0 +1,660 @@ + + + + + diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue new file mode 100644 index 0000000..863feb2 --- /dev/null +++ b/pages/detail/detail.vue @@ -0,0 +1,1703 @@ + + + + + diff --git a/pages/h5/bridge.vue b/pages/h5/bridge.vue index 68b0353..76f420d 100644 --- a/pages/h5/bridge.vue +++ b/pages/h5/bridge.vue @@ -1,6 +1,6 @@ @@ -8,49 +8,37 @@ export default { data() { return { - activityHomeUrl: 'http://point.agrimedia.cn/affiliate-activity/pages/index/index', - src: '', from: '' } }, onLoad(options) { - this.initBridgeEntryUrl() if (options && options.from) { this.from = decodeURIComponent(options.from) } - }, - onUnload() { - if (this.from) { - this.$tools.setPromotionBridgeSkip(this.from) - } - }, - methods: { - // 进入 bridge 页后统一跳到活动首页: - // 1. 已登录时在活动首页后拼上 exuid,uid 数字段固定补足到 7 位。 - // 2. 未登录时直接进入活动首页,不带 exuid。 - initBridgeEntryUrl() { - const localUid = String(uni.getStorageSync('uid') || '') - if (!localUid) { - this.src = this.activityHomeUrl - return + const target = this.from || '/pages/tabbar/index' + uni.switchTab({ + url: target, + fail: () => { + uni.reLaunch({ + url: target + }) } - const promotionUid = this.buildPromotionUidValue(localUid) - this.src = `${this.activityHomeUrl}?exuid=${promotionUid}` - console.log(this.src) - }, - // 推广相关的 uid 数字段始终保持 7 位,不足时在末尾补 0。 - buildPromotionUidValue(localUid) { - const uidValue = String(localUid || '') - const padCount = Math.max(7 - uidValue.length, 0) - return `${uidValue}${'0'.repeat(padCount)}` - } - } + }) + }, + methods: {} } diff --git a/pages/login/login.vue b/pages/login/login.vue index 363a09c..9a145b1 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -7,7 +7,8 @@ - + +