Browse Source

首页修改

x 4 năm trước cách đây
mục cha
commit
0471ebf223
99 tập tin đã thay đổi với 2109 bổ sung493 xóa
  1. BIN
      view/.DS_Store
  2. BIN
      view/xcx/.DS_Store
  3. 6 0
      view/xcx/api/api.js
  4. 33 0
      view/xcx/api/mine.js
  5. 15 8
      view/xcx/app.json
  6. 23 0
      view/xcx/components/mine/index.js
  7. 4 0
      view/xcx/components/mine/index.json
  8. 2 0
      view/xcx/components/mine/index.wxml
  9. 1 0
      view/xcx/components/mine/index.wxss
  10. 3 0
      view/xcx/components/navbar/index.js
  11. 2 0
      view/xcx/components/navbar/index.wxss
  12. 1 1
      view/xcx/config.js
  13. BIN
      view/xcx/images/0-001.png
  14. BIN
      view/xcx/images/0-002.png
  15. BIN
      view/xcx/images/5-001.png
  16. BIN
      view/xcx/images/5-002.png
  17. BIN
      view/xcx/images/6-001.png
  18. BIN
      view/xcx/images/6-002.png
  19. BIN
      view/xcx/images/becommendTitle.png
  20. BIN
      view/xcx/images/boutiqueTitle.png
  21. BIN
      view/xcx/images/buyTitle.png
  22. BIN
      view/xcx/images/hotTitle.png
  23. BIN
      view/xcx/images/newsTitle.png
  24. BIN
      view/xcx/images/one01.png
  25. BIN
      view/xcx/images/promotionTitle.png
  26. BIN
      view/xcx/images/scan.gif
  27. BIN
      view/xcx/images/three03.png
  28. BIN
      view/xcx/images/timeBg.png
  29. BIN
      view/xcx/images/title.png
  30. BIN
      view/xcx/images/two02.png
  31. 4 0
      view/xcx/miniprogram_npm/vant-weapp/common/color.d.ts
  32. 4 0
      view/xcx/miniprogram_npm/vant-weapp/common/color.js
  33. 3 0
      view/xcx/miniprogram_npm/vant-weapp/common/component.d.ts
  34. 48 0
      view/xcx/miniprogram_npm/vant-weapp/common/component.js
  35. 1 0
      view/xcx/miniprogram_npm/vant-weapp/common/index.wxss
  36. 1 0
      view/xcx/miniprogram_npm/vant-weapp/common/style/clearfix.wxss
  37. 1 0
      view/xcx/miniprogram_npm/vant-weapp/common/style/ellipsis.wxss
  38. 1 0
      view/xcx/miniprogram_npm/vant-weapp/common/style/hairline.wxss
  39. 0 0
      view/xcx/miniprogram_npm/vant-weapp/common/style/mixins/clearfix.wxss
  40. 0 0
      view/xcx/miniprogram_npm/vant-weapp/common/style/mixins/ellipsis.wxss
  41. 0 0
      view/xcx/miniprogram_npm/vant-weapp/common/style/mixins/hairline.wxss
  42. 0 0
      view/xcx/miniprogram_npm/vant-weapp/common/style/var.wxss
  43. 7 0
      view/xcx/miniprogram_npm/vant-weapp/common/utils.d.ts
  44. 25 0
      view/xcx/miniprogram_npm/vant-weapp/common/utils.js
  45. 1 0
      view/xcx/miniprogram_npm/vant-weapp/info/index.d.ts
  46. 7 0
      view/xcx/miniprogram_npm/vant-weapp/info/index.js
  47. 3 0
      view/xcx/miniprogram_npm/vant-weapp/info/index.json
  48. 5 0
      view/xcx/miniprogram_npm/vant-weapp/info/index.wxml
  49. 1 0
      view/xcx/miniprogram_npm/vant-weapp/info/index.wxss
  50. 1 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/basic.d.ts
  51. 22 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/basic.js
  52. 1 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/button.d.ts
  53. 18 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/button.js
  54. 1 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/link.d.ts
  55. 17 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/link.js
  56. 1 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/observer/behavior.d.ts
  57. 47 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/observer/behavior.js
  58. 1 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/observer/index.d.ts
  59. 27 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/observer/index.js
  60. 1 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/observer/props.d.ts
  61. 22 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/observer/props.js
  62. 1 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/open-type.d.ts
  63. 25 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/open-type.js
  64. 4 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/safe-area.d.ts
  65. 39 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/safe-area.js
  66. 1 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/touch.d.ts
  67. 27 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/touch.js
  68. 1 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/transition.d.ts
  69. 111 0
      view/xcx/miniprogram_npm/vant-weapp/mixins/transition.js
  70. 1 0
      view/xcx/miniprogram_npm/vant-weapp/tab/index.d.ts
  71. 35 0
      view/xcx/miniprogram_npm/vant-weapp/tab/index.js
  72. 3 0
      view/xcx/miniprogram_npm/vant-weapp/tab/index.json
  73. 9 0
      view/xcx/miniprogram_npm/vant-weapp/tab/index.wxml
  74. 1 0
      view/xcx/miniprogram_npm/vant-weapp/tab/index.wxss
  75. 1 0
      view/xcx/miniprogram_npm/vant-weapp/tabs/index.d.ts
  76. 322 0
      view/xcx/miniprogram_npm/vant-weapp/tabs/index.js
  77. 6 0
      view/xcx/miniprogram_npm/vant-weapp/tabs/index.json
  78. 49 0
      view/xcx/miniprogram_npm/vant-weapp/tabs/index.wxml
  79. 2 0
      view/xcx/miniprogram_npm/vant-weapp/tabs/index.wxss
  80. 5 0
      view/xcx/miniprogram_npm/vant-weapp/wxs/array.wxs
  81. 38 0
      view/xcx/miniprogram_npm/vant-weapp/wxs/bem.wxs
  82. 54 0
      view/xcx/miniprogram_npm/vant-weapp/wxs/memoize.wxs
  83. 13 0
      view/xcx/miniprogram_npm/vant-weapp/wxs/object.wxs
  84. 12 0
      view/xcx/miniprogram_npm/vant-weapp/wxs/utils.wxs
  85. 13 0
      view/xcx/package-lock.json
  86. 14 0
      view/xcx/package.json
  87. 1 1
      view/xcx/pages/admin/order_cancellation/index.wxml
  88. 420 197
      view/xcx/pages/index/index.js
  89. 14 8
      view/xcx/pages/index/index.json
  90. 427 213
      view/xcx/pages/index/index.wxml
  91. 0 57
      view/xcx/pages/index/index.wxss
  92. 80 0
      view/xcx/pages/message/index.js
  93. 5 0
      view/xcx/pages/message/index.json
  94. 4 0
      view/xcx/pages/message/index.wxml
  95. 2 0
      view/xcx/pages/message/index.wxss
  96. 1 1
      view/xcx/pages/order_cancellation/index.wxml
  97. 1 1
      view/xcx/pages/user/user.wxml
  98. 4 5
      view/xcx/project.config.json
  99. 2 1
      view/xcx/utils/util.js

BIN
view/.DS_Store


BIN
view/xcx/.DS_Store


+ 6 - 0
view/xcx/api/api.js

