commit adae27c21db1c7e01e51bdfd3ba5d0ae29093de7 Author: yjwfn Date: Sun Dec 12 17:15:24 2021 +0800 jd coupon diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a0dddc6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +.DS_Store +node_modules +/dist + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/app.js b/app.js new file mode 100644 index 0000000..7f205bc --- /dev/null +++ b/app.js @@ -0,0 +1,84 @@ +//app.js +const i18n = require('./utils/language/i18n'); +const en = require('./utils/language/en'); +const zh_cn = require('./utils/language/zhCN'); +const {options} = require('./utils/network/services/service.js') +const constants = require('./utils/constants') +const util = require('./utils/util') + +App({ + onLaunch: function () { + + //国际化 + i18n.registerLocale({en, zh_cn}); + + //获取系统信息 + var sysinfo = wx.getSystemInfoSync(); + var language = sysinfo.language; + if (language.toLowerCase() == "zh_cn" || language.toLowerCase() == "zh") language = "zh_cn"; + this.globalData.sys_info = sysinfo; + this.globalData.sys_platform = sysinfo.platform; + this.globalData.sys_language = language; + this.i18n.setLocale(language); + + // 获取用户信息 + wx.getSetting({ + success: res => { + if (res.authSetting['scope.userInfo']) { + // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 + wx.getUserInfo({ + success: res => { + // 可以将 res 发送给后台解码出 unionId + this.globalData.userInfo = res.userInfo + // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 + // 所以此处加入 callback 以防止这种情况 + if (this.userInfoReadyCallback) { + this.userInfoReadyCallback(res) + } + } + }) + } + } + }) + + + wx.getSystemInfo({ + success: e => { + this.globalData.StatusBar = e.statusBarHeight; + let custom = wx.getMenuButtonBoundingClientRect(); + this.globalData.Custom = custom; + this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight; + this.globalData.windowWidth = e.windowWidth + this.globalData.windowHeight = e.windowHeight + } + }) + this.globalData.loginMode = util.getStorage(constants.NEW_USER_PLOY) + //获取系统配置信息 + options().then(res => { + let loginModel = false + res.data.data.forEach(it => { + if (it.key == 'app_force_login') loginModel = it.value + }) + util.setStorage(constants.NEW_USER_PLOY, loginModel) + util.setStorage(constants.DICTIONARY, res.data.data) + this.globalData.loginMode = util.getStorage(constants.NEW_USER_PLOY) + }) + + }, + + i18n, + globalData: { + userInfo: null, + StatusBar: null, + Custom: null, + CustomBar: null, + sys_language: "zh_cn", + sys_platform: "ios", + sys_info: null, + windowHeight: 0,//窗口高度 + windowWidth: 0,//窗口宽度 + loginStatus: false,//是否已经登录 + loginMode: false,//新用户是否强制注册 + shareUrl:'' + } +}) \ No newline at end of file diff --git a/app.json b/app.json new file mode 100644 index 0000000..98e61ff --- /dev/null +++ b/app.json @@ -0,0 +1,118 @@ +{ + "pages": [ + "pages/main-two/main-two", + "pages/daren/daren", + "pages/vip/vip", + "pages/strategy/strategy", + "pages/mine/mine", + "pages/launch/launch", + "pages/sort/sort", + "pages/product/product", + "pages/login/login", + "pages/login/phone-login/phone-login" + ], + "subpackages": [ + { + "root": "page_package", + "name": "features", + "pages": [ + "details/index", + "search/search", + "product-type/product-type", + "video-play/video-play", + "about/about", + "menu-product/menu-product", + "time-reward/time-reward", + "new-welfare/new-welfare", + "activity/activity", + "money/cash/cash", + "money/quota/quota", + "money/history/history", + "money/bill/bill", + "money/explain/explain", + "fans/fans", + "equity/equity", + "apply-vip/apply-vip", + "profit/profit", + "order/order", + "video-course/video-course", + "study/study", + "question/question", + "contacts/contacts", + "feedback/feedback", + "apply-vip/example/example", + "poster/poster", + "news-details/news-details", + "transfer/transfer/transfer", + "transfer/chain/chain" + ] + } + ], + "preloadRule": { + "pages/launch/launch": { + "network": "all", + "packages": [ + "page_package" + ] + } + }, + "window": { + "navigationBarBackgroundColor": "#F1444C", + "navigationBarTitleText": "尚橙优选", + "navigationBarTextStyle": "white" + }, + "tabBar": { + "custom": true, + "color": "#7A7E83", + "selectedColor": "#f43f3b", + "borderStyle": "black", + "backgroundColor": "#ffffff", + "list": [ + { + "pagePath": "pages/main-two/main-two", + "iconPath": "images/ic_tab_home.png", + "selectedIconPath": "images/ic_tab_home_cur.png", + "text": "首页" + }, + { + "pagePath": "pages/sort/sort", + "iconPath": "images/ic_tab_daren.png", + "selectedIconPath": "images/ic_tab_daren_cur.png", + "text": "分类" + }, + { + "pagePath": "pages/vip/vip", + "iconPath": "images/ic_tab_vip.png", + "selectedIconPath": "images/ic_tab_vip_cur.png", + "text": "会员" + }, + { + "pagePath": "pages/strategy/strategy", + "iconPath": "images/ic_tab_strategy.png", + "selectedIconPath": "images/ic_tab_strategy_cur.png", + "text": "攻略" + }, + { + "pagePath": "pages/mine/mine", + "iconPath": "images/ic_tab_mine.png", + "selectedIconPath": "images/ic_tab_mine_cur.png", + "text": "我的" + } + ], + "usingComponents": {} + }, + "usingComponents": { + "custom": "/components/custom/index", + "prompt": "/components/prompt-dialig/index" + }, + "networkTimeout": { + "request": 30000, + "connectSocket": 20000, + "uploadFile": 60000, + "downloadFile": 60000 + }, + "navigateToMiniProgramAppIdList": [ + "wx91d27dbf599dff74" + ], + "sitemapLocation": "sitemap.json" +} \ No newline at end of file diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..5d71c41 --- /dev/null +++ b/app.wxss @@ -0,0 +1,15 @@ +@import "utils/styles/main.wxss"; +@import "utils/styles/icon.wxss"; +@import "utils/styles/animation.wxss"; +@import "utils/styles/base.wxss"; + +/**app.wxss**/ +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 200rpx 0; + box-sizing: border-box; +} diff --git a/components/custom/index.js b/components/custom/index.js new file mode 100644 index 0000000..50a5cf9 --- /dev/null +++ b/components/custom/index.js @@ -0,0 +1,54 @@ +const app = getApp(); +Component({ + /** + * 组件的一些选项 + */ + options: { + addGlobalClass: true, + multipleSlots: true + }, + /** + * 组件的对外属性 + */ + properties: { + bgColor: { + type: String, + default: '' + }, + isCustom: { + type: [Boolean, String], + default: false + }, + isBack: { + type: [Boolean, String], + default: false + }, + bgImage: { + type: String, + default: '' + }, + }, + /** + * 组件的初始数据 + */ + data: { + StatusBar: app.globalData.StatusBar, + CustomBar: app.globalData.CustomBar, + Custom: app.globalData.Custom + }, + /** + * 组件的方法列表 + */ + methods: { + BackPage() { + wx.navigateBack({ + delta: 1 + }); + }, + toHome(){ + wx.reLaunch({ + url: '/pages/main-two/main-two', + }) + } + } +}) \ No newline at end of file diff --git a/components/custom/index.json b/components/custom/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/custom/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/custom/index.wxml b/components/custom/index.wxml new file mode 100644 index 0000000..3be8267 --- /dev/null +++ b/components/custom/index.wxml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/custom/index.wxss b/components/custom/index.wxss new file mode 100644 index 0000000..bcbaa1c --- /dev/null +++ b/components/custom/index.wxss @@ -0,0 +1 @@ +/* components/custom/index.wxss */ \ No newline at end of file diff --git a/components/home-page/home-page.js b/components/home-page/home-page.js new file mode 100644 index 0000000..feb3bd3 --- /dev/null +++ b/components/home-page/home-page.js @@ -0,0 +1,86 @@ +const app = getApp() +const constants = require("../../utils/constants") +const util = require("../../utils/util") +const {onLogin} = require("../../utils/network/services/user.js") +const {queryProductType, goodsTop} = require("../../utils/network/services/productImpl.js") +const {newsList, homeBanner} = require("../../utils/network/services/service.js") +let pageStart = 1; + +Component({ + /** + * 组件的属性列表 + */ + properties: {}, + + /** + * 组件的初始数据 + */ + data: { + windowHeight: app.globalData.windowHeight, + TabCur: 0, + scrollLeft: 0, + userInfo: '', + requesting: false, + end: false, + emptyShow: false, + page: pageStart, + listData: [], + hasTop: false, + scrollTop: 1, + enableBackToTop: false, + refreshSize: 90, + bottomSize: 100, + color: "#3F82FD", + empty: false, + selectTab: -110, + pages: 1, + isShowBack: false, + isSuperVip: false, + invitationDialog: false, + searchContent: '' + }, + + /** + * 组件的方法列表 + */ + methods: { + login() { + let that = this + this.selectComponent("#main").refresh(); + if (!app.globalData.loginStatus) { + // 登录 + wx.login({ + success: res => { + onLogin(res.code) + .then(res => { + app.globalData.userInfo = res.data.data + app.globalData.loginStatus = true + util.setStorage(constants.AUTH_INFO, res.data.data) + that.setData({userInfo: res.data.data}) + }).catch((err) => { + if (err.data.code = 'USER_NOT_REGISTERED' && app.globalData.loginMode == 'true') { + that.data.requesting = false + that.setData({token: err.data.data.token}) + wx.navigateTo({url: '/pages/login/login?token=' + err.data.data.token}) + } + }) + } + }) + } + }, + onScroll(event) { + this.setData({isShowBack: event.detail.detail.scrollTop > this.data.windowHeight * 0.4}) + }, + // 刷新数据 + refresh() { + this.login() + this.setData({empty: false, requesting: true}) + }, + // 加载更多 + more() { + this.selectComponent("#main").onMore() + this.setData({requesting: true}) + setTimeout(() => {this.setData({requesting: false})}, 1000); + }, + } +}) diff --git a/components/home-page/home-page.json b/components/home-page/home-page.json new file mode 100644 index 0000000..ae0af8d --- /dev/null +++ b/components/home-page/home-page.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "bc-scroll": "/components/refresh/refresh" + } +} \ No newline at end of file diff --git a/components/home-page/home-page.wxml b/components/home-page/home-page.wxml new file mode 100644 index 0000000..c5d907e --- /dev/null +++ b/components/home-page/home-page.wxml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 顶部 + + diff --git a/components/home-page/home-page.wxss b/components/home-page/home-page.wxss new file mode 100644 index 0000000..667fb09 --- /dev/null +++ b/components/home-page/home-page.wxss @@ -0,0 +1,2 @@ +/* components/home-page/home-page.wxss */ +@import "../../pages/index/index.wxss"; \ No newline at end of file diff --git a/components/new-item/new-item.js b/components/new-item/new-item.js new file mode 100644 index 0000000..6b556c5 --- /dev/null +++ b/components/new-item/new-item.js @@ -0,0 +1,151 @@ +// components/new-item/new-item.js +const app = getApp() +Component({ + /** + * 组件的属性列表 + */ + properties: { + listData: { + type: Array, + value: [ + { + title: '成长任务1:升级超级会员省更的多赚的多', + content: '建立一个大于50人的微信群完成升级,即可开启省得更多同时分享赚钱等9项特权。', + subTitle: '', + subContent: '', + actionBtn: '去升级', + video: '查看教学视频', + color: '' + }, + { + title: '成长任务2:掌握选爆款和会卖货的技巧', + content: '了解小程序内重要的选品频道,并掌握多种发品方式和技巧,为请朋好友带来优惠,自己也能轻松赚取推广费。', + subTitle: '想学习更多一定添加专属导师微信!', + subContent: 'df33v', + actionBtn: '复制微信号', + video: '查看教学视频', + color: 'color-main' + }, + { + title: '成长任务3:近培训群实现收益技能双增长', + content: '官方培训群有全方位阶段课程,更有大咖讲师的独家秘诀分享,帮助您的收益和技能实现快速增长。还可以添加导师微信进群学习。', + subTitle: '', + subContent: '', + actionBtn: '', + video: '查看教学视频', + color: '' + }, + { + title: '成长任务4:近爆款群选取更多爆弹素材', + content: '官方爆款群是重要选品渠道之一,这里都是全网每天的爆款商品,已图片+视频+软文形式展示增强出单!', + subTitle: '从爆款群选品要先转链在发出哦~', + subContent: '', + actionBtn: '获取进群二维码', + video: '查看教学视频', + color: 'color6' + }, + { + title: '成长任务5:邀请伙伴加入TA赚您更赚', + content: '学会邀请伙伴加入的三种方式,帮助伙伴省钱赚钱的同时您还能获得平台的额外奖励,邀请越多赚得就越多哦~', + subTitle: '', + subContent: '', + actionBtn: '去邀请', + video: '查看教学视频', + color: '' + }, + // {title:'成长任务6:gu',content:'学会邀请伙伴加入的三种方式,帮助伙伴省钱赚钱的同时您还能获得平台的额外奖励,邀请越多赚得就越多哦~',subTitle:'',subContent:'',actionBtn:'复制',video:'',color:''}, + ] + } + }, + + lifetimes: { + attached: function () { + + } + }, + + /** + * 组件的初始数据 + */ + data: { + invitationDialog: '', + item:null, + mDialog:false + }, + + /** + * 组件的方法列表 + */ + methods: { + onClick(event) { + const item = event.currentTarget.dataset.item + //type=1:跳转页面 2.复制数据 3.显示一张图 4.分享APP + switch (item.type) { + case 1: + wx.navigateTo({ + url: item.data + }) + break + case 2: + this.setData({ + invitationDialog: true, + item:item}) + break + case 3: + this.setData({mDialog: true, + item:item}) + break + case 4: + // this.setData({invitationDialog: true}) + break + } + }, + onVideoClick(event) { + const item = event.currentTarget.dataset.item + console.log(item.videoUrl) + const url = encodeURIComponent(item.videoUrl) + console.log(url) + wx.navigateTo({ + url: '/page_package/video-course/video-course?url=' + url + }) + // switch (Number(event.currentTarget.dataset.index)) { + // case 0: + // wx.navigateTo({ + // url: '/page_package/video-course/video-course' + // }) + // break + // } + }, + hideModal(event) { + switch (Number(event.currentTarget.dataset.iscode)) { + case 0: + wx.setClipboardData({ + data: this.data.item.data, + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + break + } + this.setData({ + invitationDialog: false + }) + }, + onClose() { + this.setData({ + mDialog:false + }) + }, + previewImg(event) { + wx.previewImage({ + urls: [this.data.item.data], + }) + }, + } +}) diff --git a/components/new-item/new-item.json b/components/new-item/new-item.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/new-item/new-item.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/new-item/new-item.wxml b/components/new-item/new-item.wxml new file mode 100644 index 0000000..7f7f4c7 --- /dev/null +++ b/components/new-item/new-item.wxml @@ -0,0 +1,72 @@ + + + {{item.title}} + + + + + + + + + + + + + {{item.action}} + + + + + + + 查看教学视频 + + + + + + + + + 提示 + + + + + + 您的专属导师微信号:{{item.data}} + 关于省钱赚钱的问题,请复制微\n信号去微信添加好友咨询吧~ + 添加时请备注:尚橙成员 + + + 取消 + 复制微信 + + + + + + + + + + + + 预览长按分享 + + + + \ No newline at end of file diff --git a/components/new-item/new-item.wxss b/components/new-item/new-item.wxss new file mode 100644 index 0000000..84b0ea3 --- /dev/null +++ b/components/new-item/new-item.wxss @@ -0,0 +1,37 @@ +/* components/new-item/new-item.wxss */ +@import "../../utils/styles/main.wxss"; +@import "../../utils/styles/icon.wxss"; +@import "../../utils/styles/animation.wxss"; +@import "../../utils/styles/base.wxss"; + +.teach-video{ + width: 100%; + text-align: right; + justify-content: right; +} + +.action-btn{ + padding: 14rpx 30rpx; + font-size: 26rpx; + border-radius: 8rpx; +} + +.share-btn{ + width: 164rpx; + height: 56rpx; + font-size: 26rpx; + border-radius: 8rpx; +} + +.cu-dialog1 { + position: fixed; + display: inline-block; + vertical-align: middle; + margin-left: auto; + margin-right: auto; + width: 680rpx; + max-width: 100%; + background-color: transparent; + border-radius: 10rpx; + overflow: hidden; +} \ No newline at end of file diff --git a/components/order-item/order-item.js b/components/order-item/order-item.js new file mode 100644 index 0000000..d7f0a7d --- /dev/null +++ b/components/order-item/order-item.js @@ -0,0 +1,61 @@ +// components/order-item/order-item.js +const app = getApp() +const {searchProduct} = require('../../utils/network/services/productImpl.js') +const util = require('../../utils/util.js') +const constants = require('../../utils/constants.js') +Component({ + /** + * 组件的属性列表 + */ + properties: { + orderItem: { + type: Object, + value: {}, + }, + type: { + type: Number, + value: 1 + } + }, + + /** + * 组件的初始数据 + */ + data: { + windowWidth: app.globalData.windowWidth, + isShowDialog: false, + msg: "", + }, + + /** + * 组件的方法列表 + */ + methods: { + onItem(event) { + const item = event.currentTarget.dataset.item + const data = {skuIds: [item.skuId]} + wx.showLoading({title: '加载中...'}) + searchProduct(data) + .then(res => { + wx.hideLoading() + if (res.data.data.records.length > 0) { + util.setStorage(constants.PRPDUCT_ITEM, res.data.data.records[0]) + wx.navigateTo({ + url: '/page_package/details/index' + }) + } else { + this.setData({ + isShowDialog: true, + msg: "商品已经失效" + }) + } + }).catch(err => { + wx.hideLoading() + this.setData({ + isShowDialog: true, + msg: "商品已经失效" + }) + }) + } + } +}) diff --git a/components/order-item/order-item.json b/components/order-item/order-item.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/order-item/order-item.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/order-item/order-item.wxml b/components/order-item/order-item.wxml new file mode 100644 index 0000000..1d5edb1 --- /dev/null +++ b/components/order-item/order-item.wxml @@ -0,0 +1,37 @@ + + + + 订单编号:{{orderItem.orderId}} + PLUS会员:{{orderItem.plus ? '是':'否'}} + + 下单时间:{{orderItem.orderTime}} + + 状态:{{orderItem.validCodeDesc}} + 预估返利收益:{{orderItem.estimateRebateFee}} + 预估推广收益:{{orderItem.estimateCommissionFee}} + + + + + + 同店 + + {{item.skuName}} + + + + 状态:{{item.validCodeDesc}} + 编号:{{item.orderId}} + + 数量:{{item.skuNum}} + + 计佣金额:{{item.estimateCosPrice}} + 预估返利收益:{{item.estimateRebateFee}} + 预估推广收益:{{item.estimateCommissionFee}} + + + + + + diff --git a/components/order-item/order-item.wxss b/components/order-item/order-item.wxss new file mode 100644 index 0000000..ac4780f --- /dev/null +++ b/components/order-item/order-item.wxss @@ -0,0 +1,36 @@ +/* components/order-item/order-item.wxss */ +@import "../../utils/styles/main.wxss"; +@import "../../utils/styles/icon.wxss"; +@import "../../utils/styles/animation.wxss"; +@import "../../utils/styles/base.wxss"; + + +.absolute-right{ + position: absolute; + right: 20rpx; +} + +.tag-product { + background-color: #f43f3b; + color: white; + position: absolute; + padding: 2rpx 12rpx; + font-size: 18rpx; + border-radius: 10rpx; + margin-left: 20rpx; +} + +.title-style { + text-indent: 40px; + margin-left: 20rpx; + letter-spacing: 1rpx; + line-height: 36rpx; +} + +.ellipsis { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} \ No newline at end of file diff --git a/components/poster/poster.js b/components/poster/poster.js new file mode 100644 index 0000000..f61ac5d --- /dev/null +++ b/components/poster/poster.js @@ -0,0 +1,383 @@ +// components/poster/poster.js +const app = getApp() +const {appCode} = require("../../utils/network/services/productImpl") + +Component({ + /** + * 组件的属性列表 + */ + properties: { + listData: { + type: Array, + value: [ + {content: '微信功能升级的利好\n中国巨大的人口市场\n惠享社交电商的模式与北京加持\n2020必将是喷井爆发的一年!这是天时!地利!人和!\n加入惠享让您站在时代的风口上!'}, + {content: '微信功能升级的利好\n中国巨大的人口市场\n惠享社交电商的模式与北京加持\n2020必将是喷井爆发的一年!这是天时!地利!人和!\n加入惠享让您站在时代的风口上!'}, + ] + } + }, + + /** + * 组件的初始数据 + */ + data: { + userInfo: app.globalData.userInfo, + imgWidth: 0, + imgHeight: 0, + invitationDialog: false, + mDialog: false, + synthesisImg: '', + isShow: false, + appCodes:'', + codeWidth:0, + codeHeight:0, + selectIndex:-1 + }, + + lifetimes: { + attached: function () { + this.setData({ + userInfo: app.globalData.userInfo, + imgWidth: app.globalData.windowWidth * 0.7, + imgHeight: app.globalData.windowHeight * 0.7, + codeWidth: app.globalData.windowWidth * 0.5, + codeHeight: app.globalData.windowWidth * 0.5, + }) + }, + }, + + /** + * 组件的方法列表 + */ + methods: { + onClose() { + this.setData({ + invitationDialog: false, + mDialog:false + }) + }, + onPoster(event) { + this.imgLoader(event.currentTarget.dataset.item,event.currentTarget.dataset.index) + }, + saveImg() { + wx.saveImageToPhotosAlbum({ + filePath: this.data.synthesisImg, + success: (res) => { + this.setData({invitationDialog: false}) + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: '图片保存成功,进入系统相册分享吧~', + success(res) { + if (res.confirm) { + + } + } + }) + }, + fail: (err) => { + this.setData({invitationDialog: false}) + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: '请到小程序设置中打开相册权限', + success(res) { + if (res.confirm) { + } + } + }) + } + }) + }, + saveImg1(){ + wx.saveImageToPhotosAlbum({ + filePath: this.data.appCodes, + success: (res) => { + this.setData({mDialog: false}) + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: '图片保存成功,进入系统相册分享吧~', + success(res) { + if (res.confirm) { + + } + } + }) + }, + fail: (err) => { + this.setData({mDialog: false}) + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: '请到小程序设置中打开相册权限', + success(res) { + if (res.confirm) { + } + } + }) + } + }) + }, + imgLoader(item,index) { + if (this.data.synthesisImg && this.data.selectIndex == index) { + this.setData({invitationDialog: true}) + } else { + let that = this + this.setData({ + // invitationDialog: true, + selectIndex:index + }) + wx.showLoading({title: '合成中...',}) + Promise.all([ + new Promise((resolve, reject) => { + wx.getImageInfo({ + src: item.imageUrl, + success(res) { + resolve(res) + }, + fail(err) { + err.prompt = '合成分享图失败' + reject(err) + } + }) + }), + new Promise((resolve, reject) => { + wx.getImageInfo({ + src: that.data.userInfo.avatarUrl, + success(res) { + resolve(res) + }, + fail(err) { + err.prompt = '合成头像失败' + reject(err) + } + }) + }), + new Promise((resolve, reject) => { + let data = { + page: "pages/index/index", + scene: {id:that.data.userInfo.userId }, + size: 72 + } + appCode(data) + .then(res => { + wx.showLoading({title: '合成中...',}) + let filePath = `${wx.env.USER_DATA_PATH}/${that.data.userInfo.userId}`; + wx.getFileSystemManager().writeFile({ + filePath: filePath, + data: wx.base64ToArrayBuffer(res.data.data.content), + encoding: 'binary', + success: () => { + resolve(filePath); + }, + fail: err => { + err.prompt = '合成推广码失败' + reject(err); + }, + }); + }).catch((err) => { + err.prompt = '获取推广码失败' + reject(err); + }) + }) + ]).then(res => { + const ctx = wx.createCanvasContext('myCanvas', that); + ctx.fillStyle = "#FFFFFF"; + ctx.fillRect(0, 0, that.data.imgWidth, that.data.imgHeight); + that.setData({ctx: ctx}) + const productImg = res[0].path //f分享图图 + + const avatarUrl = res[1].path //用户头像 + const userName = that.data.userInfo.nickName //用户昵称 + + //绘制商品图 + ctx.drawImage(productImg, 0, 0, that.data.imgWidth, that.data.imgHeight * 0.75); + ctx.save(); + + let imgH = that.data.imgHeight * 0.75 + + //商品标题第一行 + ctx.setTextAlign('left') + ctx.setFillStyle('#000000') + ctx.setFontSize(16) + ctx.fillText("尚橙优选·分享好物", 10, imgH + 24) + ctx.stroke() + + //用户昵称 + ctx.setTextAlign('left') + ctx.setFillStyle('#333333') + ctx.setFontSize(12) + ctx.fillText(userName, 68, imgH + 54) + ctx.stroke() + + //推广语 + ctx.setTextAlign('left') + ctx.setFillStyle('#444444') + ctx.setFontSize(11) + ctx.fillText('邀您一起加入尚橙', 68, imgH + 74) + ctx.stroke() + //推广语 + ctx.setTextAlign('left') + ctx.setFillStyle('#666666') + ctx.setFontSize(9) + ctx.fillText('分享京东优惠好货', 68, imgH + 89) + ctx.stroke() + // + // // + ctx.setTextAlign('right') + ctx.setFillStyle('#444444') + ctx.setFontSize(9) + ctx.fillText('长按识别', that.data.imgWidth - 24, that.data.imgHeight - 10) + ctx.stroke() + // + //用户头像 + ctx.arc(34, imgH + 64, 24, 0, Math.PI * 2, false); + ctx.clip(); + ctx.drawImage(avatarUrl, 10, imgH + 40, 48, 48); + ctx.restore(); + + // 推广二维码 + ctx.drawImage(res[2], that.data.imgWidth - 74, that.data.imgHeight - 88, 64, 64); + ctx.restore(); + + ctx.draw() + setTimeout(() => { + that.heIMg(that,1) + }, 50) + }).catch(err => { + console.log(">>>", err) + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: "合成图片失败", + success(res) { + } + }) + }) + } + + }, + heIMg(that,type) { + if(type == 1){ + wx.canvasToTempFilePath({ + x: 0, + y: 0, + width: that.data.imgWidth, + height: that.data.imgHeight, + canvasId: 'myCanvas', + success: function (res) { + wx.hideLoading() + that.setData({ + synthesisImg: res.tempFilePath, + isShow:false, + invitationDialog: true + }) + }, + fail: function (err) { + wx.hideLoading() + } + }, that) + }else { + wx.canvasToTempFilePath({ + x: 0, + y: 0, + width: that.data.codeWidth, + height: that.data.codeWidth, + canvasId: 'myCanvas1', + success: function (res) { + wx.hideLoading() + that.setData({ + appCodes: res.tempFilePath, + mDialog: true + }) + }, + fail: function (err) { + wx.hideLoading() + } + }, that) + } + + }, + onCopy(event){ + const item = event.currentTarget.dataset.item + wx.setClipboardData({ + data: item.content, + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + }, + appsCode(){ + if (this.data.appCodes) { + this.setData({mDialog: true}) + } else { + let that = this + wx.showLoading({title: '合成中...',}) + Promise.all([ + new Promise((resolve, reject) => { + let data = { + page: "pages/index/index", + scene: {id:that.data.userInfo.userId }, + size: that.data.codeWidth + } + appCode(data) + .then(res => { + let filePath = `${wx.env.USER_DATA_PATH}/${that.data.userInfo.userId}` + 1; + wx.getFileSystemManager().writeFile({ + filePath: filePath, + data: wx.base64ToArrayBuffer(res.data.data.content), + encoding: 'binary', + success: () => { + resolve(filePath); + }, + fail: err => { + err.prompt = '合成推广码失败' + reject(err); + }, + }); + }).catch((err) => { + err.prompt = '获取推广码失败' + reject(err); + }) + }) + ]).then(res => { + const ctx = wx.createCanvasContext('myCanvas1', that); + ctx.fillStyle = "#FFFFFF"; + ctx.fillRect(0, 0, that.data.codeWidth, that.data.codeHeight); + const productImg = res[0] //f分享图图 + + console.log("推广码",res,productImg) + //绘制商品图 + ctx.drawImage(productImg, 0, 0, that.data.codeWidth, that.data.codeHeight); + ctx.save(); + + ctx.draw() + setTimeout(() => { + that.heIMg(that,2) + }, 50) + }).catch(err => { + console.log(">>>", err) + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: "合成图片失败", + success(res) { + } + }) + }) + } + } + } +}) diff --git a/components/poster/poster.json b/components/poster/poster.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/poster/poster.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/poster/poster.wxml b/components/poster/poster.wxml new file mode 100644 index 0000000..804ee89 --- /dev/null +++ b/components/poster/poster.wxml @@ -0,0 +1,74 @@ + + + + + + + + + + + 获取我的高清小程序码 + + + + + + + {{item.title}} + + + + {{item.content}} + #点击图片获取您的专属海报# + + + + 复制文字 + + + + + + + + + + + + + 保存到手机相册 + + + + + + + + + + + + 保存到手机相册 + + + + diff --git a/components/poster/poster.wxss b/components/poster/poster.wxss new file mode 100644 index 0000000..3a28343 --- /dev/null +++ b/components/poster/poster.wxss @@ -0,0 +1,62 @@ +/* components/poster/poster.wxss */ +@import "../../utils/styles/main.wxss"; +@import "../../utils/styles/icon.wxss"; +@import "../../utils/styles/animation.wxss"; +@import "../../utils/styles/base.wxss"; + + +.colorff9700{ + color: #ff9700; +} + +.copy-btn{ + height: 48rpx; + width: 164rpx; + border-radius: 32rpx; + font-size: 24rpx; + margin-left: 20rpx; + border: 1px solid #f43f3b; + background-color: transparent; +} + +.bc-modal { + display: flex; + position: fixed; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + z-index: 999; + text-align: center; + justify-content: center; + align-items: center; + background-color: rgba(0, 0, 0, 0.5); + flex-direction: column; +} + +.modal-content{ + background: white; + display: flex; + text-align: center; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.cu-dialog1 { + position: fixed; + display: inline-block; + vertical-align: middle; + margin-left: auto; + margin-right: auto; + width: 680rpx; + max-width: 100%; + background-color: transparent; + border-radius: 10rpx; + overflow: hidden; +} + +.code-bg{ + background-image: linear-gradient(45deg, #FEF3E0, #FFEEEF); + color: var(--white); +} \ No newline at end of file diff --git a/components/product-item/product-item.js b/components/product-item/product-item.js new file mode 100644 index 0000000..86d9080 --- /dev/null +++ b/components/product-item/product-item.js @@ -0,0 +1,40 @@ +// components/product-item/product-item.js +const app = getApp() + +Component({ + options: { + multipleSlots: true // 在组件定义时的选项中启用多slot支持 + }, + /** + * 组件的属性列表 + */ + properties: { + productItem: { + type: Object, + value: {}, + }, + }, + + /** + * 组件的初始数据 + */ + data: { + windowWidth: app.globalData.windowWidth, + + }, + + lifetimes: { + attached: function () { + // let productItem = this.data.productItem + // (productItem.priceInfo.lowestCouponPrice ? + // productItem.priceInfo.lowestCouponPrice:productItem.priceInfo.price) - productItem.commissionInfo.commission + }, + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) diff --git a/components/product-item/product-item.json b/components/product-item/product-item.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/product-item/product-item.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/product-item/product-item.wxml b/components/product-item/product-item.wxml new file mode 100644 index 0000000..0098696 --- /dev/null +++ b/components/product-item/product-item.wxml @@ -0,0 +1,68 @@ + + + + + + + 京东 + + {{productItem.skuName}} + + + + + 京东价 + {{productItem.priceInfo.price}} + + {{productItem.comments}}条评论 + {{productItem.goodCommentsShare}}%好评率 + + + + + + + 优惠券 + {{productItem.coupons[0].discount ? + productItem.coupons[0].discount : 0}} + + + + {{productItem.commissionInfo.rebateHint}} + + + + + + + + + 券后价 + {{productItem.priceInfo.lowestCouponPrice ? + productItem.priceInfo.lowestCouponPrice:productItem.priceInfo.price}} + + + 返利价 + {{productItem.priceInfo.lowestRebatePrice}} + + + + 马上抢 + + + + + + + + + {{productItem.commissionInfo.commissionHint}} + + + + + \ No newline at end of file diff --git a/components/product-item/product-item.wxss b/components/product-item/product-item.wxss new file mode 100644 index 0000000..d37c53e --- /dev/null +++ b/components/product-item/product-item.wxss @@ -0,0 +1,135 @@ +/* components/product-item/product-item.wxss */ +@import "../../utils/styles/main.wxss"; +@import "../../utils/styles/icon.wxss"; +@import "../../utils/styles/animation.wxss"; +@import "../../utils/styles/base.wxss"; + +.bg-item{ + background-color: white; + width: 200rpx; + color: #f43f3b; + border-radius: 5rpx; + border: 1px solid #f43f3b; + padding: 6rpx 10rpx; + margin-left: 20rpx; + margin-top: 20rpx; +} + +.tag-product { + background-color: #f43f3b; + color: white; + position: absolute; + padding: 4rpx 12rpx; + font-size: 20rpx; + margin-top: 6rpx; + border-radius: 10rpx; + margin-left: 20rpx; +} + +.title-style { + text-indent: 40px; + margin-left: 20rpx; + letter-spacing: 1rpx; + line-height: 48rpx; +} + +.ellipsis { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.comment{ + display: flex; + text-align: end; + justify-content: end; + right: 20rpx; +} + +.semicircle-left{ + width: 20rpx; + height: 20rpx; + background-color: white; + border-bottom-left-radius: 50%; + border-top-left-radius: 50% +} + +.line-division{ + width: 96%; + height: 2rpx; + margin-left: 2%; + margin-top: 20rpx; + background-color: #f2f2f2 +} + +.comment{ + position: absolute; + right: 20rpx; +} + + + +.style-three { + width:100%; + height:1.2rem; + position:relative; + display:-webkit-box; + display:-webkit-flex; + display:flex; + align-items:center; + justify-content:center; + background-color:#f43f3b; + border:none; + color:#fff; +} + +.style-three:before { + content:""; + position:absolute; + left:-.25rem; + width:.9rem; + height:.55rem; + top:50%; + -webkit-transform:translate(-30%,-50%); + transform:translate(-30%,-50%); + -webkit-box-shadow:3px 0 0 #e76960; + box-shadow:3px 0 0 #e76960; + -webkit-border-radius:80%; + border-radius:80%; + background-color:white; +} + +.style-three .get-btn:after { + content:""; + width:.6rem; + position:absolute; + top:0; + bottom:0; + right:23.9%; + left:0; + display:block; + z-index:9; + background-color:white; + background-position:100% 35%; + background-size:1rem .5rem; + background-image:linear-gradient(-45deg,#ffffff 25%,#e76960 25%,#e76960) +} + +.style-three .get-btn { + display:-webkit-box; + display:-webkit-flex; + display:flex; + position: absolute; + right: 0; + align-items:center; + justify-content:center; + width:5%; + height:1.2rem; + text-align:center; + color:#fff; + font-size:1.5rem; + line-height:1.35; + background-color:#fff; +} \ No newline at end of file diff --git a/components/prompt-dialig/index.js b/components/prompt-dialig/index.js new file mode 100644 index 0000000..465c280 --- /dev/null +++ b/components/prompt-dialig/index.js @@ -0,0 +1,45 @@ +// components/prompt-dialig/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + cancelText: { + type: String, + default: "取消" + }, + confirmText: { + type: String, + default: "确定" + }, + promptMsg: { + type: String, + default: "提示消息", + }, + invitationDialog: { + type: Boolean, + default: false + }, + isShowCancel: { + type: Boolean, + default: false + } + + }, + + /** + * 组件的初始数据 + */ + data: {}, + + /** + * 组件的方法列表 + */ + methods: { + hideModal(event) { + this.setData({invitationDialog:false}) + if(event.currentTarget.dataset.iscode == 0) + this.triggerEvent("onConfirm") + } + } +}) diff --git a/components/prompt-dialig/index.json b/components/prompt-dialig/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/prompt-dialig/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/prompt-dialig/index.wxml b/components/prompt-dialig/index.wxml new file mode 100644 index 0000000..0a96771 --- /dev/null +++ b/components/prompt-dialig/index.wxml @@ -0,0 +1,20 @@ + + + + + 提示 + + + {{promptMsg}} + + + {{cancelText}} + {{confirmText}} + + + diff --git a/components/prompt-dialig/index.wxss b/components/prompt-dialig/index.wxss new file mode 100644 index 0000000..f91efd1 --- /dev/null +++ b/components/prompt-dialig/index.wxss @@ -0,0 +1,5 @@ +/* components/prompt-dialig/index.wxss */ +@import "../../utils/styles/main.wxss"; +@import "../../utils/styles/icon.wxss"; +@import "../../utils/styles/animation.wxss"; +@import "../../utils/styles/base.wxss"; \ No newline at end of file diff --git a/components/question/question.js b/components/question/question.js new file mode 100644 index 0000000..e95c1d4 --- /dev/null +++ b/components/question/question.js @@ -0,0 +1,86 @@ +// components/question/question.js +const app = getApp() +const constants = require("../../utils/constants") +const util = require("../../utils/util") +const {faq} = require("../../utils/network/services/service") +const startPage = 1 +Component({ + /** + * 组件的属性列表 + */ + properties: { + listData: { + type: Array, + value: [ + { + open: false, + questionList: [ + { + title: '哪些情况会造成订单无效?', + content: '1.涉嫌利用本平台实施欺诈或其他违法行为(运营方有权单方对此作出独立认定);\n' + + '\n' + + '2.被任何第三方投诉或被相关司法、行政机关处理的;\n' + + '\n' + + '3.恶意使用本平台功能,使用任何装置、软件或例行程序干预或试图干预京东台或本平台的;\n' + + '\n' + + '4.利用计算机病毒/程序等手段,非法窃取、删除、修改或增加其他会员的任何信 息,或以其他任何方式危害京东平台/本平台其他功能的正常运行;\n' + + '\n' + + '5.利用京东CPS系统漏洞,谋取利益;\n' + + '\n' + + '6.未经运营方书面同意,擅自许可他人使用本平台或擅自将本平台功能全部或部 分转让他人(包括但不限于擅自许可他人使用其帐号利用京本平台进行推广,或擅自将其帐号转让或泄露给他人的);\n' + + '\n' + + '7.以不良方法或技术等规避本协议约定和规则要求等;\n' + + '\n' + + '8.通过程序、脚本模拟或其他形式进行或产生非正常的浏览、点击、交易行为等。通过奖励、诱导点击、弹窗、自动模拟用户点击等行为,产生非正常的浏览、点击、成交的行为;\n' + + '\n' + + '9.流量劫持。如通过病毒、木马、恶意插件和未经授权软件捆绑安装、强设首页、劫持地址栏或浏览器、劫持京东页面、搜索引擎作弊、篡改用户信息等非常规手段劫持正常流量。或通过链路劫持、DNS劫持、或者ARP攻击等手段劫持正常流量。或者在用户正常浏览过程中,通过修改URL参数或弹窗(浮窗)等的方式劫持京东商城或京东合作伙伴的正常流量(包括京东页面、合作伙伴和其他网站等);\n' + + '\n' + + '10.其他京东联盟有合理理由证明的数据异常(如流量来源、分布等)情况。会员承诺并保证:按本协议约定使用本平台并进行推广,遵守平台规则,按约定收取服务费并支付平台费。' + }, + { + title: '什么是“上月预估结算佣金”、“本月预估结算佣金”?', + content: '上月预估结算佣金:上个自然月产生的已完成订单的预估佣金总额,最终结算金额以账单中的结算数据为准。\n' + + '\n' + + '本月预估结算佣金:本个自然月(不包含当日)产生的已完成订单的预估佣金总额,最终结算金额以账单中的结算数据为准。 ' + } + ] + } + ] + } + }, + + /** + * 组件的初始数据 + */ + data: { + windowWidth: app.globalData.windowWidth, + questionList:[], + page:startPage + }, + + /** + * 组件的方法列表 + */ + methods: { + onShrink(event) { + let index = event.currentTarget.dataset.index + let item = event.currentTarget.dataset.item + item.open = !item.open + let listData = this.data.listData + listData.splice(index, 1, item) + this.setData({listData: listData}) + }, + itemClick(event) { + let item = event.currentTarget.dataset.items + util.setStorage(constants.QUESTION,item) + wx.navigateTo({ + url: '/page_package/question/question' + }) + }, + getData(type){ + faq().then(res => { + this.setData({questionList:res.data.data}) + }) + }, + }, +}) diff --git a/components/question/question.json b/components/question/question.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/question/question.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/question/question.wxml b/components/question/question.wxml new file mode 100644 index 0000000..49f98cb --- /dev/null +++ b/components/question/question.wxml @@ -0,0 +1,32 @@ + + + + + + + + + {{item.category}} + + + + {{items.title}} + + + + + + + + + {{item.open?'折叠收回':'展开更多'}} + + + + + diff --git a/components/question/question.wxss b/components/question/question.wxss new file mode 100644 index 0000000..c3cce98 --- /dev/null +++ b/components/question/question.wxss @@ -0,0 +1,46 @@ +/* components/question/question.wxss */ +@import "../../utils/styles/main.wxss"; +@import "../../utils/styles/icon.wxss"; +@import "../../utils/styles/animation.wxss"; +@import "../../utils/styles/base.wxss"; + +.question-icon{ + width: 218rpx; + align-items: start; + text-align: center; + justify-content: center; +} + +.question-list{ + border-left: 1px solid #f2f2f2; +} + +.question-item{ + height: 84rpx; + border-top: 1px solid #f2f2f2; + align-items: center; + width: calc(100vw - 250rpx); + padding-left: 20rpx; +} + +.ellipsis{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.shrink-btn{ + background-color: white; + padding: 8rpx 16rpx; + border-radius: 24rpx; + margin-top: -32rpx; + +} + +.type-icon{ + width: 56rpx; + height: 56rpx; + background-image: linear-gradient(90deg, #f43f3b, #da7068); + border-radius: 50%; + color: white; +} \ No newline at end of file diff --git a/components/refresh/refresh.js b/components/refresh/refresh.js new file mode 100644 index 0000000..784903b --- /dev/null +++ b/components/refresh/refresh.js @@ -0,0 +1,227 @@ +// components/refresh/refresh.js + +const app = getApp() + +Component({ + properties: { + // 加载中 + requesting: { + type: Boolean, + value: false, + observer: 'requestingEnd', + }, + scrollTop: { + type: Number, + value: 0, + }, + // 加载完毕 + end: { + type: Boolean, + value: false, + }, + // 控制空状态的显示 + emptyShow: { + type: Boolean, + value: false, + }, + // 当前列表长度 + listCount: { + type: Number, + value: 0, + }, + // 空状态的图片 + emptyUrl: { + type: String, + value: "/assets/image/empty/empty.png" + }, + // 空状态的文字提示 + emptyText: { + type: String, + value: "未找到数据" + }, + // 是否有header + hasTop: { + type: Boolean, + value: false + }, + // 下拉刷新的高度 + refreshSize: { + type: Number, + value: 90, + observer: 'refreshChange' + }, + // 底部高度 + bottomSize: { + type: Number, + value: 0, + }, + // 颜色 + color: { + type: String, + value: "" + }, + // iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向 + enableBackToTop: { + type: Boolean, + value: false + } + }, + data: { + StatusBar: app.globalData.StatusBar, + CustomBar: app.globalData.CustomBar, + Custom: app.globalData.Custom, + /* 未渲染数据 */ + mode: 'refresh', // refresh 和 more 两种模式 + successShow: false, // 显示success + successTran: false, // 过度success + refreshStatus: 1, // 1: 下拉刷新, 2: 松开更新, 3: 加载中, 4: 加载完成 + move: -45, // movable-view 偏移量 + scrollHeight1: 0, // refresh view 高度负值 + scrollHeight2: 0, // refresh view - success view 高度负值 + timer: null, + + /* 渲染数据 */ + // scrollTop: 0, + overOnePage: false + }, + methods: { + /** + * 处理 bindscrolltolower 失效情况 + */ + scroll(e) { + // 可以触发滚动表示超过一屏 + this.setData({ + overOnePage: true + }); + clearTimeout(this.data.timer); + this.setData({ + timer: setTimeout(() => { + this.setData({ + scrollTop: e.detail.scrollTop + }) + }, 100) + }); + this.triggerEvent('scroll',e); + }, + /** + * movable-view 滚动监听 + */ + change(e) { + let refreshStatus = this.data.refreshStatus, + diff = e.detail.y; + + if (refreshStatus >= 3) return; + + if (diff > -10) { + this.setData({ + refreshStatus: 2 + }); + } else { + this.setData({ + refreshStatus: 1 + }); + } + }, + /** + * movable-view 触摸结束事件 + */ + touchend() { + let refreshStatus = this.data.refreshStatus; + + if (refreshStatus >= 3) return; + + if (refreshStatus === 2) { + wx.vibrateShort(); + this.setData({ + refreshStatus: 3, + move: 0, + mode: 'refresh' + }); + this.triggerEvent('refresh'); + } else if (refreshStatus === 1) { + this.setData({ + move: this.data.scrollHeight1 + }); + } + }, + /** + * 加载更多 + */ + more() { + if (!this.properties.end) { + this.setData({ + mode: 'more' + }); + this.triggerEvent('more'); + } + }, + /** + * 监听 requesting 字段变化, 来处理下拉刷新对应的状态变化 + */ + requestingEnd(newVal, oldVal) { + if (this.data.mode === 'more') return; + + if (oldVal === true && newVal === false) { + setTimeout(() => { + this.setData({ + successShow: true, + refreshStatus: 4, + move: this.data.scrollHeight2 + }); + setTimeout(() => { + this.setData({ + successTran: true, + move: this.data.scrollHeight1 + }); + setTimeout(() => { + this.setData({ + refreshStatus: 1, + successShow: false, + successTran: false, + move: this.data.scrollHeight1 + }); + }, 10) + }, 10) + }, 600) + } else { + if (this.data.refreshStatus !== 3) { + this.setData({ + refreshStatus: 3, + move: 0 + }); + } + } + }, + /** + * 监听下拉刷新高度变化, 如果改变重新初始化参数, 最小高度80rpx + */ + refreshChange(newVal, oldVal) { + if (newVal <= 80) { + this.setData({ + refreshSize: 80 + }); + } + // 异步加载数据时候, 延迟执行 init 方法, 防止基础库 2.7.1 版本及以下无法正确获取 dom 信息 + setTimeout(() => this.init(), 10); + }, + /** + * 初始化scroll组件参数, 动态获取 下拉刷新区域 和 success 的高度 + */ + init() { + let { + windowWidth + } = wx.getSystemInfoSync(); + let successHeight = (windowWidth || 375) / 750 * 70; + + this.createSelectorQuery().select("#refresh").boundingClientRect((res) => { + this.setData({ + scrollHeight1: -res.height, + scrollHeight2: successHeight - res.height + }); + }).exec(); + }, + }, + ready() { + this.init(); + } +}); \ No newline at end of file diff --git a/components/refresh/refresh.json b/components/refresh/refresh.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/refresh/refresh.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/refresh/refresh.wxml b/components/refresh/refresh.wxml new file mode 100644 index 0000000..2a7b21f --- /dev/null +++ b/components/refresh/refresh.wxml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + 下拉刷新 + 松开更新 + 加载中... + + + + + + + \ No newline at end of file diff --git a/components/refresh/refresh.wxss b/components/refresh/refresh.wxss new file mode 100644 index 0000000..0ad8aa8 --- /dev/null +++ b/components/refresh/refresh.wxss @@ -0,0 +1,292 @@ +.movable-area { + width: 100%; + height: 100vh; +} + +.scroll { + width: 100%; + height: calc(100vh + 90rpx); +} + +.scroll__view { + height: 100%; + position: relative; + box-sizing: border-box; +} + +.scroll__refresh { + height: 90rpx; + position: relative; +} + +.scroll__refresh--hidden { + visibility: hidden; +} + +.scroll__bottom { + position: relative; + height: 40rpx; + padding: 40rpx 0; +} + +.scroll__loading { + position: absolute; + top: 50%; + left: 0; + right: 0; + transform: translateY(-50%); + text-align: center; + color: #999; +} + +.scroll__loading .text { + display: inline-block; + vertical-align: middle; + margin-left: 40rpx; +} + +.success { + position: absolute; + z-index: 9; + top: 20rpx; + left: 0; + width: 100%; + height: 70rpx; + line-height: 70rpx; + font-size: 24rpx; + text-align: center; + opacity: 0; + transform: scale(0); + color: #3f82fd; +} + +.success:after { + content: " "; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: currentColor; + opacity: 0.7; + transform: scaleX(0); + transition: transform 0.3s ease-in-out; + z-index: 0; +} + +.success > .info { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1; + color: #fff; +} + +.success--show { + opacity: 1; + transform: scale(1); +} + +.success--show:after { + transform: scaleX(1); +} + +.success--tran { + opacity: 0; + transform: translateY(-100%); + transition: opacity 0.35s linear, transform 0.35s linear; +} + +.empty { + padding: 30rpx; + text-align: center; +} + +.empty__image { + width: 200rpx; + height: 200rpx; + margin: 160rpx auto 60rpx; +} + +.empty__text { + color: #999; +} + +.arrow { + position: relative; + border-radius: 4rpx; + width: 4rpx; + height: 30rpx; + background: #a5a5a5; + transition: transform 0.15s ease-in-out; + display: inline-block; + vertical-align: middle; +} + +.arrow:before { + position: absolute; + content: ""; + bottom: -4rpx; + right: 50%; + width: 4rpx; + height: 16rpx; + transform: rotate(45deg); + transform-origin: 100% 100%; + background: #a5a5a5; + border-radius: 4rpx; +} + +.arrow:after { + position: absolute; + content: ""; + bottom: -4rpx; + left: 50%; + width: 4rpx; + height: 16rpx; + transform: rotate(-45deg); + transform-origin: 0% 100%; + background: #a5a5a5; + border-radius: 4rpx; +} + +.arrow.rotate { + transform: rotate(-180deg); +} + +.loading { + position: relative; + display: inline-block; + vertical-align: middle; + width: 36rpx; + height: 36rpx; + margin-right: -14rpx; +} + +.loading__item { + position: absolute; + top: 0; + left: 0; + width: 36rpx; + height: 36rpx; +} + +.loading__item:before { + content: ""; + display: block; + margin: 0 auto; + width: 4rpx; + height: 8rpx; + background-color: #a5a5a5; + border-radius: 4rpx; + animation: fadeDelay 1.2s infinite ease-in-out both; +} + +.loading__item:nth-child(2) { + transform: rotate(30deg); +} + +.loading__item:nth-child(2):before { + animation-delay: -1.1s; +} + +.loading__item:nth-child(3) { + transform: rotate(60deg); +} + +.loading__item:nth-child(3):before { + animation-delay: -1s; +} + +.loading__item:nth-child(4) { + transform: rotate(90deg); +} + +.loading__item:nth-child(4):before { + animation-delay: -0.9s; +} + +.loading__item:nth-child(5) { + transform: rotate(120deg); +} + +.loading__item:nth-child(5):before { + animation-delay: -0.8s; +} + +.loading__item:nth-child(6) { + transform: rotate(150deg); +} + +.loading__item:nth-child(6):before { + animation-delay: -0.7s; +} + +.loading__item:nth-child(7) { + transform: rotate(180deg); +} + +.loading__item:nth-child(7):before { + animation-delay: -0.6s; +} + +.loading__item:nth-child(8) { + transform: rotate(210deg); +} + +.loading__item:nth-child(8):before { + animation-delay: -0.5s; +} + +.loading__item:nth-child(9) { + transform: rotate(240deg); +} + +.loading__item:nth-child(9):before { + animation-delay: -0.4s; +} + +.loading__item:nth-child(10) { + transform: rotate(270deg); +} + +.loading__item:nth-child(10):before { + animation-delay: -0.3s; +} + +.loading__item:nth-child(11) { + transform: rotate(300deg); +} + +.loading__item:nth-child(11):before { + animation-delay: -0.2s; +} + +.loading__item:nth-child(12) { + transform: rotate(330deg); +} + +.loading__item:nth-child(12):before { + animation-delay: -0.1s; +} + +@keyframes fadeDelay { + 0%, 39%, 100% { + opacity: 0.2; + } + + 40% { + opacity: 1; + } +} + +@-webkit-keyframes fadeDelay { + 0%, 39%, 100% { + opacity: 0.2; + } + + 40% { + opacity: 1; + } +} diff --git a/components/study/study.js b/components/study/study.js new file mode 100644 index 0000000..2ef7bff --- /dev/null +++ b/components/study/study.js @@ -0,0 +1,29 @@ +// components/study/study.js +const app = getApp() + +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + windowWidth: app.globalData.windowWidth, + }, + + /** + * 组件的方法列表 + */ + methods: { + onClick(event){ + wx.navigateTo({ + url: '/page_package/study/study' + }) + } + } +}) diff --git a/components/study/study.json b/components/study/study.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/study/study.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/study/study.wxml b/components/study/study.wxml new file mode 100644 index 0000000..8af3d53 --- /dev/null +++ b/components/study/study.wxml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 小编正在整理中 + diff --git a/components/study/study.wxss b/components/study/study.wxss new file mode 100644 index 0000000..6061407 --- /dev/null +++ b/components/study/study.wxss @@ -0,0 +1,11 @@ +/* components/study/study.wxss */ +@import "../../utils/styles/main.wxss"; +@import "../../utils/styles/icon.wxss"; +@import "../../utils/styles/animation.wxss"; +@import "../../utils/styles/base.wxss"; + +.skill{ + border-left: 8rpx solid #f43f3b; + padding: 4rpx 8rpx; + +} \ No newline at end of file diff --git a/components/video-swiper/video-swiper.js b/components/video-swiper/video-swiper.js new file mode 100644 index 0000000..ff97d9d --- /dev/null +++ b/components/video-swiper/video-swiper.js @@ -0,0 +1,385 @@ +// components/video-swiper/video-swiper.js +const app = getApp() +module.exports = + /******/ + (function(modules) { // webpackBootstrap + /******/ // The module cache + /******/ + var installedModules = {}; + /******/ + /******/ // The require function + /******/ + function __webpack_require__(moduleId) { + /******/ + /******/ // Check if module is in cache + /******/ + if (installedModules[moduleId]) { + /******/ + return installedModules[moduleId].exports; + /******/ + } + /******/ // Create a new module (and put it into the cache) + /******/ + var module = installedModules[moduleId] = { + /******/ + i: moduleId, + /******/ + l: false, + /******/ + exports: {} + /******/ + }; + /******/ + /******/ // Execute the module function + /******/ + modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + /******/ + /******/ // Flag the module as loaded + /******/ + module.l = true; + /******/ + /******/ // Return the exports of the module + /******/ + return module.exports; + /******/ + } + /******/ + /******/ + /******/ // expose the modules object (__webpack_modules__) + /******/ + __webpack_require__.m = modules; + /******/ + /******/ // expose the module cache + /******/ + __webpack_require__.c = installedModules; + /******/ + /******/ // define getter function for harmony exports + /******/ + __webpack_require__.d = function(exports, name, getter) { + /******/ + if (!__webpack_require__.o(exports, name)) { + /******/ + Object.defineProperty(exports, name, { + enumerable: true, + get: getter + }); + /******/ + } + /******/ + }; + /******/ + /******/ // define __esModule on exports + /******/ + __webpack_require__.r = function(exports) { + /******/ + if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { + /******/ + Object.defineProperty(exports, Symbol.toStringTag, { + value: 'Module' + }); + /******/ + } + /******/ + Object.defineProperty(exports, '__esModule', { + value: true + }); + /******/ + }; + /******/ + /******/ // create a fake namespace object + /******/ // mode & 1: value is a module id, require it + /******/ // mode & 2: merge all properties of value into the ns + /******/ // mode & 4: return value when already ns object + /******/ // mode & 8|1: behave like require + /******/ + __webpack_require__.t = function(value, mode) { + /******/ + if (mode & 1) value = __webpack_require__(value); + /******/ + if (mode & 8) return value; + /******/ + if ((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; + /******/ + var ns = Object.create(null); + /******/ + __webpack_require__.r(ns); + /******/ + Object.defineProperty(ns, 'default', { + enumerable: true, + value: value + }); + /******/ + if (mode & 2 && typeof value != 'string') + for (var key in value) __webpack_require__.d(ns, key, function(key) { + return value[key]; + }.bind(null, key)); + /******/ + return ns; + /******/ + }; + /******/ + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ + __webpack_require__.n = function(module) { + /******/ + var getter = module && module.__esModule ? + /******/ + function getDefault() { + return module['default']; + } : + /******/ + function getModuleExports() { + return module; + }; + /******/ + __webpack_require__.d(getter, 'a', getter); + /******/ + return getter; + /******/ + }; + /******/ + /******/ // Object.prototype.hasOwnProperty.call + /******/ + __webpack_require__.o = function(object, property) { + return Object.prototype.hasOwnProperty.call(object, property); + }; + /******/ + /******/ // __webpack_public_path__ + /******/ + __webpack_require__.p = ""; + /******/ + /******/ + /******/ // Load entry module and return exports + /******/ + return __webpack_require__(__webpack_require__.s = 0); + /******/ + }) +/************************************************************************/ +/******/ +([ + /* 0 */ + /***/ + (function(module, exports, __webpack_require__) { + + "use strict"; + + + Component({ + options: { + addGlobalClass: true, + pureDataPattern: /^_/ + }, + properties: { + duration: { + type: Number, + value: 500 + }, + easingFunction: { + type: String, + value: 'default' + }, + current: { + type: Number, + value: 0 + }, + loop: { + type: Boolean, + value: true + }, + videoList: { + type: Object, + value: {}, + observer: function observer() { + var newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + this._videoListChanged(newVal.videos, newVal.current); + } + } + }, + data: { + nextQueue: [], + prevQueue: [], + curQueue: [], + circular: false, + _last: 1, + _change: -1, + _invalidUp: 0, + _invalidDown: 0, + _videoContexts: [], + percent: 0, + isPaly: false, + currentIndex: 0, + windowWidth: app.globalData.windowWidth, + windowHeight: app.globalData.windowHeight, + selectVideo: { + id: 0, + index: 0 + } + }, + lifetimes: { + attached: function attached() { + this.data._videoContexts = [wx.createVideoContext('video_0', this), wx.createVideoContext('video_1', this), wx.createVideoContext('video_2', this)]; + this.setData({ + currentIndex: 0 + }) + } + }, + methods: { + _videoListChanged: function _videoListChanged(newVal, current) { + if (newVal == undefined) return + var _this = this; + + var data = this.data; + newVal.forEach(function(item) { + data.nextQueue.push(item); + }); + if (data.curQueue.length === 0) { + let postion = newVal.length - current + if (postion >= 3) + this.setData({ + curQueue: data.nextQueue.splice(current, 3) + }, function() { + _this.playCurrent(0); + }); + else + this.setData({ + curQueue: data.nextQueue.splice(current, postion) + }, function() { + _this.playCurrent(0); + }); + } + }, + animationfinish: function animationfinish(e) { + var _data = this.data, + _last = _data._last, + _change = _data._change, + curQueue = _data.curQueue, + prevQueue = _data.prevQueue, + nextQueue = _data.nextQueue; + + var current = e.detail.current; + var diff = current - _last; + if (diff === 0) return; + this.data._last = current; + this.playCurrent(current); + this.triggerEvent('change', { + activeId: curQueue[current].id + }); + var direction = diff === 1 || diff === -2 ? 'up' : 'down'; + if (direction === 'up') { + if (this.data._invalidDown === 0) { + var change = (_change + 1) % 3; + var add = nextQueue.shift(); + var remove = curQueue[change]; + if (add) { + prevQueue.push(remove); + curQueue[change] = add; + this.data._change = change; + } else { + this.data._invalidUp += 1; + } + } else { + this.data._invalidDown -= 1; + } + } + if (direction === 'down') { + if (this.data._invalidUp === 0) { + var _change2 = _change; + var _remove = curQueue[_change2]; + var _add = prevQueue.pop(); + if (_add) { + curQueue[_change2] = _add; + nextQueue.unshift(_remove); + this.data._change = (_change2 - 1 + 3) % 3; + } else { + this.data._invalidDown += 1; + } + } else { + this.data._invalidUp -= 1; + } + } + var circular = true; + if (nextQueue.length === 0 && current !== 0) { + circular = false; + } + if (prevQueue.length === 0 && current !== 2) { + circular = false; + } + this.setData({ + curQueue: curQueue, + circular: circular + }); + }, + playCurrent: function playCurrent(current) { + this.data._videoContexts.forEach(function(ctx, index) { + index !== current ? ctx.pause() : ctx.play(); + }); + }, + onPlay: function onPlay(e) { + this.trigger(e, 'play'); + this.setData({ + isPaly: true, + selectVideo: { + id: e.currentTarget.dataset.id, + index: e.currentTarget.dataset.index + } + }) + }, + onPause: function onPause(e) { + this.trigger(e, 'pause'); + this.setData({ + isPaly: false + }) + }, + clickPause(e) { + if (!this.data.isPaly) + this.data._videoContexts[e.currentTarget.dataset.index].play() + else + this.data._videoContexts[e.currentTarget.dataset.index].pause() + }, + onEnded: function onEnded(e) { + this.trigger(e, 'ended'); + }, + onError: function onError(e) { + this.trigger(e, 'error'); + }, + onTimeUpdate: function onTimeUpdate(e) { + this.trigger(e, 'timeupdate'); + let percent = (e.detail.currentTime / e.detail.duration) * 100 + this.setData({ + percent: percent.toFixed(2) + }) + }, + onWaiting: function onWaiting(e) { + this.trigger(e, 'wait'); + }, + goUserHome: function goUserHome(e) { + this.trigger(e, 'user'); + }, + likeVideoOrNot: function likeVideoOrNot(e) { + this.trigger(e, 'like'); + }, + showComments: function showComments(e) { + this.trigger(e, 'comments'); + }, + shareMe: function shareMe(e) { + this.triggerEvent('share', this.data.selectVideo, {}) + }, + onProgress: function onProgress(e) { + this.trigger(e, 'progress'); + }, + onLoadedMetaData: function onLoadedMetaData(e) { + this.trigger(e, 'loadedmetadata'); + }, + trigger: function trigger(e, type) { + var ext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var detail = e.detail; + var activeId = e.target.dataset.id; + this.triggerEvent(type, Object.assign(Object.assign(Object.assign({}, detail), { + activeId: activeId + }), ext)); + } + } + }); + }) +]); \ No newline at end of file diff --git a/components/video-swiper/video-swiper.json b/components/video-swiper/video-swiper.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/video-swiper/video-swiper.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/video-swiper/video-swiper.wxml b/components/video-swiper/video-swiper.wxml new file mode 100644 index 0000000..371875d --- /dev/null +++ b/components/video-swiper/video-swiper.wxml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + {{item.visitCount}} + + + + + {{item.seconds}} + + + + + + + + + + + + @佰创科技 + 我是视频标题 我是视频标题 + + + + + + + 商品名字 + + + ¥29.99 + ¥36.99 + + + + + + + + \ No newline at end of file diff --git a/components/video-swiper/video-swiper.wxss b/components/video-swiper/video-swiper.wxss new file mode 100644 index 0000000..3fd64b0 --- /dev/null +++ b/components/video-swiper/video-swiper.wxss @@ -0,0 +1,67 @@ +/* components/video-swiper/video-swiper.wxss */ + +.container { + height: 100vh; + width: 100vw; +} + +.video-swiper { + height: 100vh; + width: 100vw; + margin-top: -400rpx +} + +.video_item { + height: 100vh; + width: 100vw; +} + +.progress { + position: absolute; + left: 0; + bottom: 30px; + height: 4px; + width: 100vw; +} + + +/* 右侧区域 */ +.tools { + position: absolute; + right: 20rpx; + top: 50%; +} + +/* 头像 */ +.userinfo-avatar { + width: 100rpx; + height: 100rpx; + margin: 20rpx; + border-radius: 50%; +} + +.container-words { + position: absolute; + bottom: 50px; + left: 20rpx; + color: white; +} + +.video-ad{ + height: 128rpx; + background-color: rgba(252, 252, 252, 0.9); + border-radius: 8rpx; +} + +.ad-img{ + width: 128rpx; + height: 128rpx; + +} + +.play-btn { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); +} \ No newline at end of file diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js new file mode 100644 index 0000000..3a901b4 --- /dev/null +++ b/custom-tab-bar/index.js @@ -0,0 +1,50 @@ +Component({ + data: { + selected: 0, + color: "#7A7E83", + selectedColor: "#f43f3b", + list: [ + { + pagePath: "/pages/index/index", + iconPath: "/images/ic_tab_home.png", + selectedIconPath: "/images/ic_tab_home_cur.png", + text: "首页" + }, + { + pagePath: "/pages/sort/sort", + iconPath: "/images/ic_tab_daren.png", + selectedIconPath: "/images/ic_tab_daren_cur.png", + text: "分类" + }, + { + pagePath: "/pages/vip/vip", + iconPath: "/images/ic_tab_vip.png", + selectedIconPath: "/images/ic_tab_vip_cur.png", + text: "会员" + }, + { + pagePath: "/pages/strategy/strategy", + iconPath: "/images/ic_tab_strategy.png", + selectedIconPath: "/images/ic_tab_strategy_cur.png", + text: "攻略" + }, + { + pagePath: "/pages/mine/mine", + iconPath: "/images/ic_tab_mine.png", + selectedIconPath: "/images/ic_tab_mine_cur.png", + text: "我的" + } + ], + + }, + methods: { + switchTab(e) { + const data = e.currentTarget.dataset + const url = data.path + wx.switchTab({url}) + this.setData({ + selected: data.index + }) + } + } +}) \ No newline at end of file diff --git a/custom-tab-bar/index.json b/custom-tab-bar/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/custom-tab-bar/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/custom-tab-bar/index.wxml b/custom-tab-bar/index.wxml new file mode 100644 index 0000000..20d9932 --- /dev/null +++ b/custom-tab-bar/index.wxml @@ -0,0 +1,35 @@ + + + + + + + + 首页 + + + + + + + 分类 + + + + + + 会员 + + + + + + 攻略 + + + + + + 我的 + + \ No newline at end of file diff --git a/custom-tab-bar/index.wxss b/custom-tab-bar/index.wxss new file mode 100644 index 0000000..23a6264 --- /dev/null +++ b/custom-tab-bar/index.wxss @@ -0,0 +1,4 @@ +@import "/utils/styles/main.wxss"; +@import "/utils/styles/icon.wxss"; +@import "/utils/styles/animation.wxss"; +@import "/utils/styles/base.wxss"; \ No newline at end of file diff --git a/images/ic_camera.png b/images/ic_camera.png new file mode 100644 index 0000000..421bee6 Binary files /dev/null and b/images/ic_camera.png differ diff --git a/images/ic_delivery.png b/images/ic_delivery.png new file mode 100644 index 0000000..bb1a383 Binary files /dev/null and b/images/ic_delivery.png differ diff --git a/images/ic_diamond.png b/images/ic_diamond.png new file mode 100644 index 0000000..1eba055 Binary files /dev/null and b/images/ic_diamond.png differ diff --git a/images/ic_fresh.png b/images/ic_fresh.png new file mode 100644 index 0000000..6ce2d1e Binary files /dev/null and b/images/ic_fresh.png differ diff --git a/images/ic_hot.png b/images/ic_hot.png new file mode 100644 index 0000000..e2529a8 Binary files /dev/null and b/images/ic_hot.png differ diff --git a/images/ic_like.png b/images/ic_like.png new file mode 100644 index 0000000..4e65096 Binary files /dev/null and b/images/ic_like.png differ diff --git a/images/ic_link.png b/images/ic_link.png new file mode 100644 index 0000000..130f3b9 Binary files /dev/null and b/images/ic_link.png differ diff --git a/images/ic_makeups.png b/images/ic_makeups.png new file mode 100644 index 0000000..59e6fcb Binary files /dev/null and b/images/ic_makeups.png differ diff --git a/images/ic_search_bottom.png b/images/ic_search_bottom.png new file mode 100644 index 0000000..d720f5e Binary files /dev/null and b/images/ic_search_bottom.png differ diff --git a/images/ic_search_bottom_cur.png b/images/ic_search_bottom_cur.png new file mode 100644 index 0000000..899e475 Binary files /dev/null and b/images/ic_search_bottom_cur.png differ diff --git a/images/ic_search_right.png b/images/ic_search_right.png new file mode 100644 index 0000000..84761f0 Binary files /dev/null and b/images/ic_search_right.png differ diff --git a/images/ic_search_top.png b/images/ic_search_top.png new file mode 100644 index 0000000..d02bcdb Binary files /dev/null and b/images/ic_search_top.png differ diff --git a/images/ic_search_top_cur.png b/images/ic_search_top_cur.png new file mode 100644 index 0000000..45e9ac3 Binary files /dev/null and b/images/ic_search_top_cur.png differ diff --git a/images/ic_share_btn.jpg b/images/ic_share_btn.jpg new file mode 100644 index 0000000..984a37c Binary files /dev/null and b/images/ic_share_btn.jpg differ diff --git a/images/ic_skirt.png b/images/ic_skirt.png new file mode 100644 index 0000000..57e008e Binary files /dev/null and b/images/ic_skirt.png differ diff --git a/images/ic_tab_daren.png b/images/ic_tab_daren.png new file mode 100644 index 0000000..d9b5183 Binary files /dev/null and b/images/ic_tab_daren.png differ diff --git a/images/ic_tab_daren_cur.png b/images/ic_tab_daren_cur.png new file mode 100644 index 0000000..0120e98 Binary files /dev/null and b/images/ic_tab_daren_cur.png differ diff --git a/images/ic_tab_home.png b/images/ic_tab_home.png new file mode 100644 index 0000000..694a0aa Binary files /dev/null and b/images/ic_tab_home.png differ diff --git a/images/ic_tab_home_cur.png b/images/ic_tab_home_cur.png new file mode 100644 index 0000000..0be6f5e Binary files /dev/null and b/images/ic_tab_home_cur.png differ diff --git a/images/ic_tab_mine.png b/images/ic_tab_mine.png new file mode 100644 index 0000000..5ea117f Binary files /dev/null and b/images/ic_tab_mine.png differ diff --git a/images/ic_tab_mine_cur.png b/images/ic_tab_mine_cur.png new file mode 100644 index 0000000..3f74fe0 Binary files /dev/null and b/images/ic_tab_mine_cur.png differ diff --git a/images/ic_tab_strategy.png b/images/ic_tab_strategy.png new file mode 100644 index 0000000..7751ee3 Binary files /dev/null and b/images/ic_tab_strategy.png differ diff --git a/images/ic_tab_strategy_cur.png b/images/ic_tab_strategy_cur.png new file mode 100644 index 0000000..e82f394 Binary files /dev/null and b/images/ic_tab_strategy_cur.png differ diff --git a/images/ic_tab_vip.png b/images/ic_tab_vip.png new file mode 100644 index 0000000..6f3bc4f Binary files /dev/null and b/images/ic_tab_vip.png differ diff --git a/images/ic_tab_vip_cur.png b/images/ic_tab_vip_cur.png new file mode 100644 index 0000000..ae4e83e Binary files /dev/null and b/images/ic_tab_vip_cur.png differ diff --git a/images/ic_toothpaste.png b/images/ic_toothpaste.png new file mode 100644 index 0000000..08f9a24 Binary files /dev/null and b/images/ic_toothpaste.png differ diff --git a/page_package/about/about.js b/page_package/about/about.js new file mode 100644 index 0000000..cb54569 --- /dev/null +++ b/page_package/about/about.js @@ -0,0 +1,21 @@ +// page_package/about/about.js +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + StatusBar: app.globalData.StatusBar, + CustomBar: app.globalData.CustomBar, + Custom: app.globalData.Custom, + windowWidth: app.globalData.windowWidth, + windowHeight: app.globalData.windowHeight, + + }, + onLoad: function() { + + } + +}) \ No newline at end of file diff --git a/page_package/about/about.json b/page_package/about/about.json new file mode 100644 index 0000000..14b0c5b --- /dev/null +++ b/page_package/about/about.json @@ -0,0 +1,8 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "关于我们", + "usingComponents": { + "video-swiper":"/components/video-swiper/video-swiper" + } +} \ No newline at end of file diff --git a/page_package/about/about.wxml b/page_package/about/about.wxml new file mode 100644 index 0000000..496b3aa --- /dev/null +++ b/page_package/about/about.wxml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/page_package/about/about.wxss b/page_package/about/about.wxss new file mode 100644 index 0000000..e69de29 diff --git a/page_package/activity/activity.js b/page_package/activity/activity.js new file mode 100644 index 0000000..6a90c08 --- /dev/null +++ b/page_package/activity/activity.js @@ -0,0 +1,211 @@ +// page_package/activity/activity.js +const app = getApp() +const {activityByID, goodsConvert} = require('../../utils/network/services/service.js') +const {productsCode} = require('../../utils/network/services/productImpl.js') +const constants = require('../../utils/constants') +const util = require('../../utils/util') +const {onLogin} = require("../../utils/network/services/user.js") +let that = null +Page({ + + /** + * 页面的初始数据 + */ + data: { + windowWidth: app.globalData.windowWidth, + activityContent: null, + copyContent: '', + copywriting: "1.复制以下文案并微信发送给自己\n2.通过微信访问活动地址购买", + imgWidth: 0, + imgHeight: 0, + userInfo:null, + ctx:null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.setNavigationBarTitle({title: options.title}) + that = this + let width = this.data.windowWidth - 30 + this.setData({imgWidth: width, imgHeight: width + 128}) + + if (!app.globalData.loginStatus) { + wx.showLoading({title: '加载中...'}) + // 登录 + wx.login({ + success: res => { + onLogin(res.code) + .then(res => { + app.globalData.userInfo = res.data.data + app.globalData.loginStatus = true + util.setStorage(constants.AUTH_INFO, res.data.data) + that.setData({userInfo: res.data.data}) + wx.showLoading({title: '加载中...'}) + that.getActivity(options) + }).catch((err) => { + if (err.data.code = 'USER_NOT_REGISTERED' && app.globalData.loginMode == 'true') { + that.data.requesting = false + that.setData({token: err.data.data.token}) + wx.navigateTo({url: '/pages/login/login?token=' + err.data.data.token}) + } + }) + } + }) + } else + that.getActivity(options) + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + onCopy() { + if (this.data.copyContent) + this.shareContent(this.data.copyContent) + else + goodsConvert(this.data.activityContent.content) + .then(res => { + this.setData({copyContent: res.data.data.content}) + this.shareContent(this.data.copyContent) + }).catch(err => { + wx.showToast({title: "获取推广链接失败", icon: "none"}) + }) + }, + shareContent(content) { + wx.setClipboardData({ + data: content, + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + }, + goToIcon() { + wx.previewImage({ + urls: [this.data.activityContent.shareImage], + }) + }, + getActivity(options){ + activityByID(options.id) + .then(res => { + this.setData({ + activityContent: res.data.data + }) + // this.imgLoad() + }).catch(err => { + // wx.hideLoading() + wx.showToast({ + title: "活动加载失败", + icon: "none", + duration: 3000 + }) + }) + }, + imgLoad(){ + wx.showLoading({title: '加载中...'}) + Promise.all([ + new Promise((resolve, reject) => { + wx.getImageInfo({ + src: that.data.userInfo.avatarUrl, + success(res) { + resolve(res) + }, + fail(err) { + reject(err) + } + }) + }), + new Promise((resolve, reject) => { + wx.getImageInfo({ + src: that.data.activityContent.shareImage, + success(res) { + resolve(res) + }, + fail(err) { + reject(err) + } + }) + }), + // productsCode(data) + // .then(res => { + // let filePath = `${wx.env.USER_DATA_PATH}/${that.data.productDetails.skuId}${that.data.productDetails.inOrderCount30Days}`; + // wx.getFileSystemManager().writeFile({ + // filePath: filePath, + // data: wx.base64ToArrayBuffer(res.data.data.content), + // encoding: 'binary', + // success: () => { + // resolve(filePath); + // }, + // fail: err => { + // reject(err); + // }, + // }); + // }).catch((err) => { + // reject(err); + // }) + ]).then(res => { + const ctx = wx.createCanvasContext('myCanvas', that); + ctx.fillStyle = "#FFFFFF"; + ctx.fillRect(0, 0, that.data.imgWidth, that.data.imgHeight); + that.setData({ctx: ctx}) + }).catch(err => { + wx.showToast({ + title: "分享图加载失败", + icon: "none", + duration: 3000 + }) + }) + } +}) \ No newline at end of file diff --git a/page_package/activity/activity.json b/page_package/activity/activity.json new file mode 100644 index 0000000..c8d38bf --- /dev/null +++ b/page_package/activity/activity.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "活动详情", + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#eeeeee", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/activity/activity.wxml b/page_package/activity/activity.wxml new file mode 100644 index 0000000..f2f8144 --- /dev/null +++ b/page_package/activity/activity.wxml @@ -0,0 +1,28 @@ + + + + + 如何参与活动? + {{copywriting}} + + + 活动文案 + {{activityContent.content}} + + + + + + + + + + + + 复制文字 + 分享图片 + + + diff --git a/page_package/activity/activity.wxss b/page_package/activity/activity.wxss new file mode 100644 index 0000000..5713c04 --- /dev/null +++ b/page_package/activity/activity.wxss @@ -0,0 +1,11 @@ +/* page_package/activity/activity.wxss */ +page{ + background-color: #eeeeee; +} + +.bottom-bar{ + position: fixed; + bottom: 0px; + display: flex; + width: 100%; +} \ No newline at end of file diff --git a/page_package/apply-vip/apply-vip.js b/page_package/apply-vip/apply-vip.js new file mode 100644 index 0000000..8ff1fe0 --- /dev/null +++ b/page_package/apply-vip/apply-vip.js @@ -0,0 +1,210 @@ +// page_package/apply-vip/apply-vip.js +const app = getApp() +const {superMembers, superMembersUp} = require('../../utils/network/services/user.js') +const {uploadFile} = require('../../utils/network/services/service.js') +const constants = require('../../utils/constants') +const util = require('../../utils/util') + +Page({ + + /** + * 页面的初始数据 + */ + data: { + members: null, + imgList: [], + invitationDialog:false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + superMembers().then(res => { + this.setData({members: res.data.data}) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + DelImg(e) { + this.data.imgList.splice(e.currentTarget.dataset.index, 1); + this.setData({ + imgList: this.data.imgList + }) + }, + ChooseImage() { + wx.chooseImage({ + count: 2, //默认9 + sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 + sourceType: ['album'], //从相册选择 + success: (res) => { + if (this.data.imgList.length != 0) { + this.setData({ + imgList: this.data.imgList.concat(res.tempFilePaths) + }) + } else { + this.setData({ + imgList: res.tempFilePaths + }) + } + } + }); + }, + onCopy(event) { + console.log(event) + wx.setClipboardData({ + data: event.currentTarget.dataset.code, + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + }, + onExample() { + wx.navigateTo({ + url: '/page_package/apply-vip/example/example?example=' + JSON.stringify(this.data.members.examples) + }) + }, + previewImg(event) { + const index = event.currentTarget.dataset.index + wx.previewImage({ + current: this.data.imgList[index], + urls: this.data.imgList, + }) + }, + onSubmit() { + let that = this + if (this.data.imgList.length != 2) { + wx.showModal({ + title: '提示', + showCancel: false, + content: '最少需要提交两张图片', + success(res) { + } + }) + return + } + Promise.all([ + new Promise((resolve, reject) => { + uploadFile({ + path: that.data.imgList[0], + type: 1 + }).then(res1 => { + resolve(res1) + }).catch(err1 => { + reject(err1) + }) + }), + new Promise((resolve, reject) => { + uploadFile({ + path: that.data.imgList[1], + type: 1 + }).then(res1 => { + resolve(res1) + }).catch(err1 => { + reject(err1) + }) + }) + + // that.data.imgList.forEach(item => { + // + // }) + ]).then(res2 => { + let imgArr = [] + for (let i = 0; i < that.data.imgList.length; i++) imgArr.push(res2[i]) + superMembersUp({imageUrls: imgArr}) + .then((res) => { + this.setData({invitationDialog:true}) + }).catch(err => { + wx.showModal({ + title: '提示', + showCancel: false, + content: err.data.message ? err.data.message : '提交失败', + success(res) { + } + }) + }) + }).catch(err2 => { + wx.showModal({ + title: '提示', + showCancel: false, + content: err2.data.message ? err2.data.message : '提交失败', + success(res) { + } + }) + }) + }, + hideModal(event){ + this.setData({invitationDialog:false}) + if( event.currentTarget.dataset.iscode == 'x'){ + wx.requestSubscribeMessage({ + tmplIds: ['Ag7cMQ1Sl4dx8jdh_VavgZ1XWXoOPhVO5f66M6sJxq0'], + success (res) { + wx.showModal({ + title: '提示', + showCancel: false, + content: '订阅成功,审核结果第一时间发送给你', + success(res) { + wx.navigateBack({//返回 + delta: 2 + }) + } + }) + } + }) + } + } + +}) \ No newline at end of file diff --git a/page_package/apply-vip/apply-vip.json b/page_package/apply-vip/apply-vip.json new file mode 100644 index 0000000..7714023 --- /dev/null +++ b/page_package/apply-vip/apply-vip.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "建群升级", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/apply-vip/apply-vip.wxml b/page_package/apply-vip/apply-vip.wxml new file mode 100644 index 0000000..4291566 --- /dev/null +++ b/page_package/apply-vip/apply-vip.wxml @@ -0,0 +1,81 @@ + + + + + + + + + 升级进展:{{members.statusDesc}} + + 为您分配微信群编号:{{members.groupId}} + + 您需要做如下操作完成升级 + + 1.新拉或已有一个超过{{members.memberCount}}人的微信推广群,群名称修改为“{{members.groupName}}” + 复制群名称 + + + 也可添加导师微信咨询,导师微信号:{{members.wechatId}} + 复制微信号 + + + 2.上传两张截图(截图一:显示出群主和群人数 截图二:显示出群名称) + 查看示例 + + + 3.上传提交后,工作时间30分钟内会有审核结果,审核通过会有短信通知或订阅消息。 + + + + + 图片上传 + + + {{imgList.length}}/2 + + + + + + + + + + + + + + + + +提交审核 + + + + + + + 提示 + + + + + + 提交成功啦!,请等待1~3个工作日 + 你可以订阅消息,第一时间获取审核进度 + + + 取消 + 订阅消息 + + + + diff --git a/page_package/apply-vip/apply-vip.wxss b/page_package/apply-vip/apply-vip.wxss new file mode 100644 index 0000000..ccf3190 --- /dev/null +++ b/page_package/apply-vip/apply-vip.wxss @@ -0,0 +1,16 @@ +/* page_package/apply-vip/apply-vip.wxss */ +page { + background-color: #f2f2f2; +} + +.apply-body { + width: 94%; + margin-left: 3%; +} + +.apply-title { + margin-top: 48 rpx; + font-size: 32 rpx; + font-weight: 600; + color: #000; +} \ No newline at end of file diff --git a/page_package/apply-vip/example/example.js b/page_package/apply-vip/example/example.js new file mode 100644 index 0000000..c8203ad --- /dev/null +++ b/page_package/apply-vip/example/example.js @@ -0,0 +1,67 @@ +// page_package/apply-vip/example/example.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + example:[] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let example = JSON.parse(options.example) + this.setData({example:example}) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/page_package/apply-vip/example/example.json b/page_package/apply-vip/example/example.json new file mode 100644 index 0000000..6ade6ce --- /dev/null +++ b/page_package/apply-vip/example/example.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "截图示例", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/apply-vip/example/example.wxml b/page_package/apply-vip/example/example.wxml new file mode 100644 index 0000000..7f39c0d --- /dev/null +++ b/page_package/apply-vip/example/example.wxml @@ -0,0 +1,5 @@ + + + {{item.step}} + + diff --git a/page_package/apply-vip/example/example.wxss b/page_package/apply-vip/example/example.wxss new file mode 100644 index 0000000..3886eb7 --- /dev/null +++ b/page_package/apply-vip/example/example.wxss @@ -0,0 +1 @@ +/* page_package/apply-vip/example/example.wxss */ \ No newline at end of file diff --git a/page_package/contacts/contacts.js b/page_package/contacts/contacts.js new file mode 100644 index 0000000..c736156 --- /dev/null +++ b/page_package/contacts/contacts.js @@ -0,0 +1,144 @@ +const app = getApp() +const {userContacts, updateUserInfo} = require('../../utils/network/services/user.js') +const constants = require('../../utils/constants') +const util = require('../../utils/util') + +Page({ + + /** + * 页面的初始数据 + */ + data: { + isEditWeChat: false, + weChatCode: '', + windowWidth: app.globalData.windowWidth, + windowHeight: app.globalData.windowHeight, + queryData: { + pageIndex: 1, + pageSize: 20 + }, + requesting: false, + infoData: null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.refresh() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + wx.vibrateShort(); + this.refresh() + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + onEdit() { + this.setData({isEditWeChat: true}) + }, + onSave() { + this.setData({isEditWeChat: false}) + updateUserInfo({wechatId: this.data.weChatCode}) + .then(res => { + + }) + }, + onCopy(event) { + if (event.currentTarget.dataset.code) { + wx.setClipboardData({ + data: event.currentTarget.dataset.code, + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + } else wx.showToast({ + title: '暂无微信号' + }) + }, + bindInput(event) { + this.setData({weChatCode: event.detail.value}) + }, + getData(type) { + userContacts(this.data.queryData) + .then(res => { + wx.stopPullDownRefresh() + let arr = this.data.infoData + if (arr && type == 'more') { + res.data.data.fans.forEach(item => { + arr.fans.push(item) + }) + } + this.setData({ + infoData: arr ? arr : res.data.data, + requesting: false, + weChatCode: res.data.data.mine.wechatId ? res.data.data.mine.wechatId : '' + }) + }).catch(err => { + wx.stopPullDownRefresh() + this.setData({requesting: false}) + }) + }, + refresh() { + this.data.queryData.pageIndex = 1 + this.setData({queryData: this.data.queryData, requesting: true}) + this.getData('refresh') + }, + more() { + this.data.queryData.pageIndex = ++this.data.queryData.pageIndex + this.setData({queryData: this.data.queryData}) + this.getData('more') + }, + onReachBottom(){ + this.more() + } +}) \ No newline at end of file diff --git a/page_package/contacts/contacts.json b/page_package/contacts/contacts.json new file mode 100644 index 0000000..fa3dea0 --- /dev/null +++ b/page_package/contacts/contacts.json @@ -0,0 +1,7 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "我的团队", + "enablePullDownRefresh": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/contacts/contacts.wxml b/page_package/contacts/contacts.wxml new file mode 100644 index 0000000..04be2c0 --- /dev/null +++ b/page_package/contacts/contacts.wxml @@ -0,0 +1,91 @@ + + + + + + + + + 我的赶快填写微信号吧~方便导师添加你进行指导 + + + + + + {{infoData.mine.nickName}} + {{infoData.mine.identifyDesc}} + + + {{weChatCode?weChatCode:'点此填写微信号'}} + + 保 存 + + + + + 邀请人 + + + + + {{infoData.inviter.nickName}} + + + 微信号:{{infoData.inviter.wechatId}} + + 复制微信 + + + + 导师 + + + + + {{infoData.teacher.nickName}} + + + 微信号:{{infoData.teacher.wechatId}} + + 复制微信 + + + + + + 我的粉丝仅显示已填写微信号的粉丝 + + + + + {{item.nickName}} + + + 微信号:{{item.wechatId}} + + 复制微信 + + + + ———— 已经到底啦 ———— + + + diff --git a/page_package/contacts/contacts.wxss b/page_package/contacts/contacts.wxss new file mode 100644 index 0000000..aa051aa --- /dev/null +++ b/page_package/contacts/contacts.wxss @@ -0,0 +1,25 @@ +/* page_package/contacts/contacts.wxss */ + +page{ + background-color: #f2f2f2; +} + +.absolute-right{ + position: absolute; + right: 40rpx; +} + +.action-btn1{ + padding: 4rpx 16rpx; + border-radius: 6rpx; + background-color: white; + border: 1rpx solid #f43f3b; +} + +.rank{ + padding: 4rpx 16rpx; + border-radius: 32rpx; + color:#888; + background-color: white; + border: 1rpx solid #666666; +} \ No newline at end of file diff --git a/page_package/details/index.js b/page_package/details/index.js new file mode 100644 index 0000000..3e1f258 --- /dev/null +++ b/page_package/details/index.js @@ -0,0 +1,588 @@ +// page_package/details/index.js +const app = getApp() +const {goodsUrl, productsCode, appCode, purchaseUrl} = require("../../utils/network/services/productImpl.js") +const constants = require("../../utils/constants") +const util = require("../../utils/util") +const {onLogin} = require("../../utils/network/services/user.js") +Page({ + + /** + * 页面的初始数据 + */ + data: { + StatusBar: app.globalData.StatusBar, + CustomBar: app.globalData.CustomBar, + Custom: app.globalData.Custom, + windowWidth: app.globalData.windowWidth, + windowHeight: app.globalData.windowHeight, + userInfo: app.globalData.userInfo, + productDetails: null, + invitationDialog: false, + imgWidth: 0, + imgHeight: 0, + ctx: null, + modalName: "", + shareURl: "", + shareImgPath: "", + synthesisImg: '', + appImg: '', + userInfo: app.globalData.userInfo, + shareType: 1 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + productDetails: util.getStorage(constants.PRPDUCT_ITEM), + imgWidth: 255,//app.globalData.windowWidth * 0.68 + imgHeight: 407, //app.globalData.windowHeight * 0.61 + }) + let coupons = this.data.productDetails.coupons + let data = { + invitationCode: '', + couponUrl: coupons.length > 0 ? coupons[coupons.length - 1].link : '', + materialId: this.data.productDetails.materialUrl + } + if (!app.globalData.loginStatus) { + let that = this + wx.login({ + success: res => { + onLogin(res.code) + .then(res => { + app.globalData.userInfo = res.data.data + util.setStorage(constants.AUTH_INFO, res.data.data) + that.setData({userInfo: res.data.data}) + purchaseUrl(data).then(res => { + that.setData({shareURl: res.data.data.shortURL}) + }) + }).catch((err) => { + if (err.data.code = 'USER_NOT_REGISTERED') { + // that.setData({token: err.data.data.token}) + wx.navigateTo({url: '/pages/login/login?token=' + err.data.data.token}) + } + }) + } + }) + } else { + purchaseUrl(data).then(res => { + this.setData({shareURl: res.data.data.shortURL}) + }) + } + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角 + */ + onShareAppMessage: function (res) { + this.setData({modalName: ''}) + return { + title: this.data.productDetails.skuName, + path: '/pages/product/product?id=' + this.data.productDetails.skuId + '&invitationCode=' + this.data.userInfo.invitationCode, + imageUrl: this.data.productDetails.images[0], + success: function (res) { + // 转发成功 + console.log('转发成功') + }, + fail: function (res) { + // 转发失败 + console.log('转发失败') + } + } + }, + + goHome(event) { + wx.reLaunch({ + url: '/pages/index/index', + }) + }, + onShowModel() { + this.setData({ + modalName: 'bottomModal' + }) + }, + onShare(event) { + let that = this + let index = event.currentTarget.dataset.index + that.imgLoader(index) + that.setData({ + modalName: '', + shareType: Number(index) + }) + }, + onClose() { + let that = this + this.setData({ + invitationDialog: false, + }) + this.data.ctx.draw() + + if (this.data.shareImgPath) { + wx.getFileSystemManager().unlink({ + filePath: this.data.shareImgPath, + success: res => { + that.setData({shareImgPath: ''}) + } + }) + } + }, + + + imgLoader(index) { + if ((this.data.synthesisImg && index == 1) || (this.data.appImg && index == 0)) { + this.setData({invitationDialog: true}) + } else { + let that = this + wx.showLoading({title: '合成中...',}) + Promise.all([ + new Promise((resolve, reject) => { + wx.getImageInfo({ + src: that.data.productDetails.images[0], + success(res) { + resolve(res) + }, + fail(err) { + err.prompt = '合成商品图失败' + reject(err) + } + }) + }), + new Promise((resolve, reject) => { + wx.getImageInfo({ + src: that.data.userInfo.avatarUrl, + success(res) { + resolve(res) + }, + fail(err) { + err.prompt = '合成头像失败' + reject(err) + } + }) + }), + + new Promise((resolve, reject) => { + if (index == 1) {//商品推廣 + let data = { + materialUrl: this.data.productDetails.materialUrl, + size: 72 + } + if (this.data.productDetails.coupons.length > 0) { + data = { + couponUrl: this.data.productDetails.coupons[this.data.productDetails.coupons.length - 1].link, + materialUrl: this.data.productDetails.materialUrl, + size: 72 + } + } + productsCode(data) + .then(res => { + let filePath = `${wx.env.USER_DATA_PATH}/${that.data.productDetails.skuId}`; + wx.getFileSystemManager().writeFile({ + filePath: filePath, + data: wx.base64ToArrayBuffer(res.data.data.content), + encoding: 'binary', + success: () => { + resolve(filePath); + }, + fail: err => { + err.prompt = '合成商品码失败' + reject(err); + }, + }); + }).catch((err) => { + err.prompt = '获取商品码失败' + reject(err); + }) + } else { + let data = { + page: "pages/product/product", + scene: {id: that.data.productDetails.skuId,}, + size: 72 + } + appCode(data) + .then(res => { + let filePath = `${wx.env.USER_DATA_PATH}/${that.data.productDetails.skuId}${that.data.productDetails.inOrderCount30Days}`; + wx.getFileSystemManager().writeFile({ + filePath: filePath, + data: wx.base64ToArrayBuffer(res.data.data.content), + encoding: 'binary', + success: () => { + resolve(filePath); + }, + fail: err => { + err.prompt = '合成推广码失败' + reject(err); + }, + }); + }).catch((err) => { + err.prompt = '获取推广码失败' + reject(err); + }) + } + }) + + ]).then(res => { + let id = index == 1 ? 'myCanvas' : 'myCanvas1' + const ctx = wx.createCanvasContext(id, that); + ctx.fillStyle = "#FFFFFF"; + ctx.fillRect(0, 0, that.data.imgWidth, that.data.imgHeight); + that.setData({ctx: ctx}) + const productImg = res[0].path //商品图 + const title = that.data.productDetails.skuName //商品名称 + const titleLines = that.skuNameFormat(ctx, title) + //券后价 + const couponPrice = that.data.productDetails.priceInfo.lowestCouponPrice ? that.data.productDetails.priceInfo.lowestCouponPrice : that.data.productDetails.priceInfo.price + const comment = util.formatNUmber(that.data.productDetails.comments) //评论条数 + const praise = that.data.productDetails.goodCommentsShare //好评率 + const price = util.formatNUmber(that.data.productDetails.priceInfo.price) //京东价 + //优惠券 + let coupon = 0 + if (that.data.productDetails.coupons.length > 0) + coupon = that.data.productDetails.coupons[0].discount ? that.data.productDetails.coupons[0].discount : 0 + + const avatarUrl = res[1].path //用户头像 + const userName = that.data.userInfo.nickName //用户昵称 + const code = "DHWKLD" + const promotionCode = res[2].path //推广码 + + //绘制商品图 + ctx.drawImage(productImg, 0, 0, that.data.imgWidth, that.data.imgWidth); + ctx.save(); + + //京东标识矩形 + ctx.rect(10, that.data.imgWidth + 10, 23, 11) + ctx.setFillStyle('#f43f3b') + ctx.setStrokeStyle('#f43f3b') + // ctx.setBorderRadius(5) + ctx.fill() + + //京东标识文字 + ctx.setTextAlign('left') + ctx.setFillStyle('#ffffff') + ctx.setFontSize(9) + ctx.fillText('京东', 12, that.data.imgWidth + 18) + ctx.stroke() + + //商品标题第一行 + ctx.setTextAlign('left') + ctx.setFillStyle('#333333') + ctx.setFontSize(11) + ctx.fillText(titleLines[0], 43, that.data.imgWidth + 20) + ctx.stroke() + + //商品标题第二行 + ctx.setTextAlign('left') + ctx.setFillStyle('#333333') + ctx.setFontSize(11) + ctx.fillText(titleLines.length > 1 ? titleLines[1] : ' ', 10, that.data.imgWidth + 40) + ctx.stroke() + + //券后价文本 + ctx.setTextAlign('left') + ctx.setFillStyle('#f43f3b') + ctx.setFontSize(9) + ctx.fillText("券后价¥", 10, that.data.imgWidth + 64) + ctx.stroke() + + //券后价 + ctx.setTextAlign('left') + ctx.setFillStyle('#f43f3b') + ctx.setFontSize(15) + ctx.fillText(util.isNumber(couponPrice) ? Number(couponPrice).toFixed(2) : couponPrice, 45, that.data.imgWidth + 64) + ctx.stroke() + + //评论 好评 + ctx.setTextAlign('right') + ctx.setFillStyle('#666666') + ctx.setFontSize(9) + ctx.fillText(comment + "条评论 好评率" + praise + "%", that.data.imgWidth - 10, that.data.imgWidth + 64) + ctx.stroke() + + //京东价 + ctx.setTextAlign('left') + ctx.setFillStyle('#666666') + ctx.setFontSize(9) + ctx.fillText(util.isNumber(price) ? "京东价¥" + Number(price).toFixed(2) : "京东价¥" + price, 10, that.data.imgWidth + 86) + ctx.stroke() + + //优惠券 + ctx.setTextAlign('left') + ctx.setFillStyle('#f43f3b') + ctx.setFontSize(12) + ctx.fillText("优惠券¥" + coupon, 90, that.data.imgWidth + 86) + ctx.stroke() + + //用户昵称 + ctx.setTextAlign('left') + ctx.setFillStyle('#333333') + ctx.setFontSize(11) + ctx.fillText('好友' + userName, 64, that.data.imgWidth + 116) + ctx.stroke() + + //用户昵称 + ctx.setTextAlign('left') + ctx.setFillStyle('#666666') + ctx.setFontSize(8) + ctx.fillText('推荐您享受京东购物优惠', 64, that.data.imgWidth + 134) + ctx.stroke() + + // + ctx.setTextAlign('right') + ctx.setFillStyle('#444444') + ctx.setFontSize(9) + ctx.fillText('长按识别', that.data.imgWidth - 28, that.data.imgHeight - 5) + ctx.stroke() + + //用户头像 + ctx.arc(34, that.data.imgWidth + 120, 24, 0, Math.PI * 2, false); + ctx.clip(); + ctx.drawImage(avatarUrl, 10, that.data.imgWidth + 96, 48, 48); + ctx.restore(); + + //推广二维码 + ctx.drawImage(res[2], that.data.imgWidth - 74, that.data.imgHeight - 79, 64, 64); + ctx.restore(); + + ctx.draw() + + setTimeout(() => { + that.heIMg(that, index, id) + that.setData({ + shareImgPath: res[2] + }) + }, 150) + }).catch(err => { + console.log(JSON.stringify(err)) + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: err.prompt?err.prompt:"合成图片失败", + success(res) { + } + }) + }) + } + }, + + heIMg(that, index, id) { + wx.canvasToTempFilePath({ + x: 0, + y: 0, + width: that.data.imgWidth, + height: that.data.imgHeight, + canvasId: id, + success: function (res) { + wx.hideLoading() + console.log("图片ID=", id) + if (index == 1) + that.setData({ + synthesisImg: res.tempFilePath, + invitationDialog: true + }) + else that.setData({ + appImg: res.tempFilePath, + invitationDialog: true + }) + }, + fail: function (err) { + wx.hideLoading() + } + }, that) + }, + + skuNameFormat(context, title) { + let ostrtxt = '' + let olinenum = 0 + let oarrtxt = [] + context.setFontSize(11) + for (let i = 0; i < title.length; i++) { + ostrtxt = ostrtxt + title[i] + let ometricsw = context.measureText(ostrtxt) //计算字符宽度 + if (oarrtxt.length == 0) { + if (ometricsw.width > this.data.imgWidth - 60) {//设置每行的宽度 + olinenum++ + oarrtxt = oarrtxt.concat([ostrtxt]) + ostrtxt = ''; + } + } else { + if (ometricsw.width > this.data.imgWidth - 25) {//设置每行的宽度 + olinenum++ + oarrtxt = oarrtxt.concat([ostrtxt]) + ostrtxt = ''; + } + } + } + oarrtxt = oarrtxt.concat([ostrtxt]) + return oarrtxt + }, + imgPreview(event) { + const index = event.currentTarget.dataset.index + wx.previewImage({ + current: this.data.productDetails.images[index], + urls: this.data.productDetails.images + }) + }, + previewImg(event) { + wx.previewImage({ + urls: [this.data.shareType == 1 ? this.data.synthesisImg : this.data.appImg], + }) + }, + saveImg: function (event) { + wx.showLoading({title: '保存中...',}) + wx.saveImageToPhotosAlbum({ + filePath: this.data.shareType == 1 ? this.data.synthesisImg : this.data.appImg,//canvasToTempFilePath返回的tempFilePath + success: (res) => { + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: '图片保存成功,进入系统相册分享吧~', + success(res) { + if (res.confirm) { + + } + } + }) + }, + fail: (err) => { + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: '请到小程序设置中打开相册权限', + success(res) { + if (res.confirm) { + } + } + }) + } + }) + }, + goToJD() { + if (this.data.shareURl) { + let materialUrl = encodeURIComponent(this.data.shareURl); + //pages/item/detail/detail?sku=xxx + wx.navigateToMiniProgram({ + appId: 'wx91d27dbf599dff74', + path: 'pages/union/proxy/proxy?spreadUrl=' + materialUrl, + envVersion: 'release', + success(res) { + // 打开成功 + } + }); + } else { + let coupons = this.data.productDetails.coupons + let data = { + chainType: 2, + couponUrl: coupons[coupons.length - 1].link, + materialId: this.data.productDetails.materialUrl + } + if (coupons.length > 0) { + data = { + chainType: 2, + couponUrl: coupons[coupons.length - 1].link, + materialId: this.data.productDetails.materialUrl + } + } + goodsUrl(data).then(res => { + this.setData({shareURl: res.data.data.shortURL}) + let materialUrl = encodeURIComponent(this.data.shareURl); + wx.navigateToMiniProgram({ + appId: 'wx91d27dbf599dff74', + path: 'pages/union/proxy/proxy?spreadUrl=' + materialUrl, + envVersion: 'release', + success(res) { + // 打开成功 + } + }); + }) + } + }, + + onCloseModel() { + this.setData({ + modalName: '' + }) + }, + copySkuID() { + wx.setClipboardData({ + data: (this.data.productDetails.skuId).toString(), + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + }, + copySkuName() { + wx.setClipboardData({ + data: this.data.productDetails.skuName, + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + }, + onDetails() { + wx.navigateToMiniProgram({ + appId: 'wx91d27dbf599dff74', + path: 'pages/item/detail/detail?sku=' + this.data.productDetails.skuId, + envVersion: 'release', + success(res) { + // 打开成功 + } + }); + }, +}) \ No newline at end of file diff --git a/page_package/details/index.json b/page_package/details/index.json new file mode 100644 index 0000000..40ad737 --- /dev/null +++ b/page_package/details/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "商品详情", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/details/index.wxml b/page_package/details/index.wxml new file mode 100644 index 0000000..5ff2c7b --- /dev/null +++ b/page_package/details/index.wxml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + 京东 + + {{productDetails.skuName}} + + + + + 京东价 + ¥ {{productDetails.priceInfo.price}} + + 评论数 {{productDetails.comments}} + 好评率 {{productDetails.goodCommentsShare}}% + 查看详情 > + + + + + + + + 优惠券 + {{productDetails.coupons[0].discount}} + + + {{productDetails.commissionInfo.rebateHint}} + + + + + + 注:返现给下单购买用户 + + 券后价¥ + {{productDetails.priceInfo.lowestCouponPrice ? + productDetails.priceInfo.lowestCouponPrice:productDetails.priceInfo.price}} + + + 返利价¥ + {{productDetails.priceInfo.lowestRebatePrice}} + + + + + + + + + 商品编号:{{productDetails.skuId}} + + + + + + + + 京东商品 + + + 品质保证 + + + 无忧售后 + + + + + + + + + + + + + + + + 首页 + + + + + 小程序 + + 分享海报 + 京东购买 + + + + + + + + + + + + + + + + + + + + + + 保存到手机相册 + + + 预览海报长按分享 + + + + + + + + + + + + \ No newline at end of file diff --git a/page_package/details/index.wxss b/page_package/details/index.wxss new file mode 100644 index 0000000..5c99d2c --- /dev/null +++ b/page_package/details/index.wxss @@ -0,0 +1,130 @@ +/* page_package/details/index.wxss */ +.bottom-bar{ + position: fixed; + bottom: 0px; + display: flex; + width: 100%; +} + +.tag-product { + background-color: #f43f3b; + color: white; + position: absolute; + padding: 6rpx 12rpx; + font-size: 24rpx; + border-radius: 10rpx; + margin-left: 20rpx; +} + +.title-style { + text-indent: 48px; + margin-left: 20rpx; + letter-spacing: 4rpx; + line-height: 48rpx; + font-size: 32rpx +} + +.comment{ + position: absolute; + right: 20rpx; +} + +.style-three { + width:100%; + height:1.5rem; + position:relative; + display:-webkit-box; + display:-webkit-flex; + display:flex; + align-items:center; + justify-content:center; + background-color:#f43f3b; + border:none; + color:#fff; +} + +.style-three:before { + content:""; + position:absolute; + left:-.33rem; + width:0.8rem; + height:1.0rem; + top:50%; + -webkit-transform:translate(-30%,-50%); + transform:translate(-30%,-50%); + -webkit-box-shadow:3px 0 0 #e76960; + box-shadow:3px 0 0 #e76960; + -webkit-border-radius:80%; + border-radius:80%; + background-color:white; +} + +.style-three .get-btn:after { + content:""; + width:.6rem; + position:absolute; + top:0; + bottom:0; + right:28.9%; + left:0; + display:block; + z-index:9; + background-color:#fff; + background-position:100% 35%; + background-size:1rem .5rem; + background-image:linear-gradient(-45deg,#ffffff 25%,#e76960 25%,#e76960) +} + +.style-three .get-btn { + display:-webkit-box; + display:-webkit-flex; + display:flex; + position: absolute; + right: 0; + align-items:center; + justify-content:center; + width:5%; + height:1.5rem; + text-align:center; + color:#fff; + font-size:1.5rem; + line-height:1.15; + background-color:#fff; +} + +.line1{ + width: 100%; + height: 10rpx; + background-color: #f2f2f2; + margin: 20rpx 0px; +} + +.cu-dialog1 { + position: fixed; + display: inline-block; + vertical-align: middle; + margin-left: auto; + margin-right: auto; + width: 680rpx; + max-width: 100%; + background-color: transparent; + border-radius: 10rpx; + overflow: hidden; +} + +.share-img{ + width: 500rpx; + height: 750rpx; + position: relative; + display: flex; +} + +.share-btn{ + width: 100%; + background-color: white; + border-top: 1px solid #f2f2f2; +} + +.fixed{ + position: fixed; +} \ No newline at end of file diff --git a/page_package/equity/equity.js b/page_package/equity/equity.js new file mode 100644 index 0000000..b3ab953 --- /dev/null +++ b/page_package/equity/equity.js @@ -0,0 +1,87 @@ +// page_package/equity/equity.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + windowHeight: app.globalData.windowHeight, + CustomBar: app.globalData.CustomBar, + + vipList: [ + {icon: 'moneybagfill', title: '省的更多', sub: '自购有佣金'}, + {icon: 'pay', title: '推广赚钱', sub: '推广赚佣金'}, + {icon: 'baby', title: '平台奖励', sub: '平台额外奖励'}, + {icon: 'friendfill', title: '京东拉新', sub: '高额拉新奖励'}, + {icon: 'friendfill', title: '智能助手', sub: '帮您轻松赚钱'}, + {icon: 'myfill', title: '导师指导', sub: '帮您更快上手'}, + {icon: 'choicenessfill', title: '大咖课程', sub: '免费畅听'}, + {icon: 'goodsfill', title: '精品爆款', sub: '高佣品质商品'}, + {icon: 'servicefill', title: '专属客服', sub: '1V1解决问题'} + ] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + onClick() { + wx.navigateTo({ + url: '/page_package/apply-vip/apply-vip' + }) + } + } +) \ No newline at end of file diff --git a/page_package/equity/equity.json b/page_package/equity/equity.json new file mode 100644 index 0000000..000ce10 --- /dev/null +++ b/page_package/equity/equity.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "会员升级", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/equity/equity.wxml b/page_package/equity/equity.wxml new file mode 100644 index 0000000..3d29acc --- /dev/null +++ b/page_package/equity/equity.wxml @@ -0,0 +1,33 @@ + + + + + + + + + + 黄金会员九大权益 + + + + + + + + + + {{item.title}} + {{item.sub}} + + + + + + 直接建群升级 + + + + + + diff --git a/page_package/equity/equity.wxss b/page_package/equity/equity.wxss new file mode 100644 index 0000000..5ee624b --- /dev/null +++ b/page_package/equity/equity.wxss @@ -0,0 +1,49 @@ +/* page_package/equity/equity.wxss */ +page{ + background-image: linear-gradient(45deg, #f43f3b, #e76960); +} + +.vip-title{ + background: linear-gradient(to bottom,#FFFFEF, #FFCEA2); + -webkit-background-clip: text; + color: transparent; + letter-spacing:2px +} + +.vip-body{ + width: 100%; + margin-top: 60rpx; +} + +.vip-body1{ + width: 94%; + margin-left: 3%; + background-color: white; + border-radius: 8rpx; + padding: 20rpx; + border-radius: 100% 100% 100% 100% / 12rpx 12rpx 30% 30% +} + +.vip-body2{ + border: 1px solid #FFCEA2; + background-color: #FFFFEF; + border-radius: 100% 100% 100% 100% / 12rpx 12rpx 30% 30% +} + +.vip-btn{ + width: 70%; + height: 68rpx; + font-size: 30rpx; + color: #72462E; + margin-top: 70rpx; + background: linear-gradient(to right,#FFFFEF, #FFCEA2); + border-radius: 34rpx; +} + +.list-item-img { + width: 80rpx; + height: 80rpx; + background-image: linear-gradient(90deg, #FDD98C, #FFBA5E); + border-radius: 50%; + font-size: 30rpx; +} \ No newline at end of file diff --git a/page_package/fans/fans.js b/page_package/fans/fans.js new file mode 100644 index 0000000..44543f7 --- /dev/null +++ b/page_package/fans/fans.js @@ -0,0 +1,155 @@ +// page_package/fans/fans.js +const app = getApp() +const {getMembers} = require("../../utils/network/services/user.js") +const constants = require("../../utils/constants") +const util = require("../../utils/util") + +Page({ + + /** + * 页面的初始数据 + */ + data: { + windowWidth: app.globalData.windowWidth, + windowHeight: app.globalData.windowHeight, + CustomBar: app.globalData.CustomBar, + userInfo: app.globalData.userInfo, + requesting: false, + end: false, + emptyShow: false, + hasTop: false, + enableBackToTop: false, + refreshSize: 90, + bottomSize: 0, + color: "#3F82FD", + empty: false, + isLoad:false, + scrollLeft: 0, + scrollTop: -1, + TabCur: 0, + tabs: [ + // {name: "我的注册用户"}, + {name: "我的超级会员"} + ], + queryData: { + identify: 1, + pageIndex: 1, + pageSize: 20 + }, + fansList: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({queryData: this.data.queryData}) + this.getData('refresh') + if(this.data.userInfo.identify>2){ + this.setData({ + tabs:[ + // {name: "我的注册用户"}, + {name: "我的超级会员"}, + {name: "我的下级导师"}, + ] + }) + } + }, + + getData(type) { + this.setData({ + requesting: true + }) + if (type == 'refresh') + this.data.queryData.pageIndex = 1 + else + this.data.queryData.pageIndex = this.data.queryData.pageIndex + 1 + + this.data.queryData.identify = Number(this.data.TabCur) + 2 + this.setData({queryData: this.data.queryData}) + getMembers(this.data.queryData).then((res) => { + res.data.data.records.forEach( item => { + item.phone = util.phoneFor(item.phone) + item.createTime = util.isNumber(item.createTime) ? util.formatTime(new Date(item.createTime)) : item.createTime + }) + let lastList = this.data.fansList + if(type != 'refresh') res.data.data.records.forEach( item => {lastList.push(item)}) + this.setData({fansList: type == 'refresh' ? res.data.data.records : lastList}) + wx.stopPullDownRefresh() + setTimeout(() => {this.setData({requesting:false,isLoad:false})},500) + }).catch(err => { + wx.stopPullDownRefresh() + this.setData({ + requesting: false, + isLoad:false + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + this.refresh() + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.more() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + more() { + if(this.data.isLoad) return + this.setData({isLoad:true}) + this.getData('more') + }, + refresh() { + if(this.data.requesting) return + this.getData('refresh') + }, + tabSelect(e) { + this.setData({ + TabCur: e.currentTarget.dataset.id, + scrollLeft: (e.currentTarget.dataset.id - 1) * 60, + scrollTop: 0 + }) + this.getData('refresh') + // let item = e.currentTarget.dataset.item + }, +}) \ No newline at end of file diff --git a/page_package/fans/fans.json b/page_package/fans/fans.json new file mode 100644 index 0000000..9d20d87 --- /dev/null +++ b/page_package/fans/fans.json @@ -0,0 +1,11 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "我的粉丝", + "backgroundColor": "#f2f2f2", + "onReachBottomDistance": 100, + "enablePullDownRefresh": true, + "usingComponents": { + "bc-scroll": "/components/refresh/refresh" + } +} \ No newline at end of file diff --git a/page_package/fans/fans.wxml b/page_package/fans/fans.wxml new file mode 100644 index 0000000..2f6062f --- /dev/null +++ b/page_package/fans/fans.wxml @@ -0,0 +1,105 @@ + + + + + + + + + + + + {{item.name}} + + + + + + + + + + + + + + + + + + + + + + {{item.nickName}} + + + {{item.phone}} + + + 注册时间:{{item.createTime}} + + + + + + + + + + + + 暂无粉丝 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/page_package/fans/fans.wxss b/page_package/fans/fans.wxss new file mode 100644 index 0000000..d21d9d8 --- /dev/null +++ b/page_package/fans/fans.wxss @@ -0,0 +1,4 @@ +/* page_package/fans/fans.wxss */ +page{ + background-color: #f2f2f2; +} \ No newline at end of file diff --git a/page_package/feedback/feedback.js b/page_package/feedback/feedback.js new file mode 100644 index 0000000..f06fa4b --- /dev/null +++ b/page_package/feedback/feedback.js @@ -0,0 +1,107 @@ +// page_package/feedback/feedback.js +const app = getApp() +const {feedback} = require('../../utils/network/services/user.js') +const constants = require('../../utils/constants') +const util = require('../../utils/util') +Page({ + + /** + * 页面的初始数据 + */ + data: { + feedbackContent: "" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + textareaBInput(event) { + this.setData({feedbackContent: event.detail.value}) + }, + onSubmit() { + if (this.data.feedbackContent.length < 15) { + wx.showModal({ + title: '提示', + showCancel: false, + content: "请最少输入15个字符反馈信息", + success(res) { + } + }) + return + } + feedback({content:this.data.feedbackContent}).then(res => { + wx.showModal({ + title: '提示', + showCancel: false, + content: "我们收到你的反馈啦~如有必要客服将会联系你", + success(res) { + if (res.confirm) { + wx.navigateBack({//返回 + delta: 1 + }) + } + } + }) + }).catch(err => { + wx.showModal({ + title: '提示', + showCancel: false, + content: "提交失败~可以去联系客服", + success(res) { + } + }) + }) + } +}) \ No newline at end of file diff --git a/page_package/feedback/feedback.json b/page_package/feedback/feedback.json new file mode 100644 index 0000000..cf40c06 --- /dev/null +++ b/page_package/feedback/feedback.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "意见反馈", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/feedback/feedback.wxml b/page_package/feedback/feedback.wxml new file mode 100644 index 0000000..ac23015 --- /dev/null +++ b/page_package/feedback/feedback.wxml @@ -0,0 +1,14 @@ + + + 问题或建议 + + + + 提 交 + diff --git a/page_package/feedback/feedback.wxss b/page_package/feedback/feedback.wxss new file mode 100644 index 0000000..e4faaf8 --- /dev/null +++ b/page_package/feedback/feedback.wxss @@ -0,0 +1,5 @@ +/* page_package/feedback/feedback.wxss */ +.page{ + height:calc(100vh); + background-color: #f2f2f2; +} \ No newline at end of file diff --git a/page_package/menu-product/menu-product.js b/page_package/menu-product/menu-product.js new file mode 100644 index 0000000..da47271 --- /dev/null +++ b/page_package/menu-product/menu-product.js @@ -0,0 +1,289 @@ +// page_package/menu-product/menu-product.js +const app = getApp() +const {global, highCommission, deliverById, brand, queryProductType,couponList,ringPush} = require("../../utils/network/services/productImpl.js") +let pageStart = 1; +const constants = require("../../utils/constants") +const util = require("../../utils/util") + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + windowWidth: app.globalData.windowWidth, + windowHeight: app.globalData.windowHeight, + CustomBar: app.globalData.CustomBar, + + requesting: false, + end: false, + emptyShow: false, + page: pageStart, + listData: [], + hasTop: false, + enableBackToTop: false, + refreshSize: 90, + bottomSize: 150, + color: "#3F82FD", + empty: false, + + TabCur: 0, + scrollLeft: 0, + + productList: [], + type: "", + title: "",//页面标题 + tabs: [], + item: null, + cid1: null, + scrollTop:-1 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let item = JSON.parse(options.item) + this.setData({ + type: options.type, + tabs: item.tabs, + item: item, + cid1: item.tabs.length > 0 ? item.tabs[0].type : null + }) + if (!util.isNumber(options.type)) + this.setData({title: options.type}) + else + switch (Number(options.type)) { + case constants.JD_DELIVERY: + this.setData({title: "京东配送"}) + break + case constants.BRAND_ZONE: + this.setData({title: "品牌专区"}) + break + case constants.COUPON: + this.setData({title: "优惠券"}) + break + case constants.HAIR_RING_PUSH: + this.setData({title: "发圈必推"}) + break + case constants.FASHION_LIFE: + this.setData({title: "时尚生活"}) + break + case constants.DIGITAL_HOME: + this.setData({title: "家电数码"}) + break + case constants.FRESH_FOOD: + this.setData({title: "食品生鲜"}) + break + case constants.FURNITYRE: + this.setData({title: "家居日用"}) + break + case constants.BEAUTY_CARE: + this.setData({title: "美妆个护"}) + break + } + + this.getList('refresh', pageStart); + + + wx.setNavigationBarTitle({ + title:this.data.title + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + // 刷新数据 + refresh() { + this.getList('refresh', pageStart); + this.setData({ + empty: false + }) + }, + // 加载更多 + more() { + this.getList('more', this.data.page); + }, + /** + * 根据类型请求数据 + * @param type 刷新类型 + * @param currentPage 分页 + * @param productType 商品类型 + * @param reqType 请求类型 + */ + getList(type, currentPage) { + let that = this + + this.setData({ + requesting: true + }) + let data = { + pageIndex: currentPage, + pageSize: 20 + } + that.setData({isLoad: type == "refresh"}) + + if (this.data.type == '搜罗好货') { + global(data).then((res) => { + that.forMaterData(that, res, currentPage, type) + }).catch((err) => { + that.errFormat(that, err) + }) + } else if (this.data.type == '高佣商品') { + highCommission(data).then((res) => { + that.forMaterData(that, res, currentPage, type) + }).catch((err) => { + that.errFormat(that, err) + }) + } else if (this.data.type == constants.JD_DELIVERY) { + deliverById(data).then((res) => { + that.forMaterData(that, res, currentPage, type) + }).catch((err) => { + that.errFormat(that, err) + }) + } else if (this.data.type == constants.BRAND_ZONE) { + brand(data).then((res) => { + that.forMaterData(that, res, currentPage, type) + }).catch((err) => { + that.errFormat(that, err) + }) + } else if (this.data.type == constants.COUPON) { + couponList(data).then((res) => { + that.forMaterData(that, res, currentPage, type) + }).catch((err) => { + that.errFormat(that, err) + }) + } else if(this.data.type == constants.HAIR_RING_PUSH){ + ringPush(data).then((res) => { + that.forMaterData(that, res, currentPage, type) + }).catch((err) => { + that.errFormat(that, err) + }) + }else if (this.data.tabs.length > 0) { + let data1 = { + cid1: this.data.cid1, + pageIndex: currentPage, + pageSize: 20 + } + queryProductType(data1).then((res) => { + that.forMaterData(that, res, currentPage, type) + }).catch((err) => { + that.errFormat(that, err) + }) + } + }, + + forMaterData(that, res, currentPage, type) { + let lastData = that.data.productList + let reqData = res.data.data.records + if (type == 'refresh') { + lastData = reqData + } else { + reqData.forEach(item => { + lastData.push(item) + }) + } + + lastData.forEach((item) => { + + let couponPrice = item.priceInfo.lowestCouponPrice + if (item.coupons.length > 0 && couponPrice != 'undefined' && couponPrice != 'NaN') { + try { + item.priceInfo.lowestCouponPrice = item.priceInfo.lowestCouponPrice.toFixed(2) + } catch (e) { + // console.log(">>>", e) + } + } + + if (item.comments) + item.comments = util.formatNUmber(item.comments) + try { + item.priceInfo.price = item.priceInfo.price.toFixed(2) + } catch (e) { + } + + }) + + that.setData({ + page: currentPage + 1, + productList: lastData, + requesting: false + }) + }, + errFormat(that, err) { + that.setData({ + requesting: false + }) + wx.showModal({ + title: '提示', + showCancel: false, + content: err.data.message ? err.data.message : '获取信息失败', + success(res) { + } + }) + }, + itemCLick(event) { + let item = event.currentTarget.dataset.item + util.setStorage(constants.PRPDUCT_ITEM, item) + wx.navigateTo({ + url: '/page_package/details/index' + }) + }, + tabSelect(e) { + this.setData({ + TabCur: e.currentTarget.dataset.id, + scrollLeft: (e.currentTarget.dataset.id - 1) * 60, + scrollTop:0 + }) + let item = e.currentTarget.dataset.item + this.setData({cid1:item.type}) + this.getList('refresh', pageStart) + }, +}) \ No newline at end of file diff --git a/page_package/menu-product/menu-product.json b/page_package/menu-product/menu-product.json new file mode 100644 index 0000000..ec9c0de --- /dev/null +++ b/page_package/menu-product/menu-product.json @@ -0,0 +1,8 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "usingComponents": { + "bc-scroll": "/components/refresh/refresh", + "product-item": "/components/product-item/product-item" + } +} \ No newline at end of file diff --git a/page_package/menu-product/menu-product.wxml b/page_package/menu-product/menu-product.wxml new file mode 100644 index 0000000..b43469e --- /dev/null +++ b/page_package/menu-product/menu-product.wxml @@ -0,0 +1,47 @@ + + + + + + + + + + + + {{item.name}} + + + + + + + + + + + + + + + + + + + + diff --git a/page_package/menu-product/menu-product.wxss b/page_package/menu-product/menu-product.wxss new file mode 100644 index 0000000..c551584 --- /dev/null +++ b/page_package/menu-product/menu-product.wxss @@ -0,0 +1,6 @@ +/* page_package/menu-product/menu-product.wxss */ + +.bg-gradual-white1{ + background-color: white; + color: #333; +} \ No newline at end of file diff --git a/page_package/money/bill/bill.js b/page_package/money/bill/bill.js new file mode 100644 index 0000000..56111fa --- /dev/null +++ b/page_package/money/bill/bill.js @@ -0,0 +1,116 @@ +const app = getApp() +const {getHistoryRecords} = require("../../../utils/network/services/user.js") +const constants = require("../../../utils/constants") +const util = require("../../../utils/util") +Page({ + + /** + * 页面的初始数据 + */ + data: { + windowHeight: app.globalData.windowHeight, + windowWidth: app.globalData.windowWidth, + CustomBar: app.globalData.CustomBar, + + requesting: false, + end: false, + emptyShow: false, + hasTop: false, + enableBackToTop: false, + refreshSize: 90, + bottomSize: 0, + color: "#3F82FD", + empty: false, + + queryData: { + pageIndex: 1, + pageSize: 20 + }, + settlementList: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getData('refresh') + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + getData(type) { + this.setData({ + requesting: true + }) + if (type == 'refresh') + this.data.queryData.pageIndex = 1 + else + this.data.queryData.pageIndex = this.data.queryData.pageIndex + 1 + + this.setData({queryData: this.data.queryData}) + getHistoryRecords(this.data.queryData).then((res) => { + this.setData({ + settlementList: res.data.data.records, + requesting: false + }) + }).catch(err => { + this.setData({ + requesting: false + }) + }) + }, + + refresh() { + this.getData('refresh') + }, + more() { + this.getData('more') + } +}) \ No newline at end of file diff --git a/page_package/money/bill/bill.json b/page_package/money/bill/bill.json new file mode 100644 index 0000000..925f723 --- /dev/null +++ b/page_package/money/bill/bill.json @@ -0,0 +1,8 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "结算账单", + "usingComponents": { + "bc-scroll": "/components/refresh/refresh" + } +} \ No newline at end of file diff --git a/page_package/money/bill/bill.wxml b/page_package/money/bill/bill.wxml new file mode 100644 index 0000000..2dd1961 --- /dev/null +++ b/page_package/money/bill/bill.wxml @@ -0,0 +1,16 @@ + + + + + + + + + + + 暂无结算账单 + + + + diff --git a/page_package/money/bill/bill.wxss b/page_package/money/bill/bill.wxss new file mode 100644 index 0000000..27523b3 --- /dev/null +++ b/page_package/money/bill/bill.wxss @@ -0,0 +1,4 @@ +/* page_package/money/bill/bill.wxss */ +page{ + background-color: #f2f2f2; +} \ No newline at end of file diff --git a/page_package/money/cash/cash.js b/page_package/money/cash/cash.js new file mode 100644 index 0000000..3e20480 --- /dev/null +++ b/page_package/money/cash/cash.js @@ -0,0 +1,147 @@ +// page_package/money/cash/cash.js +const app = getApp() +const {getWalleta,userInfo} = require("../../../utils/network/services/user.js") +const constants = require("../../../utils/constants") +const util = require("../../../utils/util") +let that = null +Page({ + + /** + * 页面的初始数据 + */ + data: { + requesting: false, + end: false, + emptyShow: false, + hasTop: false, + enableBackToTop: false, + refreshSize: 90, + bottomSize: 0, + color: "#3F82FD", + empty: false, + invitationDialog:false, + + rule: "①本月预估推广收益:【下单时间】在本月内的推广商品订单佣金总和。\n" + + "②本月可提现收益额:【完成时间】在上月内的推广商品订单佣金总和。\n" + + "注:退货订单会扣除佣金。换货订单会重新计算可提现时间。", + process: "操作流程\n" + + "一、小程序-会员-收益提现。\n" + + "二、填写个人身份信息,确保填写的实名信息和您的微信实名认证信息一致,否则无法正常到账。\n" + + "三、收益只可在每月27~30全天申请提现,错过需要等下个月申请,单笔提现金额需大于1元。\n" + + "四、未提现的收益不会清0,会累积到账户余额,可下次合并提现。\n" + + "五、提现到账后,您会收到微信服务通知提醒,注意查收", + + cashData: null, + userInfo:null, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this + let userInfo = util.getStorage(constants.VIP_INFO_AUTO) + that.setData({userInfo:userInfo}) + that.refresh() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + userInfo().then(res => {that.setData({userInfo:res.data.data})}) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + // 刷新数据 + refresh() { + that.setData({ + requesting: true + }) + getWalleta().then((res) => { + that.setData({ + cashData: res.data.data, + requesting: false + }) + }).catch(err => { + that.setData({ + requesting: false + }) + }) + }, + + itemClick(event) { + switch (Number(event.currentTarget.dataset.index)) { + case 0: + if (that.data.userInfo.wechatId) { + wx.navigateTo({ + url: '/page_package/money/quota/quota?balance=' + that.data.cashData.balance + }) + } else this.setData({invitationDialog:true}) + break + case 1: + wx.navigateTo({ + url: '/page_package/money/history/history' + }) + break + case 2: + wx.navigateTo({ + url: '/page_package/money/bill/bill' + }) + break + case 3: + wx.navigateTo({ + url: '/page_package/money/explain/explain' + }) + break + } + }, + hideModal(event){ + this.setData({invitationDialog:false}) + if(event.currentTarget.dataset.iscode == 0) + wx.navigateTo({url: '/page_package/contacts/contacts'}) + }, + more() { + + } +}) \ No newline at end of file diff --git a/page_package/money/cash/cash.json b/page_package/money/cash/cash.json new file mode 100644 index 0000000..4c2a6d2 --- /dev/null +++ b/page_package/money/cash/cash.json @@ -0,0 +1,8 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "提现", + "usingComponents": { + "bc-scroll": "/components/refresh/refresh" + } +} \ No newline at end of file diff --git a/page_package/money/cash/cash.wxml b/page_package/money/cash/cash.wxml new file mode 100644 index 0000000..9023f2e --- /dev/null +++ b/page_package/money/cash/cash.wxml @@ -0,0 +1,69 @@ + + + + + + + + + + + + 可提现金额:¥{{cashData.balance}} + {{cashData.withdrawLimit}} + + 提现 + + + 提现历史 + 详情 + + + 结算账单 + 详情 + + + + + 我的本月可提现收益与上月预估收益不一致? + 根据京东推广规则: + {{rule}} + 更多提现说明> + + + + {{process}} + + + + + + + + + 提示 + + + + + + 提现金额会自动转到微信零钱 + 需要提供微信号才能发起提现 + + + 取消 + 去完善 + + + + diff --git a/page_package/money/cash/cash.wxss b/page_package/money/cash/cash.wxss new file mode 100644 index 0000000..601a808 --- /dev/null +++ b/page_package/money/cash/cash.wxss @@ -0,0 +1,20 @@ +/* page_package/money/cash/cash.wxss */ +page{ + background-color: #f2f2f2 +} + +.rule-card{ + width: 94%; + margin-left: 3%; + border-radius: 8rpx; + background-color: white; +} + +.process-card{ + width: 92%; + margin-left: 4%; +} + +.rule-text{ + line-height:48rpx +} \ No newline at end of file diff --git a/page_package/money/explain/explain.js b/page_package/money/explain/explain.js new file mode 100644 index 0000000..2440a03 --- /dev/null +++ b/page_package/money/explain/explain.js @@ -0,0 +1,76 @@ +// page_package/money/explain/explain.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + prompt:"1.每月27日(节假日顺延)系统会自动结算上一个自然月产生的可结算佣金至“可提现金额”中,您可随时点击“提现”。\n\n" + + "注:仅每月27号~30号3天可以提现,错过需要等下个月再提。\n\n" + + "2.为保证您能正常结算和提现,请您一点要正确填写资料申请提现,申请后耐心等待,一般1~3个工作日给你完成打款", + noun:"预估佣金:已完成订单在当月产生的佣金变化之和,为当月新增完成订单佣金减去已完成订单的退货等逆向佣金。\n\n" + + "订单状态:待付款、已付款、已完成、已结算、无效。\n\n" + + "待付款:指买家还未付款的订单。\n\n" + + "已付款:指买家已经付款的订单。\n\n" + + "已完成:指买家已确认收货的订单,自营商品订单在快递投递完成后自动确认收货," + + "第三方卖家的订单需要买家主动点击确认收货,若买家不点击确认收货,该订单将在20后自动变为已完成。\n\n" + + "已结算:订单完成26后将变为已结算的订单,且订单的计佣佣金将变为可提现金额。\n\n" + + "无效:无效订单包括已取消订单、违规订单等,无效订单的计佣金额和计佣佣金均0。" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/page_package/money/explain/explain.json b/page_package/money/explain/explain.json new file mode 100644 index 0000000..ea841f8 --- /dev/null +++ b/page_package/money/explain/explain.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "提现说明", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/money/explain/explain.wxml b/page_package/money/explain/explain.wxml new file mode 100644 index 0000000..3ae3684 --- /dev/null +++ b/page_package/money/explain/explain.wxml @@ -0,0 +1,19 @@ + + + + + + + + + 一、结算提示 + {{prompt}} + + + + 二、名词解释 + {{noun}} + + + + diff --git a/page_package/money/explain/explain.wxss b/page_package/money/explain/explain.wxss new file mode 100644 index 0000000..af22801 --- /dev/null +++ b/page_package/money/explain/explain.wxss @@ -0,0 +1,4 @@ +/* page_package/money/explain/explain.wxss */ +.line-height40{ + line-height: 40rpx; +} \ No newline at end of file diff --git a/page_package/money/history/history.js b/page_package/money/history/history.js new file mode 100644 index 0000000..e09368f --- /dev/null +++ b/page_package/money/history/history.js @@ -0,0 +1,180 @@ +// page_package/money/history/history.js +const app = getApp() +const {getHistoryRecords} = require("../../../utils/network/services/user.js") +const constants = require("../../../utils/constants") +const util = require("../../../utils/util") + +Page({ + + /** + * 页面的初始数据 + */ + data: { + windowHeight: app.globalData.windowHeight, + windowWidth: app.globalData.windowWidth, + CustomBar: app.globalData.CustomBar, + + requesting: false, + end: false, + emptyShow: false, + hasTop: false, + enableBackToTop: false, + refreshSize: 90, + bottomSize: 0, + color: "#3F82FD", + empty: false, + + queryData: { + pageIndex: 1, + pageSize: 20 + }, + historyList: [ + { + "id":1241218946633691138, + "wechatId":"wuxing07240011", + "amount":9.99, + "payeeName":"伍星", + "status":0, + "statusDesc":"已提交", + "submitTime":[ + 2020, + 3, + 21, + 12, + 23, + 52 + ], + "operations":[ + { + "operatorName":"伍星", + "operateTime":[ + 2020, + 3, + 21, + 12, + 23, + 52 + ], + "remark":"伍星 发起了提现申请" + } + ] + } + ] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getData('refresh') + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + getData(type) { + this.setData({ + requesting: true + }) + if (type == 'refresh') + this.data.queryData.pageIndex = 1 + else + this.data.queryData.pageIndex = this.data.queryData.pageIndex + 1 + + this.setData({queryData: this.data.queryData}) + getHistoryRecords(this.data.queryData).then((res) => { + let list = res.data.data.records + list.forEach(item => { + item.isOpen = false + item.submitTime = util.formatTime(new Date(item.submitTime)) + item.operations.forEach(im => { im.operateTime = util.formatTime(new Date(im.operateTime))}) + }) + + if (type != 'refresh') list.forEach(im => {this.data.historyList.push(im)}) + + this.setData({ + historyList: type == 'refresh' ? list:this.data.historyList, + requesting: false + }) + }).catch(err => { + this.setData({ + requesting: false + }) + }) + }, + openDetails(event){ + let item = event.currentTarget.dataset.item + let index = event.currentTarget.dataset.index + this.data.historyList.forEach(im => { + im.isOpen = false + if(item.id == im.id) im.isOpen = !item.isOpen + }) + this.setData({historyList:this.data.historyList}) + }, + refresh() { + this.getData('refresh') + }, + more() { + this.getData('more') + }, + copy(event){ + let item = event.currentTarget.dataset.item + wx.setClipboardData({ + data: item.id.toString(), + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + } +}) \ No newline at end of file diff --git a/page_package/money/history/history.json b/page_package/money/history/history.json new file mode 100644 index 0000000..2400f4f --- /dev/null +++ b/page_package/money/history/history.json @@ -0,0 +1,8 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "提现历史", + "usingComponents": { + "bc-scroll": "/components/refresh/refresh" + } +} \ No newline at end of file diff --git a/page_package/money/history/history.wxml b/page_package/money/history/history.wxml new file mode 100644 index 0000000..0690924 --- /dev/null +++ b/page_package/money/history/history.wxml @@ -0,0 +1,59 @@ + + + + + + + + + + + 暂无提现历史 + + + + + 单号:{{item.id}} + 复制 + + + 提现者:{{item.payeeName}} + 提现金额: + {{item.amount}} + + 提现状态:{{item.statusDesc}} + 提现时间:{{item.submitTime}} + + 详情 + + + + + + + {{im.remark}} + {{im.operateTime}} + + + + + + + + + + + + diff --git a/page_package/money/history/history.wxss b/page_package/money/history/history.wxss new file mode 100644 index 0000000..2964667 --- /dev/null +++ b/page_package/money/history/history.wxss @@ -0,0 +1,54 @@ +/* page_package/money/history/history.wxss */ +page{ + background-color: #f2f2f2; +} + +.l_box{ + border-left: 1px solid #EEF0F2; + padding: 20rpx 0 20rpx 50rpx; + margin-left: 30rpx; + position: relative; +} +.l_box::after{ + content: ''; + display: inline-block; + position: absolute; + left: -15rpx; + top: 60rpx; + width: 20rpx; + height: 20rpx; + border-radius: 20rpx; + background: #BDBDBD; + border: 2px solid #EEE; +} +.l_content{ + position: relative; + background: #eef0f2; + padding: 10rpx 20rpx; + border-radius: 10rpx; + font-size: 26rpx; +} +.l_content::after{ + content: ''; + display: inline-block; + position: absolute; + left: -20rpx; + top: 36rpx; + border-left: 20rpx solid #fff; + border-bottom: 20rpx solid #eef0f2; +} +.l_first{ + border-left: 1px solid #f43f3b; +} +.l_first::after{ + background: #f43f3b; + border: 2px solid #EEE; +} +.l_first_content{ + background: #ffffff; + color: #f43f3b; + border: 1px solid #f43f3b; +} +.l_first_content::after{ + border-bottom-color: #f43f3b; +} \ No newline at end of file diff --git a/page_package/money/quota/quota.js b/page_package/money/quota/quota.js new file mode 100644 index 0000000..4feea64 --- /dev/null +++ b/page_package/money/quota/quota.js @@ -0,0 +1,218 @@ +// page_package/money/quota/quota.js +const app = getApp() +const util = require("../../../utils/util") +const {applyWithdraw, sendCode} = require("../../../utils/network/services/user.js") +const constants = require("../../../utils/constants") +let interval = null +let that = null +Page({ + + /** + * 页面的初始数据 + */ + data: { + userInfo: app.globalData.userInfo, + money: 0, + cashMoney: '', + inputRemind: "", + sumInfo: { + amount: 0, + code: "", + payeeCardId: "", + payeeName: "", + wechatId: "" + }, + isDisabled: false, + currentTime: 61, + promptMsg: "验证码", + phone: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this + let userInfo = util.getStorage(constants.VIP_INFO_AUTO) + if (userInfo.phone) + this.setData({ + money: Number(options.balance), + userInfo: userInfo, + phone: util.phoneFor(userInfo.phone) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + onInput(event) { + let inputValue = event.detail.value + switch (Number(event.currentTarget.dataset.index)) { + case 0: + let remind = '' + if (Number(inputValue) <= 0) remind = '最少提现金额为1元' + else if (Number(inputValue) > this.data.money) remind = '输入的金额超过可转出的进度' + this.data.sumInfo.amount = inputValue + this.setData({ + cashMoney: inputValue, + inputRemind: remind, + sumInfo: this.data.sumInfo + }) + break + } + }, + onBlur(event) { + let inputValue = event.detail.value + switch (Number(event.currentTarget.dataset.index)) { + case 0: + this.setData({cashMoney: inputValue}) + break + } + }, + onInput1(event) { + let inputValue = event.detail.value + let subInfo = this.data.sumInfo + switch (Number(event.currentTarget.dataset.type)) { + case 1: + subInfo.payeeName = inputValue + break + case 2: + subInfo.payeeCardId = inputValue + break + case 3: + subInfo.code = inputValue + break + } + this.setData({sumInfo: subInfo}) + }, + onQuota() { + this.setData({cashMoney: this.data.money}) + }, + sendCode() { + sendCode({phone: this.data.userInfo.phone}) + .then(res => { + that.setData({isDisabled: true}) + util.onToast('发送成功', 'success') + that.setInt() + }).catch(err => { + this.setData({isDisabled: false}) + wx.showModal({ + title: '提示', + showCancel: false, + content: err.data?err.data.message:'发送失败', + success(res) { + + } + }) + }) + }, + onSubmit() { + let subInfo = this.data.sumInfo + subInfo.amount = this.data.cashMoney ? this.data.cashMoney : 0 + if (Number(subInfo.amount) < 1) { + util.onToast('提现金额必须大于1元') + return + } else if (!subInfo.payeeName) { + util.onToast('请输入姓名') + return; + } else if (subInfo.payeeCardId.length < 14) { + util.onToast('请输入合法证件号码') + return; + } else if (!subInfo.code) { + util.onToast('请输入验证码') + return; + } + subInfo.wechatId = this.data.userInfo.wechatId + + this.setData({sumInfo: subInfo, invitationDialog: true}) + }, + hideModal(event) { + this.setData({invitationDialog: false}) + if (Number(event.currentTarget.dataset.iscode) == 0) { + applyWithdraw(this.data.sumInfo) + .then((res) => { + wx.showModal({ + title: '提示', + showCancel: false, + content: "提现成功,1-3个工作日到账", + success(res) { + wx.navigateBack({//返回 + delta: 1 + }) + } + }) + }).catch(err => { + console.log(err) + wx.showModal({ + title: '失败提示', + showCancel: false, + content: err.data?err.data.message:'提现失败', + success(res) { + + } + }) + }) + } + }, + setInt() { + let currentTime = this.data.currentTime + interval = setInterval(function () { + currentTime--; + that.setData({promptMsg: currentTime + '秒',isDisabled: true}) + if (currentTime <= 0) { + clearInterval(interval) + that.setData({ + promptMsg: '重新发送', + currentTime: 61, + isDisabled: false + }) + } + }, 1000) + } +}) \ No newline at end of file diff --git a/page_package/money/quota/quota.json b/page_package/money/quota/quota.json new file mode 100644 index 0000000..3411921 --- /dev/null +++ b/page_package/money/quota/quota.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "提现到微信", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/money/quota/quota.wxml b/page_package/money/quota/quota.wxml new file mode 100644 index 0000000..7ffca94 --- /dev/null +++ b/page_package/money/quota/quota.wxml @@ -0,0 +1,93 @@ + + + + + + + + + 可提现金额:¥{{money}} + 每次最少提现1元 + + + + + + + 全部提现 + + + + {{inputRemind}} + + 请确保已注册尚橙账号的微信号(昵称:{{userInfo.nickName}})已绑定过银行卡 + + + +
+ + 完善提现信息 + + + + + + + + + + {{phone}}(不可修改) + + + + + +
+ +注:申请提现后1~3个工作日到账 + + + + + + + 提示 + + + + + + + 提现金额:¥{{sumInfo.amount}} + 姓名:{{sumInfo.payeeName}} + 身份证:{{sumInfo.payeeCardId}} + 微信号:{{sumInfo.wechatId}} + + + + 取消 + 确认提现 + + + + \ No newline at end of file diff --git a/page_package/money/quota/quota.wxss b/page_package/money/quota/quota.wxss new file mode 100644 index 0000000..21c6833 --- /dev/null +++ b/page_package/money/quota/quota.wxss @@ -0,0 +1,35 @@ +/* page_package/money/quota/quota.wxss */ +page{ + background-color: #f2f2f2; +} + +.cash-item{ + height: 118rpx; + background-color: white; + align-items: center; +} + +.cash-item-icon{ + width: 88rpx; + height: 88rpx; + margin: 10rpx; + border-right: 1rpx solid #f2f2f2; +} +.cash-item-money{ + height: 64rpx; +} + +.cash-btn{ + width: 80%; + margin-left: 10%; + height: 84rpx; +} + +.send-btn-def{ + background-color: #3595f5; + color: white; +} +.send-btn{ + background-color: #666666; + color: #ededed; +} \ No newline at end of file diff --git a/page_package/new-welfare/new-welfare.js b/page_package/new-welfare/new-welfare.js new file mode 100644 index 0000000..ad8f513 --- /dev/null +++ b/page_package/new-welfare/new-welfare.js @@ -0,0 +1,70 @@ +// page_package/new-welfare/new-welfare.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + windowHeight: app.globalData.windowHeight, + CustomBar: app.globalData.CustomBar, + activityContent:"1、活动时间:2020年3月10日-2020年4月30日(共计51天)\n 2、活动期间:解冻新用户下单享受0.9元够好物活动\n 3、" + + "超级会员:推广成功一单补贴8元,邀请人补贴1.6元" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/page_package/new-welfare/new-welfare.json b/page_package/new-welfare/new-welfare.json new file mode 100644 index 0000000..a0b8429 --- /dev/null +++ b/page_package/new-welfare/new-welfare.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "新人福利", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/new-welfare/new-welfare.wxml b/page_package/new-welfare/new-welfare.wxml new file mode 100644 index 0000000..3a853f7 --- /dev/null +++ b/page_package/new-welfare/new-welfare.wxml @@ -0,0 +1,31 @@ + + + + + + + + + + 活动介绍 + {{activityContent}} + + + + 活动介绍 + {{activityContent}} + + + + 活动介绍 + {{activityContent}} + + + + + + + 微信推广 + 面对面推广 + 朋友圈推广 + \ No newline at end of file diff --git a/page_package/new-welfare/new-welfare.wxss b/page_package/new-welfare/new-welfare.wxss new file mode 100644 index 0000000..92d9cf4 --- /dev/null +++ b/page_package/new-welfare/new-welfare.wxss @@ -0,0 +1,14 @@ +/* page_package/new-welfare/new-welfare.wxss */ +page{ + background-color: #f2f2f2; +} + +.content-body{ + width: 92%; + margin-left: 4%; + background-color: white; + padding: 12rpx; + border-radius: 5rpx; + margin-top: 30rpx; + line-height: 56rpx; +} \ No newline at end of file diff --git a/page_package/news-details/news-details.js b/page_package/news-details/news-details.js new file mode 100644 index 0000000..3ac2d05 --- /dev/null +++ b/page_package/news-details/news-details.js @@ -0,0 +1,96 @@ +// page_package/news-details/news-details.js +const app = getApp() +const {messagesDetails} = require('../../utils/network/services/service.js') +const constants = require('../../utils/constants') +const util = require('../../utils/util') +let that = null + +Page({ + + /** + * 页面的初始数据 + */ + data: { + title:'', + time:'', + msgContent:null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({title:options.title}) + messagesDetails(options.id) + .then(res => { + console.log(">>>>",res.data) + this.setData({msgContent:res.data.data, + time:util.formatData(new Date(res.data.data.createTime))}) + }).catch( err => { + + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + onCopy(){ + wx.setClipboardData({ + data: this.data.msgContent.content, + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + } +}) \ No newline at end of file diff --git a/page_package/news-details/news-details.json b/page_package/news-details/news-details.json new file mode 100644 index 0000000..7ae2781 --- /dev/null +++ b/page_package/news-details/news-details.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "消息详情", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/news-details/news-details.wxml b/page_package/news-details/news-details.wxml new file mode 100644 index 0000000..9db68e0 --- /dev/null +++ b/page_package/news-details/news-details.wxml @@ -0,0 +1,17 @@ + + + + + {{title}} + {{time}} + + + {{msgContent.content}} + + + + 复制文字 + + diff --git a/page_package/news-details/news-details.wxss b/page_package/news-details/news-details.wxss new file mode 100644 index 0000000..2a71119 --- /dev/null +++ b/page_package/news-details/news-details.wxss @@ -0,0 +1,5 @@ +/* page_package/news-details/news-details.wxss */ + +page{ + background-color: #f2f2f2; +} \ No newline at end of file diff --git a/page_package/order/order.js b/page_package/order/order.js new file mode 100644 index 0000000..82d721d --- /dev/null +++ b/page_package/order/order.js @@ -0,0 +1,218 @@ +// page_package/order/order.js +const { orderList } = require('../../utils/network/services/user.js') +const constants = require('../../utils/constants') +const util = require('../../utils/util') +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + windowHeight: app.globalData.windowHeight, + windowWidth: app.globalData.windowWidth, + CustomBar: app.globalData.CustomBar, + StatusBar: app.globalData.StatusBar, + tabs: ['全部', '待付款', '已付款', '已完成', '无效'], + titles: ['我购买的','我推广的'], + TabCur: 0, + TabCur1: 0, + scrollLeft: 0, + scrollLeft1: 0, + searchHeight: 90, + typeHeight: 0, + selectData: { + startTime: '', + endTime: '' + }, + isLoad: false, + + queryData: { + begin: '', + end: '', + pageIndex: 1, + pageSize: 10, + type:1, + status:1 + }, + isShowDialog:false, + orderList:[], + identify:1, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let TimeNow = new Date(); + let startDay = new Date(TimeNow.getFullYear(), TimeNow.getMonth(), 1); + this.data.selectData.startTime = util.formatData(startDay) + this.data.selectData.endTime = util.formatData(TimeNow) + this.setData({ + identify:util.identityApp(Number(options.identify)), + selectData:this.data.selectData + }) + const that = this + const query = wx.createSelectorQuery() + query.select('#search').boundingClientRect() + query.exec(function (res) {that.setData({ searchHeight: res[0].height })}) + if(this.data.identify){ + const query1 = wx.createSelectorQuery() + query1.select('#type').boundingClientRect() + query1.exec(function (res) {that.setData({ typeHeight: res[0].height })}) + } + + this.getList('refresh') + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + onLoads(){ + this.getList('refresh') + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + tabSelect (event) { + console.log(Number(event.currentTarget.dataset.id),">>>>",Number(event.currentTarget.dataset.id) + 1) + this.data.queryData.status = Number(event.currentTarget.dataset.id) + 1 + this.setData({ + TabCur: Number(event.currentTarget.dataset.id), + scrollLeft: (event.currentTarget.dataset.id - 1) * 60, + queryData:this.data.queryData + }) + this.getList('refresh') + }, + + titleSelect (event) { + this.data.queryData.type = Number(event.currentTarget.dataset.id) + 1 + this.setData({ + TabCur1: event.currentTarget.dataset.id, + scrollLeft1: (event.currentTarget.dataset.id - 1) * 60, + TabCur:0, + queryData:this.data.queryData + }) + this.getList('refresh') + }, + DateChange (event) { + let selectTime = event.detail.value + console.log(selectTime) + switch (Number(event.currentTarget.dataset.index)) { + case 0: + if (!this.data.selectData.endTime || + (this.data.selectData.endTime && + util.compareTime(this.data.selectData.endTime, selectTime))) { + this.data.selectData.startTime = selectTime + this.setData({ selectData: this.data.selectData }) + } else { + this.data.selectData.startTime = selectTime + this.data.selectData.endTime = selectTime + this.setData({ selectData: this.data.selectData }) + } + break + case 1: + if (!this.data.selectData.startTime || + (this.data.selectData.startTime && + util.compareTime(selectTime, this.data.selectData.startTime))) { + this.data.selectData.endTime = selectTime + this.setData({ selectData: this.data.selectData }) + } else { + this.data.selectData.startTime = selectTime + this.data.selectData.endTime = selectTime + this.setData({ selectData: this.data.selectData }) + } + break + } + }, + getList (type) { + this.setData({ + isLoad: true + }) + if (type == 'refresh') + this.data.queryData.pageIndex = 1 + else + this.data.queryData.pageIndex = this.data.queryData.pageIndex + 1 + + this.data.queryData.begin = this.data.selectData.startTime + this.data.queryData.end = this.data.selectData.endTime + if (this.data.selectData.startTime && !this.data.selectData.endTime) + this.data.queryData.end = this.data.selectData.startTime + + if (!this.data.selectData.startTime && this.data.selectData.endTime) + this.data.queryData.begin = this.data.selectData.endTime + + if(this.data.selectData.startTime){ + this.data.queryData.begin = this.data.queryData.begin.split("-").join("") + this.data.queryData.end = this.data.queryData.end.split("-").join("") + } + if(this.data.TabCur != 0) + this.data.queryData.status = Number(this.data.TabCur) + 1 + this.setData({ queryData: this.data.queryData }) + + orderList(this.data.queryData) + .then(res => { + + res.data.data.records.forEach( item => { + if(util.isNumber(item.orderTime)){ + item.orderTime = util.formatTime(new Date(item.orderTime)) + } + }) + + let lastList = this.data.orderList + if(type != 'refresh') res.data.data.records.forEach( item => {lastList.push(item)}) + + + this.setData({ + orderList: type == 'refresh' ? res.data.data.records : lastList, + isLoad: false + }) + }).catch(err => { + this.setData({isLoad:false}) + }) + } +}) \ No newline at end of file diff --git a/page_package/order/order.json b/page_package/order/order.json new file mode 100644 index 0000000..d451dd3 --- /dev/null +++ b/page_package/order/order.json @@ -0,0 +1,8 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "我的订单", + "usingComponents": { + "order-item": "/components/order-item/order-item" + } +} \ No newline at end of file diff --git a/page_package/order/order.wxml b/page_package/order/order.wxml new file mode 100644 index 0000000..9ad3c43 --- /dev/null +++ b/page_package/order/order.wxml @@ -0,0 +1,62 @@ + + + + + + + + + + + {{item}} + + + + + + + + + 下单时间: + + {{selectData.startTime ? selectData.startTime:'开始时间'}} + + + + + + {{selectData.endTime ? selectData.endTime:'结束时间'}} + + + + 搜索 + + + + + {{item}} + + + + + + + + + + + + + + + + + 暂无订单 + + diff --git a/page_package/order/order.wxss b/page_package/order/order.wxss new file mode 100644 index 0000000..91d3712 --- /dev/null +++ b/page_package/order/order.wxss @@ -0,0 +1,12 @@ +/* page_package/order/order.wxss */ + +.time-select{ + background-color: #f2f2f2; + padding: 4rpx; +} + +.scroll-vi{ + background-color: #f2f2f2; + min-height: 500rpx; + width: 100%; +} \ No newline at end of file diff --git a/page_package/poster/poster.js b/page_package/poster/poster.js new file mode 100644 index 0000000..076de54 --- /dev/null +++ b/page_package/poster/poster.js @@ -0,0 +1,96 @@ +const app = getApp() +const {posters} = require("../../utils/network/services/user.js") +const constants = require("../../utils/constants") +const util = require("../../utils/util") + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + requesting: false, + posterList:[], + query:{ + pageIndex:1, + pageSize:10 + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getData('refresh') + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + wx.vibrateShort(); + this.refresh() + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + getData(type){ + if(type == 'refresh'){ + + } + posters(this.data.query) + .then(res => { + wx.stopPullDownRefresh() + console.log(">>>>>",res.data.data) + this.setData({posterList:res.data.data.records}) + }).catch(err => { + wx.stopPullDownRefresh() + }) + }, + more() { + + }, + refresh() { + this.getData('refresh') + }, +}) \ No newline at end of file diff --git a/page_package/poster/poster.json b/page_package/poster/poster.json new file mode 100644 index 0000000..fc6e0f4 --- /dev/null +++ b/page_package/poster/poster.json @@ -0,0 +1,9 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "邀请海报", + "enablePullDownRefresh": true, + "usingComponents": { + "poster-item": "/components/poster/poster" + } +} \ No newline at end of file diff --git a/page_package/poster/poster.wxml b/page_package/poster/poster.wxml new file mode 100644 index 0000000..d9c3467 --- /dev/null +++ b/page_package/poster/poster.wxml @@ -0,0 +1,5 @@ + + + + + diff --git a/page_package/poster/poster.wxss b/page_package/poster/poster.wxss new file mode 100644 index 0000000..8d12e5c --- /dev/null +++ b/page_package/poster/poster.wxss @@ -0,0 +1 @@ +/* page_package/poster/poster.wxss */ \ No newline at end of file diff --git a/page_package/product-type/product-type.js b/page_package/product-type/product-type.js new file mode 100644 index 0000000..b03565e --- /dev/null +++ b/page_package/product-type/product-type.js @@ -0,0 +1,235 @@ +// page_package/product-type/product-type.js +const app = getApp() +const {queryProductType} = require("../../utils/network/services/productImpl.js") +let pageStart = 1; +const constants = require("../../utils/constants") +const util = require("../../utils/util") +const data = require("../../utils/data") + +Page({ + data: { + TabCur: 0, + MainCur: 0, + VerticalNavTop: 0, + list: [], + load: true, + scrollTop:0, + CustomBar: app.globalData.CustomBar, + windowWidth: app.globalData.windowWidth, + windowHeight: app.globalData.windowHeight, + requesting: false, + end: false, + emptyShow: false, + page: pageStart, + listData: [], + hasTop: false, + enableBackToTop: false, + refreshSize: 90, + bottomSize: 0, + color: "#3F82FD", + empty: false, + + requestData: { + cid1: 12218, + pageIndex: pageStart, + pageSize: 20 + }, + productList: [], + productType: data.PRODUCT + }, + onLoad() { + + this.getList('refresh', pageStart, 12218); + + wx.showLoading({ + title: '加载中...', + mask: true + }); + let list = [{}]; + for (let i = 0; i < 26; i++) { + list[i] = {}; + list[i].name = String.fromCharCode(65 + i); + list[i].id = i; + } + this.setData({ + list: list, + listCur: list[0] + }) + }, + onReady() { + wx.hideLoading() + }, + tabSelect(e) { + let data = this.data.requestData + let item = e.currentTarget.dataset.item + data.cid1 = item.id + this.setData({ + requestData: data, + scrollTop:1 + }) + this.getList('refresh', pageStart, item.id); + + // if (wx.pageScrollTo) { + // wx.pageScrollTo({ + // scrollTop: 0, + // selector:'#type-scroll', + // duration: 300, + // success:function () { + // console.log("成功") + // }, + // fail:function () { + // console.log("失败") + // } + // }) + // } + + this.setData({ + TabCur: e.currentTarget.dataset.id, + MainCur: e.currentTarget.dataset.id, + VerticalNavTop: (e.currentTarget.dataset.id - 1) * 50 + }) + }, + VerticalMain(e) { + let that = this; + let list = this.data.list; + let tabHeight = 0; + if (this.data.load) { + for (let i = 0; i < list.length; i++) { + let view = wx.createSelectorQuery().select("#main-" + list[i].id); + view.fields({ + size: true + }, data => { + list[i].top = tabHeight; + tabHeight = tabHeight + data.height; + list[i].bottom = tabHeight; + }).exec(); + } + that.setData({ + load: false, + list: list + }) + } + let scrollTop = e.detail.scrollTop + 20; + for (let i = 0; i < list.length; i++) { + if (scrollTop > list[i].top && scrollTop < list[i].bottom) { + that.setData({ + VerticalNavTop: (list[i].id - 1) * 50, + TabCur: list[i].id + }) + return false + } + } + }, + + + // ----------刷新----------- + itemClick(e) { + console.log(e); + }, + hasTopChange(e) { + this.setData({ + hasTop: e.detail.value + }) + }, + enableBackToTopChange(e) { + this.setData({ + enableBackToTop: e.detail.value + }) + }, + refreshChange(e) { + this.setData({ + refreshSize: e.detail.value + }) + }, + bottomChange(e) { + this.setData({ + bottomSize: e.detail.value + }) + }, + radioChange: function (e) { + this.setData({ + color: e.detail.value + }) + }, + emptyChange(e) { + if (e.detail.value) { + this.setData({ + listData: [], + emptyShow: true, + end: true + }) + } else { + this.setData({ + emptyShow: false, + end: false + }) + } + }, + getList(type, currentPage, productType) { + let that = this + this.setData({ + requesting: true + }) + + wx.showNavigationBarLoading() + + let data = { + cid1: productType, + pageIndex: currentPage, + pageSize: 20 + } + + queryProductType(data).then((res) => { + wx.hideNavigationBarLoading() + + let lastData = that.data.productList + let reqData = res.data.data.records + if (type == 'refresh') { + lastData = reqData + } else { + reqData.forEach(item =>{lastData.push(item)}) + } + lastData.forEach((item) => { + if(item.coupons.length > 0 && item.priceInfo.lowestCouponPrice) + item.priceInfo.lowestCouponPrice = item.priceInfo.lowestCouponPrice.toFixed(2) + + item.comments = util.formatNUmber(item.comments) + item.priceInfo.price = item.priceInfo.price.toFixed(2) + }) + + that.setData({ + page: currentPage + 1, + requesting: false, + productList: lastData + }) + }).catch((err) => { + wx.hideNavigationBarLoading() + that.setData({ + requesting: false + }) + wx.showModal({ + title: '提示', + showCancel: false, + content: err.data.message ? err.data.message : '获取信息失败', + success(res) { + } + }) + }) + }, + // 刷新数据 + refresh() { + this.getList('refresh', 1, this.data.requestData.cid1); + }, + // 加载更多 + more() { + this.getList('more', this.data.page, this.data.requestData.cid1); + }, + + onClick(event){ + util.setStorage(constants.PRPDUCT_ITEM,event.currentTarget.dataset.item) + wx.navigateTo({ + url: '/page_package/details/index' + }) + } + +}) \ No newline at end of file diff --git a/page_package/product-type/product-type.json b/page_package/product-type/product-type.json new file mode 100644 index 0000000..98a8f51 --- /dev/null +++ b/page_package/product-type/product-type.json @@ -0,0 +1,9 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "商品分类", + "usingComponents": { + "bc-scroll": "/components/refresh/refresh", + "type": "/pages/main-two/type/type" + } +} \ No newline at end of file diff --git a/page_package/product-type/product-type.wxml b/page_package/product-type/product-type.wxml new file mode 100644 index 0000000..c47f0a8 --- /dev/null +++ b/page_package/product-type/product-type.wxml @@ -0,0 +1,47 @@ + + + + + + + + + + {{item.name}} + + + + + + + + + + + + + {{item.skuName}} + + 优惠券 ¥{{item.coupons[0].discount}} + + + {{item.comments}}条评论 + {{item.goodCommentsShare}}%好评率 + + + 券后价¥ + {{item.priceInfo.lowestCouponPrice ? item.priceInfo.lowestCouponPrice:item.priceInfo.price}} + + {{item.commissionInfo.commissionHint}} + + + + + + + + + + \ No newline at end of file diff --git a/page_package/product-type/product-type.wxss b/page_package/product-type/product-type.wxss new file mode 100644 index 0000000..cb25f6a --- /dev/null +++ b/page_package/product-type/product-type.wxss @@ -0,0 +1,77 @@ +/* page_package/product-type/product-type.wxss */ + +.VerticalNav.nav { + width: 96px; + white-space: initial; +} + +.VerticalNav.nav .cu-item { + width: 100%; + text-align: center; + background-color: #f2f2f2; + margin: 0; + border: none; + height: 50px; + position: relative; +} + +.VerticalNav.nav .cu-item.cur { + background-color: #fff; +} + +.VerticalNav.nav .cu-item.cur::after { + content: ""; + width: 8rpx; + height: 30rpx; + border-radius: 10rpx 0 0 10rpx; + position: absolute; + background-color: currentColor; + top: 0; + right: 0rpx; + bottom: 0; + margin: auto; +} + +.VerticalBox { + display: flex; +} + +.VerticalMain { + background-color: #fff; +} + +.ellipsis{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.rounded{ + border-bottom-right-radius: 8rpx; + border-bottom-left-radius: 8rpx; +} + +.bg-item{ + background-color: #f2f2f2; + color: #f43f3b; + border-radius: 5rpx; + border: 1px solid #f43f3b; + padding: 3rpx 10rpx; +} + +.comment{ + position: absolute; + right: 10rpx; +} + +.type-item{ + background-color: #f2f2f2; + padding-bottom: 10rpx; + border-bottom-right-radius: 8rpx; + border-bottom-left-radius: 8rpx; +} + +.img-item{ + border-top-right-radius: 8rpx; + border-top-left-radius: 8rpx; +} \ No newline at end of file diff --git a/page_package/profit/profit.js b/page_package/profit/profit.js new file mode 100644 index 0000000..0a5b8c1 --- /dev/null +++ b/page_package/profit/profit.js @@ -0,0 +1,156 @@ +// page_package/profit/profit.js +const app = getApp() +const {getFeeData} = require("../../utils/network/services/user.js") +const constants = require("../../utils/constants") +const util = require("../../utils/util") + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + tabs: ["本月预估", "上月预估", "近30天预估"], + TabCur: 0, + scrollLeft: 0, + + requesting: false, + end: false, + emptyShow: false, + hasTop: false, + enableBackToTop: false, + refreshSize: 90, + bottomSize: 0, + color: "#3F82FD", + empty: false, + scrollTop: 0, + + thisMonth: util.getEstimateDate(), + lastMonth: util.getLastMonth(), + lastDays: util.getLastDays(), + + modelTitle: "", + modelContent: "", + modalName: '', + + feeList: null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getData() + }, + + getData() { + this.setData({requesting: true}) + getFeeData().then((res) => { + this.setData({ + feeList: res.data.data, + requesting: false + }) + }).catch(err => { + this.setData({ + requesting: false + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + hideModal() { + this.setData({modalName: ''}) + }, + more() { + + }, + refresh() { + this.getData() + }, + tabSelect(event) { + this.setData({ + TabCur: event.currentTarget.dataset.id, + scrollLeft: (event.currentTarget.dataset.id - 1) * 60 + }) + }, + onShowModel(event) { + switch (Number(event.currentTarget.dataset.index)) { + case 0: + if (Number(event.currentTarget.dataset.type) == 0) { + this.setData({ + modelTitle: this.data.feeList.thisMonth[0].description.popTitle, + modelContent: this.data.feeList.thisMonth[0].description.popText, + modalName: 'bottomModal' + }) + } else if (Number(event.currentTarget.dataset.type) == 1) { + this.setData({ + modelTitle: this.data.feeList.lastMonth[0].description.popTitle, + modelContent: this.data.feeList.lastMonth[0].description.popText, + modalName: 'bottomModal' + }) + } else { + this.setData({ + modelTitle: this.data.feeList.nearly30Days[0].description.popTitle, + modelContent: this.data.feeList.nearly30Days[0].description.popText, + modalName: 'bottomModal' + }) + } + break + case 1: + this.setData({ + modelTitle: this.data.feeList.billingInfo.description.popTitle, + modelContent: this.data.feeList.billingInfo.description.popText, + modalName: 'bottomModal' + }) + break + } + } +}) \ No newline at end of file diff --git a/page_package/profit/profit.json b/page_package/profit/profit.json new file mode 100644 index 0000000..3a6ebcc --- /dev/null +++ b/page_package/profit/profit.json @@ -0,0 +1,8 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "我的收益", + "usingComponents": { + "bc-scroll": "/components/refresh/refresh" + } +} \ No newline at end of file diff --git a/page_package/profit/profit.wxml b/page_package/profit/profit.wxml new file mode 100644 index 0000000..3b1cf5a --- /dev/null +++ b/page_package/profit/profit.wxml @@ -0,0 +1,122 @@ + + + + + + + + + + + + {{item}} + + + + + + + + + + + + + + {{item.title}} + + + {{item.value}} + + + + + + {{feeList.billingInfo.description.text}} + + + + + + + + + + {{modelTitle}} + 确定 + + + {{modelContent}} + + + \ No newline at end of file diff --git a/page_package/profit/profit.wxss b/page_package/profit/profit.wxss new file mode 100644 index 0000000..187ad11 --- /dev/null +++ b/page_package/profit/profit.wxss @@ -0,0 +1,4 @@ +/* page_package/profit/profit.wxss */ +page{ + background-color: #f2f2f2; +} \ No newline at end of file diff --git a/page_package/question/question.js b/page_package/question/question.js new file mode 100644 index 0000000..1941da3 --- /dev/null +++ b/page_package/question/question.js @@ -0,0 +1,70 @@ +// page_package/question/question.js +const constants = require("../../utils/constants") +const util = require("../../utils/util") +Page({ + + /** + * 页面的初始数据 + */ + data: { + question:null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + question:util.getStorage(constants.QUESTION) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/page_package/question/question.json b/page_package/question/question.json new file mode 100644 index 0000000..5a05e9c --- /dev/null +++ b/page_package/question/question.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "问题解答", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/question/question.wxml b/page_package/question/question.wxml new file mode 100644 index 0000000..4ea3ffd --- /dev/null +++ b/page_package/question/question.wxml @@ -0,0 +1,13 @@ + + + + + + + + + + {{question.title}} + + {{question.answer}} + \ No newline at end of file diff --git a/page_package/question/question.wxss b/page_package/question/question.wxss new file mode 100644 index 0000000..c521542 --- /dev/null +++ b/page_package/question/question.wxss @@ -0,0 +1,4 @@ +/* page_package/question/question.wxss */ +page{ + background-color: #f2f2f2; +} \ No newline at end of file diff --git a/page_package/search/search.js b/page_package/search/search.js new file mode 100644 index 0000000..e85a39c --- /dev/null +++ b/page_package/search/search.js @@ -0,0 +1,281 @@ +// page_package/search/search.js +const app = getApp() +const constants = require("../../utils/constants.js") +const util = require("../../utils/util.js") + +Page({ + + /** + * + */ + data: { + StatusBar: app.globalData.StatusBar, + CustomBar: app.globalData.CustomBar, + Custom: app.globalData.Custom, + windowHeight: app.globalData.windowHeight, + windowWidth: app.globalData.windowWidth, + searchHistory: [], + searchContent: "", + scrolltop: '', + conditionList: [ + {name: '综合排序'}, + {name: '高返利比'}, + {name: '销量'}, + {name: '价格'}, + ], + numList: [{ + name: '打开京东APP' + }, { + name: '长按复制商品标题' + }, { + name: '打开惠享小程序' + }, { + name: '点击搜索' + },], + + isCoupon: false, + isFilter: false, + isCheck: false, + curID: 0, + priceSort: false, + salesSort: false, + page:1, + sortName:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + if(options.content){ + this.setData({searchContent:options.content}) + let historyList = util.getStorage(constants.SEARCH_HISTORY) + historyList = historyList ? historyList : [] + let isExis = historyList.filter((elem) => elem == this.data.searchContent) + + if (isExis.length == 0) { + historyList.push(this.data.searchContent) + util.setStorage(constants.SEARCH_HISTORY, historyList) + } + this.setData({ + isCoupon: true, + isCheck: false, + isFilter: true, + priceSort: false, + salesSort: false, + curID: 0, + page:1, + sortName:'' + }) + this.selectComponent("#search-product-list").getSearchList('refresh', 1, this.data.searchContent, '', '', ''); + } + let historyList = util.getStorage(constants.SEARCH_HISTORY) + // 获取本地搜索历史 + this.setData({ + searchHistory: historyList + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + /**清除记录 */ + onClear() { + util.removeStorage(constants.SEARCH_HISTORY) + this.setData({ + searchHistory: util.getStorage(constants.SEARCH_HISTORY) + }) + }, + historyItem(event) { + this.setData({ + searchContent: event.currentTarget.dataset.item + }) + // this.selectComponent("#search-product-list").getList('refresh', 1, + // event.currentTarget.dataset.item, 'search'); + }, + /** + * 搜索框输入监听 + */ + bindinput(event) { + this.setData({ + searchContent: event.detail.value + }) + }, + more(){ + this.selectComponent("#search-product-list").getSearchList('more', ++this.data.page, this.data.searchContent, '', this.data.priceSort ? 'desc' : 'asc', this.data.sortName); + }, + //筛选规则 + onSort(event) { + this.setData({scrolltop: 0}) + switch (Number(event.currentTarget.dataset.index)) { + case 0: + this.setData({ + isCoupon: true, + isCheck: false, + isFilter: true, + curID: 0, + salesSort: false, + priceSort: false, + page:1, + sortName:'' + }) + this.selectComponent("#search-product-list").getSearchList('refresh', 1, this.data.searchContent, '', '', ''); + break + case 1: + this.setData({ + isCoupon: true, + isCheck: false, + isFilter: true, + curID: 1, + salesSort: false, + priceSort: false, + page:1, + sortName:'commission' + }) + this.selectComponent("#search-product-list").getSearchList('refresh', 1, this.data.searchContent, '', 'desc', 'commission'); + break + case 2: + this.setData({ + isCoupon: true, + isCheck: false, + isFilter: true, + curID: 2, + salesSort: !this.data.salesSort, + priceSort: false, + page:1, + sortName:'inOrderCount30Days' + }) + this.selectComponent("#search-product-list").getSearchList('refresh', 1, this.data.searchContent, '', this.data.salesSort ? 'desc' : 'asc', 'inOrderCount30Days'); + break + case 3: + this.setData({ + isCoupon: true, + isCheck: false, + isFilter: true, + curID: 3, + salesSort: false, + priceSort: !this.data.priceSort, + page:1, + sortName:'price' + }) + this.selectComponent("#search-product-list").getSearchList('refresh', 1, this.data.searchContent, '', this.data.priceSort ? 'desc' : 'asc', 'price'); + break + } + }, + onCheck(event) { + this.setData({scrolltop: 0}) + if (event.detail.value) { + this.setData({ + isCoupon: true, + isCheck: true, + isFilter: false, + priceSort: false, + salesSort: false, + curID: 0, + page:1, + sortName:'' + }) + this.selectComponent("#search-product-list").getSearchList('refresh', 1, this.data.searchContent, 1, '', ''); + } else { + this.setData({ + isCoupon: true, + isCheck: false, + isFilter: true, + priceSort: false, + salesSort: false, + curID: 0, + page:1, + sortName:'' + }) + this.selectComponent("#search-product-list").getSearchList('refresh', 1, this.data.searchContent, '', '', ''); + } + }, + onSerach(event) { + let that = this + if (this.data.searchContent) { + let historyList = util.getStorage(constants.SEARCH_HISTORY) + historyList = historyList ? historyList : [] + let isExis = historyList.filter((elem) => elem == that.data.searchContent) + + if (isExis.length == 0) { + historyList.push(this.data.searchContent) + util.setStorage(constants.SEARCH_HISTORY, historyList) + } + this.setData({scrolltop: 0}) + switch (Number(event.currentTarget.dataset.index)) { + case 0: + this.setData({ + isCoupon: true, + isCheck: true, + isFilter: false, + priceSort: false, + salesSort: false, + curID: 0, + page:1, + sortName:'' + }) + this.selectComponent("#search-product-list").getSearchList('refresh', 1, this.data.searchContent, 1, '', ''); + break + case 1: + this.setData({ + isCoupon: true, + isCheck: false, + isFilter: true, + priceSort: false, + salesSort: false, + curID: 0, + page:1, + sortName:'' + }) + this.selectComponent("#search-product-list").getSearchList('refresh', 1, this.data.searchContent, '', '', ''); + break + } + } + } +}) \ No newline at end of file diff --git a/page_package/search/search.json b/page_package/search/search.json new file mode 100644 index 0000000..5915c46 --- /dev/null +++ b/page_package/search/search.json @@ -0,0 +1,8 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "搜索商品", + "usingComponents": { + "type": "/pages/main-two/type/type" + } +} \ No newline at end of file diff --git a/page_package/search/search.wxml b/page_package/search/search.wxml new file mode 100644 index 0000000..75aae8a --- /dev/null +++ b/page_package/search/search.wxml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + 搜优惠券 + + 搜京东全站 + + + + + + + + 综合排序 + + 高返佣比 + + + 销量 + + + + + + + + 价格 + + + + + + + + + + + + + 仅显示优惠券商品 + + + + + + + + + + + + + + 省钱技巧:京东领券后再来惠享购买享受用券和返利双重优惠 + + + + + + {{index + 1}} + + + + {{item.name}} + + {{item.name}} + + + + + + + 搜索记录 + + + + {{item}} + + + + + + + + \ No newline at end of file diff --git a/page_package/search/search.wxss b/page_package/search/search.wxss new file mode 100644 index 0000000..c9fb199 --- /dev/null +++ b/page_package/search/search.wxss @@ -0,0 +1,25 @@ +/* page_package/search/search.wxss */ +.skill{ + color: #83653F; +} + +.ellipsis{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.ellipsis-title{ + margin-top: 10rpx; + font-size: 30rpx; +} + +.condition-item{ + width: 25%; + height: 56rpx; +} + +.line1{ + width: 100%; + height: 1rpx; + background-color: #f2f2f2; +} \ No newline at end of file diff --git a/page_package/study/study.js b/page_package/study/study.js new file mode 100644 index 0000000..66d36fe --- /dev/null +++ b/page_package/study/study.js @@ -0,0 +1,114 @@ +// page_package/study/study.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + windowHeight: app.globalData.windowHeight, + CustomBar: app.globalData.CustomBar, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + onSave(event) { + wx.getSetting({ + success(res) { + wx.showLoading({title: '保存中...',}) + wx.downloadFile({ + url: "http://mss.sankuai.com/v1/mss_51a7233366a4427fa6132a6ce72dbe54/newsPicture/05558951-de60-49fb-b674-dd906c8897a6", + success: function(res) { + wx.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: function(data) { + wx.hideLoading() + wx.showModal({ + title: '提示', + showCancel: false, + content: '图片保存成功,进入系统相册分享吧~', + success(res) { + if (res.confirm) { + + } + } + }) + }, + fail: function(err) { + wx.hideLoading() + console.log(err); + } + }); + } + }); + }, + fail: (err) => { + wx.showModal({ + title: '提示', + showCancel: false, + content: '请到小程序设置中打开相册权限', + success(res) {} + }) + } + }); + }, + onPreview(event) { + wx.previewImage({ + urls: ['https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1583131085102&di=3454eccc0e5443f08f24157034dd9220&imgtype=0&src=http%3A%2F%2Fhbimg.huabanimg.com%2F437304a7ca4cf0c9386df81fcfc761299c6a11271ffc5-OwRrXi_fw658'], + }) + } + +}) \ No newline at end of file diff --git a/page_package/study/study.json b/page_package/study/study.json new file mode 100644 index 0000000..e3bed80 --- /dev/null +++ b/page_package/study/study.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "进阶学习", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/study/study.wxml b/page_package/study/study.wxml new file mode 100644 index 0000000..5f0cb7b --- /dev/null +++ b/page_package/study/study.wxml @@ -0,0 +1,26 @@ + + + 返回 + 进阶学习 + + + + 招商+入门+冲刺官方系统培训课程 + 惠享主力就业计划特别课,集招商、入门、提升的综合进阶培训,主力更多人创收! + + + + + + 保存到手机相册 + 分享图片 + + + + \ No newline at end of file diff --git a/page_package/study/study.wxss b/page_package/study/study.wxss new file mode 100644 index 0000000..156e44f --- /dev/null +++ b/page_package/study/study.wxss @@ -0,0 +1 @@ +/* page_package/study/study.wxss */ \ No newline at end of file diff --git a/page_package/time-reward/time-reward.js b/page_package/time-reward/time-reward.js new file mode 100644 index 0000000..6b01f92 --- /dev/null +++ b/page_package/time-reward/time-reward.js @@ -0,0 +1,66 @@ +// page_package/time-reward/time-reward.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/page_package/time-reward/time-reward.json b/page_package/time-reward/time-reward.json new file mode 100644 index 0000000..a264894 --- /dev/null +++ b/page_package/time-reward/time-reward.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "限时奖励", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/time-reward/time-reward.wxml b/page_package/time-reward/time-reward.wxml new file mode 100644 index 0000000..b70b9e7 --- /dev/null +++ b/page_package/time-reward/time-reward.wxml @@ -0,0 +1,5 @@ + + + + + diff --git a/page_package/time-reward/time-reward.wxss b/page_package/time-reward/time-reward.wxss new file mode 100644 index 0000000..c8b54eb --- /dev/null +++ b/page_package/time-reward/time-reward.wxss @@ -0,0 +1 @@ +/* page_package/time-reward/time-reward.wxss */ \ No newline at end of file diff --git a/page_package/transfer/chain/chain.js b/page_package/transfer/chain/chain.js new file mode 100644 index 0000000..47adf6e --- /dev/null +++ b/page_package/transfer/chain/chain.js @@ -0,0 +1,111 @@ +// page_package/transfer/chain/chain.js +const {goodsConvert} = require('../../../utils/network/services/service.js') +Page({ + + /** + * 页面的初始数据 + */ + data: { + content:"", + chainContent:'', + isShowDialog:false, + msg:"" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + content:decodeURIComponent(options.content) + }) + this.onChain() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + onChain(){ + if(this.data.content){ + goodsConvert(this.data.content) + .then(res => { + this.setData({chainContent: res.data.data.content}) + }).catch(err => { + console.log(err) + this.setData({ + isShowDialog:true, + msg:"获取推广链接失败" + }) + }) + }else { + this.setData({ + isShowDialog:true, + msg:"获取推广链接失败" + }) + } + }, + textareaBInput(event) { + this.setData({chainContent: event.detail.value}) + }, + onCopy(){ + if(this.data.chainContent){ + wx.setClipboardData({ + data: this.data.chainContent, + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + } + } +}) \ No newline at end of file diff --git a/page_package/transfer/chain/chain.json b/page_package/transfer/chain/chain.json new file mode 100644 index 0000000..5f0f511 --- /dev/null +++ b/page_package/transfer/chain/chain.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "分享", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/transfer/chain/chain.wxml b/page_package/transfer/chain/chain.wxml new file mode 100644 index 0000000..1daaf78 --- /dev/null +++ b/page_package/transfer/chain/chain.wxml @@ -0,0 +1,24 @@ + + + + +请勿更改链接,尚橙仅提供技术支持,请确保分享内容真实合法,勿使用京东内部优惠券、好评返现虚假描述 + + + + 如何分享?1 + 保存文字 + =>2 + 关闭小程序 + =>3 + 粘贴到群或个人 + + + 保存文字 + + + \ No newline at end of file diff --git a/page_package/transfer/chain/chain.wxss b/page_package/transfer/chain/chain.wxss new file mode 100644 index 0000000..9c360fb --- /dev/null +++ b/page_package/transfer/chain/chain.wxss @@ -0,0 +1 @@ +/* page_package/transfer/chain/chain.wxss */ diff --git a/page_package/transfer/transfer/transfer.js b/page_package/transfer/transfer/transfer.js new file mode 100644 index 0000000..bc66641 --- /dev/null +++ b/page_package/transfer/transfer/transfer.js @@ -0,0 +1,88 @@ +// page_package/transfer/transfer/transfer.js + +Page({ + + /** + * 页面的初始数据 + */ + data: { + isShow: true, + searchContent: "", + isShowDialog:false, + msg:"" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + textareaBInput(event) { + this.setData({searchContent: event.detail.value}) + }, + onClose() { + this.setData({isShow: false}) + }, + onClear() { + this.setData({searchContent: ''}) + }, + onTransfer() { + const content = this.data.searchContent + if(content.length < 10) return + const url = encodeURIComponent(content) + wx.navigateTo({ + url: '/page_package/transfer/chain/chain?content=' + url + }) + } + +}) \ No newline at end of file diff --git a/page_package/transfer/transfer/transfer.json b/page_package/transfer/transfer/transfer.json new file mode 100644 index 0000000..3ffedce --- /dev/null +++ b/page_package/transfer/transfer/transfer.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "转链", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/transfer/transfer/transfer.wxml b/page_package/transfer/transfer/transfer.wxml new file mode 100644 index 0000000..78445f1 --- /dev/null +++ b/page_package/transfer/transfer/transfer.wxml @@ -0,0 +1,30 @@ + + + + + + 通过转链后链接生成的订单才能计算到您的佣金中 + + + + + + + 清空 + + + 转换成我的链接 + + + + + diff --git a/page_package/transfer/transfer/transfer.wxss b/page_package/transfer/transfer/transfer.wxss new file mode 100644 index 0000000..076d2dc --- /dev/null +++ b/page_package/transfer/transfer/transfer.wxss @@ -0,0 +1,5 @@ +/* page_package/transfer/transfer/transfer.wxss */ +.page{ + height: calc(100vh); + background-color: #f2f2f2; +} \ No newline at end of file diff --git a/page_package/video-course/video-course.js b/page_package/video-course/video-course.js new file mode 100644 index 0000000..0228069 --- /dev/null +++ b/page_package/video-course/video-course.js @@ -0,0 +1,87 @@ +// page_package/video-course/video-course.js +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + CustomBar: app.globalData.CustomBar, + windowHeight: app.globalData.windowHeight, + url:"" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + url:decodeURIComponent(options.url) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + onPlay(e) {}, + + onPause(e) { + // console.log('pause', e.detail.activeId) + }, + + onEnded(e) {}, + + onError(e) {}, + + onWaiting(e) {}, + + onTimeUpdate(e) {}, + + onProgress(e) {}, +}) \ No newline at end of file diff --git a/page_package/video-course/video-course.json b/page_package/video-course/video-course.json new file mode 100644 index 0000000..55b9dde --- /dev/null +++ b/page_package/video-course/video-course.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "视频教程", + "usingComponents": {} +} \ No newline at end of file diff --git a/page_package/video-course/video-course.wxml b/page_package/video-course/video-course.wxml new file mode 100644 index 0000000..3794845 --- /dev/null +++ b/page_package/video-course/video-course.wxml @@ -0,0 +1,24 @@ + + + + + + diff --git a/page_package/video-course/video-course.wxss b/page_package/video-course/video-course.wxss new file mode 100644 index 0000000..945efdb --- /dev/null +++ b/page_package/video-course/video-course.wxss @@ -0,0 +1,5 @@ +/* page_package/video-course/video-course.wxss */ +.video_item { + height: 100vh; + width: 100vw; +} \ No newline at end of file diff --git a/page_package/video-play/video-play.js b/page_package/video-play/video-play.js new file mode 100644 index 0000000..60a68ac --- /dev/null +++ b/page_package/video-play/video-play.js @@ -0,0 +1,70 @@ +// page_package/video-play/video-play.js + +const app = getApp() + +const data = require("../../pages/daren/test-data.js") + +const videoList = data.videos + + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + StatusBar: app.globalData.StatusBar, + CustomBar: app.globalData.CustomBar, + Custom: app.globalData.Custom, + windowWidth: app.globalData.windowWidth, + windowHeight: app.globalData.windowHeight, + current:0, + videoList, + videos:{} + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + let lists = { + current: Number(options.index), + videos: videoList + } + + this.setData({ + current: Number(options.index), + videos: lists + }) + }, + + onPlay(e) {}, + + onPause(e) { + // console.log('pause', e.detail.activeId) + }, + + onEnded(e) {}, + + onError(e) {}, + + onWaiting(e) {}, + + onTimeUpdate(e) {}, + + onProgress(e) {}, + + onLoadedMetaData(e) { + console.log('LoadedMetaData', e) + }, + + onShare(e){ + wx.showToast({ + title: '分享视频' + e.detail.index, + icon: "none", + duration: 3000 + }) + } + +}) \ No newline at end of file diff --git a/page_package/video-play/video-play.json b/page_package/video-play/video-play.json new file mode 100644 index 0000000..6ecc5fc --- /dev/null +++ b/page_package/video-play/video-play.json @@ -0,0 +1,6 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "video-swiper": "/components/video-swiper/video-swiper" + } +} \ No newline at end of file diff --git a/page_package/video-play/video-play.wxml b/page_package/video-play/video-play.wxml new file mode 100644 index 0000000..379331f --- /dev/null +++ b/page_package/video-play/video-play.wxml @@ -0,0 +1,10 @@ + + + + + 返回 + + + + + \ No newline at end of file diff --git a/page_package/video-play/video-play.wxss b/page_package/video-play/video-play.wxss new file mode 100644 index 0000000..fd73799 --- /dev/null +++ b/page_package/video-play/video-play.wxss @@ -0,0 +1,17 @@ +/* page_package/video-play/video-play.wxss */ + +page { + height: 100vh; + width: 100vw; + position: fixed; +} + +.container { + width: 100%; + height: 100%; +} + +.swiper { + width: 100%; + height: 100%; +} diff --git a/pages/daren/daren.js b/pages/daren/daren.js new file mode 100644 index 0000000..fe943c4 --- /dev/null +++ b/pages/daren/daren.js @@ -0,0 +1,115 @@ +// pages/daren/daren.js +const app = getApp() +const data = require("./test-data.js") +let pageStart = 0 + +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + StatusBar: app.globalData.StatusBar, + CustomBar: app.globalData.CustomBar, + Custom: app.globalData.Custom, + TabCur: 0, + scrollLeft: 0, + windowWidth: app.globalData.windowWidth, + windowHeight: app.globalData.windowHeight, + + tabs: ["推荐", "关注"], + videoList: data.videos, + + requesting: false, + end: false, + emptyShow: false, + page: pageStart, + listData: [], + hasTop: false, + enableBackToTop: false, + refreshSize: 90, + bottomSize: 100, + color: "#3F82FD", + empty: false + }, + + lifetimes: { + attached: function () { + // 在组件实例进入页面节点树时执行 + this.getList('refresh', pageStart); + }, + }, + + /** + * 组件的方法列表 + */ + methods: { + tabSelect(e) { + this.setData({ + TabCur: e.currentTarget.dataset.id, + scrollLeft: (e.currentTarget.dataset.id - 1) * 60 + }) + }, + togo(e) { + let index = e.currentTarget.dataset.index + wx.navigateTo({ + url: '/page_package/video-play/video-play?index=' + index + // url:'/page_package/about/about' + }) + }, + // 刷新数据 + refresh() { + this.getList('refresh', pageStart); + this.setData({ + empty: false + }) + }, + // 加载更多 + more() { + this.getList('more', this.data.page); + }, + getList(type, currentPage) { + this.setData({ + requesting: true + }) + + wx.showNavigationBarLoading() + + // 模拟异步获取数据场景 + setTimeout(() => { + this.setData({ + requesting: false + }) + + wx.hideNavigationBarLoading() + + if (type === 'refresh') { + this.setData({ + page: currentPage + 1 + }) + } else { + this.setData({ + page: currentPage + 1, + end: false + }) + } + }, 1000); + } + }, + pageLifetimes: { + show() { + if (typeof this.getTabBar === 'function' && + this.getTabBar()) { + this.getTabBar().setData({ + selected: 1 + }) + } + } + } +}) \ No newline at end of file diff --git a/pages/daren/daren.json b/pages/daren/daren.json new file mode 100644 index 0000000..136f361 --- /dev/null +++ b/pages/daren/daren.json @@ -0,0 +1,6 @@ +{ + + "usingComponents": { + "bc-scroll": "/components/refresh/refresh" + } +} \ No newline at end of file diff --git a/pages/daren/daren.wxml b/pages/daren/daren.wxml new file mode 100644 index 0000000..65faaec --- /dev/null +++ b/pages/daren/daren.wxml @@ -0,0 +1,62 @@ + + + + + + + + {{item}} + + + + + + + + + + 暂无数据 + + + + + + + + + + + + +