commit ca67f7ce6f2081ff6864c402381506d36b5bf8ec
Author: 杨豪 <781521347@qq.com>
Date: Wed Aug 4 09:54:03 2021 +0800
上传代码
diff --git a/app.js b/app.js
new file mode 100644
index 0000000..2b1924e
--- /dev/null
+++ b/app.js
@@ -0,0 +1,137 @@
+//app.js
+App({
+ onLaunch: function (e) {
+ var that = this;
+ //获取设备信息
+ this.setMenuHeight()
+ },
+ onShow(e){
+ var query = {};
+ if(e.query.q){
+ //通过扫码进来获取二维码上的参数并存入storage
+ let urlSpread = e.query.q;
+ if (urlSpread) {
+ if (urlSpread.indexOf('%3F') != -1) {
+ // 通过扫桌面二维码进来
+ urlSpread = urlSpread.split("%3F")[1].replace(/%3D/g, ":").replace(/%26/g, ",").split(",").map((item, index) => {
+ item = item.split(":");
+ return `"${item[0]}":"${item[1]}"`;
+ }).join(",");
+ query = JSON.parse("{" + urlSpread + "}");
+ }
+ console.log('query1',query)
+ this.globalData.inviterId = query.id
+ }
+ } else{
+ query = e.query
+ console.log('query2',query)
+ this.globalData.inviterId = query.id
+ }
+ },
+ setMenuHeight(){
+ wx.getSystemInfo({
+ success: res => {
+ // console.log(res)
+ this.globalData.navTopHeight = res.statusBarHeight;
+ this.globalData.CustomBar = res.statusBarHeight + 45;
+ }
+ });
+ let menuButtonObj = wx.getMenuButtonBoundingClientRect();
+ this.globalData.menuTop = menuButtonObj.top;
+ // console.log(menuButtonObj)
+ this.globalData.menuHeight = menuButtonObj.height;
+ this.globalData.navHeight = menuButtonObj.height + (menuButtonObj.top - this.globalData.navTopHeight);
+ },
+ getToken(){
+ // console.log('getToken')
+ var tokentime = wx.getStorageSync('tokentime') || '';//过期时间
+ var timestamp = Date.parse(new Date());// 当前时间
+ var expiration = timestamp + 60000 * 60 * 12; //缓存12小时
+ var token = wx.getStorageSync('token') || '';
+ this.login(expiration);
+ },
+ login(expiration){
+ wx.login({
+ success: res => {
+ // 发送 res.code 到后台换取 openId, sessionKey, unionId
+ // console.log('code:',res.code)
+ this.http('GET','wechat/auth',{code : res.code,spread:0,login_type:0}).then(
+ response =>{
+ if(response.data.isSuccess){
+ wx.setStorageSync('token', 'Bearer '+ response.data.data.token);
+ wx.setStorageSync('uid', response.data.data.userId);
+ wx.setStorageSync('tokentime', expiration);
+ } else{
+ wx.showToast({
+ title: response.data.msg,
+ icon : 'none'
+ })
+ }
+ }
+ )
+ }
+ })
+ },
+ getInfo(){
+
+ this.http('get','userinfo').then((res)=>{
+ if(res.data.success){
+ wx.setStorageSync('userInfo',res.data.data)
+ var pages = getCurrentPages().pop();//当前页面
+ if (pages.getUser){
+ pages.getUser();
+ }
+ }
+ })
+ },
+ http(mathods,url, params) {
+ var that = this;
+ var header = {
+ 'content-type': 'application/json',
+ 'Authorization' : wx.getStorageSync('token') || ''
+ }
+ return new Promise(
+ (resolve,reject) => {
+ wx.showLoading({
+ title: "正在加载中...",
+ })
+ wx.request({
+ url: this.globalData.baseURL + url, //请求地址
+ method: mathods, //请求方法
+ header: header,
+ data: params || {}, //请求参数
+ success: res => {
+ wx.hideLoading();
+ //判断token是否过期 res.data.code == 40001
+ if(!res.data.isSuccess && res.data.code == 40001){
+ console.log('token过期')
+ that.getToken()
+ }
+ resolve(res);
+ //成功执行方法,参数值为res.data,直接将返回的数据传入
+ },
+ fail: function() {
+ //请求失败
+ wx.hideLoading();
+ wx.showToast({
+ title: '服务器错误,请稍后再试!',
+ icon : 'none'
+ })
+ reject(err)
+ },
+ })
+ }
+ )
+ },
+ globalData: {
+ // baseURL : 'http://192.168.0.114:8092/api/',
+ baseURL : 'https://www.cyjyyjy.com:8093/api/',
+ userInfo: null,
+ navHeight : 0,
+ navTopHeight: 0,
+ menuTop: 0,
+ menuHeight: 0,
+ CustomBar: 0,
+ inviterId: null , //分享码
+ }
+})
\ No newline at end of file
diff --git a/app.json b/app.json
new file mode 100644
index 0000000..5c9ebe8
--- /dev/null
+++ b/app.json
@@ -0,0 +1,20 @@
+{
+ "pages":[
+ "pages/user/agreement/index",
+ "pages/user/index",
+ "pages/user/incomeDetail/index",
+ "pages/user/profession/index",
+ "pages/index/index",
+ "pages/user/completeData/index",
+ "pages/user/personalData/index",
+ "pages/user/industry/index"
+ ],
+ "window":{
+ "backgroundTextStyle":"light",
+ "navigationBarBackgroundColor": "#212226",
+ "navigationBarTitleText": "禅易云生态",
+ "navigationBarTextStyle":"white"
+ },
+ "style": "v2",
+ "sitemapLocation": "sitemap.json"
+}
diff --git a/app.wxss b/app.wxss
new file mode 100644
index 0000000..065abd7
--- /dev/null
+++ b/app.wxss
@@ -0,0 +1,95 @@
+/**app.wxss**/
+view,
+scroll-view,
+swiper,
+button,
+input,
+textarea,
+label,
+navigator,
+image {
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+/* layout */
+.acea-row-nowrap {
+ display: flex;
+ /* 辅助类 */
+}
+.acea-row {
+ display: flex;
+ flex-wrap: wrap;
+ /* 辅助类 */
+}
+.acea-row.row-middle,.acea-row-nowrap.row-middle{
+ align-items: center;
+}
+.acea-row.row-top,.acea-row-nowrap.row-top {
+ align-items: flex-start;
+}
+.acea-row.row-bottom {
+ align-items: flex-end;
+}
+.acea-row.row-center,.acea-row-nowrap.row-center {
+ justify-content: center;
+}
+.acea-row.row-right,.acea-row-nowrap.row-right {
+ justify-content: flex-end;
+}
+.acea-row.row-left,.acea-row-nowrap.row-left {
+ justify-content: flex-start;
+}
+.acea-row.row-between,.acea-row-nowrap.row-between {
+ justify-content: space-between;
+}
+.acea-row.row-around, .acea-row-nowrap.row-around{
+ justify-content: space-around;
+}
+.acea-row.row-column-around,.acea-row-nowrap.row-column-around {
+ flex-direction: column;
+ justify-content: space-around;
+}
+.acea-row.row-column {
+ flex-direction: column;
+}
+.acea-row.row-column-between,.acea-row-nowrap.row-column-between {
+ flex-direction: column;
+ justify-content: space-between;
+}
+/* 上下左右垂直居中 */
+.acea-row.row-center-wrapper,.acea-row-nowrap.row-center-wrapper {
+ align-items: center;
+ justify-content: center;
+}
+/* 上下两边居中对齐 */
+.acea-row.row-between-wrapper,.acea-row-nowrap.row-between-wrapper {
+ align-items: center;
+ justify-content: space-between;
+}
+.line1{
+ overflow:hidden;
+ text-overflow:ellipsis;
+ white-space:nowrap;
+ width: 100%;
+}
+.line2{
+ word-break:break-all;
+ display:-webkit-box;
+ -webkit-line-clamp:2;
+ -webkit-box-orient:vertical;
+ overflow:hidden;
+}
+
+.back-btn{
+ width: 36rpx;
+ height: 36rpx;
+ position: fixed;
+ left: 40rpx;
+ text-align: center;
+ line-height: 36rpx;
+ z-index: 99;
+}
+.back-btn image{
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/dist/cell/index.d.ts b/dist/cell/index.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/dist/cell/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/cell/index.js b/dist/cell/index.js
new file mode 100644
index 0000000..a0123d1
--- /dev/null
+++ b/dist/cell/index.js
@@ -0,0 +1,38 @@
+import { link } from '../mixins/link';
+import { VantComponent } from '../common/component';
+VantComponent({
+ classes: [
+ 'title-class',
+ 'label-class',
+ 'value-class',
+ 'right-icon-class',
+ 'hover-class',
+ ],
+ mixins: [link],
+ props: {
+ title: null,
+ value: null,
+ icon: String,
+ size: String,
+ label: String,
+ center: Boolean,
+ isLink: Boolean,
+ required: Boolean,
+ clickable: Boolean,
+ titleWidth: String,
+ customStyle: String,
+ arrowDirection: String,
+ useLabelSlot: Boolean,
+ border: {
+ type: Boolean,
+ value: true,
+ },
+ titleStyle: String,
+ },
+ methods: {
+ onClick(event) {
+ this.$emit('click', event.detail);
+ this.jumpLink();
+ },
+ },
+});
diff --git a/dist/cell/index.json b/dist/cell/index.json
new file mode 100644
index 0000000..0a336c0
--- /dev/null
+++ b/dist/cell/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-icon": "../icon/index"
+ }
+}
diff --git a/dist/cell/index.wxml b/dist/cell/index.wxml
new file mode 100644
index 0000000..8387c3c
--- /dev/null
+++ b/dist/cell/index.wxml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+ {{ title }}
+
+
+
+
+ {{ label }}
+
+
+
+
+ {{ value }}
+
+
+
+
+
+
+
+
diff --git a/dist/cell/index.wxs b/dist/cell/index.wxs
new file mode 100644
index 0000000..e3500c4
--- /dev/null
+++ b/dist/cell/index.wxs
@@ -0,0 +1,17 @@
+/* eslint-disable */
+var style = require('../wxs/style.wxs');
+var addUnit = require('../wxs/add-unit.wxs');
+
+function titleStyle(data) {
+ return style([
+ {
+ 'max-width': addUnit(data.titleWidth),
+ 'min-width': addUnit(data.titleWidth),
+ },
+ data.titleStyle,
+ ]);
+}
+
+module.exports = {
+ titleStyle: titleStyle,
+};
diff --git a/dist/cell/index.wxss b/dist/cell/index.wxss
new file mode 100644
index 0000000..605570d
--- /dev/null
+++ b/dist/cell/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:4px;margin-right:var(--padding-base,4px)}.van-cell__right-icon-wrap{margin-left:4px;margin-left:var(--padding-base,4px);color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)}
\ No newline at end of file
diff --git a/dist/collapse-item/animate.d.ts b/dist/collapse-item/animate.d.ts
new file mode 100644
index 0000000..0c33c00
--- /dev/null
+++ b/dist/collapse-item/animate.d.ts
@@ -0,0 +1,6 @@
+///
+export declare function setContentAnimate(
+ context: WechatMiniprogram.Component.TrivialInstance,
+ expanded: boolean,
+ mounted: boolean
+): void;
diff --git a/dist/collapse-item/animate.js b/dist/collapse-item/animate.js
new file mode 100644
index 0000000..7ce1dae
--- /dev/null
+++ b/dist/collapse-item/animate.js
@@ -0,0 +1,70 @@
+import { canIUseAnimate } from '../common/version';
+import { getRect } from '../common/utils';
+function useAnimate(context, expanded, mounted, height) {
+ const selector = '.van-collapse-item__wrapper';
+ if (expanded) {
+ context.animate(
+ selector,
+ [
+ { height: 0, ease: 'ease-in-out', offset: 0 },
+ { height: `${height}px`, ease: 'ease-in-out', offset: 1 },
+ { height: `auto`, ease: 'ease-in-out', offset: 1 },
+ ],
+ mounted ? 300 : 0,
+ () => {
+ context.clearAnimation(selector);
+ }
+ );
+ return;
+ }
+ context.animate(
+ selector,
+ [
+ { height: `${height}px`, ease: 'ease-in-out', offset: 0 },
+ { height: 0, ease: 'ease-in-out', offset: 1 },
+ ],
+ 300,
+ () => {
+ context.clearAnimation(selector);
+ }
+ );
+}
+function useAnimation(context, expanded, mounted, height) {
+ const animation = wx.createAnimation({
+ duration: 0,
+ timingFunction: 'ease-in-out',
+ });
+ if (expanded) {
+ if (height === 0) {
+ animation.height('auto').top(1).step();
+ } else {
+ animation
+ .height(height)
+ .top(1)
+ .step({
+ duration: mounted ? 300 : 1,
+ })
+ .height('auto')
+ .step();
+ }
+ context.setData({
+ animation: animation.export(),
+ });
+ return;
+ }
+ animation.height(height).top(0).step({ duration: 1 }).height(0).step({
+ duration: 300,
+ });
+ context.setData({
+ animation: animation.export(),
+ });
+}
+export function setContentAnimate(context, expanded, mounted) {
+ getRect(context, '.van-collapse-item__content')
+ .then((rect) => rect.height)
+ .then((height) => {
+ canIUseAnimate()
+ ? useAnimate(context, expanded, mounted, height)
+ : useAnimation(context, expanded, mounted, height);
+ });
+}
diff --git a/dist/collapse-item/index.d.ts b/dist/collapse-item/index.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/dist/collapse-item/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/collapse-item/index.js b/dist/collapse-item/index.js
new file mode 100644
index 0000000..c44c27e
--- /dev/null
+++ b/dist/collapse-item/index.js
@@ -0,0 +1,59 @@
+import { VantComponent } from '../common/component';
+import { useParent } from '../common/relation';
+import { setContentAnimate } from './animate';
+VantComponent({
+ classes: ['title-class', 'content-class'],
+ relation: useParent('collapse'),
+ props: {
+ name: null,
+ title: null,
+ value: null,
+ icon: String,
+ label: String,
+ disabled: Boolean,
+ clickable: Boolean,
+ border: {
+ type: Boolean,
+ value: true,
+ },
+ isLink: {
+ type: Boolean,
+ value: true,
+ },
+ },
+ data: {
+ expanded: false,
+ },
+ mounted() {
+ this.updateExpanded();
+ this.mounted = true;
+ },
+ methods: {
+ updateExpanded() {
+ if (!this.parent) {
+ return;
+ }
+ const { value, accordion } = this.parent.data;
+ const { children = [] } = this.parent;
+ const { name } = this.data;
+ const index = children.indexOf(this);
+ const currentName = name == null ? index : name;
+ const expanded = accordion
+ ? value === currentName
+ : (value || []).some((name) => name === currentName);
+ if (expanded !== this.data.expanded) {
+ setContentAnimate(this, expanded, this.mounted);
+ }
+ this.setData({ index, expanded });
+ },
+ onClick() {
+ if (this.data.disabled) {
+ return;
+ }
+ const { name, expanded } = this.data;
+ const index = this.parent.children.indexOf(this);
+ const currentName = name == null ? index : name;
+ this.parent.switch(currentName, !expanded);
+ },
+ },
+});
diff --git a/dist/collapse-item/index.json b/dist/collapse-item/index.json
new file mode 100644
index 0000000..0e5425c
--- /dev/null
+++ b/dist/collapse-item/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-cell": "../cell/index"
+ }
+}
diff --git a/dist/collapse-item/index.wxml b/dist/collapse-item/index.wxml
new file mode 100644
index 0000000..ae4cc83
--- /dev/null
+++ b/dist/collapse-item/index.wxml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/collapse-item/index.wxss b/dist/collapse-item/index.wxss
new file mode 100644
index 0000000..0bb936c
--- /dev/null
+++ b/dist/collapse-item/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;transition:-webkit-transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s),-webkit-transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)}
\ No newline at end of file
diff --git a/dist/collapse/index.d.ts b/dist/collapse/index.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/dist/collapse/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/collapse/index.js b/dist/collapse/index.js
new file mode 100644
index 0000000..60e4611
--- /dev/null
+++ b/dist/collapse/index.js
@@ -0,0 +1,44 @@
+import { VantComponent } from '../common/component';
+import { useChildren } from '../common/relation';
+VantComponent({
+ relation: useChildren('collapse-item'),
+ props: {
+ value: {
+ type: null,
+ observer: 'updateExpanded',
+ },
+ accordion: {
+ type: Boolean,
+ observer: 'updateExpanded',
+ },
+ border: {
+ type: Boolean,
+ value: true,
+ },
+ },
+ methods: {
+ updateExpanded() {
+ this.children.forEach((child) => {
+ child.updateExpanded();
+ });
+ },
+ switch(name, expanded) {
+ const { accordion, value } = this.data;
+ const changeItem = name;
+ if (!accordion) {
+ name = expanded
+ ? (value || []).concat(name)
+ : (value || []).filter((activeName) => activeName !== name);
+ } else {
+ name = expanded ? name : '';
+ }
+ if (expanded) {
+ this.$emit('open', changeItem);
+ } else {
+ this.$emit('close', changeItem);
+ }
+ this.$emit('change', name);
+ this.$emit('input', name);
+ },
+ },
+});
diff --git a/dist/collapse/index.json b/dist/collapse/index.json
new file mode 100644
index 0000000..467ce29
--- /dev/null
+++ b/dist/collapse/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/dist/collapse/index.wxml b/dist/collapse/index.wxml
new file mode 100644
index 0000000..fd4e171
--- /dev/null
+++ b/dist/collapse/index.wxml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/dist/collapse/index.wxss b/dist/collapse/index.wxss
new file mode 100644
index 0000000..99694d6
--- /dev/null
+++ b/dist/collapse/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';
\ No newline at end of file
diff --git a/dist/common/color.d.ts b/dist/common/color.d.ts
new file mode 100644
index 0000000..386f307
--- /dev/null
+++ b/dist/common/color.d.ts
@@ -0,0 +1,7 @@
+export declare const RED = "#ee0a24";
+export declare const BLUE = "#1989fa";
+export declare const WHITE = "#fff";
+export declare const GREEN = "#07c160";
+export declare const ORANGE = "#ff976a";
+export declare const GRAY = "#323233";
+export declare const GRAY_DARK = "#969799";
diff --git a/dist/common/color.js b/dist/common/color.js
new file mode 100644
index 0000000..6b285bd
--- /dev/null
+++ b/dist/common/color.js
@@ -0,0 +1,7 @@
+export const RED = '#ee0a24';
+export const BLUE = '#1989fa';
+export const WHITE = '#fff';
+export const GREEN = '#07c160';
+export const ORANGE = '#ff976a';
+export const GRAY = '#323233';
+export const GRAY_DARK = '#969799';
diff --git a/dist/common/component.d.ts b/dist/common/component.d.ts
new file mode 100644
index 0000000..6b0a958
--- /dev/null
+++ b/dist/common/component.d.ts
@@ -0,0 +1,8 @@
+///
+import { VantComponentOptions } from '../definitions/index';
+declare function VantComponent<
+ Data extends WechatMiniprogram.Component.DataOption,
+ Props extends WechatMiniprogram.Component.PropertyOption,
+ Methods extends WechatMiniprogram.Component.MethodOption
+>(vantOptions: VantComponentOptions): void;
+export { VantComponent };
diff --git a/dist/common/component.js b/dist/common/component.js
new file mode 100644
index 0000000..5530c6f
--- /dev/null
+++ b/dist/common/component.js
@@ -0,0 +1,45 @@
+import { basic } from '../mixins/basic';
+function mapKeys(source, target, map) {
+ Object.keys(map).forEach((key) => {
+ if (source[key]) {
+ target[map[key]] = source[key];
+ }
+ });
+}
+function VantComponent(vantOptions) {
+ const options = {};
+ mapKeys(vantOptions, options, {
+ data: 'data',
+ props: 'properties',
+ mixins: 'behaviors',
+ methods: 'methods',
+ beforeCreate: 'created',
+ created: 'attached',
+ mounted: 'ready',
+ destroyed: 'detached',
+ classes: 'externalClasses',
+ });
+ // add default externalClasses
+ options.externalClasses = options.externalClasses || [];
+ options.externalClasses.push('custom-class');
+ // add default behaviors
+ options.behaviors = options.behaviors || [];
+ options.behaviors.push(basic);
+ // add relations
+ const { relation } = vantOptions;
+ if (relation) {
+ options.relations = relation.relations;
+ options.behaviors.push(relation.mixin);
+ }
+ // map field to form-field behavior
+ if (vantOptions.field) {
+ options.behaviors.push('wx://form-field');
+ }
+ // add default options
+ options.options = {
+ multipleSlots: true,
+ addGlobalClass: true,
+ };
+ Component(options);
+}
+export { VantComponent };
diff --git a/dist/common/index.wxss b/dist/common/index.wxss
new file mode 100644
index 0000000..976825d
--- /dev/null
+++ b/dist/common/index.wxss
@@ -0,0 +1 @@
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file
diff --git a/dist/common/relation.d.ts b/dist/common/relation.d.ts
new file mode 100644
index 0000000..be5f2ee
--- /dev/null
+++ b/dist/common/relation.d.ts
@@ -0,0 +1,21 @@
+///
+declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
+export declare function useParent(
+ name: string,
+ onEffect?: (this: TrivialInstance) => void
+): {
+ relations: {
+ [x: string]: WechatMiniprogram.Component.RelationOption;
+ };
+ mixin: string;
+};
+export declare function useChildren(
+ name: string,
+ onEffect?: (this: TrivialInstance, target: TrivialInstance) => void
+): {
+ relations: {
+ [x: string]: WechatMiniprogram.Component.RelationOption;
+ };
+ mixin: string;
+};
+export {};
diff --git a/dist/common/relation.js b/dist/common/relation.js
new file mode 100644
index 0000000..99c1a49
--- /dev/null
+++ b/dist/common/relation.js
@@ -0,0 +1,64 @@
+export function useParent(name, onEffect) {
+ const path = `../${name}/index`;
+ return {
+ relations: {
+ [path]: {
+ type: 'ancestor',
+ linked() {
+ onEffect && onEffect.call(this);
+ },
+ linkChanged() {
+ onEffect && onEffect.call(this);
+ },
+ unlinked() {
+ onEffect && onEffect.call(this);
+ },
+ },
+ },
+ mixin: Behavior({
+ created() {
+ Object.defineProperty(this, 'parent', {
+ get: () => this.getRelationNodes(path)[0],
+ });
+ Object.defineProperty(this, 'index', {
+ // @ts-ignore
+ get: () => {
+ var _a, _b;
+ return (_b =
+ (_a = this.parent) === null || _a === void 0
+ ? void 0
+ : _a.children) === null || _b === void 0
+ ? void 0
+ : _b.indexOf(this);
+ },
+ });
+ },
+ }),
+ };
+}
+export function useChildren(name, onEffect) {
+ const path = `../${name}/index`;
+ return {
+ relations: {
+ [path]: {
+ type: 'descendant',
+ linked(target) {
+ onEffect && onEffect.call(this, target);
+ },
+ linkChanged(target) {
+ onEffect && onEffect.call(this, target);
+ },
+ unlinked(target) {
+ onEffect && onEffect.call(this, target);
+ },
+ },
+ },
+ mixin: Behavior({
+ created() {
+ Object.defineProperty(this, 'children', {
+ get: () => this.getRelationNodes(path) || [],
+ });
+ },
+ }),
+ };
+}
diff --git a/dist/common/style/clearfix.wxss b/dist/common/style/clearfix.wxss
new file mode 100644
index 0000000..a0ca838
--- /dev/null
+++ b/dist/common/style/clearfix.wxss
@@ -0,0 +1 @@
+.van-clearfix:after{display:table;clear:both;content:""}
\ No newline at end of file
diff --git a/dist/common/style/ellipsis.wxss b/dist/common/style/ellipsis.wxss
new file mode 100644
index 0000000..1e9dbc9
--- /dev/null
+++ b/dist/common/style/ellipsis.wxss
@@ -0,0 +1 @@
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}
\ No newline at end of file
diff --git a/dist/common/style/hairline.wxss b/dist/common/style/hairline.wxss
new file mode 100644
index 0000000..49b9e65
--- /dev/null
+++ b/dist/common/style/hairline.wxss
@@ -0,0 +1 @@
+.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file
diff --git a/dist/common/style/mixins/clearfix.wxss b/dist/common/style/mixins/clearfix.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/dist/common/style/mixins/ellipsis.wxss b/dist/common/style/mixins/ellipsis.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/dist/common/style/mixins/hairline.wxss b/dist/common/style/mixins/hairline.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/dist/common/style/theme.wxss b/dist/common/style/theme.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/dist/common/style/var.wxss b/dist/common/style/var.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/dist/common/utils.d.ts b/dist/common/utils.d.ts
new file mode 100644
index 0000000..59dbbfb
--- /dev/null
+++ b/dist/common/utils.d.ts
@@ -0,0 +1,31 @@
+///
+export { isDef } from './validator';
+export declare function range(num: number, min: number, max: number): number;
+export declare function nextTick(cb: (...args: any[]) => void): void;
+export declare function getSystemInfoSync(): WechatMiniprogram.SystemInfo;
+export declare function addUnit(value?: string | number): string | undefined;
+export declare function requestAnimationFrame(
+ cb: () => void
+): number | WechatMiniprogram.NodesRef;
+export declare function pickExclude(obj: unknown, keys: string[]): {};
+export declare function getRect(
+ context: WechatMiniprogram.Component.TrivialInstance,
+ selector: string
+): Promise;
+export declare function getAllRect(
+ context: WechatMiniprogram.Component.TrivialInstance,
+ selector: string
+): Promise;
+export declare function groupSetData(
+ context: WechatMiniprogram.Component.TrivialInstance,
+ cb: () => void
+): void;
+export declare function toPromise(
+ promiseLike: Promise | unknown
+): Promise;
+export declare function getCurrentPage(): T &
+ WechatMiniprogram.OptionalInterface &
+ WechatMiniprogram.Page.InstanceProperties &
+ WechatMiniprogram.Page.InstanceMethods &
+ WechatMiniprogram.Page.Data &
+ WechatMiniprogram.IAnyObject;
diff --git a/dist/common/utils.js b/dist/common/utils.js
new file mode 100644
index 0000000..15555dd
--- /dev/null
+++ b/dist/common/utils.js
@@ -0,0 +1,90 @@
+import { isDef, isNumber, isPlainObject, isPromise } from './validator';
+import { canIUseGroupSetData, canIUseNextTick } from './version';
+export { isDef } from './validator';
+export function range(num, min, max) {
+ return Math.min(Math.max(num, min), max);
+}
+export function nextTick(cb) {
+ if (canIUseNextTick()) {
+ wx.nextTick(cb);
+ } else {
+ setTimeout(() => {
+ cb();
+ }, 1000 / 30);
+ }
+}
+let systemInfo;
+export function getSystemInfoSync() {
+ if (systemInfo == null) {
+ systemInfo = wx.getSystemInfoSync();
+ }
+ return systemInfo;
+}
+export function addUnit(value) {
+ if (!isDef(value)) {
+ return undefined;
+ }
+ value = String(value);
+ return isNumber(value) ? `${value}px` : value;
+}
+export function requestAnimationFrame(cb) {
+ const systemInfo = getSystemInfoSync();
+ if (systemInfo.platform === 'devtools') {
+ return setTimeout(() => {
+ cb();
+ }, 1000 / 30);
+ }
+ return wx
+ .createSelectorQuery()
+ .selectViewport()
+ .boundingClientRect()
+ .exec(() => {
+ cb();
+ });
+}
+export function pickExclude(obj, keys) {
+ if (!isPlainObject(obj)) {
+ return {};
+ }
+ return Object.keys(obj).reduce((prev, key) => {
+ if (!keys.includes(key)) {
+ prev[key] = obj[key];
+ }
+ return prev;
+ }, {});
+}
+export function getRect(context, selector) {
+ return new Promise((resolve) => {
+ wx.createSelectorQuery()
+ .in(context)
+ .select(selector)
+ .boundingClientRect()
+ .exec((rect = []) => resolve(rect[0]));
+ });
+}
+export function getAllRect(context, selector) {
+ return new Promise((resolve) => {
+ wx.createSelectorQuery()
+ .in(context)
+ .selectAll(selector)
+ .boundingClientRect()
+ .exec((rect = []) => resolve(rect[0]));
+ });
+}
+export function groupSetData(context, cb) {
+ if (canIUseGroupSetData()) {
+ context.groupSetData(cb);
+ } else {
+ cb();
+ }
+}
+export function toPromise(promiseLike) {
+ if (isPromise(promiseLike)) {
+ return promiseLike;
+ }
+ return Promise.resolve(promiseLike);
+}
+export function getCurrentPage() {
+ const pages = getCurrentPages();
+ return pages[pages.length - 1];
+}
diff --git a/dist/common/validator.d.ts b/dist/common/validator.d.ts
new file mode 100644
index 0000000..ae7c48f
--- /dev/null
+++ b/dist/common/validator.d.ts
@@ -0,0 +1,11 @@
+export declare function isFunction(val: unknown): val is Function;
+export declare function isPlainObject(
+ val: unknown
+): val is Record;
+export declare function isPromise(val: unknown): val is Promise;
+export declare function isDef(value: unknown): boolean;
+export declare function isObj(x: unknown): x is Record;
+export declare function isNumber(value: string): boolean;
+export declare function isBoolean(value: unknown): value is boolean;
+export declare function isImageUrl(url: string): boolean;
+export declare function isVideoUrl(url: string): boolean;
diff --git a/dist/common/validator.js b/dist/common/validator.js
new file mode 100644
index 0000000..a6d416c
--- /dev/null
+++ b/dist/common/validator.js
@@ -0,0 +1,31 @@
+// eslint-disable-next-line @typescript-eslint/ban-types
+export function isFunction(val) {
+ return typeof val === 'function';
+}
+export function isPlainObject(val) {
+ return val !== null && typeof val === 'object' && !Array.isArray(val);
+}
+export function isPromise(val) {
+ return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch);
+}
+export function isDef(value) {
+ return value !== undefined && value !== null;
+}
+export function isObj(x) {
+ const type = typeof x;
+ return x !== null && (type === 'object' || type === 'function');
+}
+export function isNumber(value) {
+ return /^\d+(\.\d+)?$/.test(value);
+}
+export function isBoolean(value) {
+ return typeof value === 'boolean';
+}
+const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
+const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i;
+export function isImageUrl(url) {
+ return IMAGE_REGEXP.test(url);
+}
+export function isVideoUrl(url) {
+ return VIDEO_REGEXP.test(url);
+}
diff --git a/dist/common/version.d.ts b/dist/common/version.d.ts
new file mode 100644
index 0000000..988b226
--- /dev/null
+++ b/dist/common/version.d.ts
@@ -0,0 +1,7 @@
+export declare function canIUseModel(): boolean;
+export declare function canIUseFormFieldButton(): boolean;
+export declare function canIUseAnimate(): boolean;
+export declare function canIUseGroupSetData(): boolean;
+export declare function canIUseNextTick(): boolean;
+export declare function canIUseCanvas2d(): boolean;
+export declare function canIUseGetUserProfile(): boolean;
diff --git a/dist/common/version.js b/dist/common/version.js
new file mode 100644
index 0000000..6444d7b
--- /dev/null
+++ b/dist/common/version.js
@@ -0,0 +1,48 @@
+import { getSystemInfoSync } from './utils';
+function compareVersion(v1, v2) {
+ v1 = v1.split('.');
+ v2 = v2.split('.');
+ const len = Math.max(v1.length, v2.length);
+ while (v1.length < len) {
+ v1.push('0');
+ }
+ while (v2.length < len) {
+ v2.push('0');
+ }
+ for (let i = 0; i < len; i++) {
+ const num1 = parseInt(v1[i], 10);
+ const num2 = parseInt(v2[i], 10);
+ if (num1 > num2) {
+ return 1;
+ }
+ if (num1 < num2) {
+ return -1;
+ }
+ }
+ return 0;
+}
+function gte(version) {
+ const system = getSystemInfoSync();
+ return compareVersion(system.SDKVersion, version) >= 0;
+}
+export function canIUseModel() {
+ return gte('2.9.3');
+}
+export function canIUseFormFieldButton() {
+ return gte('2.10.3');
+}
+export function canIUseAnimate() {
+ return gte('2.9.0');
+}
+export function canIUseGroupSetData() {
+ return gte('2.4.0');
+}
+export function canIUseNextTick() {
+ return wx.canIUse('nextTick');
+}
+export function canIUseCanvas2d() {
+ return gte('2.9.0');
+}
+export function canIUseGetUserProfile() {
+ return !!wx.getUserProfile;
+}
diff --git a/dist/icon/index.d.ts b/dist/icon/index.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/dist/icon/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/icon/index.js b/dist/icon/index.js
new file mode 100644
index 0000000..75f2c94
--- /dev/null
+++ b/dist/icon/index.js
@@ -0,0 +1,20 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+ props: {
+ dot: Boolean,
+ info: null,
+ size: null,
+ color: String,
+ customStyle: String,
+ classPrefix: {
+ type: String,
+ value: 'van-icon',
+ },
+ name: String,
+ },
+ methods: {
+ onClick() {
+ this.$emit('click');
+ },
+ },
+});
diff --git a/dist/icon/index.json b/dist/icon/index.json
new file mode 100644
index 0000000..bf0ebe0
--- /dev/null
+++ b/dist/icon/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-info": "../info/index"
+ }
+}
diff --git a/dist/icon/index.wxml b/dist/icon/index.wxml
new file mode 100644
index 0000000..3c70174
--- /dev/null
+++ b/dist/icon/index.wxml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
diff --git a/dist/icon/index.wxs b/dist/icon/index.wxs
new file mode 100644
index 0000000..45e3aa0
--- /dev/null
+++ b/dist/icon/index.wxs
@@ -0,0 +1,39 @@
+/* eslint-disable */
+var style = require('../wxs/style.wxs');
+var addUnit = require('../wxs/add-unit.wxs');
+
+function isImage(name) {
+ return name.indexOf('/') !== -1;
+}
+
+function rootClass(data) {
+ var classes = ['custom-class'];
+
+ if (data.classPrefix != null) {
+ classes.push(data.classPrefix);
+ }
+
+ if (isImage(data.name)) {
+ classes.push('van-icon--image');
+ } else if (data.classPrefix != null) {
+ classes.push(data.classPrefix + '-' + data.name);
+ }
+
+ return classes.join(' ');
+}
+
+function rootStyle(data) {
+ return style([
+ {
+ color: data.color,
+ 'font-size': addUnit(data.size),
+ },
+ data.customStyle,
+ ]);
+}
+
+module.exports = {
+ isImage: isImage,
+ rootClass: rootClass,
+ rootStyle: rootStyle,
+};
diff --git a/dist/icon/index.wxss b/dist/icon/index.wxss
new file mode 100644
index 0000000..a9085c8
--- /dev/null
+++ b/dist/icon/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-icon{position:relative;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon,.van-icon:before{display:inline-block}.van-icon-exchange:before{content:"\e6af"}.van-icon-eye:before{content:"\e6b0"}.van-icon-enlarge:before{content:"\e6b1"}.van-icon-expand-o:before{content:"\e6b2"}.van-icon-eye-o:before{content:"\e6b3"}.van-icon-expand:before{content:"\e6b4"}.van-icon-filter-o:before{content:"\e6b5"}.van-icon-fire:before{content:"\e6b6"}.van-icon-fail:before{content:"\e6b7"}.van-icon-failure:before{content:"\e6b8"}.van-icon-fire-o:before{content:"\e6b9"}.van-icon-flag-o:before{content:"\e6ba"}.van-icon-font:before{content:"\e6bb"}.van-icon-font-o:before{content:"\e6bc"}.van-icon-gem-o:before{content:"\e6bd"}.van-icon-flower-o:before{content:"\e6be"}.van-icon-gem:before{content:"\e6bf"}.van-icon-gift-card:before{content:"\e6c0"}.van-icon-friends:before{content:"\e6c1"}.van-icon-friends-o:before{content:"\e6c2"}.van-icon-gold-coin:before{content:"\e6c3"}.van-icon-gold-coin-o:before{content:"\e6c4"}.van-icon-good-job-o:before{content:"\e6c5"}.van-icon-gift:before{content:"\e6c6"}.van-icon-gift-o:before{content:"\e6c7"}.van-icon-gift-card-o:before{content:"\e6c8"}.van-icon-good-job:before{content:"\e6c9"}.van-icon-home-o:before{content:"\e6ca"}.van-icon-goods-collect:before{content:"\e6cb"}.van-icon-graphic:before{content:"\e6cc"}.van-icon-goods-collect-o:before{content:"\e6cd"}.van-icon-hot-o:before{content:"\e6ce"}.van-icon-info:before{content:"\e6cf"}.van-icon-hotel-o:before{content:"\e6d0"}.van-icon-info-o:before{content:"\e6d1"}.van-icon-hot-sale-o:before{content:"\e6d2"}.van-icon-hot:before{content:"\e6d3"}.van-icon-like:before{content:"\e6d4"}.van-icon-idcard:before{content:"\e6d5"}.van-icon-invition:before{content:"\e6d6"}.van-icon-like-o:before{content:"\e6d7"}.van-icon-hot-sale:before{content:"\e6d8"}.van-icon-location-o:before{content:"\e6d9"}.van-icon-location:before{content:"\e6da"}.van-icon-label:before{content:"\e6db"}.van-icon-lock:before{content:"\e6dc"}.van-icon-label-o:before{content:"\e6dd"}.van-icon-map-marked:before{content:"\e6de"}.van-icon-logistics:before{content:"\e6df"}.van-icon-manager:before{content:"\e6e0"}.van-icon-more:before{content:"\e6e1"}.van-icon-live:before{content:"\e6e2"}.van-icon-manager-o:before{content:"\e6e3"}.van-icon-medal:before{content:"\e6e4"}.van-icon-more-o:before{content:"\e6e5"}.van-icon-music-o:before{content:"\e6e6"}.van-icon-music:before{content:"\e6e7"}.van-icon-new-arrival-o:before{content:"\e6e8"}.van-icon-medal-o:before{content:"\e6e9"}.van-icon-new-o:before{content:"\e6ea"}.van-icon-free-postage:before{content:"\e6eb"}.van-icon-newspaper-o:before{content:"\e6ec"}.van-icon-new-arrival:before{content:"\e6ed"}.van-icon-minus:before{content:"\e6ee"}.van-icon-orders-o:before{content:"\e6ef"}.van-icon-new:before{content:"\e6f0"}.van-icon-paid:before{content:"\e6f1"}.van-icon-notes-o:before{content:"\e6f2"}.van-icon-other-pay:before{content:"\e6f3"}.van-icon-pause-circle:before{content:"\e6f4"}.van-icon-pause:before{content:"\e6f5"}.van-icon-pause-circle-o:before{content:"\e6f6"}.van-icon-peer-pay:before{content:"\e6f7"}.van-icon-pending-payment:before{content:"\e6f8"}.van-icon-passed:before{content:"\e6f9"}.van-icon-plus:before{content:"\e6fa"}.van-icon-phone-circle-o:before{content:"\e6fb"}.van-icon-phone-o:before{content:"\e6fc"}.van-icon-printer:before{content:"\e6fd"}.van-icon-photo-fail:before{content:"\e6fe"}.van-icon-phone:before{content:"\e6ff"}.van-icon-photo-o:before{content:"\e700"}.van-icon-play-circle:before{content:"\e701"}.van-icon-play:before{content:"\e702"}.van-icon-phone-circle:before{content:"\e703"}.van-icon-point-gift-o:before{content:"\e704"}.van-icon-point-gift:before{content:"\e705"}.van-icon-play-circle-o:before{content:"\e706"}.van-icon-shrink:before{content:"\e707"}.van-icon-photo:before{content:"\e708"}.van-icon-qr:before{content:"\e709"}.van-icon-qr-invalid:before{content:"\e70a"}.van-icon-question-o:before{content:"\e70b"}.van-icon-revoke:before{content:"\e70c"}.van-icon-replay:before{content:"\e70d"}.van-icon-service:before{content:"\e70e"}.van-icon-question:before{content:"\e70f"}.van-icon-search:before{content:"\e710"}.van-icon-refund-o:before{content:"\e711"}.van-icon-service-o:before{content:"\e712"}.van-icon-scan:before{content:"\e713"}.van-icon-share:before{content:"\e714"}.van-icon-send-gift-o:before{content:"\e715"}.van-icon-share-o:before{content:"\e716"}.van-icon-setting:before{content:"\e717"}.van-icon-points:before{content:"\e718"}.van-icon-photograph:before{content:"\e719"}.van-icon-shop:before{content:"\e71a"}.van-icon-shop-o:before{content:"\e71b"}.van-icon-shop-collect-o:before{content:"\e71c"}.van-icon-shop-collect:before{content:"\e71d"}.van-icon-smile:before{content:"\e71e"}.van-icon-shopping-cart-o:before{content:"\e71f"}.van-icon-sign:before{content:"\e720"}.van-icon-sort:before{content:"\e721"}.van-icon-star-o:before{content:"\e722"}.van-icon-smile-comment-o:before{content:"\e723"}.van-icon-stop:before{content:"\e724"}.van-icon-stop-circle-o:before{content:"\e725"}.van-icon-smile-o:before{content:"\e726"}.van-icon-star:before{content:"\e727"}.van-icon-success:before{content:"\e728"}.van-icon-stop-circle:before{content:"\e729"}.van-icon-records:before{content:"\e72a"}.van-icon-shopping-cart:before{content:"\e72b"}.van-icon-tosend:before{content:"\e72c"}.van-icon-todo-list:before{content:"\e72d"}.van-icon-thumb-circle-o:before{content:"\e72e"}.van-icon-thumb-circle:before{content:"\e72f"}.van-icon-umbrella-circle:before{content:"\e730"}.van-icon-underway:before{content:"\e731"}.van-icon-upgrade:before{content:"\e732"}.van-icon-todo-list-o:before{content:"\e733"}.van-icon-tv-o:before{content:"\e734"}.van-icon-underway-o:before{content:"\e735"}.van-icon-user-o:before{content:"\e736"}.van-icon-vip-card-o:before{content:"\e737"}.van-icon-vip-card:before{content:"\e738"}.van-icon-send-gift:before{content:"\e739"}.van-icon-wap-home:before{content:"\e73a"}.van-icon-wap-nav:before{content:"\e73b"}.van-icon-volume-o:before{content:"\e73c"}.van-icon-video:before{content:"\e73d"}.van-icon-wap-home-o:before{content:"\e73e"}.van-icon-volume:before{content:"\e73f"}.van-icon-warning:before{content:"\e740"}.van-icon-weapp-nav:before{content:"\e741"}.van-icon-wechat-pay:before{content:"\e742"}.van-icon-warning-o:before{content:"\e743"}.van-icon-wechat:before{content:"\e744"}.van-icon-setting-o:before{content:"\e745"}.van-icon-youzan-shield:before{content:"\e746"}.van-icon-warn-o:before{content:"\e747"}.van-icon-smile-comment:before{content:"\e748"}.van-icon-user-circle-o:before{content:"\e749"}.van-icon-video-o:before{content:"\e74a"}.van-icon-add-square:before{content:"\e65c"}.van-icon-add:before{content:"\e65d"}.van-icon-arrow-down:before{content:"\e65e"}.van-icon-arrow-up:before{content:"\e65f"}.van-icon-arrow:before{content:"\e660"}.van-icon-after-sale:before{content:"\e661"}.van-icon-add-o:before{content:"\e662"}.van-icon-alipay:before{content:"\e663"}.van-icon-ascending:before{content:"\e664"}.van-icon-apps-o:before{content:"\e665"}.van-icon-aim:before{content:"\e666"}.van-icon-award:before{content:"\e667"}.van-icon-arrow-left:before{content:"\e668"}.van-icon-award-o:before{content:"\e669"}.van-icon-audio:before{content:"\e66a"}.van-icon-bag-o:before{content:"\e66b"}.van-icon-balance-list:before{content:"\e66c"}.van-icon-back-top:before{content:"\e66d"}.van-icon-bag:before{content:"\e66e"}.van-icon-balance-pay:before{content:"\e66f"}.van-icon-balance-o:before{content:"\e670"}.van-icon-bar-chart-o:before{content:"\e671"}.van-icon-bars:before{content:"\e672"}.van-icon-balance-list-o:before{content:"\e673"}.van-icon-birthday-cake-o:before{content:"\e674"}.van-icon-bookmark:before{content:"\e675"}.van-icon-bill:before{content:"\e676"}.van-icon-bell:before{content:"\e677"}.van-icon-browsing-history-o:before{content:"\e678"}.van-icon-browsing-history:before{content:"\e679"}.van-icon-bookmark-o:before{content:"\e67a"}.van-icon-bulb-o:before{content:"\e67b"}.van-icon-bullhorn-o:before{content:"\e67c"}.van-icon-bill-o:before{content:"\e67d"}.van-icon-calendar-o:before{content:"\e67e"}.van-icon-brush-o:before{content:"\e67f"}.van-icon-card:before{content:"\e680"}.van-icon-cart-o:before{content:"\e681"}.van-icon-cart-circle:before{content:"\e682"}.van-icon-cart-circle-o:before{content:"\e683"}.van-icon-cart:before{content:"\e684"}.van-icon-cash-on-deliver:before{content:"\e685"}.van-icon-cash-back-record:before{content:"\e686"}.van-icon-cashier-o:before{content:"\e687"}.van-icon-chart-trending-o:before{content:"\e688"}.van-icon-certificate:before{content:"\e689"}.van-icon-chat:before{content:"\e68a"}.van-icon-clear:before{content:"\e68b"}.van-icon-chat-o:before{content:"\e68c"}.van-icon-checked:before{content:"\e68d"}.van-icon-clock:before{content:"\e68e"}.van-icon-clock-o:before{content:"\e68f"}.van-icon-close:before{content:"\e690"}.van-icon-closed-eye:before{content:"\e691"}.van-icon-circle:before{content:"\e692"}.van-icon-cluster-o:before{content:"\e693"}.van-icon-column:before{content:"\e694"}.van-icon-comment-circle-o:before{content:"\e695"}.van-icon-cluster:before{content:"\e696"}.van-icon-comment:before{content:"\e697"}.van-icon-comment-o:before{content:"\e698"}.van-icon-comment-circle:before{content:"\e699"}.van-icon-completed:before{content:"\e69a"}.van-icon-credit-pay:before{content:"\e69b"}.van-icon-coupon:before{content:"\e69c"}.van-icon-debit-pay:before{content:"\e69d"}.van-icon-coupon-o:before{content:"\e69e"}.van-icon-contact:before{content:"\e69f"}.van-icon-descending:before{content:"\e6a0"}.van-icon-desktop-o:before{content:"\e6a1"}.van-icon-diamond-o:before{content:"\e6a2"}.van-icon-description:before{content:"\e6a3"}.van-icon-delete:before{content:"\e6a4"}.van-icon-diamond:before{content:"\e6a5"}.van-icon-delete-o:before{content:"\e6a6"}.van-icon-cross:before{content:"\e6a7"}.van-icon-edit:before{content:"\e6a8"}.van-icon-ellipsis:before{content:"\e6a9"}.van-icon-down:before{content:"\e6aa"}.van-icon-discount:before{content:"\e6ab"}.van-icon-ecard-pay:before{content:"\e6ac"}.van-icon-envelop-o:before{content:"\e6ae"}@font-face{font-weight:400;font-style:normal;font-display:auto;font-family:vant-icon;src:url(https://at.alicdn.com/t/font_2553510_7cds497uxwn.woff2?t=1621320123079) format("woff2"),url(https://at.alicdn.com/t/font_2553510_7cds497uxwn.woff?t=1621320123079) format("woff"),url(https://at.alicdn.com/t/font_2553510_7cds497uxwn.ttf?t=1621320123079) format("truetype")}:host{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-icon--image{width:1em;height:1em}.van-icon__image{width:100%;height:100%}.van-icon__info{z-index:1}
\ No newline at end of file
diff --git a/dist/info/index.d.ts b/dist/info/index.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/dist/info/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/info/index.js b/dist/info/index.js
new file mode 100644
index 0000000..489f39c
--- /dev/null
+++ b/dist/info/index.js
@@ -0,0 +1,8 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+ props: {
+ dot: Boolean,
+ info: null,
+ customStyle: String,
+ },
+});
diff --git a/dist/info/index.json b/dist/info/index.json
new file mode 100644
index 0000000..467ce29
--- /dev/null
+++ b/dist/info/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/dist/info/index.wxml b/dist/info/index.wxml
new file mode 100644
index 0000000..b39b524
--- /dev/null
+++ b/dist/info/index.wxml
@@ -0,0 +1,7 @@
+
+
+{{ dot ? '' : info }}
diff --git a/dist/info/index.wxss b/dist/info/index.wxss
new file mode 100644
index 0000000..953136a
--- /dev/null
+++ b/dist/info/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-info{position:absolute;top:0;right:0;display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;white-space:nowrap;-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%);-webkit-transform-origin:100%;transform-origin:100%;height:16px;height:var(--info-size,16px);min-width:16px;min-width:var(--info-size,16px);padding:0 3px;padding:var(--info-padding,0 3px);color:#fff;color:var(--info-color,#fff);font-weight:500;font-weight:var(--info-font-weight,500);font-size:12px;font-size:var(--info-font-size,12px);font-family:-apple-system-font,Helvetica Neue,Arial,sans-serif;font-family:var(--info-font-family,-apple-system-font,Helvetica Neue,Arial,sans-serif);background-color:#ee0a24;background-color:var(--info-background-color,#ee0a24);border:1px solid #fff;border:var(--info-border-width,1px) solid var(--white,#fff);border-radius:16px;border-radius:var(--info-size,16px)}.van-info--dot{min-width:0;border-radius:100%;width:8px;width:var(--info-dot-size,8px);height:8px;height:var(--info-dot-size,8px);background-color:#ee0a24;background-color:var(--info-dot-color,#ee0a24)}
\ No newline at end of file
diff --git a/dist/mixins/basic.d.ts b/dist/mixins/basic.d.ts
new file mode 100644
index 0000000..b273369
--- /dev/null
+++ b/dist/mixins/basic.d.ts
@@ -0,0 +1 @@
+export declare const basic: string;
diff --git a/dist/mixins/basic.js b/dist/mixins/basic.js
new file mode 100644
index 0000000..9c59dc3
--- /dev/null
+++ b/dist/mixins/basic.js
@@ -0,0 +1,11 @@
+export const basic = Behavior({
+ methods: {
+ $emit(name, detail, options) {
+ this.triggerEvent(name, detail, options);
+ },
+ set(data) {
+ this.setData(data);
+ return new Promise((resolve) => wx.nextTick(resolve));
+ },
+ },
+});
diff --git a/dist/mixins/button.d.ts b/dist/mixins/button.d.ts
new file mode 100644
index 0000000..b51db87
--- /dev/null
+++ b/dist/mixins/button.d.ts
@@ -0,0 +1 @@
+export declare const button: string;
diff --git a/dist/mixins/button.js b/dist/mixins/button.js
new file mode 100644
index 0000000..320b561
--- /dev/null
+++ b/dist/mixins/button.js
@@ -0,0 +1,41 @@
+import { canIUseGetUserProfile } from '../common/version';
+export const button = Behavior({
+ externalClasses: ['hover-class'],
+ properties: {
+ id: String,
+ lang: String,
+ businessId: Number,
+ sessionFrom: String,
+ sendMessageTitle: String,
+ sendMessagePath: String,
+ sendMessageImg: String,
+ showMessageCard: Boolean,
+ appParameter: String,
+ ariaLabel: String,
+ openType: String,
+ getUserProfileDesc: String,
+ },
+ data: {
+ canIUseGetUserProfile: canIUseGetUserProfile(),
+ },
+ methods: {
+ onGetUserInfo(event) {
+ this.triggerEvent('getuserinfo', event.detail);
+ },
+ onContact(event) {
+ this.triggerEvent('contact', event.detail);
+ },
+ onGetPhoneNumber(event) {
+ this.triggerEvent('getphonenumber', event.detail);
+ },
+ onError(event) {
+ this.triggerEvent('error', event.detail);
+ },
+ onLaunchApp(event) {
+ this.triggerEvent('launchapp', event.detail);
+ },
+ onOpenSetting(event) {
+ this.triggerEvent('opensetting', event.detail);
+ },
+ },
+});
diff --git a/dist/mixins/link.d.ts b/dist/mixins/link.d.ts
new file mode 100644
index 0000000..d58043b
--- /dev/null
+++ b/dist/mixins/link.d.ts
@@ -0,0 +1 @@
+export declare const link: string;
diff --git a/dist/mixins/link.js b/dist/mixins/link.js
new file mode 100644
index 0000000..4612e34
--- /dev/null
+++ b/dist/mixins/link.js
@@ -0,0 +1,24 @@
+export const link = Behavior({
+ properties: {
+ url: String,
+ linkType: {
+ type: String,
+ value: 'navigateTo',
+ },
+ },
+ methods: {
+ jumpLink(urlKey = 'url') {
+ const url = this.data[urlKey];
+ if (url) {
+ if (
+ this.data.linkType === 'navigateTo' &&
+ getCurrentPages().length > 9
+ ) {
+ wx.redirectTo({ url });
+ } else {
+ wx[this.data.linkType]({ url });
+ }
+ }
+ },
+ },
+});
diff --git a/dist/mixins/page-scroll.d.ts b/dist/mixins/page-scroll.d.ts
new file mode 100644
index 0000000..a76f542
--- /dev/null
+++ b/dist/mixins/page-scroll.d.ts
@@ -0,0 +1,8 @@
+///
+declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption;
+declare type Scroller = (
+ this: WechatMiniprogram.Component.TrivialInstance,
+ event?: IPageScrollOption
+) => void;
+export declare const pageScrollMixin: (scroller: Scroller) => string;
+export {};
diff --git a/dist/mixins/page-scroll.js b/dist/mixins/page-scroll.js
new file mode 100644
index 0000000..9e4a5f3
--- /dev/null
+++ b/dist/mixins/page-scroll.js
@@ -0,0 +1,33 @@
+import { getCurrentPage } from '../common/utils';
+function onPageScroll(event) {
+ const { vanPageScroller = [] } = getCurrentPage();
+ vanPageScroller.forEach((scroller) => {
+ if (typeof scroller === 'function') {
+ // @ts-ignore
+ scroller(event);
+ }
+ });
+}
+export const pageScrollMixin = (scroller) =>
+ Behavior({
+ attached() {
+ const page = getCurrentPage();
+ if (Array.isArray(page.vanPageScroller)) {
+ page.vanPageScroller.push(scroller.bind(this));
+ } else {
+ page.vanPageScroller =
+ typeof page.onPageScroll === 'function'
+ ? [page.onPageScroll.bind(page), scroller.bind(this)]
+ : [scroller.bind(this)];
+ }
+ page.onPageScroll = onPageScroll;
+ },
+ detached() {
+ var _a;
+ const page = getCurrentPage();
+ page.vanPageScroller =
+ ((_a = page.vanPageScroller) === null || _a === void 0
+ ? void 0
+ : _a.filter((item) => item !== scroller)) || [];
+ },
+ });
diff --git a/dist/mixins/touch.d.ts b/dist/mixins/touch.d.ts
new file mode 100644
index 0000000..35ee831
--- /dev/null
+++ b/dist/mixins/touch.d.ts
@@ -0,0 +1 @@
+export declare const touch: string;
diff --git a/dist/mixins/touch.js b/dist/mixins/touch.js
new file mode 100644
index 0000000..c6e94c3
--- /dev/null
+++ b/dist/mixins/touch.js
@@ -0,0 +1,37 @@
+// @ts-nocheck
+const MIN_DISTANCE = 10;
+function getDirection(x, y) {
+ if (x > y && x > MIN_DISTANCE) {
+ return 'horizontal';
+ }
+ if (y > x && y > MIN_DISTANCE) {
+ return 'vertical';
+ }
+ return '';
+}
+export const touch = Behavior({
+ methods: {
+ resetTouchStatus() {
+ this.direction = '';
+ this.deltaX = 0;
+ this.deltaY = 0;
+ this.offsetX = 0;
+ this.offsetY = 0;
+ },
+ touchStart(event) {
+ this.resetTouchStatus();
+ const touch = event.touches[0];
+ this.startX = touch.clientX;
+ this.startY = touch.clientY;
+ },
+ touchMove(event) {
+ const touch = event.touches[0];
+ this.deltaX = touch.clientX - this.startX;
+ this.deltaY = touch.clientY - this.startY;
+ this.offsetX = Math.abs(this.deltaX);
+ this.offsetY = Math.abs(this.deltaY);
+ this.direction =
+ this.direction || getDirection(this.offsetX, this.offsetY);
+ },
+ },
+});
diff --git a/dist/mixins/transition.d.ts b/dist/mixins/transition.d.ts
new file mode 100644
index 0000000..dd829e5
--- /dev/null
+++ b/dist/mixins/transition.d.ts
@@ -0,0 +1 @@
+export declare function transition(showDefaultValue: boolean): string;
diff --git a/dist/mixins/transition.js b/dist/mixins/transition.js
new file mode 100644
index 0000000..3b3ec77
--- /dev/null
+++ b/dist/mixins/transition.js
@@ -0,0 +1,115 @@
+// @ts-nocheck
+import { requestAnimationFrame } from '../common/utils';
+import { isObj } from '../common/validator';
+const getClassNames = (name) => ({
+ enter: `van-${name}-enter van-${name}-enter-active enter-class enter-active-class`,
+ 'enter-to': `van-${name}-enter-to van-${name}-enter-active enter-to-class enter-active-class`,
+ leave: `van-${name}-leave van-${name}-leave-active leave-class leave-active-class`,
+ 'leave-to': `van-${name}-leave-to van-${name}-leave-active leave-to-class leave-active-class`,
+});
+export function transition(showDefaultValue) {
+ return Behavior({
+ properties: {
+ customStyle: String,
+ // @ts-ignore
+ show: {
+ type: Boolean,
+ value: showDefaultValue,
+ observer: 'observeShow',
+ },
+ // @ts-ignore
+ duration: {
+ type: null,
+ value: 300,
+ observer: 'observeDuration',
+ },
+ name: {
+ type: String,
+ value: 'fade',
+ },
+ },
+ data: {
+ type: '',
+ inited: false,
+ display: false,
+ },
+ ready() {
+ if (this.data.show === true) {
+ this.observeShow(true, false);
+ }
+ },
+ methods: {
+ observeShow(value, old) {
+ if (value === old) {
+ return;
+ }
+ value ? this.enter() : this.leave();
+ },
+ enter() {
+ const { duration, name } = this.data;
+ const classNames = getClassNames(name);
+ const currentDuration = isObj(duration) ? duration.enter : duration;
+ this.status = 'enter';
+ this.$emit('before-enter');
+ requestAnimationFrame(() => {
+ if (this.status !== 'enter') {
+ return;
+ }
+ this.$emit('enter');
+ this.setData({
+ inited: true,
+ display: true,
+ classes: classNames.enter,
+ currentDuration,
+ });
+ requestAnimationFrame(() => {
+ if (this.status !== 'enter') {
+ return;
+ }
+ this.transitionEnded = false;
+ this.setData({ classes: classNames['enter-to'] });
+ });
+ });
+ },
+ leave() {
+ if (!this.data.display) {
+ return;
+ }
+ const { duration, name } = this.data;
+ const classNames = getClassNames(name);
+ const currentDuration = isObj(duration) ? duration.leave : duration;
+ this.status = 'leave';
+ this.$emit('before-leave');
+ requestAnimationFrame(() => {
+ if (this.status !== 'leave') {
+ return;
+ }
+ this.$emit('leave');
+ this.setData({
+ classes: classNames.leave,
+ currentDuration,
+ });
+ requestAnimationFrame(() => {
+ if (this.status !== 'leave') {
+ return;
+ }
+ this.transitionEnded = false;
+ setTimeout(() => this.onTransitionEnd(), currentDuration);
+ this.setData({ classes: classNames['leave-to'] });
+ });
+ });
+ },
+ onTransitionEnd() {
+ if (this.transitionEnded) {
+ return;
+ }
+ this.transitionEnded = true;
+ this.$emit(`after-${this.status}`);
+ const { show, display } = this.data;
+ if (!show && display) {
+ this.setData({ display: false });
+ }
+ },
+ },
+ });
+}
diff --git a/dist/wxs/add-unit.wxs b/dist/wxs/add-unit.wxs
new file mode 100644
index 0000000..4f33462
--- /dev/null
+++ b/dist/wxs/add-unit.wxs
@@ -0,0 +1,12 @@
+/* eslint-disable */
+var REGEXP = getRegExp('^-?\d+(\.\d+)?$');
+
+function addUnit(value) {
+ if (value == null) {
+ return undefined;
+ }
+
+ return REGEXP.test('' + value) ? value + 'px' : value;
+}
+
+module.exports = addUnit;
diff --git a/dist/wxs/array.wxs b/dist/wxs/array.wxs
new file mode 100644
index 0000000..610089c
--- /dev/null
+++ b/dist/wxs/array.wxs
@@ -0,0 +1,5 @@
+function isArray(array) {
+ return array && array.constructor === 'Array';
+}
+
+module.exports.isArray = isArray;
diff --git a/dist/wxs/bem.wxs b/dist/wxs/bem.wxs
new file mode 100644
index 0000000..1efa129
--- /dev/null
+++ b/dist/wxs/bem.wxs
@@ -0,0 +1,39 @@
+/* eslint-disable */
+var array = require('./array.wxs');
+var object = require('./object.wxs');
+var PREFIX = 'van-';
+
+function join(name, mods) {
+ name = PREFIX + name;
+ mods = mods.map(function(mod) {
+ return name + '--' + mod;
+ });
+ mods.unshift(name);
+ return mods.join(' ');
+}
+
+function traversing(mods, conf) {
+ if (!conf) {
+ return;
+ }
+
+ if (typeof conf === 'string' || typeof conf === 'number') {
+ mods.push(conf);
+ } else if (array.isArray(conf)) {
+ conf.forEach(function(item) {
+ traversing(mods, item);
+ });
+ } else if (typeof conf === 'object') {
+ object.keys(conf).forEach(function(key) {
+ conf[key] && mods.push(key);
+ });
+ }
+}
+
+function bem(name, conf) {
+ var mods = [];
+ traversing(mods, conf);
+ return join(name, mods);
+}
+
+module.exports = bem;
diff --git a/dist/wxs/memoize.wxs b/dist/wxs/memoize.wxs
new file mode 100644
index 0000000..8f7f46d
--- /dev/null
+++ b/dist/wxs/memoize.wxs
@@ -0,0 +1,55 @@
+/**
+ * Simple memoize
+ * wxs doesn't support fn.apply, so this memoize only support up to 2 args
+ */
+/* eslint-disable */
+
+function isPrimitive(value) {
+ var type = typeof value;
+ return (
+ type === 'boolean' ||
+ type === 'number' ||
+ type === 'string' ||
+ type === 'undefined' ||
+ value === null
+ );
+}
+
+// mock simple fn.call in wxs
+function call(fn, args) {
+ if (args.length === 2) {
+ return fn(args[0], args[1]);
+ }
+
+ if (args.length === 1) {
+ return fn(args[0]);
+ }
+
+ return fn();
+}
+
+function serializer(args) {
+ if (args.length === 1 && isPrimitive(args[0])) {
+ return args[0];
+ }
+ var obj = {};
+ for (var i = 0; i < args.length; i++) {
+ obj['key' + i] = args[i];
+ }
+ return JSON.stringify(obj);
+}
+
+function memoize(fn) {
+ var cache = {};
+
+ return function() {
+ var key = serializer(arguments);
+ if (cache[key] === undefined) {
+ cache[key] = call(fn, arguments);
+ }
+
+ return cache[key];
+ };
+}
+
+module.exports = memoize;
diff --git a/dist/wxs/object.wxs b/dist/wxs/object.wxs
new file mode 100644
index 0000000..e077107
--- /dev/null
+++ b/dist/wxs/object.wxs
@@ -0,0 +1,13 @@
+/* eslint-disable */
+var REGEXP = getRegExp('{|}|"', 'g');
+
+function keys(obj) {
+ return JSON.stringify(obj)
+ .replace(REGEXP, '')
+ .split(',')
+ .map(function(item) {
+ return item.split(':')[0];
+ });
+}
+
+module.exports.keys = keys;
diff --git a/dist/wxs/style.wxs b/dist/wxs/style.wxs
new file mode 100644
index 0000000..d88ca7c
--- /dev/null
+++ b/dist/wxs/style.wxs
@@ -0,0 +1,42 @@
+/* eslint-disable */
+var object = require('./object.wxs');
+var array = require('./array.wxs');
+
+function kebabCase(word) {
+ var newWord = word
+ .replace(getRegExp("[A-Z]", 'g'), function (i) {
+ return '-' + i;
+ })
+ .toLowerCase()
+
+ return newWord;
+}
+
+function style(styles) {
+ if (array.isArray(styles)) {
+ return styles
+ .filter(function (item) {
+ return item != null && item !== '';
+ })
+ .map(function (item) {
+ return style(item);
+ })
+ .join(';');
+ }
+
+ if ('Object' === styles.constructor) {
+ return object
+ .keys(styles)
+ .filter(function (key) {
+ return styles[key] != null && styles[key] !== '';
+ })
+ .map(function (key) {
+ return [kebabCase(key), [styles[key]]].join(':');
+ })
+ .join(';');
+ }
+
+ return styles;
+}
+
+module.exports = style;
diff --git a/dist/wxs/utils.wxs b/dist/wxs/utils.wxs
new file mode 100644
index 0000000..f66d33a
--- /dev/null
+++ b/dist/wxs/utils.wxs
@@ -0,0 +1,10 @@
+/* eslint-disable */
+var bem = require('./bem.wxs');
+var memoize = require('./memoize.wxs');
+var addUnit = require('./add-unit.wxs');
+
+module.exports = {
+ bem: memoize(bem),
+ memoize: memoize,
+ addUnit: addUnit
+};
diff --git a/images/agreement1.png b/images/agreement1.png
new file mode 100644
index 0000000..6e7b3bc
Binary files /dev/null and b/images/agreement1.png differ
diff --git a/images/agreement2.png b/images/agreement2.png
new file mode 100644
index 0000000..feb0b27
Binary files /dev/null and b/images/agreement2.png differ
diff --git a/images/agreement3.png b/images/agreement3.png
new file mode 100644
index 0000000..f56969a
Binary files /dev/null and b/images/agreement3.png differ
diff --git a/images/arrow-r.png b/images/arrow-r.png
new file mode 100644
index 0000000..ba92598
Binary files /dev/null and b/images/arrow-r.png differ
diff --git a/images/back.png b/images/back.png
new file mode 100644
index 0000000..738da3a
Binary files /dev/null and b/images/back.png differ
diff --git a/images/icon-bg.png b/images/icon-bg.png
new file mode 100644
index 0000000..f8d9087
Binary files /dev/null and b/images/icon-bg.png differ
diff --git a/images/income-bg.png b/images/income-bg.png
new file mode 100644
index 0000000..f8d9087
Binary files /dev/null and b/images/income-bg.png differ
diff --git a/images/logo.png b/images/logo.png
new file mode 100644
index 0000000..501e015
Binary files /dev/null and b/images/logo.png differ
diff --git a/images/mail-b.png b/images/mail-b.png
new file mode 100644
index 0000000..35beedc
Binary files /dev/null and b/images/mail-b.png differ
diff --git a/images/mail-c.png b/images/mail-c.png
new file mode 100644
index 0000000..d9f7372
Binary files /dev/null and b/images/mail-c.png differ
diff --git a/images/mail-t.png b/images/mail-t.png
new file mode 100644
index 0000000..034300f
Binary files /dev/null and b/images/mail-t.png differ
diff --git a/images/menu1.png b/images/menu1.png
new file mode 100644
index 0000000..ec2c22c
Binary files /dev/null and b/images/menu1.png differ
diff --git a/images/menu2.png b/images/menu2.png
new file mode 100644
index 0000000..6a2f3b7
Binary files /dev/null and b/images/menu2.png differ
diff --git a/images/menu3.png b/images/menu3.png
new file mode 100644
index 0000000..78877ec
Binary files /dev/null and b/images/menu3.png differ
diff --git a/images/menu4.png b/images/menu4.png
new file mode 100644
index 0000000..dfb1905
Binary files /dev/null and b/images/menu4.png differ
diff --git a/images/menu5.png b/images/menu5.png
new file mode 100644
index 0000000..f743682
Binary files /dev/null and b/images/menu5.png differ
diff --git a/images/menu6.png b/images/menu6.png
new file mode 100644
index 0000000..228a8fd
Binary files /dev/null and b/images/menu6.png differ
diff --git a/images/menu7.png b/images/menu7.png
new file mode 100644
index 0000000..d629bef
Binary files /dev/null and b/images/menu7.png differ
diff --git a/images/menu8.png b/images/menu8.png
new file mode 100644
index 0000000..35e19c2
Binary files /dev/null and b/images/menu8.png differ
diff --git a/images/menu9.png b/images/menu9.png
new file mode 100644
index 0000000..da8d1fb
Binary files /dev/null and b/images/menu9.png differ
diff --git a/images/no1-bg.png b/images/no1-bg.png
new file mode 100644
index 0000000..67c698f
Binary files /dev/null and b/images/no1-bg.png differ
diff --git a/images/no1.png b/images/no1.png
new file mode 100644
index 0000000..d51e10f
Binary files /dev/null and b/images/no1.png differ
diff --git a/images/no2-bg.png b/images/no2-bg.png
new file mode 100644
index 0000000..fb091d8
Binary files /dev/null and b/images/no2-bg.png differ
diff --git a/images/no2.png b/images/no2.png
new file mode 100644
index 0000000..3a0748c
Binary files /dev/null and b/images/no2.png differ
diff --git a/images/no3-bg.png b/images/no3-bg.png
new file mode 100644
index 0000000..ddd63c1
Binary files /dev/null and b/images/no3-bg.png differ
diff --git a/images/no3.png b/images/no3.png
new file mode 100644
index 0000000..69ddb3a
Binary files /dev/null and b/images/no3.png differ
diff --git a/images/pay-btn.png b/images/pay-btn.png
new file mode 100644
index 0000000..9e28ee8
Binary files /dev/null and b/images/pay-btn.png differ
diff --git a/images/pay1.png b/images/pay1.png
new file mode 100644
index 0000000..540cbfd
Binary files /dev/null and b/images/pay1.png differ
diff --git a/images/pay2.png b/images/pay2.png
new file mode 100644
index 0000000..b31c7b1
Binary files /dev/null and b/images/pay2.png differ
diff --git a/images/personalPage-bg.png b/images/personalPage-bg.png
new file mode 100644
index 0000000..150a7c7
Binary files /dev/null and b/images/personalPage-bg.png differ
diff --git a/images/share-btn.png b/images/share-btn.png
new file mode 100644
index 0000000..3bae88b
Binary files /dev/null and b/images/share-btn.png differ
diff --git a/images/shareImg.png b/images/shareImg.png
new file mode 100644
index 0000000..c177af0
Binary files /dev/null and b/images/shareImg.png differ
diff --git a/images/user-title.png b/images/user-title.png
new file mode 100644
index 0000000..b59f88c
Binary files /dev/null and b/images/user-title.png differ
diff --git a/images/userIndex-top-bg.png b/images/userIndex-top-bg.png
new file mode 100644
index 0000000..64b75b9
Binary files /dev/null and b/images/userIndex-top-bg.png differ
diff --git a/pages/index/index.js b/pages/index/index.js
new file mode 100644
index 0000000..6d24502
--- /dev/null
+++ b/pages/index/index.js
@@ -0,0 +1,64 @@
+// index.js
+// 获取应用实例
+const app = getApp()
+
+Page({
+ data: {
+ motto: 'Hello World',
+ userInfo: {},
+ hasUserInfo: false,
+ canIUse: wx.canIUse('button.open-type.getUserInfo'),
+ canIUseGetUserProfile: false,
+ // canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
+ canIUseOpenData:false
+ },
+ onLoad() {
+ if (wx.getUserProfile) {
+ this.setData({
+ canIUseGetUserProfile: true
+ })
+ }
+ },
+ getUserProfile(e) {
+ // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
+ wx.getUserProfile({
+ desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+ success: (response) => {
+ console.log('response',response)
+ wx.login({
+ success: res => {
+ // 发送 res.code 到后台换取 openId, sessionKey, unionId
+ console.log('code:',res.code)
+ let data = {
+ code: res.code,
+ iv: response.iv,
+ encryptedData:response.encryptedData,
+ spread: 0,
+ login_type: 0
+ }
+ app.http('POST','wxapp/auth',data).then(
+ result =>{
+ if(result.data.isSuccess){
+ wx.setStorageSync('token', 'Bearer '+ result.data.data.token);
+ } else{
+ wx.showToast({
+ title: result.data.msg,
+ icon : 'none'
+ })
+ }
+ }
+ )
+ }
+ })
+ }
+ })
+ },
+ getUserInfo(e) {
+ // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息
+ console.log('e',e)
+ this.setData({
+ userInfo: e.detail.userInfo,
+ hasUserInfo: true
+ })
+ }
+})
diff --git a/pages/index/index.json b/pages/index/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/index/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
new file mode 100644
index 0000000..f00d294
--- /dev/null
+++ b/pages/index/index.wxml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 请使用1.4.4及以上版本基础库
+
+
+
+ {{userInfo.nickName}}
+
+
+
+ {{motto}}
+
+
diff --git a/pages/index/index.wxss b/pages/index/index.wxss
new file mode 100644
index 0000000..eb64203
--- /dev/null
+++ b/pages/index/index.wxss
@@ -0,0 +1,19 @@
+/**index.wxss**/
+.userinfo {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ color: #aaa;
+}
+
+.userinfo-avatar {
+ overflow: hidden;
+ width: 128rpx;
+ height: 128rpx;
+ margin: 20rpx;
+ border-radius: 50%;
+}
+
+.usermotto {
+ margin-top: 200px;
+}
\ No newline at end of file
diff --git a/pages/user/agreement/index.js b/pages/user/agreement/index.js
new file mode 100644
index 0000000..5c6d96a
--- /dev/null
+++ b/pages/user/agreement/index.js
@@ -0,0 +1,209 @@
+// pages/user/agreement/index.js
+const app = getApp();
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ navTopHeight: app.globalData.menuTop + app.globalData.navTopHeight + 10,
+ userInfo: null,
+ canIUse: wx.canIUse('button.open-type.getUserInfo'),
+ canIUseGetUserProfile: false,
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ if (wx.getUserProfile) {
+ this.setData({
+ canIUseGetUserProfile: true
+ })
+ }
+ wx.login({
+ success: res => {
+ // 发送 res.code 到后台换取 openId, sessionKey, unionId
+ this.setData({
+ code: res.code
+ })
+ }
+ })
+ let pages = getCurrentPages();
+ console.log(pages)
+ app.http('get','userinfo').then((res)=>{
+ if(res.data.success){
+ wx.setStorageSync('userInfo',res.data.data)
+ this.setData({
+ userInfo: res.data.data
+ })
+ }
+ }).then(()=>{
+ console.log(pages.length)
+ console.log(pages[0].route)
+ if(pages[pages.length - 2]){
+ if(this.data.userInfo.isRecharge && pages[pages.length - 2].route !== 'pages/user/index'){
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/user/index',
+ })
+ },3000)
+ }
+ if(pages[pages.length - 2].route == 'pages/user/completeData/index'){
+ console.log('isRecharge',this.data.userInfo.isRecharge)
+ if(this.data.userInfo.isRecharge == 1){
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/user/index',
+ })
+ },3000)
+ }
+ }
+ } else{
+ if(this.data.userInfo.isRecharge){
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/user/index',
+ })
+ },2000)
+ }
+ }
+ })
+ },
+
+ getUserProfile(e) {
+ // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
+ wx.getUserProfile({
+ desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+ success: (response) => {
+ wx.showLoading({
+ title: '登陆中...',
+ })
+ let data = {
+ code: this.data.code,
+ iv: response.iv,
+ encryptedData:response.encryptedData,
+ spread: 0,
+ login_type: 0
+ }
+ app.http('POST','wxapp/auth',data).then(
+ result =>{
+ if(result.data.success){
+ wx.hideLoading()
+ wx.setStorageSync('token', 'Bearer '+ result.data.data.token);
+ wx.setStorageSync('userInfo', result.data.data.user);
+ wx.showModal({
+ title: "提示",
+ content: '登陆成功!点击确定按钮完善信息',
+ success: res =>{
+ if(res.confirm){
+ if(result.data.data.user.isRecharge == 0){
+ wx.navigateTo({
+ url: '../personalData/index',
+ })
+ } else{
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/user/index',
+ })
+ },1000)
+ }
+ } else{
+ if(result.data.data.user.isRecharge == 0){
+ wx.navigateTo({
+ url: '../personalData/index',
+ })
+ } else{
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/user/index',
+ })
+ },1000)
+ }
+ }
+ }
+ })
+ } else{
+ wx.showToast({
+ title: result.data.msg,
+ icon : 'none'
+ })
+ }
+ }
+ )
+
+ }
+ })
+ },
+ getUserInfo(e) {
+ // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息
+ this.setData({
+ userInfo: e.detail.userInfo,
+ hasUserInfo: true
+ })
+ },
+ toPay(){
+ wx.navigateTo({
+ url: '../personalData/index',
+ })
+ },
+ backPage(){
+ wx.navigateBack({
+ delta: 1,
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ getUser(){
+ this.setData({
+ userInfo: wx.getStorageSync('userInfo')
+ })
+ },
+ onShow: function () {
+ app.getInfo();
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/user/agreement/index.json b/pages/user/agreement/index.json
new file mode 100644
index 0000000..965b8e8
--- /dev/null
+++ b/pages/user/agreement/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationStyle": "custom"
+}
\ No newline at end of file
diff --git a/pages/user/agreement/index.wxml b/pages/user/agreement/index.wxml
new file mode 100644
index 0000000..a0d766c
--- /dev/null
+++ b/pages/user/agreement/index.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 请使用1.4.4及以上版本基础库
+
+
+
diff --git a/pages/user/agreement/index.wxss b/pages/user/agreement/index.wxss
new file mode 100644
index 0000000..91431f8
--- /dev/null
+++ b/pages/user/agreement/index.wxss
@@ -0,0 +1,47 @@
+/* pages/user/agreement/index.wxss */
+.agreement-box{
+ width: 100%;
+ position: relative;
+}
+.agreement-box image{
+ width: 100%;
+ display: block;
+}
+.agreement-box .img{
+ height: 2848rpx;
+}
+.agreement-box .img1{
+ height: 924rpx;
+}
+.agreement-box .img2{
+ height: 834rpx;
+}
+.agreement-box .img3{
+ height: 1090rpx;
+}
+
+.btn-box{
+ width: 440rpx !important;
+ height: 142rpx !important;
+ padding: 0 !important;
+ position: absolute;
+ top: 658rpx;
+ left: 50%;
+ margin-left: -220rpx !important;
+ background: none !important;
+}
+
+.pay-box{
+ width: 100%;
+ min-height: 100vh;
+}
+.pay-box image{
+ width: 100%;
+ display: block;
+}
+.pay-box .img1{
+ height: 609rpx;
+}
+.pay-box .img2{
+ height: 1235rpx;
+}
\ No newline at end of file
diff --git a/pages/user/completeData/index.js b/pages/user/completeData/index.js
new file mode 100644
index 0000000..33b007e
--- /dev/null
+++ b/pages/user/completeData/index.js
@@ -0,0 +1,122 @@
+// pages/user/completeData/index.js
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showMove: false,
+ navTopHeight: app.globalData.menuTop + app.globalData.navTopHeight + 10,
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ showMove: true
+ })
+ },
+ backPage(){
+ wx.navigateBack({
+ delta: 1,
+ })
+ },
+ toPay(){
+ let data = {
+ price: null,
+ from: 'routine',
+ paidPrice: 0
+ }
+ app.http('post','recharge/wechat',data).then((res)=>{
+ if(res.data.success){
+ let orderInfo = res.data.data.data;
+ this.payment(orderInfo)
+ } else{
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none'
+ })
+ }
+ })
+ },
+ payment(orderInfo){
+ // 调用支付接口
+ wx.requestPayment({
+ provider: 'wxpay',
+ ...orderInfo,
+ signType: 'MD5',
+ success: success => {
+ wx.showToast({
+ title: '支付成功',
+ icon: 'success',
+ duration: 3000,
+ })
+ wx.removeStorageSync('form')
+ let time = setTimeout(() => {
+ clearTimeout(time)
+ wx.navigateTo({
+ url: '../agreement/index',
+ })
+ }, 3000)
+ },
+ fail: error => {
+ console.log(error)
+ if (error.errMsg == 'requestPayment:fail cancel') {
+ wx.showToast({ title: '已取消支付', icon: 'none', duration: 5000 })
+ } else {
+ wx.showToast({ title: error || error.msg, icon: 'none', duration: 5000 })
+ }
+ },
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ // onShareAppMessage: function () {
+
+ // }
+})
\ No newline at end of file
diff --git a/pages/user/completeData/index.json b/pages/user/completeData/index.json
new file mode 100644
index 0000000..965b8e8
--- /dev/null
+++ b/pages/user/completeData/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationStyle": "custom"
+}
\ No newline at end of file
diff --git a/pages/user/completeData/index.wxml b/pages/user/completeData/index.wxml
new file mode 100644
index 0000000..1f8e2d9
--- /dev/null
+++ b/pages/user/completeData/index.wxml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 信息已为您保存
+ 成为体验官
+ 前1000名体验官可享限时专属价 ¥199/年
+
+
+
diff --git a/pages/user/completeData/index.wxss b/pages/user/completeData/index.wxss
new file mode 100644
index 0000000..43cd97c
--- /dev/null
+++ b/pages/user/completeData/index.wxss
@@ -0,0 +1,134 @@
+/* pages/user/completeData/index.wxss */
+page{
+ width: 100%;
+ height: 100vh;
+}
+.page-box{
+ width: 100%;
+ height: 100%;
+ position: relative;
+}
+.bg-img-box{
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+.bg-img-box image{
+ width: 100%;
+ height: 100%;
+}
+.mail-box{
+ width: 687rpx;
+ position: absolute;
+ top: 0;
+ left: 50%;
+ transform: translateX(-50%);
+}
+.mail-box .mail-img-box{
+ position: absolute;
+}
+
+.mail-top,.mail-bottom{
+ z-index: 3;
+}
+.mail-top{
+ z-index: 4;
+ top: 10rpx;
+ /* top: 314rpx; */
+}
+.top-move{
+ animation: topMove 2s ease;
+ animation-fill-mode: forwards;
+}
+.mail-top image{
+ width: 687rpx;
+ height: 445rpx;
+}
+.mail-center image{
+ width: 684rpx;
+ height: 648rpx;
+ transform: scale(0.99);
+}
+.mail-center{
+ top: 316rpx;
+}
+.mail-bottom image{
+ width: 687rpx;
+ height: 432rpx;
+
+}
+.mail-bottom{
+ top: 616rpx;
+}
+.btm-move{
+ animation: btmMove 1.5s ease;
+ animation-fill-mode: forwards;
+}
+@keyframes topMove{
+ 0% {
+ top: 10rpx;
+ opacity: 0.8;
+ }
+ 100% {
+ top: 314rpx;
+ opacity: 1;
+ }
+}
+@keyframes btmMove{
+ 0% {
+ top: 616rpx;
+ opacity: 0.2;
+ }
+ 100% {
+ top: 532rpx;
+ opacity: 1;
+ }
+}
+
+.tips{
+ width: 100%;
+ color:#EFDACA;
+ font-size: 40rpx;
+ line-height: 56rpx;
+ position: absolute;
+ top: 1000rpx;
+ text-align: center;
+}
+.word-move{
+ animation: wordMove 1s ease;
+ animation-fill-mode: forwards;
+}
+@keyframes wordMove{
+ 0%{
+ left: -100%;
+ }
+ 100%{
+ left: 0;
+ }
+}
+.pay-btn{
+ width: 686rpx;
+ height: 82rpx;
+ position: absolute;
+ top: 1100rpx;
+ left: 50%;
+ transform: translateX(-50%);
+ background: linear-gradient(322deg, #DEB99F 0%, #E9D1C0 51%, #E3C9B5 100%);
+ border-radius: 62rpx;
+ text-align: center;
+ line-height: 82rpx;
+ color: #946F46;
+}
+.tip{
+ width: 100%;
+ text-align: center;
+ color: #EFDACA;
+ font-size: 32rpx;
+ line-height: 44rpx;
+ position: absolute;
+ top: 1200rpx;
+ left: 50%;
+ transform: translateX(-50%);
+}
\ No newline at end of file
diff --git a/pages/user/incomeDetail/index.js b/pages/user/incomeDetail/index.js
new file mode 100644
index 0000000..10a413c
--- /dev/null
+++ b/pages/user/incomeDetail/index.js
@@ -0,0 +1,86 @@
+// pages/user/incomeDetail/index.js
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ navTopHeight: app.globalData.menuTop + app.globalData.navTopHeight + 10,
+ pageData:{}
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getDetail()
+ },
+ getDetail(){
+ app.http('get','user/profitDetail').then((res)=>{
+ if(res.data.success){
+ this.setData({
+ pageData: res.data.data
+ })
+ } else{
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none'
+ })
+ }
+ })
+ },
+ backPage(){
+ wx.navigateBack({
+ delta: 1,
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ // onShareAppMessage: function () {
+
+ // }
+})
\ No newline at end of file
diff --git a/pages/user/incomeDetail/index.json b/pages/user/incomeDetail/index.json
new file mode 100644
index 0000000..965b8e8
--- /dev/null
+++ b/pages/user/incomeDetail/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationStyle": "custom"
+}
\ No newline at end of file
diff --git a/pages/user/incomeDetail/index.wxml b/pages/user/incomeDetail/index.wxml
new file mode 100644
index 0000000..620d450
--- /dev/null
+++ b/pages/user/incomeDetail/index.wxml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+ 累计邀请
+ {{pageData.inviterCount}}人
+
+
+ 累计收益
+ {{pageData.brokeragePrice}}元
+
+
+
+
+
+
+
+
+ {{index+1}}
+
+
+
+
+ {{item.nickname}}
+ {{item.spreadTime}}
+
+
+
+ +100元
+
+
+
+
+
+
+
diff --git a/pages/user/incomeDetail/index.wxss b/pages/user/incomeDetail/index.wxss
new file mode 100644
index 0000000..fced112
--- /dev/null
+++ b/pages/user/incomeDetail/index.wxss
@@ -0,0 +1,118 @@
+/* pages/user/incomeDetail/index.wxss */
+page{
+ background: #212226;
+}
+.detail-page{
+ width: 100%;
+ position: relative;
+}
+.top-bg{
+ width: 100%;
+ height: 450rpx;
+}
+.top-bg image{
+ width: 100%;
+ height: 450rpx;
+ position: absolute;
+}
+.income-box{
+ width: 100%;
+ min-height: 200rpx;
+ position: relative;
+ top: 140rpx;
+ left: 0rpx;
+
+}
+.income-box image{
+ width: 670rpx;
+ height: 208rpx;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+.income-l{
+ width: 50%;
+ height: 100%;
+ position: absolute;
+ left: 0;
+ z-index: 2;
+ color: #946F46;
+ padding: 30rpx 0 20rpx;
+}
+.t{
+ color:#E4C6B0;
+}
+.num{
+ color: #E4C6B0;
+ font-size: 36rpx;
+ font-weight: bold;
+ margin: 20rpx 0;
+}
+.btn{
+ width: 124rpx;
+ height: 44rpx;
+ line-height: 44rpx;
+ text-align: center;
+ background: #EFDACA;
+ border-radius: 62rpx;
+ font-size: 26rpx;
+}
+.income-r{
+ height: auto;
+ left: 50%;
+}
+
+.invitation-list-box{
+ position: relative;
+ z-index: 99;
+ top: -80rpx;
+}
+.invi-title{
+ padding-left: 40rpx;
+ font-size: 32rpx;
+ color: #EFDACA;
+ line-height: 40rpx;
+ margin-bottom: 12rpx;
+}
+.list-box{
+ width: 100%;
+ min-height: 200rpx;
+ background: #212226;
+ border-radius: 40rpx 40rpx 0px 0px;
+ padding-top: 36rpx;
+}
+.rank-list-box{
+ width: 100%;
+ max-height: 780rpx;
+ padding: 0 40rpx;
+ font-size: 24rpx;
+ overflow-y: scroll;
+ color: #E4C6B0;
+}
+.rank-item .num{
+ min-width: 38rpx;
+ height: 32rpx;
+ color: #E4C6B0;
+ font-size: 26rpx;
+}
+.item-right-l image{
+ width: 74rpx;
+ height: 74rpx;
+ border-radius: 50%;
+ margin-right: 16rpx;
+}
+.item-right-l{
+ width: 70%;
+}
+.item-right-l .name{
+ font-size: 24rpx;
+ color: #fff;
+ width: 80%;
+ line-height: 34rpx;
+ margin-top: 6rpx;
+}
+.item-right{
+ width: 618rpx;
+ height: 132rpx;
+ border-bottom: 1px solid #6B6158;
+}
\ No newline at end of file
diff --git a/pages/user/index.js b/pages/user/index.js
new file mode 100644
index 0000000..5481c7c
--- /dev/null
+++ b/pages/user/index.js
@@ -0,0 +1,139 @@
+// pages/user/index.js
+const app = getApp();
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ userInfo: {},
+ pageData:{},
+ rankList: [],
+ menuList: [
+ {name: '需求优先', icon: '../../images/menu1.png'},
+ {name: '收益分成', icon: '../../images/menu2.png'},
+ {name: '上架特权', icon: '../../images/menu3.png'},
+ {name: '活动特权', icon: '../../images/menu4.png'},
+ {name: '精品项目', icon: '../../images/menu5.png'},
+ {name: '专属推荐码', icon: '../../images/menu6.png'},
+ {name: '会员特价', icon: '../../images/menu7.png'},
+ {name: '专属活动', icon: '../../images/menu8.png'},
+ {name: '增值收益', icon: '../../images/menu9.png'}
+ ],
+ shareFlag: false
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ userInfo: wx.getStorageSync('userInfo')
+ })
+ this.getPageData();
+ this.getShareFlag();
+ wx.hideShareMenu()
+ },
+ getShareFlag(){
+ app.http('get','user/getShareFlag').then((res)=>{
+ if(res.data.success){
+ this.setData({
+ shareFlag: res.data.data
+ })
+ }
+ })
+ },
+ getPageData(){
+ app.http('get','user/myProfit').then((res)=>{
+ if(res.data.success){
+ if(res.data.data.userProfitList.length >= 3 ){
+ this.setData({
+ rankList: res.data.data.userProfitList.slice(3)
+ })
+ console.log(res.data.data.userProfitList.slice(3))
+ console.log(this.data.rankList)
+ }
+
+ this.setData({
+ pageData: res.data.data
+ })
+ console.log(this.data.pageData[3])
+ }
+ })
+ },
+ toMoreMenu(){
+ wx.navigateTo({
+ url: './agreement/index',
+ })
+ },
+ toIncomeDetail(){
+ wx.navigateTo({
+ url: './incomeDetail/index',
+ })
+ },
+ tixian(){
+ wx.showToast({
+ title: '提现功能暂未开放!',
+ icon: 'none'
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function (res) {
+ if(this.data.shareFlag){
+ return {
+ imageUrl: '../../images/shareImg.png',
+ path: '/pages/user/agreement/index?id='+this.data.userInfo.uid // 路径,传递参数到指定页面。
+ }
+ } else{
+ wx.showToast({
+ title: '暂时不能分享哦~',
+ icon: 'none'
+ })
+ }
+
+ }
+})
\ No newline at end of file
diff --git a/pages/user/index.json b/pages/user/index.json
new file mode 100644
index 0000000..81b2408
--- /dev/null
+++ b/pages/user/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationStyle": "custom"
+}
\ No newline at end of file
diff --git a/pages/user/index.wxml b/pages/user/index.wxml
new file mode 100644
index 0000000..56b4593
--- /dev/null
+++ b/pages/user/index.wxml
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+ {{pageData.nickname}}
+
+
+
+
+
+
+
+
+
+ 累计邀请
+ {{pageData.inviterCount}}人
+ 查看
+
+
+
+ 累计收益
+ {{pageData.brokeragePrice}}元
+ 提现
+
+
+
+
+
+ 邀请榜
+
+
+
+
+
+
+
+ {{pageData.userProfitList[1].nickname || '暂无'}}
+ 已邀请{{pageData.userProfitList[1].inviterCount || 0}}人
+ 获得收益
+ {{pageData.userProfitList[1].brokeragePrice || 0}}元
+
+
+
+
+
+
+
+ {{pageData.userProfitList[0].nickname}}
+ 已邀请{{pageData.userProfitList[0].inviterCount}}人
+ 获得收益
+ {{pageData.userProfitList[0].brokeragePrice}}元
+
+
+
+
+
+
+
+ {{pageData.userProfitList[2].nickname || '暂无'}}
+ 已邀请{{pageData.userProfitList[2].inviterCount || 0}}人
+ 获得收益
+ {{pageData.userProfitList[2].brokeragePrice || 0}}元
+
+
+
+
+
+ {{index+4}}
+
+
+
+ {{item.nickname}}
+
+
+ 已邀请{{item.inviterCount}}人
+ 收益{{item.brokeragePrice}}元
+
+
+
+
+
+
+
+
+
diff --git a/pages/user/index.wxss b/pages/user/index.wxss
new file mode 100644
index 0000000..a1f2aa4
--- /dev/null
+++ b/pages/user/index.wxss
@@ -0,0 +1,293 @@
+/* pages/user/index.wxss */
+page{
+ background: #212226;
+}
+image{
+ width: 100%;
+ height: 100%;
+}
+.user-index-box{
+ min-height: 100vh;
+ color: #EFDACA;
+ position: relative;
+}
+.user-index-top{
+ width: 100%;
+ height: 1020rpx;
+ position: relative;
+}
+.user-index-top .top-bg{
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+.user-info-box{
+ position: absolute;
+ top: 112rpx;
+ left: 40rpx;
+ z-index: 2;
+}
+.header-img{
+ width: 134rpx;
+ height: 134rpx;
+ margin-right: 34rpx;
+}
+.header-img image{
+ width: 134rpx;
+ height: 134rpx;
+ border-radius: 50%;
+}
+.user-info{
+ width: 450rpx;
+}
+.user-title{
+ width: 242rpx;
+ height: 56rpx;
+}
+.user-title image{
+ width: 242rpx;
+ height: 56rpx;
+}
+
+.menu-box{
+ width: 670rpx;
+ height: 244rpx;
+ border: 2px solid #EFDACA;
+ border-radius: 16rpx;
+ position: absolute;
+ top: 290rpx;
+ left: 40rpx;
+ padding: 20rpx 0 16rpx 16rpx;
+}
+.menu-title-box{
+ font-size: 32rpx;
+ line-height: 44rpx;
+ font-weight: bold;
+}
+.fz20{
+ font-size: 20rpx;
+ font-weight: normal;
+}
+.see-more image{
+ width: 10rpx;
+ height: 18rpx;
+ display: block;
+ margin-left: 10rpx;
+}
+.scroll-view_H{
+ white-space: nowrap;
+ width: 100%;
+}
+.menu-list{
+ margin-top: 36rpx;
+}
+.menu-item{
+ display: inline-block;
+ text-align: center;
+ margin-right: 30rpx;
+}
+.menu-item image{
+ width: 70rpx;
+ height: 70rpx;
+ display: inline-block;
+ margin-bottom: 6rpx;
+}
+
+.myIncome-box{
+ position: absolute;
+ top: 576rpx;
+ left: 40rpx;
+}
+.income-box{
+ width: 670rpx;
+ height: 208rpx;
+ border-radius: 12rpx;
+ margin-top: 10rpx;
+ position: relative;
+}
+.income-box image{
+ width: 670rpx;
+ height: 208rpx;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+.income-l{
+ width: 50%;
+ height: 100%;
+ position: absolute;
+ left: 0;
+ z-index: 2;
+ color: #946F46;
+ padding: 30rpx 0 20rpx;
+}
+.num{
+ color: #363636;
+ font-size: 36rpx;
+ font-weight: bold;
+}
+.btn{
+ width: 124rpx;
+ height: 44rpx;
+ line-height: 44rpx;
+ text-align: center;
+ background: #EFDACA;
+ border-radius: 62rpx;
+ font-size: 26rpx;
+}
+.income-r{
+ left: 50%;
+}
+.invitation-list-box{
+ position: relative;
+ z-index: 99;
+ top: -140rpx;
+}
+.invi-title{
+ padding-left: 40rpx;
+ font-size: 32rpx;
+ color: #EFDACA;
+ line-height: 40rpx;
+ margin-bottom: 12rpx;
+}
+.list-box{
+ width: 100%;
+ background: #212226;
+ border-radius: 40rpx 40rpx 0px 0px;
+ padding-top: 36rpx;
+}
+.medal-box{
+
+}
+.medal{
+ width: 224rpx;
+ height: 336rpx;
+ font-size: 20rpx;
+ color: #946F46;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ position: relative;
+ text-align: center;
+ line-height: 38rpx;
+}
+.medal .medal-bg{
+ width: 224rpx;
+ height: 336rpx;
+ position: absolute;
+}
+.medal-content{
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ z-index: 22;
+}
+.user-header{
+ width: 86rpx;
+ height: 86rpx;
+ border-radius: 50%;
+ overflow: hidden;
+ position: absolute;
+ left: 50%;
+ top: -43rpx;
+ transform: translateX(-50%);
+}
+.medal-content .user-name{
+ color: #363636;
+ font-size: 24rpx;
+ line-height: 34rpx;
+ margin-bottom: 16rpx;
+ margin-top: 56rpx;
+}
+.income-money{
+ font-size: 28rpx;
+ color: #363636;
+ font-weight: bold;
+ margin-top: 16rpx;
+}
+.medal-icon{
+ width: 136rpx;
+ height: 136rpx;
+ position: absolute;
+ right: -68rpx;
+ bottom: -10rpx;
+}
+.medal1{
+ margin: 0 22rpx;
+ z-index: 99;
+}
+.medal2,.medal3{
+ width: 202rpx;
+ height: 303rpx;
+ margin-top: 80rpx;
+}
+.medal3{
+ margin-top: 100rpx;
+}
+.medal2 .medal-icon{
+ width: 112rpx;
+ height: 112rpx;
+ bottom: -20rpx;
+ right: -20rpx;
+}
+.medal2 .medal-bg,.medal3 .medal-bg{
+ width: 202rpx;
+ height: 303rpx;
+}
+.medal3 .medal-icon{
+ width: 100rpx;
+ height: 100rpx;
+ right: -20rpx;
+}
+.rank-list-box{
+ width: 100%;
+ max-height: 780rpx;
+ padding: 0 40rpx;
+ font-size: 24rpx;
+ overflow-y: scroll;
+}
+.rank-item .num{
+ min-width: 50rpx;
+ color: #E4C6B0;
+}
+.item-right-l image{
+ width: 74rpx;
+ height: 74rpx;
+ border-radius: 50%;
+ margin-right: 16rpx;
+}
+.item-right-l{
+ width: 70%;
+}
+.item-right-l .name{
+ font-size: 24rpx;
+ color: #fff;
+ width: 80%;
+}
+.item-right{
+ width: 618rpx;
+ height: 132rpx;
+ border-bottom: 1px solid #6B6158;
+}
+.item-right-r{
+ text-align: right;
+}
+
+.share-btn{
+ width: 334rpx !important;
+ height: 132rpx !important;
+ padding: 0 !important;
+ margin: 40rpx auto !important;
+ background: transparent !important;
+ position: fixed;
+ bottom: 0rpx;
+ left: 50%;
+ margin-left: -162rpx !important;
+ z-index: 999;
+}
+.share-btn image{
+ width: 334rpx;
+ height: 132rpx;
+ display: inline-block;
+}
\ No newline at end of file
diff --git a/pages/user/industry/index.js b/pages/user/industry/index.js
new file mode 100644
index 0000000..04d3405
--- /dev/null
+++ b/pages/user/industry/index.js
@@ -0,0 +1,66 @@
+// pages/user/industry/index.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/pages/user/industry/index.json b/pages/user/industry/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/user/industry/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/user/industry/index.wxml b/pages/user/industry/index.wxml
new file mode 100644
index 0000000..053e341
--- /dev/null
+++ b/pages/user/industry/index.wxml
@@ -0,0 +1,2 @@
+
+pages/user/industry/index.wxml
diff --git a/pages/user/industry/index.wxss b/pages/user/industry/index.wxss
new file mode 100644
index 0000000..904f5d8
--- /dev/null
+++ b/pages/user/industry/index.wxss
@@ -0,0 +1 @@
+/* pages/user/industry/index.wxss */
\ No newline at end of file
diff --git a/pages/user/pay/index.js b/pages/user/pay/index.js
new file mode 100644
index 0000000..996c387
--- /dev/null
+++ b/pages/user/pay/index.js
@@ -0,0 +1,66 @@
+// pages/user/pay/index.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/pages/user/pay/index.json b/pages/user/pay/index.json
new file mode 100644
index 0000000..965b8e8
--- /dev/null
+++ b/pages/user/pay/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationStyle": "custom"
+}
\ No newline at end of file
diff --git a/pages/user/pay/index.wxml b/pages/user/pay/index.wxml
new file mode 100644
index 0000000..2e147c2
--- /dev/null
+++ b/pages/user/pay/index.wxml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/pages/user/pay/index.wxss b/pages/user/pay/index.wxss
new file mode 100644
index 0000000..9deaa00
--- /dev/null
+++ b/pages/user/pay/index.wxss
@@ -0,0 +1,15 @@
+/* pages/user/pay/index.wxss */
+.pay-box{
+ width: 100%;
+ min-height: 100vh;
+}
+.pay-box image{
+ width: 100%;
+ display: block;
+}
+.img1{
+ height: 609rpx;
+}
+.img2{
+ height: 1235rpx;
+}
\ No newline at end of file
diff --git a/pages/user/personalData/index.js b/pages/user/personalData/index.js
new file mode 100644
index 0000000..51ddeaa
--- /dev/null
+++ b/pages/user/personalData/index.js
@@ -0,0 +1,263 @@
+// pages/user/personalData/index.js
+const app = getApp();
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ navTopHeight: app.globalData.menuTop + app.globalData.navTopHeight + 20,
+ form: {
+ realName:'',
+ idcard:'',
+ phone:'',
+ code: '',
+ city:'请选择所在城市',
+ profession:'',
+ position: '请选择',
+ },
+ disabled: false,
+ second: 60,
+ positionArr: ['企业负责人','高层管理者','中层管理者','基层管理者','普通员工'],
+
+ timer: null
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ userInfo: wx.getStorageSync('userInfo')
+ })
+ if(this.data.userInfo.phone){
+ this.setData({
+ ['form.phone']: this.data.userInfo.phone
+ })
+ }
+ if(app.globalData.inviterId){
+ this.bindInviter()
+ }
+ },
+ //绑定上级
+ bindInviter(){
+ app.http('get','user/bindInviter',{inviterId:app.globalData.inviterId}).then((res)=>{
+ if(res.data.success){
+ console.log('绑定成功')
+ } else{
+ console.log('绑定失败')
+ }
+ })
+ },
+ setFormStorage(){
+ wx.setStorageSync('form', this.data.form)
+ },
+ changeName(e){
+ this.setData({
+ ['form.realName'] : e.detail.value
+ })
+ this.setFormStorage()
+ },
+ changePhone(e){
+ this.setData({
+ ['form.phone'] : e.detail.value
+ })
+ },
+ changeidCard(e){
+ this.setData({
+ ['form.idCard'] : e.detail.value
+ })
+ this.setFormStorage()
+ },
+ bindRegionChange(e){
+ this.setData({
+ ['form.city'] : e.detail.value.join(' ')
+ })
+ this.setFormStorage()
+ },
+ bindPickerChange(e){
+ this.setData({
+ ['form.position']: this.data.positionArr[e.detail.value]
+ })
+ this.setFormStorage()
+ },
+ changeCode(e){
+ this.setData({
+ ['form.code']: e.detail.value
+ })
+ this.setFormStorage()
+ },
+ toProfession(){
+ wx.navigateTo({
+ url: '../profession/index',
+ })
+ this.setFormStorage()
+ },
+ getPhoneNumber(e){
+ if(e.detail.errMsg == 'getPhoneNumber:ok'){
+ app.http('post','wxapp/binding',
+ {encryptedData: e.detail.encryptedData,
+ iv: e.detail.iv
+ }).then((res)=>{
+ if(res.data.success){
+ this.setData({
+ ['form.phone']: res.data.data.phone
+ })
+ wx.showToast({
+ title: res.data.msg,
+ })
+ } else{
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none'
+ })
+ }
+ })
+ }
+ },
+
+ backPage(){
+ wx.navigateBack({
+ delta: 1,
+ })
+ },
+ sendCode(){
+ var reg=/^1[3456789]\d{9}$/;
+ if (this.data.form.phone === '') {
+ wx.showModal({
+ title: '手机号码不能为空',
+ type: 'none'
+ });
+ return
+ } else if(!reg.test(this.data.form.phone)){
+ wx.showModal({
+ title: '请输入有效的手机号码',
+ type: 'none'
+ });
+ return
+ } else{
+ if(this.data.disabled == false){
+ clearInterval(this.data.timer)
+ this.setData({
+ disabled: true
+ })
+ let timer = setInterval(()=>{ //设置延迟执行
+ this.timeup()
+ },1000);
+ this.setData({
+ timer: timer
+ })
+ }
+ app.http('post','user/getVerificationCode',{phone: this.data.form.phone}).then((res)=>{
+ if(res.data.success){
+ wx.showToast({
+ title:'短信已发送!'
+ })
+
+ } else{
+ wx.showToast({
+ title:res.data.msg,
+ icon:'none'
+ })
+ }
+ })
+ }
+
+ },
+ timeup(){
+ this.setData({
+ second: this.data.second - 1
+ })
+ if (this.data.second == 0) {
+ this.second = 60;
+ this.setData({
+ disabled: false,
+ second: 60
+ })
+ clearInterval(this.data.timer)
+ return;
+ }
+ },
+ toComplete(){
+ let data = {
+ realName: this.data.form.realName,
+ idCard: this.data.form.idCard,
+ code: this.data.form.code,
+ phone: this.data.form.phone,
+ city: this.data.form.city,
+ industry: this.data.form.profession,
+ position: this.data.form.position
+ }
+ app.http('post','user/edit',data).then((res)=>{
+ if(res.data.success){
+ wx.navigateTo({
+ url: '../completeData/index',
+ })
+ app.getInfo()
+ } else{
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none'
+ })
+ }
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ if(wx.getStorageSync('form')){
+ let form = wx.getStorageSync('form')
+ this.setData({
+ ['form.realName']: form.realName,
+ ['form.city']: form.city,
+ ['form.idCard']: form.idCard,
+ ['form.code']: form.code,
+ ['form.position']: form.position
+ })
+ }
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ // onShareAppMessage: function () {
+
+ // }
+})
\ No newline at end of file
diff --git a/pages/user/personalData/index.json b/pages/user/personalData/index.json
new file mode 100644
index 0000000..965b8e8
--- /dev/null
+++ b/pages/user/personalData/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationStyle": "custom"
+}
\ No newline at end of file
diff --git a/pages/user/personalData/index.wxml b/pages/user/personalData/index.wxml
new file mode 100644
index 0000000..0db732c
--- /dev/null
+++ b/pages/user/personalData/index.wxml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+ 欢迎入驻禅易云生态
+
+
+ 请完善个人信息
+
+
+ 姓名
+
+
+
+ 身份证号
+
+
+
+ 手机号
+
+
+
+
+ 短信验证码
+
+
+ 发送验证码
+ {{ second }}秒后重新发送
+
+
+
+ 所在城市
+
+
+ {{form.city}}
+
+
+
+
+ 所在行业
+
+
+
+ 所在职位
+
+ {{form.position}}
+
+
+
+
+ 保存并入驻
+
+
diff --git a/pages/user/personalData/index.wxss b/pages/user/personalData/index.wxss
new file mode 100644
index 0000000..eeb02dd
--- /dev/null
+++ b/pages/user/personalData/index.wxss
@@ -0,0 +1,130 @@
+/* pages/user/personalData/index.wxss */
+page{
+ width: 100%;
+ height: 100vh;
+}
+.personal-index{
+ width: 100%;
+ height: 100vh;
+ position: relative;
+ overflow: hidden;
+}
+.bg-img-box{
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+.bg-img-box image{
+ width: 100%;
+ height: 100%;
+}
+.logo-box{
+ position: absolute;
+ top: 220rpx;
+ left: 32rpx;
+ width: 100%;
+ font-size: 40rpx;
+ color: #EFDACA;
+}
+.logo-box image{
+ width: 160rpx;
+ height: 90rpx;
+ margin-bottom: 22rpx;
+}
+
+.form-box{
+ position: absolute;
+ top: 400rpx;
+ left: 0;
+ font-size: 28rpx;
+ color: #363636;
+ width: 100%;
+ padding: 0 32rpx;
+}
+.title{
+ font-size: 40rpx;
+ color: #EFDACA;
+}
+
+.form{
+ width: 100%;
+ min-height: 640rpx;
+ background: linear-gradient(322deg, #DEB99F 0%, #E9D1C0 51%, #E3C9B5 100%);
+ border-radius: 8rpx;
+ margin: 62rpx 0;
+ padding: 16rpx 0;
+}
+.form .inp-box{
+ width: 100%;
+ height: 86rpx;
+ padding: 0 16rpx;
+ border-bottom: 2rpx solid #B89F83;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.form .inp-box .label{
+ width: 160rpx;
+ text-align: left;
+}
+.inp-box input{
+ text-align: right;
+}
+.sencode-box{
+ width: calc(100% - 180rpx);
+}
+.sencode-box input{
+ width: 230rpx;
+}
+.sencode-box .sendcode-btn,.getPhone-btn{
+ width: 220rpx;
+ height: 66rpx;
+ text-align: center;
+ line-height: 66rpx;
+ background: #FFFFFF;
+ color: #BE996F;
+ box-shadow: 6rpx 6rpx 12rpx #D1BCA5;
+ border-radius: 8rpx;
+ position: relative;
+}
+.sendcode-btn::before{
+ content: '';
+ display: inline-block;
+ width: 2rpx;
+ height: 40rpx;
+ background: #C3AA91;
+ position: absolute;
+ left: -10rpx;
+ top: 10rpx;
+}
+.picker{
+ color: #6D6D6D;
+}
+.noBorder{
+ border: none !important;
+}
+
+.submit-btn{
+ width: 268rpx;
+ height: 82rpx;
+ text-align: center;
+ line-height: 82rpx;
+ color: #946F46;
+ font-size: 32rpx;
+ background: linear-gradient(322deg, #DEB99F 0%, #E9D1C0 51%, #E3C9B5 100%);
+ box-shadow: 6rpx 6rpx 20rpx rgba(22, 22, 22, 0.43);
+ border-radius: 62rpx;
+ margin: 0 auto;
+}
+
+
+.getPhone-btn{
+ width: 210rpx !important;
+ padding: 0 !important;
+ font-size: 28rpx;
+ font-weight: normal;
+ color: #BE996F;
+ margin-left: 10rpx !important;
+}
\ No newline at end of file
diff --git a/pages/user/profession/index.js b/pages/user/profession/index.js
new file mode 100644
index 0000000..81a5fc6
--- /dev/null
+++ b/pages/user/profession/index.js
@@ -0,0 +1,98 @@
+// pages/user/profession/index.js
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ activeName: '1',
+ professionList:[]
+ },
+ onChange(event) {
+ this.setData({
+ activeName: event.detail
+ });
+ },
+ getProfessionList(){
+ app.http('post','api/industry/listIndustry').then((res)=>{
+ console.log(res)
+ if(res.data.success){
+ this.setData({
+ professionList: res.data.data
+ })
+ }
+ })
+ },
+ sonItemClick(e){
+ console.log(e)
+ let name = e.currentTarget.dataset.name;
+ let pages = getCurrentPages();
+ //获取当前页面js里面的pages里的所有信息。
+ let prevPage = pages[ pages.length - 2 ];
+ //prevPage 是获取上一个页面的js里面的pages的所有信息。 -2 是上一个页面,-3是上上个页面以此类推。
+
+ //也可以直接给页面上的参数赋值
+ prevPage.setData({
+ ['form.profession']: name
+ })
+ wx.navigateBack({
+ delta: 1,
+ })
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getProfessionList()
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ // onShareAppMessage: function () {
+
+ // }
+})
\ No newline at end of file
diff --git a/pages/user/profession/index.json b/pages/user/profession/index.json
new file mode 100644
index 0000000..7035710
--- /dev/null
+++ b/pages/user/profession/index.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "van-collapse":"../../..//dist/collapse/index",
+ "van-collapse-item":"../../..//dist/collapse-item/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/user/profession/index.wxml b/pages/user/profession/index.wxml
new file mode 100644
index 0000000..02782c1
--- /dev/null
+++ b/pages/user/profession/index.wxml
@@ -0,0 +1,15 @@
+
+
+
+
+ {{sonItem.industryname}}
+
+
+
\ No newline at end of file
diff --git a/pages/user/profession/index.wxss b/pages/user/profession/index.wxss
new file mode 100644
index 0000000..61bbbc0
--- /dev/null
+++ b/pages/user/profession/index.wxss
@@ -0,0 +1,6 @@
+/* pages/user/profession/index.wxss */
+.sonItem{
+ font-size: 28rpx;
+ line-height: 40rpx;
+ padding: 20rpx;
+}
\ No newline at end of file
diff --git a/project.config.json b/project.config.json
new file mode 100644
index 0000000..1234c44
--- /dev/null
+++ b/project.config.json
@@ -0,0 +1,74 @@
+{
+ "description": "项目配置文件",
+ "packOptions": {
+ "ignore": []
+ },
+ "setting": {
+ "urlCheck": false,
+ "es6": true,
+ "enhance": false,
+ "postcss": true,
+ "preloadBackgroundData": false,
+ "minified": true,
+ "newFeature": false,
+ "coverView": true,
+ "nodeModules": false,
+ "autoAudits": false,
+ "showShadowRootInWxmlPanel": true,
+ "scopeDataCheck": false,
+ "uglifyFileName": false,
+ "checkInvalidKey": true,
+ "checkSiteMap": true,
+ "uploadWithSourceMap": true,
+ "compileHotReLoad": false,
+ "useMultiFrameRuntime": true,
+ "useApiHook": true,
+ "useApiHostProcess": true,
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
+ },
+ "enableEngineNative": false,
+ "useIsolateContext": true,
+ "useCompilerModule": true,
+ "userConfirmedUseCompilerModuleSwitch": false,
+ "userConfirmedBundleSwitch": false,
+ "packNpmManually": false,
+ "packNpmRelationList": [],
+ "minifyWXSS": true
+ },
+ "compileType": "miniprogram",
+ "libVersion": "2.17.0",
+ "appid": "wx5348e39dcbbefe1e",
+ "projectname": "zhaoshangMiniApp",
+ "debugOptions": {
+ "hidedInDevtools": []
+ },
+ "scripts": {},
+ "staticServerOptions": {
+ "baseURL": "",
+ "servePath": ""
+ },
+ "isGameTourist": false,
+ "condition": {
+ "search": {
+ "list": []
+ },
+ "conversation": {
+ "list": []
+ },
+ "game": {
+ "list": []
+ },
+ "plugin": {
+ "list": []
+ },
+ "gamePlugin": {
+ "list": []
+ },
+ "miniprogram": {
+ "list": []
+ }
+ }
+}
\ No newline at end of file
diff --git a/project.private.config.json b/project.private.config.json
new file mode 100644
index 0000000..1859cc4
--- /dev/null
+++ b/project.private.config.json
@@ -0,0 +1,60 @@
+{
+ "setting": {},
+ "condition": {
+ "plugin": {
+ "list": []
+ },
+ "game": {
+ "list": []
+ },
+ "gamePlugin": {
+ "list": []
+ },
+ "miniprogram": {
+ "list": [
+ {
+ "name": "pages/user/personalData/index",
+ "pathName": "pages/user/personalData/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/user/completeData/index",
+ "pathName": "pages/user/completeData/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/user/completeData/index",
+ "pathName": "pages/user/completeData/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/user/agreement/index",
+ "pathName": "pages/user/agreement/index",
+ "query": "id=101",
+ "scene": null
+ },
+ {
+ "name": "pages/user/agreement/index",
+ "pathName": "pages/user/agreement/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/user/incomeDetail/index",
+ "pathName": "pages/user/incomeDetail/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/user/index",
+ "pathName": "pages/user/index",
+ "query": "",
+ "scene": null
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/sitemap.json b/sitemap.json
new file mode 100644
index 0000000..ca02add
--- /dev/null
+++ b/sitemap.json
@@ -0,0 +1,7 @@
+{
+ "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+ "rules": [{
+ "action": "allow",
+ "page": "*"
+ }]
+}
\ No newline at end of file
diff --git a/utils/util.js b/utils/util.js
new file mode 100644
index 0000000..764bc2c
--- /dev/null
+++ b/utils/util.js
@@ -0,0 +1,19 @@
+const formatTime = date => {
+ const year = date.getFullYear()
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ const hour = date.getHours()
+ const minute = date.getMinutes()
+ const second = date.getSeconds()
+
+ return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
+}
+
+const formatNumber = n => {
+ n = n.toString()
+ return n[1] ? n : `0${n}`
+}
+
+module.exports = {
+ formatTime
+}