@@ -189,4 +189,10 @@ export function verifyCode() {
  */
 export function getCity() {
   return request.get('city_list', { }, { noAuth: true });
+}
+
+
+
+export function getNotifications() {
+  return request.get('user/notifications', {}, { noAuth: true })
 }

+ 33 - 0
view/xcx/api/mine.js

@@ -0,0 +1,33 @@
+import request from "./../utils/request.js";
+/**
+ * 黑洞矿井相关接口
+ * 
+*/
+
+/**
+ * 启动
+*/
+export function bootCoin() {
+  request.post("coin/boot");
+}
+
+/**
+ * 历史记录
+*/
+export function coinHistory(page = 1, limit = 30) {
+  request.get("coin/history?page=" + page + "&limit=" + limit);
+}
+
+/**
+ * 更新钱包地址
+*/
+export function coinAddress(address, symbol = "doge") {
+  request.post("coin/addr", { symbol: symbol, addr: address });
+}
+
+/**
+ * 提币
+*/
+export function coinTransfer(amount, symbol = "doge") {
+  request.post("coin/transfer", { symbol: symbol, amount: amount });
+}

+ 15 - 8
view/xcx/app.json

@@ -62,7 +62,8 @@
     "components/home/index",
     "components/write-off/index",
     "components/price-change/index",
-    "components/general-window/index"
+    "components/general-window/index",
+    "pages/message/index"
   ],
   "subPackages": [
     {
@@ -109,15 +110,21 @@
     "list": [
       {
         "pagePath": "pages/index/index",
-        "iconPath": "images/1-001.png",
-        "selectedIconPath": "images/1-002.png",
-        "text": "首页"
+        "iconPath": "images/0-001.png",
+        "selectedIconPath": "images/0-002.png",
+        "text": "活动"
       },
       {
-        "pagePath": "pages/goods_cate/goods_cate",
-        "iconPath": "images/2-001.png",
-        "selectedIconPath": "images/2-002.png",
-        "text": "分类"
+        "pagePath": "pages/user_money/index",
+        "iconPath": "images/6-001.png",
+        "selectedIconPath": "images/6-002.png",
+        "text": "钱包"
+      },
+      {
+        "pagePath": "pages/message/index",
+        "iconPath": "images/5-001.png",
+        "selectedIconPath": "images/5-002.png",
+        "text": "消息"
       },
       {
         "pagePath": "pages/order_addcart/order_addcart",

+ 23 - 0
view/xcx/components/mine/index.js

@@ -0,0 +1,23 @@
+// components/mine/index.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+  }
+})

+ 4 - 0
view/xcx/components/mine/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 2 - 0
view/xcx/components/mine/index.wxml

@@ -0,0 +1,2 @@
+<!--components/mine/index.wxml-->
+<text>components/mine/index.wxml</text>

+ 1 - 0
view/xcx/components/mine/index.wxss

@@ -0,0 +1 @@
+/* components/mine/index.wxss */

+ 3 - 0
view/xcx/components/navbar/index.js

@@ -58,6 +58,9 @@ Component({
         case '4': case "gradual01":
           color = 'gradual01'
           break;
+        case '5': case "gradual02":
+          color = 'gradual02'
+          break;
         default:
           break;
       }

+ 2 - 0
view/xcx/components/navbar/index.wxss

@@ -4,7 +4,9 @@
 .navbar.black{background-color:#232323;}
 .navbar.gray{background-color:#666;}
 .navbar.red{background-color:#eb5447;}
+/* .navbar.gradual01{background-image: linear-gradient(to right,#f67837 0%,#f11d09 100%);} */
 .navbar.gradual01{background-image: linear-gradient(to right,#f67837 0%,#f11d09 100%);}
+.navbar.gradual02{background-image: linear-gradient(to right,#ff3366 0%,#ff6533 100%);}
 .navbar .navbarH{position:relative;}
 .navbar .navbarH .navbarCon{position:absolute;bottom:0;height:100rpx;width:100%;}
 .navbar .navbarH .navbarCon .name{color:#000;font-size:36rpx;font-weight:bold;width: 300rpx;text-align: center;}

+ 1 - 1
view/xcx/config.js

@@ -1,6 +1,6 @@
 module.exports = {
   // 请求域名 格式: https://您的域名
-  HTTP_REQUEST_URL:'http://v329.wuht.net',
+  HTTP_REQUEST_URL:'http://twong.us',
   // Socket链接 暂不做配置
   WSS_SERVER_URL:'',
 

BIN
view/xcx/images/0-001.png


BIN
view/xcx/images/0-002.png


BIN
view/xcx/images/5-001.png


BIN
view/xcx/images/5-002.png


BIN
view/xcx/images/6-001.png


BIN
view/xcx/images/6-002.png


BIN
view/xcx/images/becommendTitle.png


BIN
view/xcx/images/boutiqueTitle.png


BIN
view/xcx/images/buyTitle.png


BIN
view/xcx/images/hotTitle.png


BIN
view/xcx/images/newsTitle.png


BIN
view/xcx/images/one01.png


BIN
view/xcx/images/promotionTitle.png


BIN
view/xcx/images/scan.gif


BIN
view/xcx/images/three03.png


BIN
view/xcx/images/timeBg.png


BIN
view/xcx/images/title.png


BIN
view/xcx/images/two02.png


+ 4 - 0
view/xcx/miniprogram_npm/vant-weapp/common/color.d.ts

@@ -0,0 +1,4 @@
+export declare const RED = "#f44";
+export declare const BLUE = "#1989fa";
+export declare const GREEN = "#07c160";
+export declare const ORANGE = "#ff976a";

+ 4 - 0
view/xcx/miniprogram_npm/vant-weapp/common/color.js

@@ -0,0 +1,4 @@
+export const RED = '#f44';
+export const BLUE = '#1989fa';
+export const GREEN = '#07c160';
+export const ORANGE = '#ff976a';

+ 3 - 0
view/xcx/miniprogram_npm/vant-weapp/common/component.d.ts

@@ -0,0 +1,3 @@
+import { VantComponentOptions, CombinedComponentInstance } from '../definitions/index';
+declare function VantComponent<Data, Props, Methods, Computed>(vantOptions?: VantComponentOptions<Data, Props, Methods, Computed, CombinedComponentInstance<Data, Props, Methods, Computed>>): void;
+export { VantComponent };

+ 48 - 0
view/xcx/miniprogram_npm/vant-weapp/common/component.js

@@ -0,0 +1,48 @@
+import { basic } from '../mixins/basic';
+import { observe } from '../mixins/observer/index';
+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',
+        relations: 'relations',
+        destroyed: 'detached',
+        classes: 'externalClasses'
+    });
+    const { relation } = vantOptions;
+    if (relation) {
+        options.relations = Object.assign(options.relations || {}, {
+            [`../${relation.name}/index`]: relation
+        });
+    }
+    // add default externalClasses
+    options.externalClasses = options.externalClasses || [];
+    options.externalClasses.push('custom-class');
+    // add default behaviors
+    options.behaviors = options.behaviors || [];
+    options.behaviors.push(basic);
+    // map field to form-field behavior
+    if (vantOptions.field) {
+        options.behaviors.push('wx://form-field');
+    }
+    // add default options
+    options.options = {
+        multipleSlots: true,
+        addGlobalClass: true
+    };
+    observe(vantOptions, options);
+    Component(options);
+}
+export { VantComponent };

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/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{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{content:"";display:table;clear:both}.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{content:" ";position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:-50%;left:-50%;right:-50%;bottom:-50%;-webkit-transform:scale(.5);transform:scale(.5);border:0 solid #eee}.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}

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/common/style/clearfix.wxss

@@ -0,0 +1 @@
+.van-clearfix:after{content:"";display:table;clear:both}

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/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{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/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{content:" ";position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:-50%;left:-50%;right:-50%;bottom:-50%;-webkit-transform:scale(.5);transform:scale(.5);border:0 solid #eee}.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}

+ 0 - 0
view/xcx/miniprogram_npm/vant-weapp/common/style/mixins/clearfix.wxss


+ 0 - 0
view/xcx/miniprogram_npm/vant-weapp/common/style/mixins/ellipsis.wxss


+ 0 - 0
view/xcx/miniprogram_npm/vant-weapp/common/style/mixins/hairline.wxss


+ 0 - 0
view/xcx/miniprogram_npm/vant-weapp/common/style/var.wxss


+ 7 - 0
view/xcx/miniprogram_npm/vant-weapp/common/utils.d.ts

@@ -0,0 +1,7 @@
+/// <reference types="miniprogram-api-typings" />
+export declare function isDef(value: any): boolean;
+export declare function isObj(x: any): boolean;
+export declare function isNumber(value: any): boolean;
+export declare function range(num: number, min: number, max: number): number;
+export declare function nextTick(fn: Function): void;
+export declare function getSystemInfoSync(): WechatMiniprogram.GetSystemInfoSuccessCallbackResult;

+ 25 - 0
view/xcx/miniprogram_npm/vant-weapp/common/utils.js

@@ -0,0 +1,25 @@
+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+$/.test(value);
+}
+export function range(num, min, max) {
+    return Math.min(Math.max(num, min), max);
+}
+export function nextTick(fn) {
+    setTimeout(() => {
+        fn();
+    }, 1000 / 30);
+}
+let systemInfo = null;
+export function getSystemInfoSync() {
+    if (systemInfo == null) {
+        systemInfo = wx.getSystemInfoSync();
+    }
+    return systemInfo;
+}

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/info/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 7 - 0
view/xcx/miniprogram_npm/vant-weapp/info/index.js

@@ -0,0 +1,7 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+    props: {
+        info: null,
+        customStyle: String
+    }
+});

+ 3 - 0
view/xcx/miniprogram_npm/vant-weapp/info/index.json

@@ -0,0 +1,3 @@
+{
+  "component": true
+}

+ 5 - 0
view/xcx/miniprogram_npm/vant-weapp/info/index.wxml

@@ -0,0 +1,5 @@
+<view
+  wx:if="{{ info !== null && info !== '' }}"
+  class="custom-class van-info"
+  style="{{ customStyle }}"
+>{{ info }}</view>

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/info/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-info{position:absolute;top:-8px;right:0;min-width:16px;padding:0 3px;font-family:PingFang SC,Helvetica Neue,Arial,sans-serif;font-size:12px;font-weight:500;line-height:14px;color:#fff;text-align:center;white-space:nowrap;background-color:#f44;border:1px solid #fff;border-radius:16px;-webkit-transform:translateX(50%);transform:translateX(50%);box-sizing:border-box;-webkit-transform-origin:100%;transform-origin:100%}

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/basic.d.ts

@@ -0,0 +1 @@
+export declare const basic: string;

+ 22 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/basic.js

@@ -0,0 +1,22 @@
+export const basic = Behavior({
+    methods: {
+        $emit(...args) {
+            this.triggerEvent(...args);
+        },
+        getRect(selector, all) {
+            return new Promise(resolve => {
+                wx.createSelectorQuery()
+                    .in(this)[all ? 'selectAll' : 'select'](selector)
+                    .boundingClientRect(rect => {
+                    if (all && Array.isArray(rect) && rect.length) {
+                        resolve(rect);
+                    }
+                    if (!all && rect) {
+                        resolve(rect);
+                    }
+                })
+                    .exec();
+            });
+        }
+    }
+});

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/button.d.ts

@@ -0,0 +1 @@
+export declare const button: string;

+ 18 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/button.js

@@ -0,0 +1,18 @@
+export const button = Behavior({
+    externalClasses: ['hover-class'],
+    properties: {
+        id: String,
+        lang: {
+            type: String,
+            value: 'en'
+        },
+        businessId: Number,
+        sessionFrom: String,
+        sendMessageTitle: String,
+        sendMessagePath: String,
+        sendMessageImg: String,
+        showMessageCard: Boolean,
+        appParameter: String,
+        ariaLabel: String
+    }
+});

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/link.d.ts

@@ -0,0 +1 @@
+export declare const link: string;

+ 17 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/link.js

@@ -0,0 +1,17 @@
+export const link = Behavior({
+    properties: {
+        url: String,
+        linkType: {
+            type: String,
+            value: 'navigateTo'
+        }
+    },
+    methods: {
+        jumpLink(urlKey = 'url') {
+            const url = this.data[urlKey];
+            if (url) {
+                wx[this.data.linkType]({ url });
+            }
+        }
+    }
+});

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/observer/behavior.d.ts

@@ -0,0 +1 @@
+export declare const behavior: string;

+ 47 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/observer/behavior.js

@@ -0,0 +1,47 @@
+function setAsync(context, data) {
+    return new Promise(resolve => {
+        context.setData(data, resolve);
+    });
+}
+export const behavior = Behavior({
+    created() {
+        if (!this.$options) {
+            return;
+        }
+        const cache = {};
+        const { computed } = this.$options();
+        const keys = Object.keys(computed);
+        this.calcComputed = () => {
+            const needUpdate = {};
+            keys.forEach(key => {
+                const value = computed[key].call(this);
+                if (cache[key] !== value) {
+                    cache[key] = value;
+                    needUpdate[key] = value;
+                }
+            });
+            return needUpdate;
+        };
+    },
+    attached() {
+        this.set();
+    },
+    methods: {
+        // set data and set computed data
+        set(data, callback) {
+            const stack = [];
+            if (data) {
+                stack.push(setAsync(this, data));
+            }
+            if (this.calcComputed) {
+                stack.push(setAsync(this, this.calcComputed()));
+            }
+            return Promise.all(stack).then(res => {
+                if (callback && typeof callback === 'function') {
+                    callback.call(this);
+                }
+                return res;
+            });
+        }
+    }
+});

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/observer/index.d.ts

@@ -0,0 +1 @@
+export declare function observe(vantOptions: any, options: any): void;

+ 27 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/observer/index.js

@@ -0,0 +1,27 @@
+import { behavior } from './behavior';
+import { observeProps } from './props';
+export function observe(vantOptions, options) {
+    const { watch, computed } = vantOptions;
+    options.behaviors.push(behavior);
+    if (watch) {
+        const props = options.properties || {};
+        Object.keys(watch).forEach(key => {
+            if (key in props) {
+                let prop = props[key];
+                if (prop === null || !('type' in prop)) {
+                    prop = { type: prop };
+                }
+                prop.observer = watch[key];
+                props[key] = prop;
+            }
+        });
+        options.properties = props;
+    }
+    if (computed) {
+        options.methods = options.methods || {};
+        options.methods.$options = () => vantOptions;
+        if (options.properties) {
+            observeProps(options.properties);
+        }
+    }
+}

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/observer/props.d.ts

@@ -0,0 +1 @@
+export declare function observeProps(props: any): void;

+ 22 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/observer/props.js

@@ -0,0 +1,22 @@
+export function observeProps(props) {
+    if (!props) {
+        return;
+    }
+    Object.keys(props).forEach(key => {
+        let prop = props[key];
+        if (prop === null || !('type' in prop)) {
+            prop = { type: prop };
+        }
+        let { observer } = prop;
+        prop.observer = function (...args) {
+            if (observer) {
+                if (typeof observer === 'string') {
+                    observer = this[observer];
+                }
+                observer.apply(this, args);
+            }
+            this.set();
+        };
+        props[key] = prop;
+    });
+}

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/open-type.d.ts

@@ -0,0 +1 @@
+export declare const openType: string;

+ 25 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/open-type.js

@@ -0,0 +1,25 @@
+export const openType = Behavior({
+    properties: {
+        openType: String
+    },
+    methods: {
+        bindGetUserInfo(event) {
+            this.$emit('getuserinfo', event.detail);
+        },
+        bindContact(event) {
+            this.$emit('contact', event.detail);
+        },
+        bindGetPhoneNumber(event) {
+            this.$emit('getphonenumber', event.detail);
+        },
+        bindError(event) {
+            this.$emit('error', event.detail);
+        },
+        bindLaunchApp(event) {
+            this.$emit('launchapp', event.detail);
+        },
+        bindOpenSetting(event) {
+            this.$emit('opensetting', event.detail);
+        },
+    }
+});

+ 4 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/safe-area.d.ts

@@ -0,0 +1,4 @@
+export declare const safeArea: ({ safeAreaInsetBottom, safeAreaInsetTop }?: {
+    safeAreaInsetBottom?: boolean;
+    safeAreaInsetTop?: boolean;
+}) => string;

+ 39 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/safe-area.js

@@ -0,0 +1,39 @@
+let cache = null;
+function getSafeArea() {
+    return new Promise((resolve, reject) => {
+        if (cache != null) {
+            resolve(cache);
+        }
+        else {
+            wx.getSystemInfo({
+                success: ({ model, screenHeight, statusBarHeight }) => {
+                    const iphoneX = /iphone x/i.test(model);
+                    const iphoneNew = /iPhone11/i.test(model) && screenHeight === 812;
+                    cache = {
+                        isIPhoneX: iphoneX || iphoneNew,
+                        statusBarHeight
+                    };
+                    resolve(cache);
+                },
+                fail: reject
+            });
+        }
+    });
+}
+export const safeArea = ({ safeAreaInsetBottom = true, safeAreaInsetTop = false } = {}) => Behavior({
+    properties: {
+        safeAreaInsetTop: {
+            type: Boolean,
+            value: safeAreaInsetTop
+        },
+        safeAreaInsetBottom: {
+            type: Boolean,
+            value: safeAreaInsetBottom
+        }
+    },
+    created() {
+        getSafeArea().then(({ isIPhoneX, statusBarHeight }) => {
+            this.set({ isIPhoneX, statusBarHeight });
+        });
+    }
+});

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/touch.d.ts

@@ -0,0 +1 @@
+export declare const touch: string;

+ 27 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/touch.js

@@ -0,0 +1,27 @@
+export const touch = Behavior({
+    methods: {
+        touchStart(event) {
+            const touch = event.touches[0];
+            this.direction = '';
+            this.deltaX = 0;
+            this.deltaY = 0;
+            this.offsetX = 0;
+            this.offsetY = 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.offsetX > this.offsetY
+                    ? 'horizontal'
+                    : this.offsetX < this.offsetY
+                        ? 'vertical'
+                        : '';
+        }
+    }
+});

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/transition.d.ts

@@ -0,0 +1 @@
+export declare const transition: (showDefaultValue: boolean) => any;

+ 111 - 0
view/xcx/miniprogram_npm/vant-weapp/mixins/transition.js

@@ -0,0 +1,111 @@
+import { isObj } from '../common/utils';
+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`
+});
+const nextTick = () => new Promise(resolve => setTimeout(resolve, 1000 / 30));
+export const transition = function (showDefaultValue) {
+    return Behavior({
+        properties: {
+            customStyle: String,
+            // @ts-ignore
+            show: {
+                type: Boolean,
+                value: showDefaultValue,
+                observer: 'observeShow'
+            },
+            // @ts-ignore
+            duration: {
+                type: [Number, Object],
+                value: 300,
+                observer: 'observeDuration'
+            },
+            name: {
+                type: String,
+                value: 'fade'
+            }
+        },
+        data: {
+            type: '',
+            inited: false,
+            display: false
+        },
+        attached() {
+            if (this.data.show) {
+                this.enter();
+            }
+        },
+        methods: {
+            observeShow(value) {
+                if (value) {
+                    this.enter();
+                }
+                else {
+                    this.leave();
+                }
+            },
+            enter() {
+                const { duration, name } = this.data;
+                const classNames = getClassNames(name);
+                const currentDuration = isObj(duration) ? duration.enter : duration;
+                this.status = 'enter';
+                Promise.resolve()
+                    .then(nextTick)
+                    .then(() => {
+                    this.checkStatus('enter');
+                    this.set({
+                        inited: true,
+                        display: true,
+                        classes: classNames.enter,
+                        currentDuration
+                    });
+                })
+                    .then(nextTick)
+                    .then(() => {
+                    this.checkStatus('enter');
+                    this.set({
+                        classes: classNames['enter-to']
+                    });
+                })
+                    .catch(() => { });
+            },
+            leave() {
+                const { duration, name } = this.data;
+                const classNames = getClassNames(name);
+                const currentDuration = isObj(duration) ? duration.leave : duration;
+                this.status = 'leave';
+                Promise.resolve()
+                    .then(nextTick)
+                    .then(() => {
+                    this.checkStatus('leave');
+                    this.set({
+                        classes: classNames.leave,
+                        currentDuration
+                    });
+                })
+                    .then(() => setTimeout(() => this.onTransitionEnd(), currentDuration))
+                    .then(nextTick)
+                    .then(() => {
+                    this.checkStatus('leave');
+                    this.set({
+                        classes: classNames['leave-to']
+                    });
+                })
+                    .catch(() => { });
+            },
+            checkStatus(status) {
+                if (status !== this.status) {
+                    throw new Error(`incongruent status: ${status}`);
+                }
+            },
+            onTransitionEnd() {
+                if (!this.data.show) {
+                    this.set({ display: false });
+                    this.$emit('transitionEnd');
+                }
+            }
+        }
+    });
+};

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/tab/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 35 - 0
view/xcx/miniprogram_npm/vant-weapp/tab/index.js

@@ -0,0 +1,35 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+    relation: {
+        name: 'tabs',
+        type: 'ancestor'
+    },
+    props: {
+        dot: Boolean,
+        info: null,
+        title: String,
+        disabled: Boolean,
+        titleStyle: String
+    },
+    data: {
+        width: null,
+        inited: false,
+        active: false,
+        animated: false
+    },
+    watch: {
+        title: 'update',
+        disabled: 'update',
+        dot: 'update',
+        info: 'update',
+        titleStyle: 'update'
+    },
+    methods: {
+        update() {
+            const parent = this.getRelationNodes('../tabs/index')[0];
+            if (parent) {
+                parent.updateTabs();
+            }
+        }
+    }
+});

+ 3 - 0
view/xcx/miniprogram_npm/vant-weapp/tab/index.json

@@ -0,0 +1,3 @@
+{
+  "component": true
+}

+ 9 - 0
view/xcx/miniprogram_npm/vant-weapp/tab/index.wxml

@@ -0,0 +1,9 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<view
+  wx:if="{{ animated || inited }}"
+  class="custom-class {{ utils.bem('tab__pane', { active, inactive: !active }) }}"
+  style="{{ animated || active ? '' : 'display: none;' }} {{ width ? 'width:' + width + 'px;' : '' }}"
+>
+  <slot />
+</view>

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/tab/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-tab__pane{box-sizing:border-box;overflow-y:auto}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible}

+ 1 - 0
view/xcx/miniprogram_npm/vant-weapp/tabs/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 322 - 0
view/xcx/miniprogram_npm/vant-weapp/tabs/index.js

@@ -0,0 +1,322 @@
+const app = getApp();
+import { VantComponent } from '../common/component';
+import { touch } from '../mixins/touch';
+import { nextTick } from '../common/utils';
+VantComponent({
+    mixins: [touch],
+    classes: ['nav-class', 'tab-class', 'tab-active-class', 'line-class'],
+    relation: {
+        name: 'tab',
+        type: 'descendant',
+        linked(child) {
+            this.child.push(child);
+            this.updateTabs(this.data.tabs.concat(child.data));
+        },
+        unlinked(child) {
+            const index = this.child.indexOf(child);
+            const { tabs } = this.data;
+            tabs.splice(index, 1);
+            this.child.splice(index, 1);
+            this.updateTabs(tabs);
+        }
+    },
+    props: {
+        color: String,
+        sticky: Boolean,
+        animated: Boolean,
+        swipeable: Boolean,
+        lineWidth: {
+            type: Number,
+            value: -1
+        },
+        lineHeight: {
+            type: Number,
+            value: -1
+        },
+        active: {
+            type: Number,
+            value: 0
+        },
+        type: {
+            type: String,
+            value: 'line'
+        },
+        border: {
+            type: Boolean,
+            value: true
+        },
+        duration: {
+            type: Number,
+            value: 0.3
+        },
+        zIndex: {
+            type: Number,
+            value: 1
+        },
+        swipeThreshold: {
+            type: Number,
+            value: 4
+        },
+        offsetTop: {
+            type: Number,
+            value: 0
+        }
+    },
+    data: {
+        tabs: [],
+        lineStyle: '',
+        scrollLeft: 0,
+        scrollable: false,
+        trackStyle: '',
+        wrapStyle: '',
+        position: '',
+        navH:''
+    },
+    watch: {
+        swipeThreshold() {
+            this.set({
+                scrollable: this.child.length > this.data.swipeThreshold
+            });
+        },
+        color: 'setLine',
+        lineWidth: 'setLine',
+        lineHeight: 'setLine',
+        active: 'setActiveTab',
+        animated: 'setTrack',
+        offsetTop: 'setWrapStyle'
+    },
+    beforeCreate() {
+        this.child = [];
+    },
+    mounted() {
+        this.setData({
+          navH: app.globalData.navHeight
+        });
+        this.setLine(true);
+        this.setTrack();
+        this.scrollIntoView();
+        this.getRect('.van-tabs__wrap').then((rect) => {
+            this.navHeight = rect.height;
+            this.observerContentScroll();
+        });
+    },
+    destroyed() {
+        // @ts-ignore
+        this.createIntersectionObserver().disconnect();
+    },
+    methods: {
+        updateTabs(tabs) {
+            tabs = tabs || this.data.tabs;
+            this.set({
+                tabs,
+                scrollable: tabs.length > this.data.swipeThreshold
+            });
+            this.setActiveTab();
+        },
+        trigger(eventName, index) {
+            this.$emit(eventName, {
+                index,
+                title: this.data.tabs[index].title
+            });
+        },
+        onTap(event) {
+            const { index } = event.currentTarget.dataset;
+            if (this.data.tabs[index].disabled) {
+                this.trigger('disabled', index);
+            }
+            else {
+                this.trigger('click', index);
+                this.setActive(index);
+            }
+        },
+        setActive(active) {
+            if (active !== this.data.active) {
+                this.trigger('change', active);
+                this.set({ active });
+                this.setActiveTab();
+            }
+        },
+        setLine(skipTransition) {
+            if (this.data.type !== 'line') {
+                return;
+            }
+            const { color, active, duration, lineWidth, lineHeight } = this.data;
+            this.getRect('.van-tab', true).then((rects) => {
+                const rect = rects[active];
+                const width = lineWidth !== -1 ? lineWidth : rect.width / 2;
+                const height = lineHeight !== -1 ? `height: ${lineHeight}px;` : '';
+                let left = rects
+                    .slice(0, active)
+                    .reduce((prev, curr) => prev + curr.width, 0);
+                left += (rect.width - width) / 2;
+                const transition = skipTransition
+                    ? ''
+                    : `transition-duration: ${duration}s; -webkit-transition-duration: ${duration}s;`;
+                this.set({
+                    lineStyle: `
+            ${height}
+            width: ${width}px;
+            background-color: ${color};
+            -webkit-transform: translateX(${left}px);
+            transform: translateX(${left}px);
+            ${transition}
+          `
+                });
+            });
+        },
+        setTrack() {
+            const { animated, active, duration } = this.data;
+            if (!animated)
+                return '';
+            this.getRect('.van-tabs__content').then((rect) => {
+                const { width } = rect;
+                this.set({
+                    trackStyle: `
+            width: ${width * this.child.length}px;
+            left: ${-1 * active * width}px;
+            transition: left ${duration}s;
+            display: -webkit-box;
+            display: flex;
+          `
+                });
+                const props = { width, animated };
+                this.child.forEach((item) => {
+                    item.set(props);
+                });
+            });
+        },
+        setActiveTab() {
+            this.child.forEach((item, index) => {
+                const data = {
+                    active: index === this.data.active
+                };
+                if (data.active) {
+                    data.inited = true;
+                }
+                if (data.active !== item.data.active) {
+                    item.set(data);
+                }
+            });
+            nextTick(() => {
+                this.setLine();
+                this.setTrack();
+                this.scrollIntoView();
+            });
+        },
+        // scroll active tab into view
+        scrollIntoView() {
+            const { active, scrollable } = this.data;
+            if (!scrollable) {
+                return;
+            }
+            Promise.all([
+                this.getRect('.van-tab', true),
+                this.getRect('.van-tabs__nav')
+            ]).then(([tabRects, navRect]) => {
+                const tabRect = tabRects[active];
+                const offsetLeft = tabRects
+                    .slice(0, active)
+                    .reduce((prev, curr) => prev + curr.width, 0);
+                this.set({
+                    scrollLeft: offsetLeft - (navRect.width - tabRect.width) / 2
+                });
+            });
+        },
+        onTouchStart(event) {
+            if (!this.data.swipeable)
+                return;
+            this.touchStart(event);
+        },
+        onTouchMove(event) {
+            if (!this.data.swipeable)
+                return;
+            this.touchMove(event);
+        },
+        // watch swipe touch end
+        onTouchEnd() {
+            if (!this.data.swipeable)
+                return;
+            const { active, tabs } = this.data;
+            const { direction, deltaX, offsetX } = this;
+            const minSwipeDistance = 50;
+            if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
+                if (deltaX > 0 && active !== 0) {
+                    this.setActive(active - 1);
+                }
+                else if (deltaX < 0 && active !== tabs.length - 1) {
+                    this.setActive(active + 1);
+                }
+            }
+        },
+        setWrapStyle() {
+            const { offsetTop, position } = this.data;
+            let wrapStyle;
+            switch (position) {
+                case 'top':
+                    wrapStyle = `
+            top: ${offsetTop}px;
+            position: fixed;
+          `;
+                    break;
+                case 'bottom':
+                    wrapStyle = `
+            top: auto;
+            bottom: 0;
+          `;
+                    break;
+                default:
+                    wrapStyle = '';
+            }
+            // cut down `set`
+            if (wrapStyle === this.data.wrapStyle)
+                return;
+            this.set({ wrapStyle });
+        },
+        observerContentScroll() {
+            if (!this.data.sticky) {
+                return;
+            }
+            const { offsetTop } = this.data;
+            const { windowHeight } = wx.getSystemInfoSync();
+            // @ts-ignore
+            this.createIntersectionObserver().disconnect();
+            // @ts-ignore
+            this.createIntersectionObserver()
+                .relativeToViewport({ top: -(this.navHeight + offsetTop) })
+                .observe('.van-tabs', (res) => {
+                const { top } = res.boundingClientRect;
+                if (top > offsetTop) {
+                    return;
+                }
+                const position = res.intersectionRatio > 0 ? 'top' : 'bottom';
+                this.$emit('scroll', {
+                    scrollTop: top + offsetTop,
+                    isFixed: position === 'top'
+                });
+                this.setPosition(position);
+            });
+            // @ts-ignore
+            this.createIntersectionObserver()
+                .relativeToViewport({ bottom: -(windowHeight - 1 - offsetTop) })
+                .observe('.van-tabs', (res) => {
+                const { top, bottom } = res.boundingClientRect;
+                if (bottom < this.navHeight) {
+                    return;
+                }
+                const position = res.intersectionRatio > 0 ? 'top' : '';
+                this.$emit('scroll', {
+                    scrollTop: top + offsetTop,
+                    isFixed: position === 'top'
+                });
+                this.setPosition(position);
+            });
+        },
+        setPosition(position) {
+            if (position !== this.data.position) {
+                this.set({ position }).then(() => {
+                    this.setWrapStyle();
+                });
+            }
+        }
+    }
+});

+ 6 - 0
view/xcx/miniprogram_npm/vant-weapp/tabs/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-info": "../info/index"
+  }
+}

+ 49 - 0
view/xcx/miniprogram_npm/vant-weapp/tabs/index.wxml

@@ -0,0 +1,49 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<view class="custom-class {{ utils.bem('tabs', [type]) }}">
+  <view style="z-index: {{ zIndex }}; {{ wrapStyle }};top:{{navH}}rpx" class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }}">
+    <slot name="nav-left" />
+
+    <scroll-view
+      scroll-x="{{ scrollable }}"
+      scroll-with-animation
+      scroll-left="{{ scrollLeft }}"
+      class="van-tabs__scroll--{{ type }}"
+      style="{{ color ? 'border-color: ' + color : '' }}"
+    >
+      <view class="{{ utils.bem('tabs__nav', [type]) }} nav-class">
+        <view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ lineStyle }}" />
+        <view
+          wx:for="{{ tabs }}"
+          wx:key="index"
+          data-index="{{ index }}"
+          class="van-ellipsis tab-class {{ index === active ? 'tab-active-class' : '' }} {{ utils.bem('tab', { active: index === active, disabled: item.disabled }) }}"
+          style="{{ color && index !== active && type === 'card' && !item.disabled ? 'color: ' + color : '' }} {{ color && index === active && type === 'card' ? ';background-color:' + color : '' }} {{ color ? ';border-color: ' + color : '' }} {{ scrollable ? ';flex-basis:' + (88 / swipeThreshold) + '%' : '' }}"
+          bind:tap="onTap"
+        >
+          <view class="van-ellipsis {{ utils.bem('tab__title', { dot: item.dot }) }}" style="{{ item.titleStyle }}">
+            {{ item.title }}
+            <van-info
+              wx:if="{{ item.info !== null }}"
+              info="{{ item.info }}"
+              custom-class="van-tab__title__info"
+            />
+          </view>
+        </view>
+      </view>
+    </scroll-view>
+
+    <slot name="nav-right" />
+  </view>
+  <view
+    class="van-tabs__content"
+    bind:touchstart="onTouchStart"
+    bind:touchmove="onTouchMove"
+    bind:touchend="onTouchEnd"
+    bind:touchcancel="onTouchEnd"
+  >
+    <view class="van-tabs__track" style="{{ trackStyle }}">
+      <slot />
+    </view>
+  </view>
+</view>

+ 2 - 0
view/xcx/miniprogram_npm/vant-weapp/tabs/index.wxss

@@ -0,0 +1,2 @@
+@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{position:absolute;top:0;right:0;left:0;display:-webkit-flex;display:flex;background-color:#fff}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll--card{border:1px solid #f44;border-radius:2px}.van-tabs__nav{position:relative;display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{height:30px}.van-tabs__nav--card .van-tab{line-height:30px;color:#f44;border-right:1px solid #f44}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{position:absolute;bottom:0;left:0;z-index:1;height:3px;background-color:#f44;border-radius:3px}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px;overflow:hidden;}.van-tabs--card{padding-top:30px;margin:0 15px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tabs__content{overflow:hidden}.van-tab,.van-tabs__track{position:relative}.van-tab{min-width:0;padding:0 5px;font-size:14px;line-height:44px;color:#7d7e80;text-align:center;cursor:pointer;box-sizing:border-box;-webkit-flex:1;flex:1}.van-tab--active{font-weight:500;color:#333}.van-tab--disabled{color:#c9c9c9}.van-tab__title--dot:after{display:inline-block;width:8px;height:8px;vertical-align:middle;background-color:#f44;border-radius:100%;content:""}.van-tab__title__info{position:relative!important;top:-1px!important;display:inline-block;-webkit-transform:translateX(0)!important;transform:translateX(0)!important}
+.van-tabs__scroll--line{height:48px;}

+ 5 - 0
view/xcx/miniprogram_npm/vant-weapp/wxs/array.wxs

@@ -0,0 +1,5 @@
+function isArray(array) {
+  return array && array.constructor === 'Array';
+}
+
+module.exports.isArray = isArray;

+ 38 - 0
view/xcx/miniprogram_npm/vant-weapp/wxs/bem.wxs

@@ -0,0 +1,38 @@
+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 = bem;

+ 54 - 0
view/xcx/miniprogram_npm/vant-weapp/wxs/memoize.wxs

@@ -0,0 +1,54 @@
+/**
+ * Simple memoize
+ * wxs doesn't support fn.apply, so this memoize only support up to 2 args
+ */
+
+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 = memoize;

+ 13 - 0
view/xcx/miniprogram_npm/vant-weapp/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;

+ 12 - 0
view/xcx/miniprogram_npm/vant-weapp/wxs/utils.wxs

@@ -0,0 +1,12 @@
+var bem = require('./bem.wxs').bem;
+var memoize = require('./memoize.wxs').memoize;
+
+function isSrc(url) {
+  return url.indexOf('http') === 0 || url.indexOf('data:image') === 0 || url.indexOf('//') === 0;
+}
+
+module.exports = {
+  bem: memoize(bem),
+  isSrc: isSrc,
+  memoize: memoize
+};

+ 13 - 0
view/xcx/package-lock.json

@@ -0,0 +1,13 @@
+{
+  "name": "twong",
+  "version": "1.0.0",
+  "lockfileVersion": 1,
+  "requires": true,
+  "dependencies": {
+    "vant-weapp": {
+      "version": "0.5.23",
+      "resolved": "https://registry.npmjs.org/vant-weapp/-/vant-weapp-0.5.23.tgz",
+      "integrity": "sha512-kI0uYbF5rp85u+puNtXUMqnDbefUvAhJ+sC0Tfx8H95fmUM+MpvEaNxR6JdTYv1JMOL++D3HkpNDxSr4ClrNFg=="
+    }
+  }
+}

+ 14 - 0
view/xcx/package.json

@@ -0,0 +1,14 @@
+{
+  "name": "twong",
+  "version": "1.0.0",
+  "description": "twong",
+  "main": "app.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "vant-weapp": "^0.5.23"
+  }
+}

+ 1 - 1
view/xcx/pages/admin/order_cancellation/index.wxml

@@ -8,7 +8,7 @@
       <view class="bnt" bindtap="codeChange">立即核销</view>
     </view>
     <view class="scan" bindtap="scanCode">
-      <image src="/images/scan.gif"></image>
+      <!-- <image src="/images/scan.gif"></image> -->
     </view>
 </view>
 <view wx:if="{{iShidden}}">

+ 420 - 197
view/xcx/pages/index/index.js

@@ -1,198 +1,421 @@
-const app = getApp();
-
-import { getIndexData, getCoupons, getTemlIds, getLiveList} from '../../api/api.js';
-import { CACHE_SUBSCRIBE_MESSAGE } from '../../config.js';
-import Util from '../../utils/util.js';
-import wxh from '../../utils/wxh.js';
-Page({
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    imgUrls: [],
-    itemNew:[],
-    activityList:[],
-    menus: [],
-    bastBanner: [],
-    bastInfo: '',
-    bastList: [],
-    fastInfo: '',
-    fastList: [],
-    firstInfo: '',
-    firstList: [],
-    salesInfo: '',
-    likeInfo: [],
-    lovelyBanner: {},
-    benefit:[],
-    indicatorDots: false,
-    circular: true,
-    autoplay: true,
-    interval: 3000,
-    duration: 500,
-    parameter:{
-      'navbar':'0',
-      'return':'0'
-    },
-    window: false,
-    iShidden:false,
-    navH: "",
-    newGoodsBananr:'',
-    selfLongitude: '',
-    selfLatitude: '',
-    liveList: [],
-    liveInfo:{},
-  },
-  closeTip:function(){
-    wx.setStorageSync('msg_key',true);
-    this.setData({
-      iShidden:true
-    })
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    wxh.selfLocation(1);
-    this.setData({
-      navH: app.globalData.navHeight
-    });
-    if (options.spid) app.globalData.spid = options.spid;
-    if (options.scene) app.globalData.code = decodeURIComponent(options.scene);
-    if (wx.getStorageSync('msg_key')) this.setData({ iShidden:true});
-    this.getTemlIds();
-    this.getLiveList();
-  },
-  getLiveList:function(){
-    getLiveList(1,20).then(res=>{
-      if(res.data.length == 1){
-        this.setData({liveInfo:res.data[0]});
-      }else{
-        this.setData({liveList:res.data});
-      }
-    }).catch(res=>{
-
-    })
-  },
-  /**
-   * 商品详情跳转
-   */
-  goDetail: function (e) {
-    let item = e.currentTarget.dataset.items
-    if (item.activity && item.activity.type === "1") {
-      wx.navigateTo({
-        url: `/pages/activity/goods_seckill_details/index?id=${item.activity.id}&time=${item.activity.time}&status=1`
-      });
-    } else if (item.activity && item.activity.type === "2") {
-      wx.navigateTo({ url: `/pages/activity/goods_bargain_details/index?id=${item.activity.id}` });
-    } else if (item.activity && item.activity.type === "3") {
-      wx.navigateTo({
-        url: `/pages/activity/goods_combination_details/index?id=${item.activity.id}`
-      });
-    } else {
-      wx.navigateTo({ url: `/pages/goods_details/index?id=${item.id}` });
-    }
-  },
-  getTemlIds(){
-    let messageTmplIds = wx.getStorageSync(CACHE_SUBSCRIBE_MESSAGE);
-    if (!messageTmplIds){
-      getTemlIds().then(res=>{
-        if (res.data) 
-          wx.setStorageSync(CACHE_SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
-      })
-    }
-  },
-  catchTouchMove: function (res) {
-    return false
-  },
-  onColse:function(){
-    this.setData({ window: false});
-  },
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-    this.getIndexConfig();
-    if(app.globalData.isLog && app.globalData.token) this.get_issue_coupon_list();
-  },
-  get_issue_coupon_list:function(){
-    var that = this;
-    getCoupons({page:1,limit:3}).then(res=>{
-      that.setData({ couponList: res.data });
-      if (!res.data.length) that.setData({ window: false });
-    });
-  },
-  getIndexConfig:function(){
-    var that = this;
-    getIndexData().then(res=>{
-      that.setData({
-        imgUrls: res.data.banner,
-        menus: res.data.menus,
-        itemNew: res.data.roll,
-        activityList: res.data.activity,
-        bastBanner: res.data.info.bastBanner,
-        bastInfo: res.data.info.bastInfo,
-        bastList: res.data.info.bastList,
-        fastInfo: res.data.info.fastInfo,
-        fastList: res.data.info.fastList,
-        firstInfo: res.data.info.firstInfo,
-        firstList: res.data.info.firstList,
-        salesInfo: res.data.info.salesInfo,
-        likeInfo: res.data.likeInfo,
-        lovelyBanner: res.data.lovely.length ? res.data.lovely[0] : {},
-        benefit: res.data.benefit,
-        logoUrl: res.data.logoUrl,
-        couponList: res.data.couponList,
-        newGoodsBananr: res.data.newGoodsBananr
-      });
-      wx.getSetting({
-        success(res) {
-          if (!res.authSetting['scope.userInfo']) {
-            that.setData({ window: that.data.couponList.length ? true : false });
-          } else {
-            that.setData({ window: false, iShidden: true});
-          }
-        }
-      });
-    })
-  },
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-    this.setData({ window:false});
-  },
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-    this.getIndexConfig();
-    if (app.globalData.isLog && app.globalData.token) this.get_issue_coupon_list();
-    wx.stopPullDownRefresh();
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  }
+const app = getApp();
+import wxh from '../../utils/wxh.js';
+import { getIndexData, getCoupons, getTemlIds, getLiveList } from '../../api/api.js';
+import { CACHE_SUBSCRIBE_MESSAGE } from '../../config.js';
+import { getCategoryList, getProductHot, getProductslist } from '../../api/store.js';
+import { getCouponReceive} from '../../api/user.js';
+import { getSeckillIndexTime, getSeckillList } from '../../api/activity.js';
+
+import Util from '../../utils/util.js';
+
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    logoUrl:'',
+    categoryOne:[],
+    banner: [],
+    itemNew: [],
+    menus: [],
+    getCouponList:[],
+    activity:[],
+    timeList: [],
+    killIndex: 0,//点击当前index值;
+    seckillTimeIndex: 0, //当前秒杀index;
+    killIndexTime: 0,//点击当前index值所对应的秒杀时间;
+    killIndexLen: 0,//当前秒杀的产品列表长度
+    seckillList:[],
+    scrollLeft: 0,
+    elementWidth:0,
+    status:1,
+    lovely: [],
+    info: {
+      fastList: [],
+      bastBanner: [],
+      firstList: [],
+      bastList: []
+    },
+    avtiveIndex: 0,
+    likeInfo: [],
+    benefit:[],
+    hostProduct: [],
+    indicatorDots: false,
+    circular: true,
+    autoplay: true,
+    intervalNew: 3500,
+    durationNew: 700,
+    parameter:{
+      'navbar':'0',
+      'return':'0',
+      'class':'5'
+    },
+    window: false,
+    iShiddenTip: false,
+    isAuto: false, //是否自动授权;
+    iShidden: true, //是否隐藏;
+    isGoIndex: false, //是否返回首页;
+    navH: "",
+    recommend:{
+      loadend: false,
+      loading: false,
+      loadTitle: '加载更多',
+      page: 1,
+      limit:20,
+    },
+    where: {
+      page: 1,
+      limit: 20,
+      cid: 0, //一级分类id
+      sid: 0 //二级分类id
+    },
+    loadend: false,
+    loading: false,
+    loadTitle: '加载更多',
+    productList: [],
+    categoryActive: 0,
+    tapActive:0,
+    countDownHour: "00",
+    countDownMinute: "00",
+    countDownSecond: "00",
+    seckillCont:true,
+    interval:null,
+    newGoodsBananr: '',
+    liveList: [],
+    liveInfo: {}
+  },
+  closeTip:function(){
+    wx.setStorageSync('msg_key',true);
+    this.setData({
+      iShiddenTip:true
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wxh.selfLocation(1);
+    this.getCategoryData();
+    // this.getCoupon();
+    this.get_host_product();
+    this.get_product_list();
+    this.setData({
+      navH: app.globalData.navHeight
+    });
+    if (options.spid) app.globalData.spid = options.spid;
+    if (options.scene) app.globalData.code = decodeURIComponent(options.scene);
+    if (wx.getStorageSync('msg_key')) this.setData({ iShiddenTip:true});
+    this.getTemlIds();
+    this.getLiveList();
+  },
+  getTemlIds() {
+    let messageTmplIds = wx.getStorageSync(CACHE_SUBSCRIBE_MESSAGE);
+    if (!messageTmplIds) {
+      getTemlIds().then(res => {
+        if (res.data)
+          wx.setStorageSync(CACHE_SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
+      }).catch(()=>{})
+    }
+  },
+  //授权
+  onLoadFun: function () {
+    this.getCoupon();
+  },
+  catchTouchMove: function (res) {
+    return false
+  },
+  onColse:function(){
+    this.setData({ window: false});
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+  bindchange(e) {
+    var index = e.detail.current;
+    this.setData({ avtiveIndex: index});
+  },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    // this.getCoupon();
+    this.getIndexConfig();
+    // this.getSeckillTime();
+  },
+  getIndexConfig:function(){
+    var that = this;
+    getIndexData().then(res=>{
+      that.setData({
+        banner: res.data.banner,
+        menus: res.data.menus,
+        activity: res.data.activity,
+        lovely: res.data.lovely,
+        info: res.data.info,
+        itemNew: res.data.roll,
+        likeInfo: res.data.likeInfo,
+        benefit: res.data.benefit,
+        logoUrl: res.data.logoUrl,
+        couponList: res.data.couponList,
+      });
+      // 检测是否授权;scope.userInfo存在为授权;
+      wx.getSetting({
+        success(res) {
+          if (!res.authSetting['scope.userInfo']) {
+            that.setData({ window: that.data.couponList.length ? true : false });
+          } else {
+            that.setData({ window: false, iShidden: true});
+          }
+        }
+      });
+    })
+  },
+  getLiveList: function () {
+    getLiveList(1, 20).then(res => {
+      if (res.data.length == 1) {
+        this.setData({ liveInfo: res.data[0] });
+      } else {
+        this.setData({ liveList: res.data });
+      }
+    }).catch(res => {
+
+    })
+  },
+  /**
+ * 商品详情跳转
+ */
+  goDetailType: function (e) {
+    let item = e.currentTarget.dataset.items
+    if (item.activity && item.activity.type === "1") {
+      wx.navigateTo({
+        url: `/pages/activity/goods_seckill_details/index?id=${item.activity.id}&time=${item.activity.time}&status=1`
+      });
+    } else if (item.activity && item.activity.type === "2") {
+      wx.navigateTo({ url: `/pages/activity/goods_bargain_details/index?id=${item.activity.id}` });
+    } else if (item.activity && item.activity.type === "3") {
+      wx.navigateTo({
+        url: `/pages/activity/goods_combination_details/index?id=${item.activity.id}`
+      });
+    } else {
+      wx.navigateTo({ url: `/pages/goods_details/index?id=${item.id}` });
+    }
+  },
+  /**
+* 获取我的推荐
+*/
+  get_host_product: function (isPage) {
+    var that = this;
+    if (that.data.recommend.loadend) return;
+    if (that.data.recommend.loading) return;
+    if (isPage === true) that.setData({ hostProduct: [] });
+    that.setData({'recommend.loading': true, 'recommend.loadTitle': ''});
+    getProductHot(that.data.recommend.page, that.data.recommend.limit).then(res => {
+      let list = res.data;
+      let hostProduct = app.SplitArray(list, that.data.hostProduct);
+      let loadend = list.length < that.data.recommend.limit;
+      that.setData({
+        'recommend.loadend': loadend,
+        'recommend.loading': false,
+        'recommend.loadTitle': loadend ? '已全部加载' : '加载更多',
+        hostProduct: hostProduct,
+        ['recommend.page']: that.data.recommend.page + 1,
+      });
+    }).catch(err => {
+      that.setData({ loading: false, loadTitle: '加载更多' });
+    });
+  },
+  categoryTap: function (event) {
+    let that = this, tapActive = event.detail.index;
+    that.setData({
+      tapActive: tapActive
+    })
+    if (tapActive > 0) {
+      that.setData({
+         'where.page':1,
+         loadend:false,
+         loading:false,
+         'where.cid': that.data.categoryOne[tapActive - 1].id,
+         'where.sid': that.data.categoryOne[tapActive - 1].children.length
+          ? that.data.categoryOne[tapActive - 1].children[0].id
+          : -1,
+        categoryActive:0
+      })
+      that.get_product_list(true);
+    }
+  },
+  productTap: function (e) {
+    let that = this,index = e.currentTarget.dataset.indexn;
+    that.setData({
+      categoryActive: index,
+      'where.page':1,
+      loadend:false,
+      loading:false,
+      'where.sid': that.data.categoryOne[that.data.tapActive - 1].children[index].id
+    })
+    that.get_product_list(true);
+  },
+  get_product_list: function (isPage){
+    var that = this;
+    if (that.data.loading) return;
+    if (that.data.loadend) return;
+    if (isPage === true) that.setData({ productList: [] });
+    that.setData({ loading: true, loadTitle: '' });
+    getProductslist(that.data.where).then(res => {
+      let list = res.data;
+      let productList = app.SplitArray(list, that.data.productList);
+      let loadend = list.length < that.data.where.limit;
+      that.setData({
+        loadend: loadend,
+        loading: false,
+        loadTitle: loadend ? '已全部加载' : '加载更多',
+        productList: productList,
+        ['where.page']: that.data.where.page + 1
+      });
+    }).catch(err => {
+      that.setData({ loading: false, loadTitle: '加载更多' });
+    });
+  },
+  getSeckillTime: function () {
+    let that = this;
+    getSeckillIndexTime().then(res => {
+      let timeList = res.data.seckillTime, seckillTimeIndex = res.data.seckillTimeIndex;
+      that.setData({
+        timeList: timeList,
+        seckillCont: res.data.seckillCont,
+        killIndex: seckillTimeIndex,
+        seckillTimeIndex: seckillTimeIndex,
+        killIndexTime: timeList[that.data.killIndex].stop,
+        status: timeList[seckillTimeIndex].status
+      })
+      wxh.time(timeList[that.data.killIndex].stop, that,false);
+      that.getSeckillLists(); 
+    }).catch(()=>{
+      
+    });
+  },
+  setTime: function (e) {
+    var that = this, index = e.currentTarget.dataset.index;
+    that.setData({
+      killIndex: index,
+      status: that.data.timeList[index].status
+    })
+    that.getSeckillLists();
+  },
+  getSeckillLists: function () {
+    let that = this;
+    let timeId = that.data.timeList[that.data.killIndex].id;
+    getSeckillList(timeId, { page: 1, limit: 20 }).then(res => {
+      that.setData({
+        seckillList: res.data
+      })
+      
+      if (this.data.timeList.length){
+        let query = wx.createSelectorQuery().in(this);
+        query.select('.timeLen').boundingClientRect(function (res) {
+          if(res){
+            that.setData({
+              scrollLeft: (that.data.killIndex - 1.8) * res.width
+            });
+          }
+        }).exec();
+        if (that.data.killIndex === that.data.seckillTimeIndex) {
+          that.setData({
+            killIndexLen: res.data.length
+          })
+        }
+      }
+    }).catch(()=>{});
+  },
+  goDetail: function (e) {
+    let index = this.data.timeList[this.data.killIndex];
+    wx.navigateTo({
+      url: '/pages/activity/goods_seckill_details/index?id=' + e.currentTarget.dataset.id + '&time=' + index.stop + '&status=' + index.status
+    })
+  },
+  getCategoryData: function () {
+    let that = this;
+    getCategoryList().then(res => {
+      that.setData({
+        categoryOne: res.data
+      })
+    });
+  },
+  getCoupon: function () {
+    var that = this;
+    getCoupons({page: 1,limit: 6}).then(res => {
+      that.setData({
+        getCouponList: res.data
+      })
+    }).catch(err => {
+      // app.Tips({
+      //   title: err
+      // });
+    });
+  },
+  receiveCoupon: function (e) {
+    if (!app.globalData.isLog) {
+      this.setData({
+        iShidden: false
+      });
+    } else {
+      var that = this;
+      var list = that.data.getCouponList;
+      var index = e.currentTarget.dataset.index;
+      var id = that.data.getCouponList[index].id;
+      getCouponReceive({
+        couponId: id
+      })
+        .then(function () {
+          list[index].is_use = true;
+          that.setData({
+            getCouponList: that.data.getCouponList
+          })
+          app.Tips({
+            title: "领取成功"
+          });
+        })
+        .catch(function (err) {
+          // app.Tips({
+          //   title: err
+          // });
+        });
+    }
+  },
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+    this.setData({ window:false});
+    this.data.interval !== null && clearInterval(this.data.interval);
+  },
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+    this.data.interval !== null && clearInterval(this.data.interval);
+  },
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+    this.getIndexConfig();
+    wx.stopPullDownRefresh();
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    this.get_host_product();
+    this.get_product_list();
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
 })

+ 14 - 8
view/xcx/pages/index/index.json

@@ -1,9 +1,15 @@
-{
-  "usingComponents": {
-    "navbar": "/components/navbar/index",
-    "goodList": "/components/goodList/index",
-    "promotionGood": "/components/promotionGood/index",
-    "coupon-window": "/components/coupon-window/index",
-    "home": "/components/home/index"
-  }
+{
+  "usingComponents": {
+    "navbar": "/components/navbar/index",
+    "goodList": "/components/goodList/index",
+    "promotionGood": "/components/promotionGood/index",
+    "coupon-window": "/components/coupon-window/index",
+    "authorize": "/components/authorize/authorize",
+    "home": "/components/home/index",
+    "Tab": "vant-weapp/tab/index",
+    "Tabs": "vant-weapp/tabs/index",
+    "recommend": "/components/recommend/index",
+    "Mine": "/components/mine/index"
+  },
+  "navigationBarTextStyle": "white"
 }

+ 427 - 213
view/xcx/pages/index/index.wxml

@@ -1,213 +1,427 @@
-<navbar parameter='{{parameter}}' logoUrl="{{logoUrl}}"></navbar>
-<view class='index'>
-    <view class="indexTip" style="top:{{navH+13}}rpx" hidden="{{iShidden}}">
-       <view class="tip acea-row row-between-wrapper">
-          <view class="text">点击“<image src="/images/spot.png"></image>”添加到我的小程序, 微信首页下拉即可访问商城。</view>
-       <view class="iconfont icon-guanbi1" bindtap="closeTip"></view>
-       </view> 
-    </view>
-    <view class='index-bg' wx:if="{{imgUrls.length}}">
-        <swiper indicator-dots="true"
-            autoplay="{{autoplay}}" circular="{{circular}}" interval="{{interval}}" duration="{{duration}}" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
-            <block wx:for="{{imgUrls}}" wx:key='index'>
-              <swiper-item>
-                <navigator url='{{item.url}}' class='slide-navigator acea-row row-between-wrapper' hover-class='none'>
-                  <image src="{{item.pic}}" class="slide-image"/>
-                </navigator>                
-              </swiper-item>
-            </block>
-        </swiper>
-    </view>
-    <view class='nav acea-row' wx:if="{{menus.length}}">
-      <block wx:for="{{menus}}" wx:key='index'>
-        <navigator class='item' wx:if="{{item.show == '1'}}" url='{{item.url}}'  open-type='switchTab' hover-class='none'>
-          <view class='pictrue'><image src='{{item.pic}}'></image></view>
-          <view>{{item.name}}</view>
-        </navigator>
-        <navigator class='item' wx:else url='{{item.url}}' hover-class='none'>
-          <view class='pictrue'><image src='{{item.pic}}'></image></view>
-          <view>{{item.name}}</view>
-        </navigator>
-      </block> 
-    </view>
-    <view class='news acea-row row-between-wrapper' wx:if="{{itemNew.length}}">
-       <view class='pictrue'><image src='/images/news.png'></image></view>
-       <view class='swiperTxt'>
-            <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="2500" duration="{{duration}}" vertical="true" circular="true">
-                <block wx:for="{{itemNew}}" wx:key='index'>
-                    <swiper-item catchtouchmove='catchTouchMove'>
-                        <navigator wx:if="{{item.show == '1'}}" url='{{item.url}}'  open-type='switchTab' class='acea-row row-between-wrapper' hover-class='none'>
-                            <view class='text acea-row row-between-wrapper'>
-                                <view class='label border2' wx:if="{{item.id%2 == 0}}">最新</view>
-                                <view class='newsTitle line1'>{{item.info}}</view>
-                            </view>
-                            <view class='iconfont icon-xiangyou'></view>
-                        </navigator>
-                        <navigator wx:else open-type='navigate' url='{{item.url}}'  class='acea-row row-between-wrapper' hover-class='none'>
-                            <view class='text acea-row row-between-wrapper'>
-                                <view class='label border2' wx:if="{{item.id%2 == 0}}">最新</view>
-                                <view class='newsTitle line1'>{{item.info}}</view>
-                            </view>
-                            <view class='iconfont icon-xiangyou'></view>
-                        </navigator>
-                    </swiper-item>
-                  </block>
-              </swiper> 
-       </view>
-    </view>
-    <view class='specialArea acea-row row-between-wrapper' wx:if="{{activityList.length}}">
-      <block wx:for="{{activityList}}" wx:key='index'>
-       <navigator class='assemble' url='{{item.link}}' wx:if="{{index < 1}}">
-          <image src='{{item.pic}}'></image>
-          <view class='text'>
-             <view class='name'>{{item.title}}</view>
-             <view class='infor'>{{item.info}}</view>
-          </view>
-       </navigator>
-      </block> 
-       <view class='list acea-row row-column-between'>
-          <block wx:for="{{activityList}}" wx:key='index'>
-            <navigator class='item' url='{{item.link}}' wx:if="{{index > 0}}">
-              <image src='{{item.pic}}'></image>
-              <view class='text'>
-                  <view class='name'>{{item.title}}</view>
-                  <view class='infor'>{{item.info}}</view>
-              </view>
-            </navigator>
-          </block>  
-       </view>
-    </view>
-    <view class="liveBroadcast" wx:if='{{liveList.length || liveInfo.roomid}}'>
-        <view class="title">热门直播</view>
-        <!-- end:结束;time:直播时间 -->
-        <navigator wx:if='{{liveInfo.roomid}}' hover-class="none" url="plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id={{liveInfo.roomid}}" class="broadcast time">
-           <view class="pictrue">
-              <image src="{{liveInfo.share_img}}"></image>
-              <view class="label" wx:if='{{liveInfo.live_status == 101}}'><text class="iconfont icon-zhibo"></text>直播中</view>
-              <view class="label" wx:if='{{liveInfo.live_status == 103}}'><text class="iconfont icon-zhibojieshux"></text>已结束</view>
-              <view class="label" wx:if='{{liveInfo.live_status == 102}}'><text class="iconfont icon-shijian"></text>直播时间 {{liveInfo._start_time}}</view>
-           </view>
-           <view class="text line1">{{liveInfo.name}}</view>
-        </navigator>
-        <view class="list" wx:if="{{liveList.length}}">
-           <scroll-view class="scroll-view_x" scroll-x style="width:auto;overflow:hidden;">
-              <navigator hover-class="none" wx:for='{{liveList}}' wx:key='index' url="plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id={{item.roomid}}" class="item">
-                  <view class="pictrue">
-                    <image src="{{item.share_img}}"></image>
-                    <view class="label" wx:if='{{item.live_status == 101}}'><text class="iconfont icon-zhibo"></text>直播中</view>
-              <view class="label" wx:if='{{item.live_status == 103}}'><text class="iconfont icon-zhibojieshux"></text>已结束</view>
-              <view class="label" wx:if='{{item.live_status == 102}}'><text class="iconfont icon-shijian"></text>直播时间 {{item._start_time}}</view>
-                  </view>
-                  <view class="text line1">{{item.name}}</view>
-                </navigator>
-            </scroll-view>
-        </view>
-    </view>
-    <view class='wrapper' wx:if="{{fastList.length}}">
-       <view class='title acea-row row-between-wrapper'>
-          <view class='text'>
-             <view class='name line1'>快速选择</view>
-             <view class='line1'>{{fastInfo}}</view>
-          </view>
-          <navigator class='more' url='/pages/goods_cate/goods_cate' open-type='switchTab'>更多<text class='iconfont icon-jiantou'></text></navigator>
-       </view>
-       <view class='scroll-product'>
-          <scroll-view class="scroll-view_x" scroll-x style="width:auto;overflow:hidden;">
-              <block wx:for="{{fastList}}" wx:key='index'>
-                 <navigator hover-class="none" class='item' url='/pages/goods_list/goods_list?sid={{item.id}}&title={{item.cate_name}}'>
-                    <view class='img-box'>
-                      <image src='{{item.pic}}'></image>
-                    </view>
-                    <view class='pro-info line1'>{{item.cate_name}}</view>
-                  </navigator>
-              </block>  
-           </scroll-view>
-        </view>
-    </view>
-     <view class='wrapper' wx:if="{{bastList.length}}">
-       <view class='title acea-row row-between-wrapper'>
-          <view class='text'>
-             <view class='name line1'>精品推荐</view>
-             <view class='line1'>{{bastInfo}}</view>
-          </view>
-          <navigator class='more' hover-class="none" url='/pages/first-new-product/index?type=1'>更多<text class='iconfont icon-jiantou'></text></navigator>
-       </view>
-       <view class='boutique'>
-            <swiper  autoplay="true"  indicator-dots="true"
-                 circular="{{circular}}" interval="{{interval}}" duration="{{duration}}" indicator-color="rgba(252,65,65,0.3)" indicator-active-color="#fc4141">
-                <block wx:for="{{bastBanner}}" wx:key='index'>
-                  <swiper-item>
-                <navigator url='{{item.link}}' style='width:100%;height:100%;' hover-class='none'>
-                    <image src="{{item.img}}" class="slide-image" data-idx='{{index}}'/>
-                    </navigator>
-                  </swiper-item>
-                </block>
-            </swiper>
-       </view>
-       <goodList bastList="{{bastList}}"></goodList>
-    </view>
-    <view class='hotList' wx:if="{{likeInfo.length}}">
-       <view class='hot-bg'>
-          <view class='title acea-row row-between-wrapper'>
-            <view class='text line1'><text class='label'>热门榜单</text>根据销量、搜索、好评等综合得出</view>
-            <navigator class='more' hover-class="none" url='/pages/first-new-product/index?type=2'>更多<text class="iconfont icon-jiantou"></text></navigator>
-          </view>
-       </view>
-       <view class='list acea-row row-middle'>
-          <block wx:for="{{likeInfo}}" wx:key='index'>
-            <navigator class='item' url='/pages/goods_details/index?id={{item.id}}'>
-              <view class='pictrue'>
-                <image src='{{item.image}}'></image>
-                <image wx:if="{{index == 0}}" src='/images/one.png' class='numPic'></image>
-                <image wx:elif="{{index == 1}}" src='/images/two.png' class='numPic'></image>
-                <image wx:elif="{{index == 2}}" src='/images/three.png' class='numPic'></image>
-              </view>
-              <view class='name line1'>{{item.store_name}}</view>
-              <view class='money font-color'>¥<text class='num'>{{item.price}}</text></view>
-            </navigator>
-          </block>  
-       </view>
-    </view>
-    <view class='adver' wx:if="{{newGoodsBananr}}">
-      <block>
-        <image src='{{newGoodsBananr}}'></image>
-      </block>  
-    </view>
-     <view class='wrapper' wx:if="{{firstList.length}}">
-       <view class='title acea-row row-between-wrapper'>
-          <view class='text'>
-             <view class='name line1'>首发新品<text class='new font-color'>NEW~</text></view>
-             <view class='line1'>{{firstInfo}}</view>
-          </view>
-          <navigator class='more' hover-class="none" url='/pages/first-new-product/index?type=3'>更多<text class='iconfont icon-jiantou'></text></navigator>
-       </view>
-       <view class='newProducts'>
-          <scroll-view class="scroll-view_x" scroll-x style="width:auto;overflow:hidden;">
-              <block wx:for="{{firstList}}" wx:key='index'>
-                 <view class='item'>
-                    <view class='img-box' bindtap="goDetail" data-items='{{item}}'>
-                      <image src='{{item.image}}'></image>
-                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type ==='1'}}">秒杀</text>
-                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '2'}}">砍价</text>
-                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '3'}}">拼团</text>
-                    </view>
-                    <view class='pro-info line1'>{{item.store_name}}</view>
-                    <view class='money font-color'>¥{{item.price}}</view>
-                 </view>
-              </block>  
-           </scroll-view>
-        </view>
-    </view>
-    <view class='wrapper' wx:if="{{benefit.length}}">
-       <view class='title acea-row row-between-wrapper'>
-          <view class='text'>
-             <view class='name line1'>促销单品</view>
-             <view class='line1'>{{salesInfo}}</view>
-          </view>
-          <navigator class='more' hover-class="none" url='/pages/promotional-items/index'>更多<text class='iconfont icon-jiantou'></text></navigator>
-       </view>
-       <promotionGood benefit="{{benefit}}"></promotionGood>
-    </view>
-</view>
-<coupon-window window='{{window}}' couponList="{{couponList}}" bind:onColse="onColse"></coupon-window>
-<home></home>
+<navbar parameter='{{parameter}}' logoUrl="{{logoUrl}}"></navbar>
+<view class="indexs">
+   <view class="indexTip" style="top:{{navH+13}}rpx" hidden="{{iShiddenTip}}">
+       <view class="tip acea-row row-between-wrapper">
+          <view class="text">点击“<image src="/images/spot.png"></image>”添加到我的小程序, 微信首页下拉即可访问商城。</view>
+       <view class="iconfont icon-guanbi1" bindtap="closeTip"></view>
+       </view> 
+    </view>
+    <Tabs color="#fff" active="{{tapActive}}" bind:click="categoryTap">
+      <Tab title="首页">
+        <view class="wrapper">
+          <view class="slider-banner banner">
+            <swiper indicator-dots="true"
+            autoplay="{{autoplay}}" circular="{{circular}}" interval="3000" duration="500" indicator-color="rgba(0,0,0,0.2)" indicator-active-color="#ff3366">
+              <swiper-item wx:for="{{banner}}" wx:key='index'>
+                <navigator url="{{item.url ? item.url : ''}}" class="pictrue acea-row row-middle" hover-class='none'>
+                  <image src="{{item.pic}}" class="slide-image"></image>
+                </navigator >
+              </swiper-item>
+            </swiper>
+          </view>
+          <view class="nav acea-row">
+            <block wx:for="{{menus}}" wx:key='index'>
+               <navigator url="{{item.url ? item.url : ''}}" wx:if="{{item.show == '1'}}" class="item" open-type='switchTab' hover-class='none'>
+              <view class="pictrue"><image src="{{item.pic}}"></image></view>
+              <view>{{ item.name }}</view>
+            </navigator>
+            <navigator url="{{item.url ? item.url : ''}}" wx:else class="item"  hover-class='none'>
+              <view class="pictrue"><image src="{{item.pic}}"></image></view>
+              <view>{{ item.name }}</view>
+            </navigator>
+            </block>
+          </view>
+          
+          <view class='news acea-row row-between-wrapper' wx:if="{{itemNew.length}}">
+            <view class='pictrue'><image src='/images/news.png'></image></view>
+            <view class='swiperTxt'>
+                  <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="2500" duration="{{duration}}" vertical="true" circular="true">
+                      <block wx:for="{{itemNew}}" wx:key='index'>
+                          <swiper-item catchtouchmove='catchTouchMove'>
+                              <navigator wx:if="{{item.show == '1'}}" url='{{item.url}}'  open-type='switchTab' class='acea-row row-between-wrapper' hover-class='none'>
+                                  <view class='text acea-row row-between-wrapper'>
+                                      <view class='label border2' wx:if="{{item.id%2 == 0}}">最新</view>
+                                      <view class='newsTitle line1'>{{item.info}}</view>
+                                  </view>
+                                  <view class='iconfont icon-xiangyou'></view>
+                              </navigator>
+                              <navigator wx:else open-type='navigate' url='{{item.url}}'  class='acea-row row-between-wrapper' hover-class='none'>
+                                  <view class='text acea-row row-between-wrapper'>
+                                      <view class='label border2' wx:if="{{item.id%2 == 0}}">最新</view>
+                                      <view class='newsTitle line1'>{{item.info}}</view>
+                                  </view>
+                                  <view class='iconfont icon-xiangyou'></view>
+                              </navigator>
+                          </swiper-item>
+                        </block>
+                    </swiper> 
+            </view>
+          </view>
+          
+          <view class="scroll-coupon" wx:if="{{getCouponList.length}}">
+             <scroll-view class="scroll-view_x" enable-flex scroll-x style="width:auto;overflow:hidden;">
+               <view
+                  class="item {{item.is_use ? 'on' : ''}}"
+                  data-index="{{index}}"
+                  bindtap="receiveCoupon"
+                  wx:for="{{getCouponList}}"
+                  wx:key='index'
+                >
+                  <image src="/images/label01.png" class="lable" wx:if='{{item.is_use === true}}'></image>
+                  <image src="/images/label02.png" class="lable" wx:elif='{{item.is_use === 2}}'></image>
+                  <view class="coupon-slide acea-row row-center-wrapper">
+                    <view class="money">
+                      ¥<text class="num">{{ item.coupon_price }}</text>
+                    </view>
+                    <view>
+                      <view class="minPrice">
+                        满¥<text class="num">{{ item.use_min_price }}</text>可用
+                      </view>
+                      <view class="time">
+                        {{ item.start_time ? item.start_time + "-" : ""
+                        }}{{ item.end_time }}
+                      </view>
+                    </view>
+                  </view>
+                </view>
+                <view class="more"><navigator url="/pages/user_get_coupon/index" hover-class="none">领取更多</navigator></view>
+             </scroll-view>
+          </view>
+          <!-- <view class="activity" wx:if="{{activity.length}}">
+            <view class="title"><image src="/images/title.png"></image></view>
+            <view class="activityCon acea-row row-between-wrapper">
+              <navigator url="{{item.link ? item.link : ''}}" class="left"
+              style="{{'background-image: url(' + item.pic + ');'}}"
+                hover-class="none" wx:for="{{activity}}" wx:if="{{index == 1}}" wx:key='index'>
+                <view class="name">{{ item.title }}</view>
+                <view class="info">{{ item.info }}</view>
+                <view class='timeCon'>
+                  <text class='num'>{{countDownHour}}</text> :
+                  <text class='num'>{{countDownMinute}}</text> :
+                  <text class='num'>{{countDownSecond}}</text>
+                </view>
+              </navigator >
+              <view class="right acea-row row-column-between">
+                <navigator url="{{item.link ? item.link : ''}}"
+                  class="item" style="background-image: url('{{item.pic}}')"
+                  wx:for="{{activity}}" wx:key='index' hover-class="none" wx:if="{{index == 0 || index == 2}}">
+                  <view class="name">{{ item.title }}</view>
+                  <view class="info">{{ item.info }}</view>
+                </navigator >
+              </view>
+            </view>
+          </view> -->
+              <view class="liveBroadcast" wx:if='{{liveList.length || liveInfo.roomid}}'>
+       <view class="publicTitle acea-row row-center-wrapper">
+              <image src="/images/tv.png"></image>
+              <!-- <navigator hover-class="none" url='/pages/first-new-product/index?type=3' class="more">更多 ></navigator> -->
+            </view>
+        <!-- end:结束;time:直播时间 -->
+        <navigator wx:if='{{liveInfo.roomid}}' hover-class="none" url="plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id={{liveInfo.roomid}}" class="broadcast time">
+           <view class="pictrue">
+              <image src="{{liveInfo.share_img}}"></image>
+              <view class="label" wx:if='{{liveInfo.live_status == 101}}'><text class="iconfont icon-zhibo"></text>直播中</view>
+              <view class="label" wx:if='{{liveInfo.live_status == 103}}'><text class="iconfont icon-zhibojieshux"></text>已结束</view>
+              <view class="label" wx:if='{{liveInfo.live_status == 102}}'><text class="iconfont icon-shijian"></text>直播时间 {{liveInfo._start_time}}</view>
+           </view>
+           <view class="text line1">{{liveInfo.name}}</view>
+        </navigator>
+        <view class="list" wx:if="{{liveList.length}}">
+           <scroll-view class="scroll-view_x" scroll-x style="width:auto;overflow:hidden;">
+              <navigator hover-class="none" wx:for='{{liveList}}' wx:key='index' url="plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id={{item.roomid}}" class="item">
+                  <view class="pictrue">
+                    <image src="{{item.share_img}}"></image>
+                    <view class="label" wx:if='{{item.live_status == 101}}'><text class="iconfont icon-zhibo"></text>直播中</view>
+              <view class="label" wx:if='{{item.live_status == 103}}'><text class="iconfont icon-zhibojieshux"></text>已结束</view>
+              <view class="label" wx:if='{{item.live_status == 102}}'><text class="iconfont icon-shijian"></text>直播时间 {{item._start_time}}</view>
+                  </view>
+                  <view class="text line1">{{item.name}}</view>
+                </navigator>
+            </scroll-view>
+        </view>
+    </view>
+          <!-- <view class="flashSale" wx:if="{{seckillCont}}">
+            <view class="title acea-row row-between row-bottom">
+              <view class="left acea-row row-middle">
+                <view class="pictrue">
+                  <image src="/images/buyTitle.png"></image>
+                </view>
+                <view class="text">
+                  <view>top sellers</view>
+                  <view class="chinese">拼手速抢惊喜 每日更新</view>
+                </view>
+              </view>
+              <view class="right acea-row row-middle">
+                <view class="item">
+                  <text class="iconfont icon-xuanzhong"></text>限时低价
+                </view>
+                <view class="item">
+                  <text class="iconfont icon-xuanzhong"></text>正品保证
+                </view>
+              </view>
+            </view>
+            <view class="pictrueBg"><image src="/images/timeBg.png"></image></view>
+            <view class="timeItem">
+                <scroll-view class="scroll-view_x" scroll-x scroll-with-animation scroll-left="{{scrollLeft}}">
+                    <view class="timeLen item {{killIndex==index?'on':''}}" data-index="{{index}}" bindtap="setTime" wx:for="{{timeList}}" wx:key='index'>
+                        <view class="time">{{ item.time }}</view>
+                        <view class="stateCon acea-row row-center-wrapper">
+                            <view class="state acea-row row-center-wrapper">
+                                {{ item.state }}
+                            </view>
+                        </view>
+                    </view>
+                </scroll-view>
+            </view>
+            <view class="list">
+                    <scroll-view class="scroll-view_x acea-row" scroll-x style="width:auto;overflow:hidden;">
+                      <view class="item" wx:for="{{seckillList}}" wx:for-item="itemSeckill" wx:key='index'>
+                        <view class="pictrue" bindtap="goDetail" data-id="{{itemSeckill.id}}">
+                          <image src="{{itemSeckill.image}}"></image>
+                          <view class="bar">
+                            <view class="pos">
+                            <view class="num acea-row row-center-wrapper" style="width:{{itemSeckill.percent}}%;"></view>
+                            <view class="stock">已抢{{itemSeckill.percent}}%</view>
+                            </view>
+                          </view>
+                        </view>
+                        <view class="text">
+                          <view class="name line1">{{ itemSeckill.title }}</view>
+                          <view class="ot-money">
+                            ¥{{ itemSeckill.ot_price }}
+                          </view>
+                          <view class="money font-color">
+                              ¥<text class="num">{{ itemSeckill.price }}</text>
+                          </view>
+                        </view>
+                      </view>
+                    </scroll-view>
+                </view>
+          </view> -->
+          <!-- <navigator 
+            url="{{lovely[0].link ? lovely[0].link : ''}}"
+            class="advert"
+            hover-class="none"
+            wx:if="{{lovely.length}}"
+            >
+            <image src="{{lovely[0].img}}"></image>
+            </navigator> -->
+             <view class='advert' wx:if="{{newGoodsBananr}}">
+                <block>
+                  <image src='{{newGoodsBananr}}'></image>
+                </block>  
+              </view>
+          <view class="newProducts" wx:if="{{info.firstList.length > 0}}">
+            <view class="publicTitle acea-row row-center-wrapper">
+              <image src="/images/newsTitle.png"></image>
+              <navigator hover-class="none" url='/pages/first-new-product/index?type=3' class="more">更多 ></navigator>
+            </view>
+            <view class="newSwiper">
+              <swiper autoplay="{{autoplay}}" circular="{{circular}}" interval="{{intervalNew}}" duration="{{durationNew}}" previous-margin="110px" next-margin="110px" bindchange="bindchange">
+                <swiper-item wx:for="{{info.firstList}}" wx:key='index'>
+                  <view bindtap="goDetailType" data-items='{{item}}' class="item {{avtiveIndex===index?'active':'quiet'}}">
+                    <image src="{{item.image}}"></image>
+                    <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type ==='1'}}">秒杀</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '2'}}">砍价</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '3'}}">拼团</text>
+                  </view>
+                </swiper-item>
+              </swiper>
+              <view class="text" wx:for="{{info.firstList}}" wx:key='index'>
+                <view wx:if="{{index === avtiveIndex}}">
+                  <view class="name line1">{{ item.store_name }}</view>
+                  <view class="money font-color">
+                    ¥<text class="num">{{ item.price }}</text>
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
+          <view
+            class="recommend"
+            wx:if="{{info.bastList.length || info.bastBanner.length}}"
+          >
+            <view class="publicTitle acea-row row-center-wrapper">
+              <image src="/images/boutiqueTitle.png"></image>
+              <navigator hover-class="none" url='/pages/first-new-product/index?type=1' class="more"
+                >更多 ></navigator>
+            </view>
+            <view class="slider-banner recommendSwiper" wx:if="{{info.bastBanner.length}}">
+              <swiper autoplay="true" indicator-dots="true"
+                 circular="{{circular}}" interval="3000" duration="500" indicator-color="rgba(0,0,0,0.2)" indicator-active-color="#ff3366">
+                <swiper-item wx:for="{{info.bastBanner}}" wx:key='index'>
+                  <navigator url="{{item.url ? item.url : ''}}" class="pictrue acea-row row-middle" hover-class="none">
+                    <image src="{{item.img}}"></image>
+                  </navigator >
+                </swiper-item>
+              </swiper>
+            </view>
+            <view class="publicList acea-row row-between-wrapper">
+              <view bindtap="goDetailType" data-items='{{item}}' class="item"
+                wx:for="{{info.bastList}}" wx:key='index'>
+                <view class="pictrue">
+                  <image src="{{item.image}}"></image>
+                  <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type ==='1'}}">秒杀</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '2'}}">砍价</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '3'}}">拼团</text>
+                </view>
+                <view class="text">
+                  <view class="name line1">{{ item.store_name }}</view>
+                  <view class="acea-row row-between-wrapper">
+                    <view>
+                      <view class="money font-color">
+                        ¥<text class="num">{{ item.price }}</text>
+                      </view>
+                      <!-- <view class="ot-money">¥{{ item.ot_price }}</view> -->
+                    </view>
+                    <view class="cart acea-row row-center-wrapper">
+                      <text class="iconfont icon-mzshopping"></text>
+                    </view>
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
+          <view class="hotList" wx:if="{{likeInfo.length}}">
+            <view class="publicTitle acea-row row-center-wrapper">
+              <image src="/images/hotTitle.png"></image>
+              <navigator url="/pages/first-new-product/index?type=2" class="more" hover-class="none">更多 ></navigator>
+            </view>
+            <view class="list acea-row">
+              <navigator url="/pages/goods_details/index?id={{item.id}}" class="item"
+              wx:for="{{likeInfo}}" wx:key='index'>
+                <view class="pictrue">
+                  <image src="{{item.image}}"></image>
+                  <image src="/images/one01.png" class="icon" wx:if='{{index === 0}}'></image>
+                 <image src="/images/two02.png" class="icon" wx:if='{{index === 1}}'></image>
+                 <image src="/images/three03.png" class="icon" wx:if='{{index === 2}}'></image> 
+                </view>
+                <view class="text">
+                  <view class="name line1">{{ item.store_name }}</view>
+                  <view class="money font-color">
+                    ¥<text class="num">{{ item.price }}</text>
+                    <!-- <text class="ot-money">¥{{ item.ot_price }}</text> -->
+                  </view>
+                </view>
+              </navigator >
+            </view>
+          </view>
+          <view class="promotion" wx:if="{{benefit.length}}">
+            <view class="publicTitle acea-row row-center-wrapper">
+              <image src="/images/promotionTitle.png"></image>
+              <navigator url="/pages/promotional-items/index" class="more" hover-class="none">更多 ></navigator>
+            </view>
+            <view class="publicList acea-row row-between-wrapper">
+              <view bindtap="goDetailType" data-items='{{item}}' class="item"
+                wx:for="{{benefit}}" wx:key='index'>
+                <view class="pictrue">
+                  <image src="{{item.image}}"></image>
+                   <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type ==='1'}}">秒杀</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '2'}}">砍价</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '3'}}">拼团</text>
+                </view>
+                <view class="text">
+                  <view class="name line1">{{ item.store_name }}</view>
+                  <view class="acea-row row-between-wrapper">
+                    <view>
+                      <view class="money font-color">
+                        ¥<text class="num">{{ item.price }}</text><text class="label bg-color">疯抢</text>
+                      </view>
+                      <view class="ot-money">¥{{ item.ot_price }}</view>
+                    </view>
+                    <view class="cart acea-row row-center-wrapper">
+                      <text class="iconfont icon-mzshopping"></text>
+                    </view>
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
+          <view class="recommendList" wx:if='{{hostProduct.length > 0}}'>
+            <view class="title">
+              <image src="/images/becommendTitle.png"></image>
+            </view>
+            <view class="publicList acea-row row-between-wrapper">
+              <view bindtap="goDetailType" data-items='{{item}}' wx:for="{{hostProduct}}" wx:key='index' class="item">
+                <view class="pictrue">
+                  <image src="{{item.image}}"></image>
+                   <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type ==='1'}}">秒杀</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '2'}}">砍价</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{item.activity && item.activity.type === '3'}}">拼团</text>
+                </view>
+                <view class="text">
+                  <view class="name line1">{{ item.store_name }}</view>
+                  <view class="acea-row row-between-wrapper">
+                    <view>
+                      <view class="money font-color">
+                        ¥<text class="num">{{ item.price }}</text>
+                      </view>
+                      <!-- <view class="ot-money">¥{{ item.ot_price }}</view> -->
+                    </view>
+                    <view class="cart acea-row row-center-wrapper">
+                      <text class="iconfont icon-mzshopping"></text>
+                    </view>
+                  </view>
+                </view>
+              </view>
+                <view class='loadingicon acea-row row-center-wrapper' wx:if='{{hostProduct.length > 0}}'>
+        <text class='loading iconfont icon-jiazai' hidden='{{recommend.loading==false}}'></text>
+        {{recommend.loadTitle}}
+     </view>
+            </view>
+          </view>
+        </view>
+      </Tab>
+      <Tab wx:for="{{categoryOne}}" title="{{item.cate_name}}" wx:key='index'>
+        <view wx:if="{{item.cate_name === '黑洞矿场'}}"><Mine></Mine></view>
+        <view wx:else class="wrapper">
+          <image wx:if="{{item.pic !== ''}}" src="{{item.pic}}" style="width: 100%"></image>
+          <view class="scroll acea-row row-middle">
+             <view class="scroll-classify" wx:if="{{item.children.length}}">
+              <scroll-view class="scroll-view_x" scroll-x style="width:auto;overflow:hidden;">
+                <view class="item {{categoryActive === indexn ? 'on' : ''}}" bindtap="productTap" data-indexn="{{indexn}}" wx:for="{{item.children}}" wx:for-item="itemn" wx:for-index="indexn" wx:key='index'>
+                    <view class="pictrue">
+                      <image src="{{itemn.pic}}"></image>
+                    </view>
+                    <view class="name line1">{{ itemn.cate_name }}</view>
+                </view>
+              </scroll-view>
+          </view>
+          </view>
+          <view class="classifyList acea-row row-between-wrapper">
+            <view bindtap="goDetailType" data-items='{{productItem}}' class="item" wx:for="{{productList}}" wx:for-item="productItem" wx:key='index'>
+              <view class="pictrue">
+                <image src="{{productItem.image}}"></image>
+                  <text class="pictrue_log_medium pictrue_log_class" wx:if="{{productItem.activity && productItem.activity.type ==='1'}}">秒杀</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{productItem.activity && productItem.activity.type === '2'}}">砍价</text>
+                      <text class="pictrue_log_medium pictrue_log_class" wx:if="{{productItem.activity && productItem.activity.type === '3'}}">拼团</text>
+              </view>
+              <view class="text">
+                <view class="name line1">{{ productItem.store_name }}</view>
+                <view class="money font-color">
+                  ¥<span class="num">{{ productItem.price }}</span>
+                </view>
+                <view class="acea-row row-between-wrapper">
+                  <view class="vipMoney" wx:if="{{productItem.vip_price && productItem.vip_price > 0}}">
+                    ¥{{ productItem.vip_price }}
+                    <image src="/images/vip.png"></image>
+                  </view>
+                  <view class="sales">已售{{ productItem.sales }}件</view>
+                </view>
+              </view>
+            </view>
+              <view class='loadingicon acea-row row-center-wrapper'>
+        <text class='loading iconfont icon-jiazai' hidden='{{loading==false}}'></text>
+        {{loadTitle}}
+     </view>
+          </view>
+          <view class='noCommodity' wx:if="{{productList.length==0 && where.page > 1}}">
+   <view class='pictrue'><image src='/images/noShopper.png'></image></view>
+   <recommend host_product="{{hostProduct}}"></recommend>
+</view>
+        </view>
+      </Tab>
+    </Tabs>
+</view>
+<coupon-window window='{{window}}' couponList="{{couponList}}" bind:onColse="onColse"></coupon-window>
+<authorize bind:onLoadFun='onLoadFun' isGoIndex='{{isGoIndex}}' iShidden="{{iShidden}}" isAuto="{{isAuto}}"></authorize>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 57
view/xcx/pages/index/index.wxss


+ 80 - 0
view/xcx/pages/message/index.js

@@ -0,0 +1,80 @@
+// pages/message/index.js
+
+import { getNotifications } from "../../api/api"
+
+const app = getApp();
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    parameter: {
+      title: "我的消息",
+      'navbar': '1',
+      'return': '1',
+      'color': false,
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.showTabBarRedDot({
+      index: 2,
+    });
+    console.log("load")
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+    console.log("ready");
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    console.log("show");
+    // getNotifications()
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+    console.log("hide")
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+    console.log("unload")
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 5 - 0
view/xcx/pages/message/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "navbar": "/components/navbar/index"
+  }
+}

+ 4 - 0
view/xcx/pages/message/index.wxml

@@ -0,0 +1,4 @@
+<navbar parameter='{{parameter}}'></navbar>
+<view class="message">
+我的消息列表
+</view>

+ 2 - 0
view/xcx/pages/message/index.wxss

@@ -0,0 +1,2 @@
+.message { text-align: center; }
+.message .item .bg { background-color: red;}

+ 1 - 1
view/xcx/pages/order_cancellation/index.wxml

@@ -5,7 +5,7 @@
       <view class="input"><input type="text" placeholder="0"></input></view>
       <view class="bnt" bindtap="audit">立即核销</view>
     </view>
-    <view class="scan"><image src="/images/scan.gif"></image></view>
+    <!-- <view class="scan"><image src="/images/scan.gif"></image></view> -->
     <!-- <WriteOff :iShidden="iShidden" @cancel="cancel"></WriteOff> -->
     <write-off iShidden="{{iShidden}}" bind:cancel="cancel"></write-off>
 </view>

+ 1 - 1
view/xcx/pages/user/user.wxml

@@ -91,7 +91,7 @@
          </view>
       </view>
    </view>
-   <image src='/images/support.png' class='support'></image>
+   <!-- <image src='/images/support.png' class='support'></image> -->
 </view> 
 
 <authorize bind:onLoadFun='onLoadFun' isGoIndex='{{isGoIndex}}' iShidden="{{iShidden}}" isAuto="{{isAuto}}"></authorize>

+ 4 - 5
view/xcx/project.config.json

@@ -6,13 +6,13 @@
   "setting": {
     "urlCheck": false,
     "es6": true,
-    "enhance": true,
+    "enhance": false,
     "postcss": true,
     "preloadBackgroundData": false,
     "minified": true,
     "newFeature": true,
     "coverView": true,
-    "nodeModules": false,
+    "nodeModules": true,
     "autoAudits": false,
     "showShadowRootInWxmlPanel": true,
     "scopeDataCheck": false,
@@ -30,7 +30,6 @@
       "outputPath": ""
     },
     "enableEngineNative": false,
-    "bundle": false,
     "useIsolateContext": true,
     "useCompilerModule": true,
     "userConfirmedUseCompilerModuleSwitch": false,
@@ -41,8 +40,8 @@
   },
   "compileType": "miniprogram",
   "libVersion": "2.16.0",
-  "appid": "wx6ca9ac1a01f617a1",
-  "projectname": "3.2",
+  "appid": "wxc2eeb4241ad96c3f",
+  "projectname": "twong",
   "debugOptions": {
     "hidedInDevtools": []
   },

+ 2 - 1
view/xcx/utils/util.js

@@ -104,8 +104,9 @@ const getUrlParams = (param,k,p) => {
 const wxgetUserInfo = function()
 {
   return new Promise((resolve, reject) =>{
-    wx.getUserInfo({
+    wx.getUserProfile({
       lang: 'zh_CN',
+      desc: '用于完善会员资料',
       success(res) {
         resolve(res);
       },

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác