Jelajahi Sumber

Revert "1"

This reverts commit 60d387edbe2555f96149fafe18787f0a113146e2.
Mike 7 tahun lalu
induk
melakukan
27046ede95
100 mengubah file dengan 9490 tambahan dan 9524 penghapusan
  1. 2 2
      wechat/.gitignore
  2. 10 10
      wechat/.txt
  3. 183 183
      wechat/api.tpl.js
  4. 636 636
      wechat/app.js
  5. 99 99
      wechat/app.json
  6. 459 459
      wechat/app.wxss
  7. 91 91
      wechat/area-picker/area-picker.js
  8. 25 25
      wechat/area-picker/area-picker.wxml
  9. 65 65
      wechat/area-picker/area-picker.wxss
  10. 57 57
      wechat/commons/copyright/copyright.wxml
  11. 2 2
      wechat/commons/extension/extension.wxml
  12. 33 33
      wechat/commons/extension/extension.wxss
  13. 26 26
      wechat/commons/float-icon/float-icon.wxml
  14. 34 34
      wechat/commons/get-card/get-card.wxml
  15. 100 100
      wechat/commons/get-card/get-card.wxss
  16. 33 33
      wechat/commons/get-coupon/get-coupon.wxml
  17. 37 37
      wechat/commons/navbar/navbar.wxml
  18. 31 31
      wechat/images/loading.svg
  19. 39 39
      wechat/images/loading2.svg
  20. 186 186
      wechat/pages/add-share/index.js
  21. 2 2
      wechat/pages/add-share/index.json
  22. 91 91
      wechat/pages/add-share/index.wxml
  23. 107 107
      wechat/pages/add-share/index.wxss
  24. 232 232
      wechat/pages/address-edit/address-edit.js
  25. 2 2
      wechat/pages/address-edit/address-edit.json
  26. 47 47
      wechat/pages/address-edit/address-edit.wxml
  27. 51 51
      wechat/pages/address-edit/address-edit.wxss
  28. 92 92
      wechat/pages/address-picker/address-picker.js
  29. 2 2
      wechat/pages/address-picker/address-picker.json
  30. 29 29
      wechat/pages/address-picker/address-picker.wxml
  31. 78 78
      wechat/pages/address-picker/address-picker.wxss
  32. 118 118
      wechat/pages/address/address.js
  33. 2 2
      wechat/pages/address/address.json
  34. 39 39
      wechat/pages/address/address.wxml
  35. 48 48
      wechat/pages/address/address.wxss
  36. 86 86
      wechat/pages/article-detail/article-detail.js
  37. 2 2
      wechat/pages/article-detail/article-detail.json
  38. 5 5
      wechat/pages/article-detail/article-detail.wxml
  39. 6 6
      wechat/pages/article-detail/article-detail.wxss
  40. 75 75
      wechat/pages/article-list/article-list.js
  41. 2 2
      wechat/pages/article-list/article-list.json
  42. 11 11
      wechat/pages/article-list/article-list.wxml
  43. 21 21
      wechat/pages/article-list/article-list.wxss
  44. 165 165
      wechat/pages/balance/balance.js
  45. 2 2
      wechat/pages/balance/balance.json
  46. 73 73
      wechat/pages/balance/balance.wxml
  47. 125 125
      wechat/pages/balance/balance.wxss
  48. 173 173
      wechat/pages/book/clerk/clerk.js
  49. 2 2
      wechat/pages/book/clerk/clerk.json
  50. 45 45
      wechat/pages/book/clerk/clerk.wxml
  51. 133 133
      wechat/pages/book/clerk/clerk.wxss
  52. 160 160
      wechat/pages/book/comment/comment.js
  53. 2 2
      wechat/pages/book/comment/comment.json
  54. 38 38
      wechat/pages/book/comment/comment.wxml
  55. 54 54
      wechat/pages/book/comment/comment.wxss
  56. 388 388
      wechat/pages/book/details/details.js
  57. 2 2
      wechat/pages/book/details/details.json
  58. 249 249
      wechat/pages/book/details/details.wxml
  59. 523 523
      wechat/pages/book/details/details.wxss
  60. 205 205
      wechat/pages/book/index/index.js
  61. 2 2
      wechat/pages/book/index/index.json
  62. 55 55
      wechat/pages/book/index/index.wxml
  63. 99 99
      wechat/pages/book/index/index.wxss
  64. 224 224
      wechat/pages/book/order-comment/order-comment.js
  65. 2 2
      wechat/pages/book/order-comment/order-comment.json
  66. 57 57
      wechat/pages/book/order-comment/order-comment.wxml
  67. 90 90
      wechat/pages/book/order-comment/order-comment.wxss
  68. 284 284
      wechat/pages/book/order/details.js
  69. 2 2
      wechat/pages/book/order/details.json
  70. 98 98
      wechat/pages/book/order/details.wxml
  71. 132 132
      wechat/pages/book/order/details.wxss
  72. 342 342
      wechat/pages/book/order/order.js
  73. 2 2
      wechat/pages/book/order/order.json
  74. 86 86
      wechat/pages/book/order/order.wxml
  75. 122 122
      wechat/pages/book/order/order.wxss
  76. 303 303
      wechat/pages/book/shop/shop.js
  77. 3 3
      wechat/pages/book/shop/shop.json
  78. 42 42
      wechat/pages/book/shop/shop.wxml
  79. 42 42
      wechat/pages/book/shop/shop.wxss
  80. 267 267
      wechat/pages/book/submit/submit.js
  81. 2 2
      wechat/pages/book/submit/submit.json
  82. 187 187
      wechat/pages/book/submit/submit.wxml
  83. 103 103
      wechat/pages/book/submit/submit.wxss
  84. 105 105
      wechat/pages/card-clerk/card-clerk.js
  85. 2 2
      wechat/pages/card-clerk/card-clerk.json
  86. 1 1
      wechat/pages/card-clerk/card-clerk.wxml
  87. 240 240
      wechat/pages/card/card.js
  88. 2 2
      wechat/pages/card/card.json
  89. 42 42
      wechat/pages/card/card.wxml
  90. 67 67
      wechat/pages/card/card.wxss
  91. 323 323
      wechat/pages/cart/cart.js
  92. 2 2
      wechat/pages/cart/cart.json
  93. 87 87
      wechat/pages/cart/cart.wxml
  94. 0 34
      wechat/pages/cart/cart.wxss
  95. 125 125
      wechat/pages/cash-detail/cash-detail.js
  96. 2 2
      wechat/pages/cash-detail/cash-detail.json
  97. 36 36
      wechat/pages/cash-detail/cash-detail.wxml
  98. 69 69
      wechat/pages/cash-detail/cash-detail.wxss
  99. 204 204
      wechat/pages/cash/cash.js
  100. 2 2
      wechat/pages/cash/cash.json

+ 2 - 2
wechat/.gitignore

xqd
@@ -1,3 +1,3 @@
-api.js
-project.config.json
+api.js
+project.config.json
 ext.json

+ 10 - 10
wechat/.txt

xqd
@@ -1,11 +1,11 @@
-默认字号:11pt
-默认字体颜色:#555
-
-小字号:9pt
-灰色字体颜色:#888
-
-块外线条颜色:#e3e3e3
-块内线条颜色:#eee
-
-主题红色:#ff4544
+默认字号:11pt
+默认字体颜色:#555
+
+小字号:9pt
+灰色字体颜色:#888
+
+块外线条颜色:#e3e3e3
+块内线条颜色:#eee
+
+主题红色:#ff4544
 绿色:#36ba75

+ 183 - 183
wechat/api.tpl.js

xqd
@@ -1,184 +1,184 @@
-var _api_root = '{$_api_root}';
-var api = {
-    index: _api_root + 'default/index',
-    default: {
-        store: _api_root + 'default/store',
-        index: _api_root + 'default/index',
-        goods_list: _api_root + 'default/goods-list',
-        cat_list: _api_root + 'default/cat-list',
-        goods: _api_root + 'default/goods',
-        district: _api_root + 'default/district',
-        goods_attr_info: _api_root + "default/goods-attr-info",
-        upload_image: _api_root + "default/upload-image",
-        comment_list: _api_root + "default/comment-list",
-        article_list: _api_root + "default/article-list",
-        article_detail: _api_root + "default/article-detail",
-        video_list: _api_root + "default/video-list",
-        goods_qrcode: _api_root + "default/goods-qrcode",
-        coupon_list: _api_root + "default/coupon-list",
-        topic_list: _api_root + "default/topic-list",
-        topic: _api_root + "default/topic",
-        navbar: _api_root + "default/navbar",
-        navigation_bar_color: _api_root + "default/navigation-bar-color",
-        shop_list: _api_root + "default/shop-list",
-        shop_detail: _api_root + "default/shop-detail",
-        topic_type: _api_root + "default/topic-type",
-        buy_data: _api_root + "default/buy-data",
-    },
-    cart: {
-        list: _api_root + 'cart/list',
-        add_cart: _api_root + 'cart/add-cart',
-        delete: _api_root + 'cart/delete',
-        cart_edit: _api_root + 'cart/cart-edit',
-    },
-    passport: {
-        login: _api_root + 'passport/login',
-        on_login: _api_root + 'passport/on-login',
-    },
-    order: {
-        submit_preview: _api_root + 'order/submit-preview',
-        submit: _api_root + 'order/submit',
-        pay_data: _api_root + 'order/pay-data',
-        list: _api_root + 'order/list',
-        revoke: _api_root + 'order/revoke',
-        confirm: _api_root + 'order/confirm',
-        count_data: _api_root + 'order/count-data',
-        detail: _api_root + 'order/detail',
-        refund_preview: _api_root + 'order/refund-preview',
-        refund: _api_root + 'order/refund',
-        refund_detail: _api_root + 'order/refund-detail',
-        comment_preview: _api_root + 'order/comment-preview',
-        comment: _api_root + 'order/comment',
-        express_detail: _api_root + 'order/express-detail',
-        clerk: _api_root + "order/clerk",
-        clerk_detail: _api_root + 'order/clerk-detail',
-        get_qrcode: _api_root + 'order/get-qrcode',
-        location: _api_root + 'order/location'
-    },
-    user: {
-        address_list: _api_root + 'user/address-list',
-        address_detail: _api_root + 'user/address-detail',
-        address_save: _api_root + 'user/address-save',
-        address_set_default: _api_root + 'user/address-set-default',
-        address_delete: _api_root + 'user/address-delete',
-        save_form_id: _api_root + "user/save-form-id",
-        favorite_add: _api_root + "user/favorite-add",
-        favorite_remove: _api_root + "user/favorite-remove",
-        favorite_list: _api_root + "user/favorite-list",
-        index: _api_root + "user/index",
-        wechat_district: _api_root + "user/wechat-district",
-        add_wechat_address: _api_root + "user/add-wechat-address",
-        topic_favorite: _api_root + "user/topic-favorite",
-        topic_favorite_list: _api_root + "user/topic-favorite-list",
-        member: _api_root + "user/member",
-        card: _api_root + "user/card",
-        card_qrcode: _api_root + "user/card-qrcode",
-        card_clerk: _api_root + "user/card-clerk",
-    },
-    share: {
-        join: _api_root + 'share/join',
-        check: _api_root + 'share/check',
-        get_info: _api_root + 'share/get-info',
-        get_price: _api_root + 'share/get-price',
-        apply: _api_root + 'share/apply',
-        cash_detail: _api_root + 'share/cash-detail',
-        get_qrcode: _api_root + 'share/get-qrcode',
-        shop_share: _api_root + 'share/shop-share',
-        bind_parent: _api_root + 'share/bind-parent',
-        get_team: _api_root + 'share/get-team',
-        get_order: _api_root + 'share/get-order',
-    },
-    coupon: {
-        index: _api_root + 'coupon/index',
-        share_send: _api_root + 'coupon/share-send',
-        receive: _api_root + 'coupon/receive',
-    },
-    miaosha: {
-        list: _api_root + 'miaosha/list',
-        goods_list: _api_root + 'miaosha/goods-list',
-        details: _api_root + 'miaosha/details',
-        submit_preview: _api_root + 'miaosha/submit-preview',
-        submit: _api_root + 'miaosha/submit',
-        pay_data: _api_root + 'miaosha/pay-data',
-        order_list: _api_root + 'miaosha/order-list',
-        order_details: _api_root + 'miaosha/order-details',
-        order_revoke: _api_root + 'miaosha/revoke',
-        express_detail: _api_root + 'miaosha/express-detail',
-        confirm: _api_root + 'miaosha/confirm',
-        comment_preview: _api_root + 'miaosha/comment-preview',
-        comment: _api_root + 'miaosha/comment',
-        refund_preview: _api_root + 'miaosha/refund-preview',
-        refund: _api_root + 'miaosha/refund',
-        refund_detail: _api_root + 'miaosha/refund-detail',
-        comment_list: _api_root + "miaosha/comment-list",
-        goods_qrcode: _api_root + "miaosha/goods-qrcode",
-    },
-    group: {
-        index: _api_root + 'group/index/index',
-        list: _api_root + 'group/index/good-list',
-        details: _api_root + 'group/index/good-details',
-        goods_attr_info: _api_root + "group/index/goods-attr-info",
-        submit_preview: _api_root + 'group/order/submit-preview',
-        submit: _api_root + 'group/order/submit',
-        pay_data: _api_root + 'group/order/pay-data',
-        order: {
-            list: _api_root + 'group/order/list',
-            detail: _api_root + 'group/order/detail',
-            express_detail: _api_root + 'group/order/express-detail',
-            comment_preview: _api_root + 'group/order/comment-preview',
-            comment: _api_root + 'group/order/comment',
-            confirm: _api_root + 'group/order/confirm',
-            goods_qrcode: _api_root + 'group/order/goods-qrcode',
-            get_qrcode: _api_root + 'group/order/get-qrcode',
-            clerk: _api_root + 'group/order/clerk',
-            clerk_order_details: _api_root + 'group/order/clerk-order-details',
-            revoke: _api_root + 'group/order/revoke',
-            refund_preview: _api_root + 'group/order/refund-preview',
-            refund: _api_root + 'group/order/refund',
-            refund_detail: _api_root + 'group/order/refund-detail',
-        },
-        group_info: _api_root + 'group/order/group',
-        comment: _api_root + 'group/index/goods-comment',
-        goods_qrcode: _api_root + 'group/index/goods-qrcode',
-        search: _api_root + 'group/index/search',
-    },
-    book: {
-        index: _api_root + 'book/index/index',
-        list: _api_root + 'book/index/good-list',
-        details: _api_root + 'book/index/good-details',
-        submit_preview: _api_root + 'book/order/submit-preview',
-        submit: _api_root + 'book/order/submit',
-        order_list: _api_root + 'book/order/list',
-        order_cancel: _api_root + 'book/order/cancel',
-        order_pay: _api_root + 'book/order/pay-data',
-        order_details: _api_root + 'book/order/order-details',
-        shop_list: _api_root + 'book/index/shop-list',
-        get_qrcode: _api_root + 'book/order/get-qrcode',
-        clerk: _api_root + 'book/order/clerk',
-        apply_refund: _api_root + 'book/order/apply-refund',
-        comment_preview: _api_root + 'book/order/comment-preview',
-        submit_comment: _api_root + 'book/order/comment',
-        goods_comment: _api_root + 'book/index/goods-comment',
-        goods_qrcode: _api_root + 'book/index/goods-qrcode',
-        clerk_order_details: _api_root + 'book/order/clerk-order-details',
-
-    },
-    quick: {
-      quick: _api_root + 'quick/quick/quick',
-      quick_goods: _api_root + 'quick/quick/quick-goods',
-      quick_car: _api_root + 'quick/quick/quick-car',
-    },
-    fxhb: {
-        open: _api_root + 'fxhb/index/open',
-        open_submit: _api_root + 'fxhb/index/open-submit',
-        detail: _api_root + 'fxhb/index/detail',
-        detail_submit: _api_root + 'fxhb/index/detail-submit',
-    },
-    recharge: {
-        index: _api_root + 'recharge/index',
-        list: _api_root + 'recharge/list',
-        submit: _api_root + 'recharge/submit',
-        record: _api_root + 'recharge/record',
-    },
-};
+var _api_root = '{$_api_root}';
+var api = {
+    index: _api_root + 'default/index',
+    default: {
+        store: _api_root + 'default/store',
+        index: _api_root + 'default/index',
+        goods_list: _api_root + 'default/goods-list',
+        cat_list: _api_root + 'default/cat-list',
+        goods: _api_root + 'default/goods',
+        district: _api_root + 'default/district',
+        goods_attr_info: _api_root + "default/goods-attr-info",
+        upload_image: _api_root + "default/upload-image",
+        comment_list: _api_root + "default/comment-list",
+        article_list: _api_root + "default/article-list",
+        article_detail: _api_root + "default/article-detail",
+        video_list: _api_root + "default/video-list",
+        goods_qrcode: _api_root + "default/goods-qrcode",
+        coupon_list: _api_root + "default/coupon-list",
+        topic_list: _api_root + "default/topic-list",
+        topic: _api_root + "default/topic",
+        navbar: _api_root + "default/navbar",
+        navigation_bar_color: _api_root + "default/navigation-bar-color",
+        shop_list: _api_root + "default/shop-list",
+        shop_detail: _api_root + "default/shop-detail",
+        topic_type: _api_root + "default/topic-type",
+        buy_data: _api_root + "default/buy-data",
+    },
+    cart: {
+        list: _api_root + 'cart/list',
+        add_cart: _api_root + 'cart/add-cart',
+        delete: _api_root + 'cart/delete',
+        cart_edit: _api_root + 'cart/cart-edit',
+    },
+    passport: {
+        login: _api_root + 'passport/login',
+        on_login: _api_root + 'passport/on-login',
+    },
+    order: {
+        submit_preview: _api_root + 'order/submit-preview',
+        submit: _api_root + 'order/submit',
+        pay_data: _api_root + 'order/pay-data',
+        list: _api_root + 'order/list',
+        revoke: _api_root + 'order/revoke',
+        confirm: _api_root + 'order/confirm',
+        count_data: _api_root + 'order/count-data',
+        detail: _api_root + 'order/detail',
+        refund_preview: _api_root + 'order/refund-preview',
+        refund: _api_root + 'order/refund',
+        refund_detail: _api_root + 'order/refund-detail',
+        comment_preview: _api_root + 'order/comment-preview',
+        comment: _api_root + 'order/comment',
+        express_detail: _api_root + 'order/express-detail',
+        clerk: _api_root + "order/clerk",
+        clerk_detail: _api_root + 'order/clerk-detail',
+        get_qrcode: _api_root + 'order/get-qrcode',
+        location: _api_root + 'order/location'
+    },
+    user: {
+        address_list: _api_root + 'user/address-list',
+        address_detail: _api_root + 'user/address-detail',
+        address_save: _api_root + 'user/address-save',
+        address_set_default: _api_root + 'user/address-set-default',
+        address_delete: _api_root + 'user/address-delete',
+        save_form_id: _api_root + "user/save-form-id",
+        favorite_add: _api_root + "user/favorite-add",
+        favorite_remove: _api_root + "user/favorite-remove",
+        favorite_list: _api_root + "user/favorite-list",
+        index: _api_root + "user/index",
+        wechat_district: _api_root + "user/wechat-district",
+        add_wechat_address: _api_root + "user/add-wechat-address",
+        topic_favorite: _api_root + "user/topic-favorite",
+        topic_favorite_list: _api_root + "user/topic-favorite-list",
+        member: _api_root + "user/member",
+        card: _api_root + "user/card",
+        card_qrcode: _api_root + "user/card-qrcode",
+        card_clerk: _api_root + "user/card-clerk",
+    },
+    share: {
+        join: _api_root + 'share/join',
+        check: _api_root + 'share/check',
+        get_info: _api_root + 'share/get-info',
+        get_price: _api_root + 'share/get-price',
+        apply: _api_root + 'share/apply',
+        cash_detail: _api_root + 'share/cash-detail',
+        get_qrcode: _api_root + 'share/get-qrcode',
+        shop_share: _api_root + 'share/shop-share',
+        bind_parent: _api_root + 'share/bind-parent',
+        get_team: _api_root + 'share/get-team',
+        get_order: _api_root + 'share/get-order',
+    },
+    coupon: {
+        index: _api_root + 'coupon/index',
+        share_send: _api_root + 'coupon/share-send',
+        receive: _api_root + 'coupon/receive',
+    },
+    miaosha: {
+        list: _api_root + 'miaosha/list',
+        goods_list: _api_root + 'miaosha/goods-list',
+        details: _api_root + 'miaosha/details',
+        submit_preview: _api_root + 'miaosha/submit-preview',
+        submit: _api_root + 'miaosha/submit',
+        pay_data: _api_root + 'miaosha/pay-data',
+        order_list: _api_root + 'miaosha/order-list',
+        order_details: _api_root + 'miaosha/order-details',
+        order_revoke: _api_root + 'miaosha/revoke',
+        express_detail: _api_root + 'miaosha/express-detail',
+        confirm: _api_root + 'miaosha/confirm',
+        comment_preview: _api_root + 'miaosha/comment-preview',
+        comment: _api_root + 'miaosha/comment',
+        refund_preview: _api_root + 'miaosha/refund-preview',
+        refund: _api_root + 'miaosha/refund',
+        refund_detail: _api_root + 'miaosha/refund-detail',
+        comment_list: _api_root + "miaosha/comment-list",
+        goods_qrcode: _api_root + "miaosha/goods-qrcode",
+    },
+    group: {
+        index: _api_root + 'group/index/index',
+        list: _api_root + 'group/index/good-list',
+        details: _api_root + 'group/index/good-details',
+        goods_attr_info: _api_root + "group/index/goods-attr-info",
+        submit_preview: _api_root + 'group/order/submit-preview',
+        submit: _api_root + 'group/order/submit',
+        pay_data: _api_root + 'group/order/pay-data',
+        order: {
+            list: _api_root + 'group/order/list',
+            detail: _api_root + 'group/order/detail',
+            express_detail: _api_root + 'group/order/express-detail',
+            comment_preview: _api_root + 'group/order/comment-preview',
+            comment: _api_root + 'group/order/comment',
+            confirm: _api_root + 'group/order/confirm',
+            goods_qrcode: _api_root + 'group/order/goods-qrcode',
+            get_qrcode: _api_root + 'group/order/get-qrcode',
+            clerk: _api_root + 'group/order/clerk',
+            clerk_order_details: _api_root + 'group/order/clerk-order-details',
+            revoke: _api_root + 'group/order/revoke',
+            refund_preview: _api_root + 'group/order/refund-preview',
+            refund: _api_root + 'group/order/refund',
+            refund_detail: _api_root + 'group/order/refund-detail',
+        },
+        group_info: _api_root + 'group/order/group',
+        comment: _api_root + 'group/index/goods-comment',
+        goods_qrcode: _api_root + 'group/index/goods-qrcode',
+        search: _api_root + 'group/index/search',
+    },
+    book: {
+        index: _api_root + 'book/index/index',
+        list: _api_root + 'book/index/good-list',
+        details: _api_root + 'book/index/good-details',
+        submit_preview: _api_root + 'book/order/submit-preview',
+        submit: _api_root + 'book/order/submit',
+        order_list: _api_root + 'book/order/list',
+        order_cancel: _api_root + 'book/order/cancel',
+        order_pay: _api_root + 'book/order/pay-data',
+        order_details: _api_root + 'book/order/order-details',
+        shop_list: _api_root + 'book/index/shop-list',
+        get_qrcode: _api_root + 'book/order/get-qrcode',
+        clerk: _api_root + 'book/order/clerk',
+        apply_refund: _api_root + 'book/order/apply-refund',
+        comment_preview: _api_root + 'book/order/comment-preview',
+        submit_comment: _api_root + 'book/order/comment',
+        goods_comment: _api_root + 'book/index/goods-comment',
+        goods_qrcode: _api_root + 'book/index/goods-qrcode',
+        clerk_order_details: _api_root + 'book/order/clerk-order-details',
+
+    },
+    quick: {
+      quick: _api_root + 'quick/quick/quick',
+      quick_goods: _api_root + 'quick/quick/quick-goods',
+      quick_car: _api_root + 'quick/quick/quick-car',
+    },
+    fxhb: {
+        open: _api_root + 'fxhb/index/open',
+        open_submit: _api_root + 'fxhb/index/open-submit',
+        detail: _api_root + 'fxhb/index/detail',
+        detail_submit: _api_root + 'fxhb/index/detail-submit',
+    },
+    recharge: {
+        index: _api_root + 'recharge/index',
+        list: _api_root + 'recharge/list',
+        submit: _api_root + 'recharge/submit',
+        record: _api_root + 'recharge/record',
+    },
+};
 module.exports = api;

+ 636 - 636
wechat/app.js

xqd
@@ -1,637 +1,637 @@
-//app.js
-var util = require('./utils/utils.js');
-var api;
-App({
-    data: {
-        deviceInfo: {}
-    },
-    is_on_launch: true,
-    onLaunch: function () {
-        let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
-        var uniacid = JSON.stringify(extConfig) != "{}" ? extConfig.uniacid : '20236';
-        this.siteInfo.uniacid = uniacid;
-        this.siteInfo.acid = uniacid;
-        wx.setStorageSync("store_id", uniacid);
-        console.log('uniacid:'+uniacid);
-        
-        this.setApi();
-        api = this.api;
-
-        this.getNavigationBarColor();
-        // this.getStoreData();
-        this.getCatList();
-    },
-
-    getStoreData: function (that) {
-        var page = this;
-        this.request({
-            url: api.default.store,
-            success: function (res) {
-                if (res.code == 0) {
-                    wx.setStorageSync("store", res.data.store);
-                    wx.setStorageSync("store_name", res.data.store_name);
-                    wx.setStorageSync("show_customer_service", res.data.show_customer_service);
-                    wx.setStorageSync("contact_tel", res.data.contact_tel);
-                    wx.setStorageSync("share_setting", res.data.share_setting);
-                }
-            },
-            complete: function () {
-                page.login(that);
-            }
-        });
-    },
-
-    getCatList: function () {
-        this.request({
-            url: api.default.cat_list,
-            success: function (res) {
-                if (res.code == 0) {
-                    var cat_list = res.data.list || [];
-                    wx.setStorageSync("cat_list", cat_list);
-                }
-            }
-        });
-    },
-
-    // dologin: function (raw) {
-    //   var pages = getCurrentPages();
-    //   var page = pages[(pages.length - 1)];
-    //   wx.login({
-    //     success: function (res) {
-    //       if (res.code) {
-    //         var code = res.code;
-    //         getApp().request({
-    //           url: api.passport.login,
-    //           method: "post",
-    //           data: {
-    //             code: code,
-    //             user_info: JSON.stringify(raw.userInfo),
-    //             encrypted_data: raw.encryptedData,
-    //             iv: raw.iv,
-    //             signature: raw.signature
-    //           },
-    //           success: function (res) {
-    //             wx.hideLoading();
-    //             if (res.code == 0) {
-    //               wx.setStorageSync("access_token", res.data.access_token);
-    //               wx.setStorageSync("user_info", res.data);
-
-    //               var p = getCurrentPages();
-    //               var parent_id = 0;
-    //               if (p[0].options.user_id != undefined) {
-    //                 var parent_id = p[0].options.user_id;
-    //               }
-    //               else if (p[0].options.scene != undefined) {
-    //                 var parent_id = p[0].options.scene;
-    //               }
-    //               getApp().bindParent({
-    //                   parent_id: parent_id || 0
-    //               });
-
-    //               if (page == undefined) {
-    //                   return;
-
-    //               }
-    //               var loginNoRefreshPage = getApp().loginNoRefreshPage;
-    //               for (var i in loginNoRefreshPage) {
-    //                   if (loginNoRefreshPage[i] === page.route)
-    //                       return;
-    //               }
-    //               wx.redirectTo({
-    //                   url: "/" + page.route + "?" + util.objectToUrlParams(page.options),
-    //                   fail: function () {
-    //                       wx.switchTab({
-    //                           url: "/" + page.route,
-    //                       });
-    //                   },
-    //               });
-              
-    //             } else {
-    //               wx.showToast({
-    //                 title: res.msg
-    //               });
-    //             }
-    //           }
-    //         });
-    //       }
-    //     }
-    //   });
-    // },
-    login: function (e) {
-        var pages = getCurrentPages();
-        var page = pages[(pages.length - 1)];
-        wx.showLoading({
-            title: "正在登录",
-            mask: true,
-        });
-        wx.login({
-            success: function (res) {
-                if (res.code) {
-                    var code = res.code;
-                    wx.getSetting({
-                        success: res => {
-                            if (res.authSetting['scope.userInfo']) {
-                              console.log('已经授权' + code)
-                                // 已经授权,可以直接调用 getUserInfo 
-                                // 获取用户信息
-                                wx.getSetting({
-                                    success: res => {
-                                        if (res.authSetting['scope.userInfo']) {
-                                            // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
-                                            wx.getUserInfo({
-                                                success: function (res) {
-                                                    getApp().request({
-                                                        url: api.passport.login,
-                                                        method: "post",
-                                                        data: {
-                                                            code: code,
-                                                            user_info: res.rawData,
-                                                            encrypted_data: res.encryptedData,
-                                                            iv: res.iv,
-                                                            signature: res.signature
-                                                        },
-                                                        success: function (res) {
-                                                            wx.hideLoading();
-                                                            if (res.code == 0) {
-                                                                wx.setStorageSync("access_token", res.data.access_token);
-                                                                wx.setStorageSync("user_info", res.data);
-                                                                var p = getCurrentPages();
-                                                                var parent_id = 0;
-                                                                if (p[0].options.user_id != undefined) {
-                                                                    var parent_id = p[0].options.user_id;
-                                                                }
-                                                                else if (p[0].options.scene != undefined) {
-                                                                    var parent_id = p[0].options.scene;
-                                                                }
-                                                                getApp().bindParent({
-                                                                    parent_id: parent_id || 0
-                                                                });
-
-                                                                if (page == undefined) {
-                                                                    return;
-
-                                                                }
-                                                                var loginNoRefreshPage = getApp().loginNoRefreshPage;
-                                                                for (var i in loginNoRefreshPage) {
-                                                                    if (loginNoRefreshPage[i] === page.route)
-                                                                        return;
-                                                                }
-                                                                wx.redirectTo({
-                                                                    url: "/" + page.route + "?" + util.objectToUrlParams(page.options),
-                                                                    fail: function () {
-                                                                        wx.switchTab({
-                                                                            url: "/" + page.route,
-                                                                        });
-                                                                    },
-                                                                });
-                                                            } else {
-                                                                wx.showToast({
-                                                                    title: res.msg
-                                                                });
-                                                            }
-                                                        }
-                                                    });
-                                                },
-                                                fail: function (res) {
-                                                    wx.hideLoading();
-                                                    getApp().getauth({
-                                                        content: '需要获取您的用户信息授权,请到小程序设置中打开授权',
-                                                        cancel: true,
-                                                        success: function (e) {
-                                                            if (e) {
-                                                                getApp().login();
-                                                            }
-                                                        },
-                                                    });
-                                                }
-                                            });
-                                        }
-                                    }
-                                })
-                            } else {
-                                page.setData({
-                                    showModal: true
-                                })
-                            }
-                        }
-                    })
-                    
-                } else {
-                    //console.log(res);
-                }
-
-            }
-        });
-    },
-    request: function (object) {
-        if (!object.data)
-            object.data = {};
-        var access_token = wx.getStorageSync("access_token");
-        if (access_token) {
-            object.data.access_token = access_token;
-        }
-        object.data._uniacid = this.siteInfo.uniacid;
-        object.data._acid = this.siteInfo.acid;
-        wx.request({
-            url: object.url,
-            header: object.header || {
-                'content-type': 'application/x-www-form-urlencoded'
-            },
-            data: object.data || {},
-            method: object.method || "GET",
-            dataType: object.dataType || "json",
-            success: function (res) {
-                if (res.data.code == -1) {
-                    getApp().login();
-                } else {
-                    if (object.success)
-                        object.success(res.data);
-                }
-            },
-            fail: function (res) {
-                console.warn('--- request fail >>>');
-                console.warn(res);
-                console.warn('<<< request fail ---');
-                var app = getApp();
-                if (app.is_on_launch) {
-                    app.is_on_launch = false;
-                    wx.showModal({
-                        title: "网络请求出错",
-                        content: res.errMsg,
-                        showCancel: false,
-                        success: function (res) {
-                            if (res.confirm) {
-                                if (object.fail)
-                                    object.fail(res);
-                            }
-                        }
-                    });
-                } else {
-                    wx.showToast({
-                        title: res.errMsg,
-                        image: "/images/icon-warning.png",
-                    });
-                    if (object.fail)
-                        object.fail(res);
-                }
-            },
-            complete: function (res) {
-                if (res.statusCode != 200) {
-                    console.log('--- request http error >>>');
-                    console.log(res.statusCode);
-                    console.log(res.data);
-                    console.log('<<< request http error ---');
-                }
-                if (object.complete)
-                    object.complete(res);
-            }
-        });
-    },
-    saveFormId: function (form_id) {
-        this.request({
-            url: api.user.save_form_id,
-            data: {
-                form_id: form_id,
-            }
-        });
-    },
-
-    loginBindParent: function (object) {
-        var access_token = wx.getStorageSync("access_token");
-        if (access_token == '') {
-            return true;
-        }
-        getApp().bindParent(object);
-    },
-    bindParent: function (object) {
-        if (object.parent_id == "undefined" || object.parent_id == 0)
-            return;
-        console.log("Try To Bind Parent With User Id:" + object.parent_id);
-        var user_info = wx.getStorageSync("user_info");
-        var share_setting = wx.getStorageSync("share_setting");
-        if (share_setting.level > 0) {
-            var parent_id = object.parent_id;
-            if (parent_id != 0) {
-                getApp().request({
-                    url: api.share.bind_parent,
-                    data: {parent_id: object.parent_id},
-                    success: function (res) {
-                        if (res.code == 0) {
-                            user_info.parent = res.data
-                            wx.setStorageSync('user_info', user_info);
-                        }
-                    }
-                });
-            }
-        }
-    },
-
-    /**
-     * 分享送优惠券
-     * */
-    shareSendCoupon: function (page) {
-        wx.showLoading({
-            mask: true,
-        });
-        if (!page.hideGetCoupon) {
-            page.hideGetCoupon = function (e) {
-                var url = e.currentTarget.dataset.url || false;
-                page.setData({
-                    get_coupon_list: null,
-                });
-                if (url) {
-                    wx.navigateTo({
-                        url: url,
-                    });
-                }
-            };
-        }
-        this.request({
-            url: api.coupon.share_send,
-            success: function (res) {
-                if (res.code == 0) {
-                    page.setData({
-                        get_coupon_list: res.data.list
-                    });
-                }
-            },
-            complete: function () {
-                wx.hideLoading();
-            }
-        });
-    },
-    getauth: function (object) {
-        wx.showModal({
-            title: '是否打开设置页面重新授权',
-            content: object.content,
-            confirmText: '去设置',
-            success: function (e) {
-                if (e.confirm) {
-                    wx.openSetting({
-                        success: function (res) {
-                            if (object.success) {
-                                object.success(res);
-                            }
-                        },
-                        fail: function (res) {
-                            if (object.fail) {
-                                object.fail(res);
-                            }
-                        },
-                        complete: function (res) {
-                            if (object.complete)
-                                object.complete(res);
-                        }
-                    })
-                } else {
-                    if (object.cancel) {
-                        getApp().getauth(object);
-                    }
-                }
-            }
-        })
-    },
-    api: require('api.js'),
-    setApi: function () {
-        var siteroot = this.siteInfo.siteroot;
-        siteroot = siteroot.replace('app/index.php', '');
-        siteroot += 'addons/zjhj_mall/core/web/index.php?store_id=-1&r=api/';
-
-        function getNewApiUri(api) {
-            for (var i in api) {
-                if (typeof api[i] === 'string') {
-                    api[i] = api[i].replace('{$_api_root}', siteroot);
-                } else {
-                    api[i] = getNewApiUri(api[i]);
-                }
-            }
-            return api;
-        }
-
-        this.api = getNewApiUri(this.api);
-        var _index_api_url = this.api.default.index;
-        var _web_root = _index_api_url.substr(0, _index_api_url.indexOf('/index.php'));
-        this.webRoot = _web_root;
-    },
-    webRoot: null,
-    siteInfo : {
-    'uniacid': '-1',
-    'acid': '-1',
-    'version': '1.0.0',
-    'siteroot': 'https://u5.9026.com/app/index.php',
-    'siteroot': 'https://u5.9026.com/app/index.php',
-    },
-    globalData:{
-    'userInfo': null,
-    },
-    currentPage: null,
-    pageOnLoad: function (page) {
-        this.currentPage = page;
-        console.log('--------pageOnLoad----------');
-        if (typeof  page.openWxapp === 'undefined') {
-            page.openWxapp = this.openWxapp;
-        }
-        if (typeof  page.showToast === 'undefined') {
-            page.showToast = this.pageShowToast;
-        }
-        this.setNavigationBarColor();
-        this.setPageNavbar(page);
-        var app = this;
-        this.currentPage.naveClick = function(e){
-            var page = this;
-            app.navigatorClick(e,page);
-        }
-        wx.getSystemInfo({
-            success: res => {
-                let modelmes = res.model;
-                if (modelmes.search('iPhone X') != -1) {
-                    page.setData({
-                        isIphoneX: true
-                    })
-                }
-            }
-        })  
-    },
-    pageOnReady: function (page) {
-        console.log('--------pageOnReady----------');
-
-    },
-    pageOnShow: function (page) {
-        console.log('--------pageOnShow----------');
-
-    },
-    pageOnHide: function (page) {
-        console.log('--------pageOnHide----------');
-
-    },
-    pageOnUnload: function (page) {
-        console.log('--------pageOnUnload----------');
-
-    },
-
-    setPageNavbar: function (page) {
-        console.log('----setPageNavbar----');
-        console.log(page);
-        var navbar = wx.getStorageSync('_navbar');
-
-        if (navbar) {
-            setNavbar(navbar);
-        }
-        this.request({
-            url: api.default.navbar,
-            success: function (res) {
-                if (res.code == 0) {
-                    setNavbar(res.data);
-                    wx.setStorageSync('_navbar', res.data);
-                }
-            }
-        });
-
-        function setNavbar(navbar) {
-            var in_navs = false;
-            var route = page.route || (page.__route__ || null);
-            for (var i in navbar.navs) {
-                if (navbar.navs[i].url === "/" + route) {
-                    navbar.navs[i].active = true;
-                    in_navs = true;
-                } else {
-                    navbar.navs[i].active = false;
-                }
-            }
-            if (!in_navs)
-                return;
-            page.setData({_navbar: navbar});
-        }
-
-    },
-
-    getNavigationBarColor: function () {
-        var app = this;
-        app.request({
-            url: api.default.navigation_bar_color,
-            success: function (res) {
-                if (res.code == 0) {
-                    wx.setStorageSync('_navigation_bar_color', res.data);
-                    app.setNavigationBarColor();
-                }
-            }
-        });
-    },
-
-    setNavigationBarColor: function () {
-        var navigation_bar_color = wx.getStorageSync('_navigation_bar_color');
-        if (navigation_bar_color) {
-            wx.setNavigationBarColor(navigation_bar_color);
-        }
-    },
-
-    //登录成功后不刷新的页面
-    loginNoRefreshPage: [
-        'pages/index/index',
-        //'pages/fxhb/open/open',
-        //'pages/fxhb/detail/detail',
-    ],
-
-    openWxapp: function (e) {
-        console.log('--openWxapp---');
-        if (!e.currentTarget.dataset.url)
-            return;
-        var url = e.currentTarget.dataset.url;
-        url = parseQueryString(url);
-        url.path = url.path ? decodeURIComponent(url.path) : "";
-        console.log("Open New App");
-        console.log(url);
-        wx.navigateToMiniProgram({
-            appId: url.appId,
-            path: url.path,
-            complete: function (e) {
-                console.log(e);
-            }
-        });
-
-        function parseQueryString(url) {
-            var reg_url = /^[^\?]+\?([\w\W]+)$/,
-                reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
-                arr_url = reg_url.exec(url),
-                ret = {};
-            if (arr_url && arr_url[1]) {
-                var str_para = arr_url[1], result;
-                while ((result = reg_para.exec(str_para)) != null) {
-                    ret[result[1]] = result[2];
-                }
-            }
-            return ret;
-        }
-    },
-
-    pageShowToast: function (e) {
-        console.log('--- pageToast ---');
-        var page = this.currentPage;
-        var duration = e.duration || 2500;
-        var title = e.title || '';
-        var success = e.success || null;
-        var fail = e.fail || null;
-        var complete = e.complete || null;
-        if (page._toast_timer) {
-            clearTimeout(page._toast_timer);
-        }
-        page.setData({
-            _toast: {
-                title: title,
-            },
-        });
-        page._toast_timer = setTimeout(function () {
-            var _toast = page.data._toast;
-            _toast.hide = true;
-            page.setData({
-                _toast: _toast,
-            });
-            if (typeof complete == 'function') {
-                complete();
-            }
-        }, duration);
-    },
-
-    navigatorClick: function (e,page) {
-        var open_type = e.currentTarget.dataset.open_type;
-        if(open_type == 'redirect'){
-            return true;
-        }
-        if (open_type == 'wxapp') {
-            var path = e.currentTarget.dataset.path;
-            var str = path.substr(0,1);
-            if(str != '/'){
-                path = '/' + path;
-            }
-            wx.navigateToMiniProgram({
-                appId: e.currentTarget.dataset.appid,
-                path: path,
-                complete: function (e) {
-                    console.log(e);
-                }
-            });
-        }
-        if(open_type == 'tel'){
-            var contact_tel = e.currentTarget.dataset.tel;
-            wx.makePhoneCall({
-                phoneNumber: contact_tel
-            })
-        }
-        return false;
-
-        function parseQueryString(url) {
-            var reg_url = /^[^\?]+\?([\w\W]+)$/,
-                reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
-                arr_url = reg_url.exec(url),
-                ret = {};
-            if (arr_url && arr_url[1]) {
-                var str_para = arr_url[1], result;
-                while ((result = reg_para.exec(str_para)) != null) {
-                    ret[result[1]] = result[2];
-                }
-            }
-            return ret;
-        }
-    },
-
+//app.js
+var util = require('./utils/utils.js');
+var api;
+App({
+    data: {
+        deviceInfo: {}
+    },
+    is_on_launch: true,
+    onLaunch: function () {
+        let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
+        var uniacid = JSON.stringify(extConfig) != "{}" ? extConfig.uniacid : '20236';
+        this.siteInfo.uniacid = uniacid;
+        this.siteInfo.acid = uniacid;
+        wx.setStorageSync("store_id", uniacid);
+        console.log('uniacid:'+uniacid);
+        
+        this.setApi();
+        api = this.api;
+
+        this.getNavigationBarColor();
+        // this.getStoreData();
+        this.getCatList();
+    },
+
+    getStoreData: function (that) {
+        var page = this;
+        this.request({
+            url: api.default.store,
+            success: function (res) {
+                if (res.code == 0) {
+                    wx.setStorageSync("store", res.data.store);
+                    wx.setStorageSync("store_name", res.data.store_name);
+                    wx.setStorageSync("show_customer_service", res.data.show_customer_service);
+                    wx.setStorageSync("contact_tel", res.data.contact_tel);
+                    wx.setStorageSync("share_setting", res.data.share_setting);
+                }
+            },
+            complete: function () {
+                page.login(that);
+            }
+        });
+    },
+
+    getCatList: function () {
+        this.request({
+            url: api.default.cat_list,
+            success: function (res) {
+                if (res.code == 0) {
+                    var cat_list = res.data.list || [];
+                    wx.setStorageSync("cat_list", cat_list);
+                }
+            }
+        });
+    },
+
+    // dologin: function (raw) {
+    //   var pages = getCurrentPages();
+    //   var page = pages[(pages.length - 1)];
+    //   wx.login({
+    //     success: function (res) {
+    //       if (res.code) {
+    //         var code = res.code;
+    //         getApp().request({
+    //           url: api.passport.login,
+    //           method: "post",
+    //           data: {
+    //             code: code,
+    //             user_info: JSON.stringify(raw.userInfo),
+    //             encrypted_data: raw.encryptedData,
+    //             iv: raw.iv,
+    //             signature: raw.signature
+    //           },
+    //           success: function (res) {
+    //             wx.hideLoading();
+    //             if (res.code == 0) {
+    //               wx.setStorageSync("access_token", res.data.access_token);
+    //               wx.setStorageSync("user_info", res.data);
+
+    //               var p = getCurrentPages();
+    //               var parent_id = 0;
+    //               if (p[0].options.user_id != undefined) {
+    //                 var parent_id = p[0].options.user_id;
+    //               }
+    //               else if (p[0].options.scene != undefined) {
+    //                 var parent_id = p[0].options.scene;
+    //               }
+    //               getApp().bindParent({
+    //                   parent_id: parent_id || 0
+    //               });
+
+    //               if (page == undefined) {
+    //                   return;
+
+    //               }
+    //               var loginNoRefreshPage = getApp().loginNoRefreshPage;
+    //               for (var i in loginNoRefreshPage) {
+    //                   if (loginNoRefreshPage[i] === page.route)
+    //                       return;
+    //               }
+    //               wx.redirectTo({
+    //                   url: "/" + page.route + "?" + util.objectToUrlParams(page.options),
+    //                   fail: function () {
+    //                       wx.switchTab({
+    //                           url: "/" + page.route,
+    //                       });
+    //                   },
+    //               });
+              
+    //             } else {
+    //               wx.showToast({
+    //                 title: res.msg
+    //               });
+    //             }
+    //           }
+    //         });
+    //       }
+    //     }
+    //   });
+    // },
+    login: function (e) {
+        var pages = getCurrentPages();
+        var page = pages[(pages.length - 1)];
+        wx.showLoading({
+            title: "正在登录",
+            mask: true,
+        });
+        wx.login({
+            success: function (res) {
+                if (res.code) {
+                    var code = res.code;
+                    wx.getSetting({
+                        success: res => {
+                            if (res.authSetting['scope.userInfo']) {
+                              console.log('已经授权' + code)
+                                // 已经授权,可以直接调用 getUserInfo 
+                                // 获取用户信息
+                                wx.getSetting({
+                                    success: res => {
+                                        if (res.authSetting['scope.userInfo']) {
+                                            // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
+                                            wx.getUserInfo({
+                                                success: function (res) {
+                                                    getApp().request({
+                                                        url: api.passport.login,
+                                                        method: "post",
+                                                        data: {
+                                                            code: code,
+                                                            user_info: res.rawData,
+                                                            encrypted_data: res.encryptedData,
+                                                            iv: res.iv,
+                                                            signature: res.signature
+                                                        },
+                                                        success: function (res) {
+                                                            wx.hideLoading();
+                                                            if (res.code == 0) {
+                                                                wx.setStorageSync("access_token", res.data.access_token);
+                                                                wx.setStorageSync("user_info", res.data);
+                                                                var p = getCurrentPages();
+                                                                var parent_id = 0;
+                                                                if (p[0].options.user_id != undefined) {
+                                                                    var parent_id = p[0].options.user_id;
+                                                                }
+                                                                else if (p[0].options.scene != undefined) {
+                                                                    var parent_id = p[0].options.scene;
+                                                                }
+                                                                getApp().bindParent({
+                                                                    parent_id: parent_id || 0
+                                                                });
+
+                                                                if (page == undefined) {
+                                                                    return;
+
+                                                                }
+                                                                var loginNoRefreshPage = getApp().loginNoRefreshPage;
+                                                                for (var i in loginNoRefreshPage) {
+                                                                    if (loginNoRefreshPage[i] === page.route)
+                                                                        return;
+                                                                }
+                                                                wx.redirectTo({
+                                                                    url: "/" + page.route + "?" + util.objectToUrlParams(page.options),
+                                                                    fail: function () {
+                                                                        wx.switchTab({
+                                                                            url: "/" + page.route,
+                                                                        });
+                                                                    },
+                                                                });
+                                                            } else {
+                                                                wx.showToast({
+                                                                    title: res.msg
+                                                                });
+                                                            }
+                                                        }
+                                                    });
+                                                },
+                                                fail: function (res) {
+                                                    wx.hideLoading();
+                                                    getApp().getauth({
+                                                        content: '需要获取您的用户信息授权,请到小程序设置中打开授权',
+                                                        cancel: true,
+                                                        success: function (e) {
+                                                            if (e) {
+                                                                getApp().login();
+                                                            }
+                                                        },
+                                                    });
+                                                }
+                                            });
+                                        }
+                                    }
+                                })
+                            } else {
+                                page.setData({
+                                    showModal: true
+                                })
+                            }
+                        }
+                    })
+                    
+                } else {
+                    //console.log(res);
+                }
+
+            }
+        });
+    },
+    request: function (object) {
+        if (!object.data)
+            object.data = {};
+        var access_token = wx.getStorageSync("access_token");
+        if (access_token) {
+            object.data.access_token = access_token;
+        }
+        object.data._uniacid = this.siteInfo.uniacid;
+        object.data._acid = this.siteInfo.acid;
+        wx.request({
+            url: object.url,
+            header: object.header || {
+                'content-type': 'application/x-www-form-urlencoded'
+            },
+            data: object.data || {},
+            method: object.method || "GET",
+            dataType: object.dataType || "json",
+            success: function (res) {
+                if (res.data.code == -1) {
+                    getApp().login();
+                } else {
+                    if (object.success)
+                        object.success(res.data);
+                }
+            },
+            fail: function (res) {
+                console.warn('--- request fail >>>');
+                console.warn(res);
+                console.warn('<<< request fail ---');
+                var app = getApp();
+                if (app.is_on_launch) {
+                    app.is_on_launch = false;
+                    wx.showModal({
+                        title: "网络请求出错",
+                        content: res.errMsg,
+                        showCancel: false,
+                        success: function (res) {
+                            if (res.confirm) {
+                                if (object.fail)
+                                    object.fail(res);
+                            }
+                        }
+                    });
+                } else {
+                    wx.showToast({
+                        title: res.errMsg,
+                        image: "/images/icon-warning.png",
+                    });
+                    if (object.fail)
+                        object.fail(res);
+                }
+            },
+            complete: function (res) {
+                if (res.statusCode != 200) {
+                    console.log('--- request http error >>>');
+                    console.log(res.statusCode);
+                    console.log(res.data);
+                    console.log('<<< request http error ---');
+                }
+                if (object.complete)
+                    object.complete(res);
+            }
+        });
+    },
+    saveFormId: function (form_id) {
+        this.request({
+            url: api.user.save_form_id,
+            data: {
+                form_id: form_id,
+            }
+        });
+    },
+
+    loginBindParent: function (object) {
+        var access_token = wx.getStorageSync("access_token");
+        if (access_token == '') {
+            return true;
+        }
+        getApp().bindParent(object);
+    },
+    bindParent: function (object) {
+        if (object.parent_id == "undefined" || object.parent_id == 0)
+            return;
+        console.log("Try To Bind Parent With User Id:" + object.parent_id);
+        var user_info = wx.getStorageSync("user_info");
+        var share_setting = wx.getStorageSync("share_setting");
+        if (share_setting.level > 0) {
+            var parent_id = object.parent_id;
+            if (parent_id != 0) {
+                getApp().request({
+                    url: api.share.bind_parent,
+                    data: {parent_id: object.parent_id},
+                    success: function (res) {
+                        if (res.code == 0) {
+                            user_info.parent = res.data
+                            wx.setStorageSync('user_info', user_info);
+                        }
+                    }
+                });
+            }
+        }
+    },
+
+    /**
+     * 分享送优惠券
+     * */
+    shareSendCoupon: function (page) {
+        wx.showLoading({
+            mask: true,
+        });
+        if (!page.hideGetCoupon) {
+            page.hideGetCoupon = function (e) {
+                var url = e.currentTarget.dataset.url || false;
+                page.setData({
+                    get_coupon_list: null,
+                });
+                if (url) {
+                    wx.navigateTo({
+                        url: url,
+                    });
+                }
+            };
+        }
+        this.request({
+            url: api.coupon.share_send,
+            success: function (res) {
+                if (res.code == 0) {
+                    page.setData({
+                        get_coupon_list: res.data.list
+                    });
+                }
+            },
+            complete: function () {
+                wx.hideLoading();
+            }
+        });
+    },
+    getauth: function (object) {
+        wx.showModal({
+            title: '是否打开设置页面重新授权',
+            content: object.content,
+            confirmText: '去设置',
+            success: function (e) {
+                if (e.confirm) {
+                    wx.openSetting({
+                        success: function (res) {
+                            if (object.success) {
+                                object.success(res);
+                            }
+                        },
+                        fail: function (res) {
+                            if (object.fail) {
+                                object.fail(res);
+                            }
+                        },
+                        complete: function (res) {
+                            if (object.complete)
+                                object.complete(res);
+                        }
+                    })
+                } else {
+                    if (object.cancel) {
+                        getApp().getauth(object);
+                    }
+                }
+            }
+        })
+    },
+    api: require('api.js'),
+    setApi: function () {
+        var siteroot = this.siteInfo.siteroot;
+        siteroot = siteroot.replace('app/index.php', '');
+        siteroot += 'addons/zjhj_mall/core/web/index.php?store_id=-1&r=api/';
+
+        function getNewApiUri(api) {
+            for (var i in api) {
+                if (typeof api[i] === 'string') {
+                    api[i] = api[i].replace('{$_api_root}', siteroot);
+                } else {
+                    api[i] = getNewApiUri(api[i]);
+                }
+            }
+            return api;
+        }
+
+        this.api = getNewApiUri(this.api);
+        var _index_api_url = this.api.default.index;
+        var _web_root = _index_api_url.substr(0, _index_api_url.indexOf('/index.php'));
+        this.webRoot = _web_root;
+    },
+    webRoot: null,
+    siteInfo : {
+    'uniacid': '-1',
+    'acid': '-1',
+    'version': '1.0.0',
+    'siteroot': 'https://u5.9026.com/app/index.php',
+    'siteroot': 'https://u5.9026.com/app/index.php',
+    },
+    globalData:{
+    'userInfo': null,
+    },
+    currentPage: null,
+    pageOnLoad: function (page) {
+        this.currentPage = page;
+        console.log('--------pageOnLoad----------');
+        if (typeof  page.openWxapp === 'undefined') {
+            page.openWxapp = this.openWxapp;
+        }
+        if (typeof  page.showToast === 'undefined') {
+            page.showToast = this.pageShowToast;
+        }
+        this.setNavigationBarColor();
+        this.setPageNavbar(page);
+        var app = this;
+        this.currentPage.naveClick = function(e){
+            var page = this;
+            app.navigatorClick(e,page);
+        }
+        wx.getSystemInfo({
+            success: res => {
+                let modelmes = res.model;
+                if (modelmes.search('iPhone X') != -1) {
+                    page.setData({
+                        isIphoneX: true
+                    })
+                }
+            }
+        })  
+    },
+    pageOnReady: function (page) {
+        console.log('--------pageOnReady----------');
+
+    },
+    pageOnShow: function (page) {
+        console.log('--------pageOnShow----------');
+
+    },
+    pageOnHide: function (page) {
+        console.log('--------pageOnHide----------');
+
+    },
+    pageOnUnload: function (page) {
+        console.log('--------pageOnUnload----------');
+
+    },
+
+    setPageNavbar: function (page) {
+        console.log('----setPageNavbar----');
+        console.log(page);
+        var navbar = wx.getStorageSync('_navbar');
+
+        if (navbar) {
+            setNavbar(navbar);
+        }
+        this.request({
+            url: api.default.navbar,
+            success: function (res) {
+                if (res.code == 0) {
+                    setNavbar(res.data);
+                    wx.setStorageSync('_navbar', res.data);
+                }
+            }
+        });
+
+        function setNavbar(navbar) {
+            var in_navs = false;
+            var route = page.route || (page.__route__ || null);
+            for (var i in navbar.navs) {
+                if (navbar.navs[i].url === "/" + route) {
+                    navbar.navs[i].active = true;
+                    in_navs = true;
+                } else {
+                    navbar.navs[i].active = false;
+                }
+            }
+            if (!in_navs)
+                return;
+            page.setData({_navbar: navbar});
+        }
+
+    },
+
+    getNavigationBarColor: function () {
+        var app = this;
+        app.request({
+            url: api.default.navigation_bar_color,
+            success: function (res) {
+                if (res.code == 0) {
+                    wx.setStorageSync('_navigation_bar_color', res.data);
+                    app.setNavigationBarColor();
+                }
+            }
+        });
+    },
+
+    setNavigationBarColor: function () {
+        var navigation_bar_color = wx.getStorageSync('_navigation_bar_color');
+        if (navigation_bar_color) {
+            wx.setNavigationBarColor(navigation_bar_color);
+        }
+    },
+
+    //登录成功后不刷新的页面
+    loginNoRefreshPage: [
+        'pages/index/index',
+        //'pages/fxhb/open/open',
+        //'pages/fxhb/detail/detail',
+    ],
+
+    openWxapp: function (e) {
+        console.log('--openWxapp---');
+        if (!e.currentTarget.dataset.url)
+            return;
+        var url = e.currentTarget.dataset.url;
+        url = parseQueryString(url);
+        url.path = url.path ? decodeURIComponent(url.path) : "";
+        console.log("Open New App");
+        console.log(url);
+        wx.navigateToMiniProgram({
+            appId: url.appId,
+            path: url.path,
+            complete: function (e) {
+                console.log(e);
+            }
+        });
+
+        function parseQueryString(url) {
+            var reg_url = /^[^\?]+\?([\w\W]+)$/,
+                reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
+                arr_url = reg_url.exec(url),
+                ret = {};
+            if (arr_url && arr_url[1]) {
+                var str_para = arr_url[1], result;
+                while ((result = reg_para.exec(str_para)) != null) {
+                    ret[result[1]] = result[2];
+                }
+            }
+            return ret;
+        }
+    },
+
+    pageShowToast: function (e) {
+        console.log('--- pageToast ---');
+        var page = this.currentPage;
+        var duration = e.duration || 2500;
+        var title = e.title || '';
+        var success = e.success || null;
+        var fail = e.fail || null;
+        var complete = e.complete || null;
+        if (page._toast_timer) {
+            clearTimeout(page._toast_timer);
+        }
+        page.setData({
+            _toast: {
+                title: title,
+            },
+        });
+        page._toast_timer = setTimeout(function () {
+            var _toast = page.data._toast;
+            _toast.hide = true;
+            page.setData({
+                _toast: _toast,
+            });
+            if (typeof complete == 'function') {
+                complete();
+            }
+        }, duration);
+    },
+
+    navigatorClick: function (e,page) {
+        var open_type = e.currentTarget.dataset.open_type;
+        if(open_type == 'redirect'){
+            return true;
+        }
+        if (open_type == 'wxapp') {
+            var path = e.currentTarget.dataset.path;
+            var str = path.substr(0,1);
+            if(str != '/'){
+                path = '/' + path;
+            }
+            wx.navigateToMiniProgram({
+                appId: e.currentTarget.dataset.appid,
+                path: path,
+                complete: function (e) {
+                    console.log(e);
+                }
+            });
+        }
+        if(open_type == 'tel'){
+            var contact_tel = e.currentTarget.dataset.tel;
+            wx.makePhoneCall({
+                phoneNumber: contact_tel
+            })
+        }
+        return false;
+
+        function parseQueryString(url) {
+            var reg_url = /^[^\?]+\?([\w\W]+)$/,
+                reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
+                arr_url = reg_url.exec(url),
+                ret = {};
+            if (arr_url && arr_url[1]) {
+                var str_para = arr_url[1], result;
+                while ((result = reg_para.exec(str_para)) != null) {
+                    ret[result[1]] = result[2];
+                }
+            }
+            return ret;
+        }
+    },
+
 });

+ 99 - 99
wechat/app.json

xqd
@@ -1,100 +1,100 @@
-{
-  "pages": [
-    "pages/index/index",
-    "pages/favorite/favorite",
-    "pages/goods/goods",
-    "pages/pay-success/index",
-    "pages/order/order",
-    "pages/order-refund-detail/order-refund-detail",
-    "pages/address/address",
-    "pages/address-edit/address-edit",
-    "pages/user/user",
-    "pages/company/company",
-    "pages/cart/cart",
-    "pages/express-company/express-company",
-    "pages/express-orderid/express-orderid",
-    "pages/order-refund/order-refund",
-    "pages/order-refund-reason/order-refund-reason",
-    "pages/order-comment/order-comment",
-    "pages/express-detail/express-detail",
-    "pages/order-detail/order-detail",
-    "pages/address-picker/address-picker",
-    "pages/list/list",
-    "pages/search/search",
-    "pages/order-submit/order-submit",
-    "pages/test/test",
-    "pages/add-share/index",
-    "pages/share/index",
-    "pages/cash/cash",
-    "pages/share-money/share-money",
-    "pages/cash-detail/cash-detail",
-    "pages/share-team/share-team",
-    "pages/share-order/share-order",
-    "pages/share-qrcode/share-qrcode",
-    "pages/article-list/article-list",
-    "pages/article-detail/article-detail",
-    "pages/cat/cat",
-    "pages/coupon/coupon",
-    "pages/clerk/clerk",
-    "pages/video/video-list",
-    "pages/coupon-list/coupon-list",
-    "pages/topic-list/topic-list",
-    "pages/topic/topic",
-    "pages/member/member",
-    "pages/web/web",
-    "pages/shop/shop",
-    "pages/shop-detail/shop-detail",
-    "pages/card/card",
-    "pages/card-clerk/card-clerk",
-
-    "pages/miaosha/miaosha",
-    "pages/miaosha/details/details",
-    "pages/miaosha/order-submit/order-submit",
-    "pages/miaosha/order/order",
-    "pages/miaosha/order-detail/order-detail",
-    "pages/miaosha/express-detail/express-detail",
-    "pages/miaosha/order-comment/order-comment",
-    "pages/miaosha/order-refund/order-refund",
-    "pages/miaosha/order-refund-detail/order-refund-detail",
-
-    "pages/pt/index/index",
-    "pages/pt/list/list",
-    "pages/pt/details/details",
-    "pages/pt/order-submit/order-submit",
-    "pages/pt/order/order",
-    "pages/pt/order-details/order-details",
-    "pages/pt/group/details",
-    "pages/pt/express-detail/express-detail",
-    "pages/pt/order-comment/order-comment",
-    "pages/pt/comment/comment",
-    "pages/pt/clerk/clerk",
-    "pages/pt/order-refund/order-refund",
-    "pages/pt/order-refund-detail/order-refund-detail",
-    "pages/pt/search/search",
-
-    "pages/book/index/index",
-    "pages/book/details/details",
-    "pages/book/submit/submit",
-    "pages/book/order/order",
-    "pages/book/order/details",
-    "pages/book/shop/shop",
-    "pages/book/clerk/clerk",
-    "pages/book/order-comment/order-comment",
-    "pages/book/comment/comment",
-
-    "pages/fxhb/open/open",
-    "pages/fxhb/detail/detail",
-    "pages/quick-purchase/index/index",
-
-    "pages/balance/balance",
-    "pages/recharge/recharge"
-  ],
-  "window": {
-    "backgroundTextStyle": "light",
-    "navigationBarBackgroundColor": "#fff",
-    "navigationBarTitleText": "Mall",
-    "navigationBarTextStyle": "black",
-    "backgroundColor": "#EFEFF4"
-  },
-  "debug": false
+{
+  "pages": [
+    "pages/index/index",
+    "pages/favorite/favorite",
+    "pages/goods/goods",
+    "pages/pay-success/index",
+    "pages/order/order",
+    "pages/order-refund-detail/order-refund-detail",
+    "pages/address/address",
+    "pages/address-edit/address-edit",
+    "pages/user/user",
+    "pages/company/company",
+    "pages/cart/cart",
+    "pages/express-company/express-company",
+    "pages/express-orderid/express-orderid",
+    "pages/order-refund/order-refund",
+    "pages/order-refund-reason/order-refund-reason",
+    "pages/order-comment/order-comment",
+    "pages/express-detail/express-detail",
+    "pages/order-detail/order-detail",
+    "pages/address-picker/address-picker",
+    "pages/list/list",
+    "pages/search/search",
+    "pages/order-submit/order-submit",
+    "pages/test/test",
+    "pages/add-share/index",
+    "pages/share/index",
+    "pages/cash/cash",
+    "pages/share-money/share-money",
+    "pages/cash-detail/cash-detail",
+    "pages/share-team/share-team",
+    "pages/share-order/share-order",
+    "pages/share-qrcode/share-qrcode",
+    "pages/article-list/article-list",
+    "pages/article-detail/article-detail",
+    "pages/cat/cat",
+    "pages/coupon/coupon",
+    "pages/clerk/clerk",
+    "pages/video/video-list",
+    "pages/coupon-list/coupon-list",
+    "pages/topic-list/topic-list",
+    "pages/topic/topic",
+    "pages/member/member",
+    "pages/web/web",
+    "pages/shop/shop",
+    "pages/shop-detail/shop-detail",
+    "pages/card/card",
+    "pages/card-clerk/card-clerk",
+
+    "pages/miaosha/miaosha",
+    "pages/miaosha/details/details",
+    "pages/miaosha/order-submit/order-submit",
+    "pages/miaosha/order/order",
+    "pages/miaosha/order-detail/order-detail",
+    "pages/miaosha/express-detail/express-detail",
+    "pages/miaosha/order-comment/order-comment",
+    "pages/miaosha/order-refund/order-refund",
+    "pages/miaosha/order-refund-detail/order-refund-detail",
+
+    "pages/pt/index/index",
+    "pages/pt/list/list",
+    "pages/pt/details/details",
+    "pages/pt/order-submit/order-submit",
+    "pages/pt/order/order",
+    "pages/pt/order-details/order-details",
+    "pages/pt/group/details",
+    "pages/pt/express-detail/express-detail",
+    "pages/pt/order-comment/order-comment",
+    "pages/pt/comment/comment",
+    "pages/pt/clerk/clerk",
+    "pages/pt/order-refund/order-refund",
+    "pages/pt/order-refund-detail/order-refund-detail",
+    "pages/pt/search/search",
+
+    "pages/book/index/index",
+    "pages/book/details/details",
+    "pages/book/submit/submit",
+    "pages/book/order/order",
+    "pages/book/order/details",
+    "pages/book/shop/shop",
+    "pages/book/clerk/clerk",
+    "pages/book/order-comment/order-comment",
+    "pages/book/comment/comment",
+
+    "pages/fxhb/open/open",
+    "pages/fxhb/detail/detail",
+    "pages/quick-purchase/index/index",
+
+    "pages/balance/balance",
+    "pages/recharge/recharge"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "Mall",
+    "navigationBarTextStyle": "black",
+    "backgroundColor": "#EFEFF4"
+  },
+  "debug": false
 }

+ 459 - 459
wechat/app.wxss

xqd
@@ -1,460 +1,460 @@
-/**app.wxss**/
-
-@import "/area-picker/area-picker.wxss";
-@import "/commons/extension/extension.wxss";
-
-page {
-    height: 100%;
-    font-size: 11pt;
-    color: #555;
-    background: #EFEFF4;
-    overflow-x: hidden;
-}
-
-page,
-block,
-view,
-scroll-view,
-swiper,
-movable-view,
-icon,
-text,
-progress,
-button,
-checkbox,
-form,
-input,
-label,
-picker,
-picker-view,
-radio,
-slider,
-switch,
-textarea,
-navigator,
-audio,
-image,
-video,
-map,
-canvas,
-contact-button {
-    box-sizing: border-box;
-    font-family: "yahei"
-}
-button{
-    font-size: 11pt;
-    font-family: inherit;
-}
-.flex {
-    display: -webkit-box;
-    display: -webkit-flex;
-    display: flex;
-}
-
-.flex-row {
-    display: -webkit-box;
-    display: -webkit-flex;
-    display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-flex-direction: row;
-    flex-direction: row;
-}
-
-.flex-col{
-    display: -webkit-box;
-    display: -webkit-flex;
-    display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-flex-direction: column;
-    flex-direction: column;
-}
-
-.flex-grow-0{
-    min-width: 0;
-    -webkit-box-flex: 0;
-    -webkit-flex-grow: 0;
-    -ms-flex-positive: 0;
-    flex-grow: 0;
-    -webkit-flex-shrink: 0;
-    -ms-flex-negative: 0;
-    flex-shrink: 0;
-}
-.flex-grow-1{
-    min-width: 0;
-    -webkit-box-flex: 1;
-    -webkit-flex-grow: 1;
-    -ms-flex-positive: 1;
-    flex-grow: 1;
-    -webkit-flex-shrink: 1;
-    -ms-flex-negative: 1;
-    flex-shrink: 1;
-}
-
-.flex-x-center{
-    display: -webkit-box;
-    display: -webkit-flex;
-    display: flex;
-    -webkit-box-pack: center;
-    -webkit-justify-content: center;
-    -ms-flex-pack: center;
-    justify-content: center;
-}
-.flex-y-center{
-    display: -webkit-box;
-    display: -webkit-flex;
-    display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
-    -ms-flex-align: center;
-    -ms-grid-row-align: center;
-    align-items: center;
-}
-.flex-y-bottom{
-    display: -webkit-box;
-    display: -webkit-flex;
-    display: flex;
-
-    -webkit-box-align: end;
-    -webkit-align-items: flex-end;
-    -ms-flex-align: end;
-    -ms-grid-row-align: flex-end;
-    align-items: flex-end;
-}
-
-
-
-.spinner {
-    margin: 0 auto;
-    width: 100rpx;
-    height: 50rpx;
-    text-align: center;
-    font-size: 10rpx;
-}
-
-.spinner > view {
-    background-color: #8c949a;
-    height: 100%;
-    width: 10rpx;
-    display: inline-block;
-    margin: 0 2rpx;
-    animation: sk-stretchdelay 1.2s infinite ease-in-out;
-}
-
-.spinner .rect2 {
-    animation-delay: -1.1s;
-}
-
-.spinner .rect3 {
-    animation-delay: -1.0s;
-}
-
-.spinner .rect4 {
-    animation-delay: -0.9s;
-}
-
-.spinner .rect5 {
-    animation-delay: -0.8s;
-}
-
-@keyframes sk-stretchdelay {
-    0%, 40%, 100% {
-        transform: scaleY(0.4);
-        -webkit-transform: scaleY(0.4);
-    }  20% {
-           transform: scaleY(1.0);
-           -webkit-transform: scaleY(1.0);
-       }
-}
-
-.copy-text-btn{
-    line-height: normal;
-    height: auto;
-    display: inline-block;
-    font-size: 9pt;
-    color: #888;
-    border: 1rpx solid #ddd;
-    border-radius: 5rpx;
-    padding: 6rpx 12rpx;
-    background-color: #fff !important;
-    box-shadow: none;
-}
-
-.no-data-tip{
-    padding: 50% 0;
-    text-align: center;
-    color: #888;
-}
-
-.no-data-tip .no-data-icon{
-    width: 125rpx;
-    height: 120rpx;
-    /* font-size: 0; */
-    /* border-radius: 9999rpx; */
-    /* background: rgba(0,0,0,.1); */
-    margin-left: auto;
-    margin-right: auto;
-    margin-bottom: 32rpx;
-}
-
-.bg-white{
-    background-color: #fff;
-}
-
-.mb-20{
-    margin-bottom: 20rpx;
-}
-
-.mb-10{
-    margin-bottom: 10rpx;
-}
-
-button[plain]{
-    border: none;
-    background: #fff;
-    color: inherit;
-}
-
-.nowrap{
-    white-space: nowrap;
-}
-
-.fs-0{
-    font-size: 0;
-}
-
-.get-coupon{
-    position: fixed;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    background: rgba(0,0,0,.75);
-    z-index: 999;
-}
-.get-coupon .get-coupon-box{
-    position: relative;
-    width: 100%;
-}
-
-.get-coupon .get-coupon-bg{
-    width: 100%;
-    position: absolute;
-    left: 0;
-    top:-210rpx;
-    z-index: -1;
-}
-
-.get-coupon .coupon-list{
-    height: 330rpx;
-    width: 550rpx;
-    margin: 0 auto;
-}
-
-.get-coupon .coupon-item{
-    width: 520rpx;
-    height: 264rpx;
-    margin-bottom: 20rpx;
-    position: relative;
-    color: #fff;
-    padding: 0 40rpx;
-}
-
-
-.get-coupon .coupon-item image{
-    position: absolute;
-    z-index: -1;
-    left: 0;
-    top:0;
-    width: 100%;
-}
-
-.get-coupon .coupon-item:last-child{
-    margin-bottom: 0;
-}
-
-.get-coupon .use-now{
-    display: block;
-    text-align: center;
-    height: 60rpx;
-    line-height: 60rpx;
-    color: #ff4544;
-    background: #fff;
-    border-radius: 6rpx;
-    margin: 15rpx 0;
-    font-size: 9pt;
-}
-
-.fs-sm{
-    font-size: 9pt;
-}
-
-.p-10{
-    padding: 10rpx 10rpx;
-}
-
-.px-24{
-    padding-left: 24rpx;
-    padding-right: 24rpx;
-}
-
-.float-icon{
-    position: fixed;
-    z-index: 20;
-    right: 50rpx;
-    bottom: 50rpx;
-}
-
-.bar-bottom~.float-icon{
-    bottom: 150rpx;
-}
-
-.float-icon .float-icon-btn{
-    display: block;
-    padding: 0;
-    margin: 0;
-    border: none;
-    background: none;
-}
-.float-icon .float-icon-btn:after{
-    display: none;
-}
-
-.float-icon .float-icon-btn:active{
-    opacity: .75;
-}
-
-.float-icon .float-icon-btn image{
-    width: 100rpx;
-    height: 100rpx;
-    display: block;
-}
-
-.w-100{
-    width: 100%;
-}
-
-.h-100{
-    height: 100%;
-}
-
-.wh-100{
-    width: 100%;
-    height: 100%;
-}
-.text-more{
-  width: 100%;
-  overflow: hidden;
-  white-space: nowrap;
-  text-overflow: ellipsis;
-  word-break: break-all;
-}
-
-.navbar{
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    width: 100%;
-    height: 115rpx;
-    background: #fff;
-    color: #555;
-    z-index: 2000;
-    border-top: 1rpx solid rgba(0,0,0,.1);
-    box-sizing: border-box;
-}
-
-.navbar navigator{
-    height: 100%;
-    width: 1%;
-}
-
-.navbar navigator > view{
-    width: 100%;
-    padding-top: 4px;
-}
-
-.navbar .navbar-icon{
-    width: 50rpx;
-    height: 64rpx;
-    display: block;
-    margin: 0 auto;
-}
-
-.navbar .navbar-text{
-    font-size: 8pt;
-    text-align: center;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-    overflow: hidden;
-    margin-top: 10rpx;
-}
-.navbar + .after-navber{
-    padding-bottom: 115rpx;
-}
-
-.navbar ~ .float-icon,
-.navbar + .after-navber .float-icon {
-    bottom: 170rpx !important;
-}
-
-.hidden{
-    display: none;
-}
-
-.text-more-2 {
-  width: 100%;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  display: -webkit-box;
-  -webkit-line-clamp: 2;
-  -webkit-box-orient: vertical;
-  word-break: break-all;
-}
-.text-more-1 {
-  -webkit-line-clamp: 1;
-  text-align: center;
-  font-size: 28rpx;
-  padding: 10rpx 10rpx 0;
-}
-
-.no-scroll {
-  height: 100%;
-  overflow-y: hidden;
-}
-
-
-.dial {
-    width: 100rpx;
-    height: 100rpx;
-    border-radius: 10rpx;
-    display: block;
-    margin-bottom: 32rpx;
-}
-
-.navbar button{
-    display: block;
-    padding: 0;
-    border: 0;
-    background: none;
-    margin: 0;
-    width: 100%;
-    line-height: 1.25;
-}
-
-.navbar button::after{
-    display: none;
-}
-
-.btn_bg_red{
-    border: 1px solid #EB4851;
-    background: #EB4851;
-    color: #ffffff;
-}
-.btn_bg_white{
-    border: 1px solid #EB4851;
-    color: #EB4851;
-    background: #ffffff;
-}
-.iphoneX{
-    padding-bottom: 34rpx;
-    height: 140rpx
+/**app.wxss**/
+
+@import "/area-picker/area-picker.wxss";
+@import "/commons/extension/extension.wxss";
+
+page {
+    height: 100%;
+    font-size: 11pt;
+    color: #555;
+    background: #EFEFF4;
+    overflow-x: hidden;
+}
+
+page,
+block,
+view,
+scroll-view,
+swiper,
+movable-view,
+icon,
+text,
+progress,
+button,
+checkbox,
+form,
+input,
+label,
+picker,
+picker-view,
+radio,
+slider,
+switch,
+textarea,
+navigator,
+audio,
+image,
+video,
+map,
+canvas,
+contact-button {
+    box-sizing: border-box;
+    font-family: "yahei"
+}
+button{
+    font-size: 11pt;
+    font-family: inherit;
+}
+.flex {
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+}
+
+.flex-row {
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-box-orient: horizontal;
+    -webkit-flex-direction: row;
+    flex-direction: row;
+}
+
+.flex-col{
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-box-orient: vertical;
+    -webkit-flex-direction: column;
+    flex-direction: column;
+}
+
+.flex-grow-0{
+    min-width: 0;
+    -webkit-box-flex: 0;
+    -webkit-flex-grow: 0;
+    -ms-flex-positive: 0;
+    flex-grow: 0;
+    -webkit-flex-shrink: 0;
+    -ms-flex-negative: 0;
+    flex-shrink: 0;
+}
+.flex-grow-1{
+    min-width: 0;
+    -webkit-box-flex: 1;
+    -webkit-flex-grow: 1;
+    -ms-flex-positive: 1;
+    flex-grow: 1;
+    -webkit-flex-shrink: 1;
+    -ms-flex-negative: 1;
+    flex-shrink: 1;
+}
+
+.flex-x-center{
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-box-pack: center;
+    -webkit-justify-content: center;
+    -ms-flex-pack: center;
+    justify-content: center;
+}
+.flex-y-center{
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-box-align: center;
+    -webkit-align-items: center;
+    -ms-flex-align: center;
+    -ms-grid-row-align: center;
+    align-items: center;
+}
+.flex-y-bottom{
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+
+    -webkit-box-align: end;
+    -webkit-align-items: flex-end;
+    -ms-flex-align: end;
+    -ms-grid-row-align: flex-end;
+    align-items: flex-end;
+}
+
+
+
+.spinner {
+    margin: 0 auto;
+    width: 100rpx;
+    height: 50rpx;
+    text-align: center;
+    font-size: 10rpx;
+}
+
+.spinner > view {
+    background-color: #8c949a;
+    height: 100%;
+    width: 10rpx;
+    display: inline-block;
+    margin: 0 2rpx;
+    animation: sk-stretchdelay 1.2s infinite ease-in-out;
+}
+
+.spinner .rect2 {
+    animation-delay: -1.1s;
+}
+
+.spinner .rect3 {
+    animation-delay: -1.0s;
+}
+
+.spinner .rect4 {
+    animation-delay: -0.9s;
+}
+
+.spinner .rect5 {
+    animation-delay: -0.8s;
+}
+
+@keyframes sk-stretchdelay {
+    0%, 40%, 100% {
+        transform: scaleY(0.4);
+        -webkit-transform: scaleY(0.4);
+    }  20% {
+           transform: scaleY(1.0);
+           -webkit-transform: scaleY(1.0);
+       }
+}
+
+.copy-text-btn{
+    line-height: normal;
+    height: auto;
+    display: inline-block;
+    font-size: 9pt;
+    color: #888;
+    border: 1rpx solid #ddd;
+    border-radius: 5rpx;
+    padding: 6rpx 12rpx;
+    background-color: #fff !important;
+    box-shadow: none;
+}
+
+.no-data-tip{
+    padding: 50% 0;
+    text-align: center;
+    color: #888;
+}
+
+.no-data-tip .no-data-icon{
+    width: 125rpx;
+    height: 120rpx;
+    /* font-size: 0; */
+    /* border-radius: 9999rpx; */
+    /* background: rgba(0,0,0,.1); */
+    margin-left: auto;
+    margin-right: auto;
+    margin-bottom: 32rpx;
+}
+
+.bg-white{
+    background-color: #fff;
+}
+
+.mb-20{
+    margin-bottom: 20rpx;
+}
+
+.mb-10{
+    margin-bottom: 10rpx;
+}
+
+button[plain]{
+    border: none;
+    background: #fff;
+    color: inherit;
+}
+
+.nowrap{
+    white-space: nowrap;
+}
+
+.fs-0{
+    font-size: 0;
+}
+
+.get-coupon{
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba(0,0,0,.75);
+    z-index: 999;
+}
+.get-coupon .get-coupon-box{
+    position: relative;
+    width: 100%;
+}
+
+.get-coupon .get-coupon-bg{
+    width: 100%;
+    position: absolute;
+    left: 0;
+    top:-210rpx;
+    z-index: -1;
+}
+
+.get-coupon .coupon-list{
+    height: 330rpx;
+    width: 550rpx;
+    margin: 0 auto;
+}
+
+.get-coupon .coupon-item{
+    width: 520rpx;
+    height: 264rpx;
+    margin-bottom: 20rpx;
+    position: relative;
+    color: #fff;
+    padding: 0 40rpx;
+}
+
+
+.get-coupon .coupon-item image{
+    position: absolute;
+    z-index: -1;
+    left: 0;
+    top:0;
+    width: 100%;
+}
+
+.get-coupon .coupon-item:last-child{
+    margin-bottom: 0;
+}
+
+.get-coupon .use-now{
+    display: block;
+    text-align: center;
+    height: 60rpx;
+    line-height: 60rpx;
+    color: #ff4544;
+    background: #fff;
+    border-radius: 6rpx;
+    margin: 15rpx 0;
+    font-size: 9pt;
+}
+
+.fs-sm{
+    font-size: 9pt;
+}
+
+.p-10{
+    padding: 10rpx 10rpx;
+}
+
+.px-24{
+    padding-left: 24rpx;
+    padding-right: 24rpx;
+}
+
+.float-icon{
+    position: fixed;
+    z-index: 20;
+    right: 50rpx;
+    bottom: 50rpx;
+}
+
+.bar-bottom~.float-icon{
+    bottom: 150rpx;
+}
+
+.float-icon .float-icon-btn{
+    display: block;
+    padding: 0;
+    margin: 0;
+    border: none;
+    background: none;
+}
+.float-icon .float-icon-btn:after{
+    display: none;
+}
+
+.float-icon .float-icon-btn:active{
+    opacity: .75;
+}
+
+.float-icon .float-icon-btn image{
+    width: 100rpx;
+    height: 100rpx;
+    display: block;
+}
+
+.w-100{
+    width: 100%;
+}
+
+.h-100{
+    height: 100%;
+}
+
+.wh-100{
+    width: 100%;
+    height: 100%;
+}
+.text-more{
+  width: 100%;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  word-break: break-all;
+}
+
+.navbar{
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    height: 115rpx;
+    background: #fff;
+    color: #555;
+    z-index: 2000;
+    border-top: 1rpx solid rgba(0,0,0,.1);
+    box-sizing: border-box;
+}
+
+.navbar navigator{
+    height: 100%;
+    width: 1%;
+}
+
+.navbar navigator > view{
+    width: 100%;
+    padding-top: 4px;
+}
+
+.navbar .navbar-icon{
+    width: 50rpx;
+    height: 64rpx;
+    display: block;
+    margin: 0 auto;
+}
+
+.navbar .navbar-text{
+    font-size: 8pt;
+    text-align: center;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    overflow: hidden;
+    margin-top: 10rpx;
+}
+.navbar + .after-navber{
+    padding-bottom: 115rpx;
+}
+
+.navbar ~ .float-icon,
+.navbar + .after-navber .float-icon {
+    bottom: 170rpx !important;
+}
+
+.hidden{
+    display: none;
+}
+
+.text-more-2 {
+  width: 100%;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  word-break: break-all;
+}
+.text-more-1 {
+  -webkit-line-clamp: 1;
+  text-align: center;
+  font-size: 28rpx;
+  padding: 10rpx 10rpx 0;
+}
+
+.no-scroll {
+  height: 100%;
+  overflow-y: hidden;
+}
+
+
+.dial {
+    width: 100rpx;
+    height: 100rpx;
+    border-radius: 10rpx;
+    display: block;
+    margin-bottom: 32rpx;
+}
+
+.navbar button{
+    display: block;
+    padding: 0;
+    border: 0;
+    background: none;
+    margin: 0;
+    width: 100%;
+    line-height: 1.25;
+}
+
+.navbar button::after{
+    display: none;
+}
+
+.btn_bg_red{
+    border: 1px solid #EB4851;
+    background: #EB4851;
+    color: #ffffff;
+}
+.btn_bg_white{
+    border: 1px solid #EB4851;
+    color: #EB4851;
+    background: #ffffff;
+}
+.iphoneX{
+    padding-bottom: 34rpx;
+    height: 140rpx
 }

+ 91 - 91
wechat/area-picker/area-picker.js

xqd
@@ -1,92 +1,92 @@
-var area_picker = {
-    page: null,
-    data: null,
-    old_value: [0, 0, 0],
-    result: [null, null, null],
-    init: function (args) {
-        var picker = this;
-        picker.page = args.page;
-        picker.data = args.data;
-        picker.page.showAreaPicker = function () {
-            picker.page.setData({
-                area_picker_show: true,
-            });
-        };
-        picker.page.hideAreaPicker = function () {
-            picker.page.setData({
-                area_picker_show: false,
-            });
-        };
-        var city_list = picker.data[0].list || [];
-        var district_list = [];
-        if (city_list.length > 0)
-            district_list = city_list[0].list || [];
-
-        picker.page.setData({
-            area_picker_province_list: picker.data,
-            area_picker_city_list: city_list,
-            area_picker_district_list: district_list,
-        });
-
-        picker.result[0] = picker.data[0] || null;
-        if (picker.data[0].list) {
-            picker.result[1] = picker.data[0].list[0];
-            if (picker.data[0].list[0].list)
-                picker.result[2] = picker.data[0].list[0].list[0];
-        }
-
-        picker.page.areaPickerChange = function (e) {
-            var province_index = e.detail.value[0];
-            var city_index = e.detail.value[1];
-            var district_index = e.detail.value[2];
-            if (e.detail.value[0] != picker.old_value[0]) {//省份改变
-                city_index = 0;
-                district_index = 0;
-                city_list = picker.data[province_index].list;
-                district_list = city_list[0].list;
-
-                picker.page.setData({
-                    area_picker_city_list: [],
-                    area_picker_district_list: [],
-                });
-                setTimeout(function () {
-                    picker.page.setData({
-                        area_picker_city_list: city_list,
-                        area_picker_district_list: district_list,
-                    });
-                }, 0);
-
-            }
-            if (e.detail.value[1] != picker.old_value[1]) {//城市改变
-                district_index = 0;
-                district_list = picker.data[province_index].list[city_index].list;
-                picker.page.setData({
-                    area_picker_district_list: [],
-                });
-                setTimeout(function () {
-                    picker.page.setData({
-                        area_picker_district_list: district_list,
-                    });
-                }, 0);
-            }
-            if (e.detail.value[2] != picker.old_value[2]) {//区改变
-            }
-            picker.old_value = [province_index, city_index, district_index];
-            picker.result[0] = picker.data[province_index];
-            picker.result[1] = picker.data[province_index].list[city_index];
-            picker.result[2] = picker.data[province_index].list[city_index].list[district_index];
-        };
-
-
-        picker.page.areaPickerConfirm = function () {
-            picker.page.hideAreaPicker();
-            // console.log(1);
-            // console.log(picker.page);
-            // console.log(typeof picker.page.onAreaPickerConfirm);
-            if (picker.page.onAreaPickerConfirm)
-                picker.page.onAreaPickerConfirm(picker.result);
-        };
-        return this;
-    },
-};
+var area_picker = {
+    page: null,
+    data: null,
+    old_value: [0, 0, 0],
+    result: [null, null, null],
+    init: function (args) {
+        var picker = this;
+        picker.page = args.page;
+        picker.data = args.data;
+        picker.page.showAreaPicker = function () {
+            picker.page.setData({
+                area_picker_show: true,
+            });
+        };
+        picker.page.hideAreaPicker = function () {
+            picker.page.setData({
+                area_picker_show: false,
+            });
+        };
+        var city_list = picker.data[0].list || [];
+        var district_list = [];
+        if (city_list.length > 0)
+            district_list = city_list[0].list || [];
+
+        picker.page.setData({
+            area_picker_province_list: picker.data,
+            area_picker_city_list: city_list,
+            area_picker_district_list: district_list,
+        });
+
+        picker.result[0] = picker.data[0] || null;
+        if (picker.data[0].list) {
+            picker.result[1] = picker.data[0].list[0];
+            if (picker.data[0].list[0].list)
+                picker.result[2] = picker.data[0].list[0].list[0];
+        }
+
+        picker.page.areaPickerChange = function (e) {
+            var province_index = e.detail.value[0];
+            var city_index = e.detail.value[1];
+            var district_index = e.detail.value[2];
+            if (e.detail.value[0] != picker.old_value[0]) {//省份改变
+                city_index = 0;
+                district_index = 0;
+                city_list = picker.data[province_index].list;
+                district_list = city_list[0].list;
+
+                picker.page.setData({
+                    area_picker_city_list: [],
+                    area_picker_district_list: [],
+                });
+                setTimeout(function () {
+                    picker.page.setData({
+                        area_picker_city_list: city_list,
+                        area_picker_district_list: district_list,
+                    });
+                }, 0);
+
+            }
+            if (e.detail.value[1] != picker.old_value[1]) {//城市改变
+                district_index = 0;
+                district_list = picker.data[province_index].list[city_index].list;
+                picker.page.setData({
+                    area_picker_district_list: [],
+                });
+                setTimeout(function () {
+                    picker.page.setData({
+                        area_picker_district_list: district_list,
+                    });
+                }, 0);
+            }
+            if (e.detail.value[2] != picker.old_value[2]) {//区改变
+            }
+            picker.old_value = [province_index, city_index, district_index];
+            picker.result[0] = picker.data[province_index];
+            picker.result[1] = picker.data[province_index].list[city_index];
+            picker.result[2] = picker.data[province_index].list[city_index].list[district_index];
+        };
+
+
+        picker.page.areaPickerConfirm = function () {
+            picker.page.hideAreaPicker();
+            // console.log(1);
+            // console.log(picker.page);
+            // console.log(typeof picker.page.onAreaPickerConfirm);
+            if (picker.page.onAreaPickerConfirm)
+                picker.page.onAreaPickerConfirm(picker.result);
+        };
+        return this;
+    },
+};
 module.exports = area_picker;

+ 25 - 25
wechat/area-picker/area-picker.wxml

xqd
@@ -1,26 +1,26 @@
-<view class="area-picker {{area_picker_show?'active':''}}">
-    <view class="area-picker-bg" bindtap="hideAreaPicker">
-        <scroll-view></scroll-view>
-    </view>
-    <view class="area-picker-body">
-        <scroll-view>
-            <view class="area-picker-top">
-                <text class="area-picker-cancel" bindtap="hideAreaPicker">取消</text>
-                <text class="area-picker-confirm" bindtap="areaPickerConfirm">确认</text>
-            </view>
-            <view class="area-picker-row">
-                <picker-view indicator-style="height: 120rpx" style="width: 100%; height: 500rpx;" bindchange="areaPickerChange">
-                    <picker-view-column>
-                        <view wx:for="{{area_picker_province_list}}" wx:key="index" style="line-height: 100rpx;text-align: center">{{item.name}}</view>
-                    </picker-view-column>
-                    <picker-view-column>
-                        <view wx:for="{{area_picker_city_list}}" wx:key="index" style="line-height: 100rpx;text-align: center">{{item.name}}</view>
-                    </picker-view-column>
-                    <picker-view-column>
-                        <view wx:for="{{area_picker_district_list}}" wx:key="index" style="line-height: 100rpx;text-align: center">{{item.name}}</view>
-                    </picker-view-column>
-                </picker-view>
-            </view>
-        </scroll-view>
-    </view>
+<view class="area-picker {{area_picker_show?'active':''}}">
+    <view class="area-picker-bg" bindtap="hideAreaPicker">
+        <scroll-view></scroll-view>
+    </view>
+    <view class="area-picker-body">
+        <scroll-view>
+            <view class="area-picker-top">
+                <text class="area-picker-cancel" bindtap="hideAreaPicker">取消</text>
+                <text class="area-picker-confirm" bindtap="areaPickerConfirm">确认</text>
+            </view>
+            <view class="area-picker-row">
+                <picker-view indicator-style="height: 120rpx" style="width: 100%; height: 500rpx;" bindchange="areaPickerChange">
+                    <picker-view-column>
+                        <view wx:for="{{area_picker_province_list}}" wx:key="index" style="line-height: 100rpx;text-align: center">{{item.name}}</view>
+                    </picker-view-column>
+                    <picker-view-column>
+                        <view wx:for="{{area_picker_city_list}}" wx:key="index" style="line-height: 100rpx;text-align: center">{{item.name}}</view>
+                    </picker-view-column>
+                    <picker-view-column>
+                        <view wx:for="{{area_picker_district_list}}" wx:key="index" style="line-height: 100rpx;text-align: center">{{item.name}}</view>
+                    </picker-view-column>
+                </picker-view>
+            </view>
+        </scroll-view>
+    </view>
 </view>

+ 65 - 65
wechat/area-picker/area-picker.wxss

xqd
@@ -1,66 +1,66 @@
-.area-picker{
-    position: fixed;
-    z-index: 10000;
-    left: 0;
-    top:0;
-    width: 100%;
-    height: 100%;
-    display: flex;
-    flex-direction: column;
-    transform: translateY(100%);
-    transition: 250ms opacity;
-    opacity: 0;
-    background: rgba(0,0,0,.3);
-}
-
-.area-picker.active{
-    transform: translateY(0);
-    opacity: 1;
-}
-
-.area-picker .area-picker-bg{
-    flex-grow: 1;
-    position: relative;
-}
-.area-picker .area-picker-bg > scroll-view{
-    left: 0;
-    top:0;
-    height: 100%;
-    width: 100%;
-    position: absolute;
-}
-.area-picker .area-picker-body{
-    flex-grow: 0;
-    height: 600rpx;
-    background: #fff;
-    transform: translateY(100%);
-    transition: 250ms transform;
-    position: relative;
-}
-
-.area-picker.active .area-picker-body{
-    transform: translateY(0);
-}
-.area-picker .area-picker-body > scroll-view{
-    left: 0;
-    top:0;
-    height: 100%;
-    width: 100%;
-    position: absolute;
-}
-.area-picker .area-picker-cancel,
-.area-picker .area-picker-confirm {
-    display: inline-block;
-    padding: 24rpx;
-    color: #888;
-}
-
-.area-picker .area-picker-confirm{
-    float: right;
-    color: #00aa00;
-}
-
-.area-picker .area-picker-row{
-    width: 100%;
-    height: 500rpx;
+.area-picker{
+    position: fixed;
+    z-index: 10000;
+    left: 0;
+    top:0;
+    width: 100%;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    transform: translateY(100%);
+    transition: 250ms opacity;
+    opacity: 0;
+    background: rgba(0,0,0,.3);
+}
+
+.area-picker.active{
+    transform: translateY(0);
+    opacity: 1;
+}
+
+.area-picker .area-picker-bg{
+    flex-grow: 1;
+    position: relative;
+}
+.area-picker .area-picker-bg > scroll-view{
+    left: 0;
+    top:0;
+    height: 100%;
+    width: 100%;
+    position: absolute;
+}
+.area-picker .area-picker-body{
+    flex-grow: 0;
+    height: 600rpx;
+    background: #fff;
+    transform: translateY(100%);
+    transition: 250ms transform;
+    position: relative;
+}
+
+.area-picker.active .area-picker-body{
+    transform: translateY(0);
+}
+.area-picker .area-picker-body > scroll-view{
+    left: 0;
+    top:0;
+    height: 100%;
+    width: 100%;
+    position: absolute;
+}
+.area-picker .area-picker-cancel,
+.area-picker .area-picker-confirm {
+    display: inline-block;
+    padding: 24rpx;
+    color: #888;
+}
+
+.area-picker .area-picker-confirm{
+    float: right;
+    color: #00aa00;
+}
+
+.area-picker .area-picker-row{
+    width: 100%;
+    height: 500rpx;
 }

+ 57 - 57
wechat/commons/copyright/copyright.wxml

xqd
@@ -1,58 +1,58 @@
-<!-- 优先使用新的版权方案 -->
-<block wx:if="{{copyright&&(copyright.icon||copyright.text)}}">
-    <view wx:if="{{copyright.open_type=='wxapp'}}" style="padding: 24rpx">
-        <view style="text-align: center;font-size: 0;">
-            <image wx:if="{{copyright.icon}}" src="{{copyright.icon}}"
-                   style="height: 60rpx;width: 240rpx"
-                   bindtap="openWxapp"
-                   data-url="{{copyright.url}}"
-                   mode="aspectFit"></image>
-        </view>
-        <view style="text-align: center;line-height: 1">
-            <text wx:if="{{copyright.text}}"
-                  bindtap="openWxapp"
-                  style="color: rgba(0,0,0,.3);font-size: 9pt;"
-                  data-url="{{copyright.url}}">{{copyright.text}}</text>
-        </view>
-    </view>
-    <view wx:elif="{{copyright.open_type=='navigate'}}" style="padding: 24rpx">
-        <view style="text-align: center;font-size: 0;">
-            <navigator url="{{copyright.url}}" style="display: inline-block">
-                <image wx:if="{{copyright.icon}}" src="{{copyright.icon}}"
-                       style="height: 60rpx;width: 240rpx"
-                       mode="aspectFit"></image>
-            </navigator>
-        </view>
-        <view style="text-align: center;line-height: 1">
-            <navigator wx:if="{{copyright.text}}"
-                  style="color: rgba(0,0,0,.3);font-size: 9pt;display: inline-block"
-                  url="{{copyright.url}}">{{copyright.text}}</navigator>
-        </view>
-    </view>
-    <view wx:else style="padding: 24rpx">
-        <view style="text-align: center;font-size: 0;">
-            <image wx:if="{{copyright.icon}}" src="{{copyright.icon}}"
-                   style="height: 60rpx;width: 240rpx"
-                   mode="aspectFit"></image>
-        </view>
-        <view style="text-align: center;line-height: 1">
-            <text wx:if="{{copyright.text}}"
-                  style="color: rgba(0,0,0,.3);font-size: 9pt;">{{copyright.text}}</text>
-        </view>
-    </view>
-</block>
-<block wx:else>
-    <block wx:if="{{store.copyright||store.copyright_pic_url}}">
-        <view class="flex-y-center flex-x-center flex-col" style="padding: 20rpx">
-            <view wx:if="{{store.copyright_pic_url}}">
-                <navigator url="{{store.copyright_url}}">
-                    <image src="{{store.copyright_pic_url}}" style="height: 60rpx;width: 240rpx"
-                           mode="aspectFit"></image>
-                </navigator>
-            </view>
-            <view wx:if="{{store.copyright}}" style="color: rgba(0,0,0,.3);font-size: 9pt;">
-                <navigator url="{{store.copyright_url}}">{{store.copyright}}</navigator>
-            </view>
-        </view>
-    </block>
+<!-- 优先使用新的版权方案 -->
+<block wx:if="{{copyright&&(copyright.icon||copyright.text)}}">
+    <view wx:if="{{copyright.open_type=='wxapp'}}" style="padding: 24rpx">
+        <view style="text-align: center;font-size: 0;">
+            <image wx:if="{{copyright.icon}}" src="{{copyright.icon}}"
+                   style="height: 60rpx;width: 240rpx"
+                   bindtap="openWxapp"
+                   data-url="{{copyright.url}}"
+                   mode="aspectFit"></image>
+        </view>
+        <view style="text-align: center;line-height: 1">
+            <text wx:if="{{copyright.text}}"
+                  bindtap="openWxapp"
+                  style="color: rgba(0,0,0,.3);font-size: 9pt;"
+                  data-url="{{copyright.url}}">{{copyright.text}}</text>
+        </view>
+    </view>
+    <view wx:elif="{{copyright.open_type=='navigate'}}" style="padding: 24rpx">
+        <view style="text-align: center;font-size: 0;">
+            <navigator url="{{copyright.url}}" style="display: inline-block">
+                <image wx:if="{{copyright.icon}}" src="{{copyright.icon}}"
+                       style="height: 60rpx;width: 240rpx"
+                       mode="aspectFit"></image>
+            </navigator>
+        </view>
+        <view style="text-align: center;line-height: 1">
+            <navigator wx:if="{{copyright.text}}"
+                  style="color: rgba(0,0,0,.3);font-size: 9pt;display: inline-block"
+                  url="{{copyright.url}}">{{copyright.text}}</navigator>
+        </view>
+    </view>
+    <view wx:else style="padding: 24rpx">
+        <view style="text-align: center;font-size: 0;">
+            <image wx:if="{{copyright.icon}}" src="{{copyright.icon}}"
+                   style="height: 60rpx;width: 240rpx"
+                   mode="aspectFit"></image>
+        </view>
+        <view style="text-align: center;line-height: 1">
+            <text wx:if="{{copyright.text}}"
+                  style="color: rgba(0,0,0,.3);font-size: 9pt;">{{copyright.text}}</text>
+        </view>
+    </view>
+</block>
+<block wx:else>
+    <block wx:if="{{store.copyright||store.copyright_pic_url}}">
+        <view class="flex-y-center flex-x-center flex-col" style="padding: 20rpx">
+            <view wx:if="{{store.copyright_pic_url}}">
+                <navigator url="{{store.copyright_url}}">
+                    <image src="{{store.copyright_pic_url}}" style="height: 60rpx;width: 240rpx"
+                           mode="aspectFit"></image>
+                </navigator>
+            </view>
+            <view wx:if="{{store.copyright}}" style="color: rgba(0,0,0,.3);font-size: 9pt;">
+                <navigator url="{{store.copyright_url}}">{{store.copyright}}</navigator>
+            </view>
+        </view>
+    </block>
 </block>

+ 2 - 2
wechat/commons/extension/extension.wxml

xqd
@@ -1,3 +1,3 @@
-<view id="_toast" wx:if="{{_toast}}">
-    <view id="_toast_title" class="{{_toast.hide?'hide':''}}"><text>{{_toast.title}}</text></view>
+<view id="_toast" wx:if="{{_toast}}">
+    <view id="_toast_title" class="{{_toast.hide?'hide':''}}"><text>{{_toast.title}}</text></view>
 </view>

+ 33 - 33
wechat/commons/extension/extension.wxss

xqd
@@ -1,34 +1,34 @@
-#_toast {
-    position: fixed;
-    top: 20%;
-    left: 0;
-    width: 100%;
-    height: 0;
-    background: #ff0;
-    z-index: 10000;
-    padding: 0 120rpx;
-    text-align: center;
-}
-
-#_toast_title {
-    font-size: 11pt;
-    display: inline-block;
-    background: rgba(0, 0, 0, 0.85);
-    color: #fff;
-    margin: 0 auto;
-    padding: 16rpx 32rpx;
-    border-radius: 16rpx;
-    max-height: 60vh;
-    overflow-y: auto;
-    overflow-x: hidden;
-    text-align: left;
-    transition: 150ms;
-    word-break: break-all;
-    box-shadow:0 0 25rpx 5rpx rgba(0, 0, 0, .5);
-
-}
-
-#_toast_title.hide {
-    opacity: 0;
-    visibility: hidden;
+#_toast {
+    position: fixed;
+    top: 20%;
+    left: 0;
+    width: 100%;
+    height: 0;
+    background: #ff0;
+    z-index: 10000;
+    padding: 0 120rpx;
+    text-align: center;
+}
+
+#_toast_title {
+    font-size: 11pt;
+    display: inline-block;
+    background: rgba(0, 0, 0, 0.85);
+    color: #fff;
+    margin: 0 auto;
+    padding: 16rpx 32rpx;
+    border-radius: 16rpx;
+    max-height: 60vh;
+    overflow-y: auto;
+    overflow-x: hidden;
+    text-align: left;
+    transition: 150ms;
+    word-break: break-all;
+    box-shadow:0 0 25rpx 5rpx rgba(0, 0, 0, .5);
+
+}
+
+#_toast_title.hide {
+    opacity: 0;
+    visibility: hidden;
 }

+ 26 - 26
wechat/commons/float-icon/float-icon.wxml

xqd
@@ -1,27 +1,27 @@
-<!--
-<movable-area style="height: {{y*2}}rpx;width: {{x*2}}rpx;position:fixed;top:0;left:0;pointer-events:none">
-=======
-<movable-area style="height: {{y}}px;width: {{x}}px;position:fixed;top:0;left:0;pointer-events:none">
->>>>>>> Stashed changes
-  <movable-view direction="all" class="float-icon" style='width:100rpx;height:100rpx;pointer-events:all;' x='{{x-60}}' y='{{y-60}}'>
-    <button open-type="contact" class="float-icon-btn" style='width:100%;height:100%;'>
-      <image src="/images/icon-service.png" style='width:100%;height:100%;'></image>
-    </button>
-  </movable-view>
-</movable-area>
--->
-<view direction="all" class="float-icon">
-    <block wx:if='{{store.dial == 1}}'>
-        <view class='dial' bindtap='to_dial' style="background-image:url('{{store.dial_pic}}'); background-size: 100rpx 100rpx;" />
-    </block>
-    <block wx:if='{{store.option.web_service}}'>
-        <navigator url="/pages/web/web?url={{store.option.web_service_url}}" open-type="navigate" hover-class='none'>
-            <image class='dial' src="{{store.option.web_service}}"></image>
-        </navigator>
-    </block>
-    <block wx:if="{{store.show_customer_service && store.show_customer_service==1}}">
-        <button open-type="contact" session-from="{{_user_info.nickname}}|" class="float-icon-btn">
-            <image src="{{store.service}}"></image>
-        </button>
-    </block>
+<!--
+<movable-area style="height: {{y*2}}rpx;width: {{x*2}}rpx;position:fixed;top:0;left:0;pointer-events:none">
+=======
+<movable-area style="height: {{y}}px;width: {{x}}px;position:fixed;top:0;left:0;pointer-events:none">
+>>>>>>> Stashed changes
+  <movable-view direction="all" class="float-icon" style='width:100rpx;height:100rpx;pointer-events:all;' x='{{x-60}}' y='{{y-60}}'>
+    <button open-type="contact" class="float-icon-btn" style='width:100%;height:100%;'>
+      <image src="/images/icon-service.png" style='width:100%;height:100%;'></image>
+    </button>
+  </movable-view>
+</movable-area>
+-->
+<view direction="all" class="float-icon">
+    <block wx:if='{{store.dial == 1}}'>
+        <view class='dial' bindtap='to_dial' style="background-image:url('{{store.dial_pic}}'); background-size: 100rpx 100rpx;" />
+    </block>
+    <block wx:if='{{store.option.web_service}}'>
+        <navigator url="/pages/web/web?url={{store.option.web_service_url}}" open-type="navigate" hover-class='none'>
+            <image class='dial' src="{{store.option.web_service}}"></image>
+        </navigator>
+    </block>
+    <block wx:if="{{store.show_customer_service && store.show_customer_service==1}}">
+        <button open-type="contact" session-from="{{_user_info.nickname}}|" class="float-icon-btn">
+            <image src="{{store.service}}"></image>
+        </button>
+    </block>
 </view>

+ 34 - 34
wechat/commons/get-card/get-card.wxml

xqd
@@ -1,35 +1,35 @@
-<block wx:if='{{show_card}}'>
-    <view class='get-card flex-x-center flex-y-center'>
-        <view class='card-block'>
-            <image src='/images/icon-card-top.png' style='width:630rpx;height:330rpx;'></image>
-            <view class='card-del flex-x-center flex-y-center' bindtap='cardDel'>
-                <image src='/images/icon-card-del.png'></image>
-            </view>
-            <view class='flex-x-center'>
-                <view class='card-info'>
-                    <view class='flex-x-center card-get'>获得{{goods_card_list.length}}张卡券</view>
-                    <block wx:for='{{goods_card_list}}'>
-                        <block wx:if='{{index<1}}'>
-                            <view class='flex-x-center card-one'>
-                                <view class='card-bg'>
-                                    <view class='card-bg-1 flex-row'>
-                                        <view class='flex-grow-0 flex-y-center'>
-                                            <image src='{{item.pic_url}}' style='width:70rpx;height:70rpx;margin-right:32rpx;'></image>
-                                        </view>
-                                        <view class='flex-grow-1 flex-y-center'>
-                                            <view class='text-more-2'>{{item.content}}</view>
-                                        </view>
-                                    </view>
-                                </view>
-                            </view>
-                        </block>
-                    </block>
-                    <view class='card-text flex-x-center'>卡券将5分钟内放入您的卡包</view>
-                    <view class='flex-x-center card-btn' bindtap='cardTo'>
-                        <image src='/images/icon-card-btn.png'></image>
-                    </view>
-                </view>
-            </view>
-        </view>
-    </view>
+<block wx:if='{{show_card}}'>
+    <view class='get-card flex-x-center flex-y-center'>
+        <view class='card-block'>
+            <image src='/images/icon-card-top.png' style='width:630rpx;height:330rpx;'></image>
+            <view class='card-del flex-x-center flex-y-center' bindtap='cardDel'>
+                <image src='/images/icon-card-del.png'></image>
+            </view>
+            <view class='flex-x-center'>
+                <view class='card-info'>
+                    <view class='flex-x-center card-get'>获得{{goods_card_list.length}}张卡券</view>
+                    <block wx:for='{{goods_card_list}}'>
+                        <block wx:if='{{index<1}}'>
+                            <view class='flex-x-center card-one'>
+                                <view class='card-bg'>
+                                    <view class='card-bg-1 flex-row'>
+                                        <view class='flex-grow-0 flex-y-center'>
+                                            <image src='{{item.pic_url}}' style='width:70rpx;height:70rpx;margin-right:32rpx;'></image>
+                                        </view>
+                                        <view class='flex-grow-1 flex-y-center'>
+                                            <view class='text-more-2'>{{item.content}}</view>
+                                        </view>
+                                    </view>
+                                </view>
+                            </view>
+                        </block>
+                    </block>
+                    <view class='card-text flex-x-center'>卡券将5分钟内放入您的卡包</view>
+                    <view class='flex-x-center card-btn' bindtap='cardTo'>
+                        <image src='/images/icon-card-btn.png'></image>
+                    </view>
+                </view>
+            </view>
+        </view>
+    </view>
 </block>

+ 100 - 100
wechat/commons/get-card/get-card.wxss

xqd
@@ -1,100 +1,100 @@
-.get-card {
-    width: 100%;
-    height: 100%;
-    position: absolute;
-    left: 0;
-    top: 0;
-    z-index: 2000;
-    background-color: rgba(0, 0, 0, 0.5);
-}
-
-.card-block {
-    margin-top: -140rpx;
-    position: relative;
-}
-
-.card-info {
-    width: 559rpx;
-    border-radius: 0 0 30rpx 30rpx;
-    background-color: #fff;
-    margin-top: -20rpx;
-    padding: 20rpx 0 50rpx 0;
-}
-
-.card-one {
-    width: 100%;
-    height: 164rpx;
-    margin-bottom: 10rpx;
-}
-
-.card-bg {
-    width: 514rpx;
-    height: 164rpx;
-    border-radius: 10rpx;
-    box-shadow: 2rpx 2rpx 30rpx #ddd;
-    padding: 14rpx;
-}
-
-.card-bg-1 {
-    width: 100%;
-    height: 100%;
-    border: 2rpx #ff4544 dashed;
-    border-radius: 10rpx;
-    padding: 0 20rpx;
-}
-
-.card-del {
-    position: absolute;
-    right: 34rpx;
-    top: 224rpx;
-    width: 90rpx;
-    height: 90rpx;
-}
-
-.card-del image{
-    width: 30rpx;
-    height: 30rpx;
-}
-
-.card-text {
-    color: #707070;
-    margin-top: 24rpx;
-    margin-bottom: 34rpx;
-    font-size: 9pt;
-}
-
-.card-text::before {
-    content: ' ';
-    margin-right: 32rpx;
-    width: 50rpx;
-    height: 1rpx;
-    background-color: #707070;
-    overflow: hidden;
-    margin-top: 21rpx;
-}
-
-.card-text::after {
-    content: ' ';
-    margin-left: 32rpx;
-    width: 50rpx;
-    height: 1rpx;
-    background-color: #707070;
-    overflow: hidden;
-    margin-top: 21rpx;
-}
-
-.card-btn {
-    position: relative;
-}
-
-.card-btn image {
-    width: 374rpx;
-    height: 96rpx;
-}
-
-.card-get{
-    margin-top: 4rpx;
-    margin-bottom: 20rpx;
-    color: #ff4544;
-    font-size: 13pt;
-}
+.get-card {
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: 2000;
+    background-color: rgba(0, 0, 0, 0.5);
+}
+
+.card-block {
+    margin-top: -140rpx;
+    position: relative;
+}
+
+.card-info {
+    width: 559rpx;
+    border-radius: 0 0 30rpx 30rpx;
+    background-color: #fff;
+    margin-top: -20rpx;
+    padding: 20rpx 0 50rpx 0;
+}
+
+.card-one {
+    width: 100%;
+    height: 164rpx;
+    margin-bottom: 10rpx;
+}
+
+.card-bg {
+    width: 514rpx;
+    height: 164rpx;
+    border-radius: 10rpx;
+    box-shadow: 2rpx 2rpx 30rpx #ddd;
+    padding: 14rpx;
+}
+
+.card-bg-1 {
+    width: 100%;
+    height: 100%;
+    border: 2rpx #ff4544 dashed;
+    border-radius: 10rpx;
+    padding: 0 20rpx;
+}
+
+.card-del {
+    position: absolute;
+    right: 34rpx;
+    top: 224rpx;
+    width: 90rpx;
+    height: 90rpx;
+}
+
+.card-del image{
+    width: 30rpx;
+    height: 30rpx;
+}
+
+.card-text {
+    color: #707070;
+    margin-top: 24rpx;
+    margin-bottom: 34rpx;
+    font-size: 9pt;
+}
+
+.card-text::before {
+    content: ' ';
+    margin-right: 32rpx;
+    width: 50rpx;
+    height: 1rpx;
+    background-color: #707070;
+    overflow: hidden;
+    margin-top: 21rpx;
+}
+
+.card-text::after {
+    content: ' ';
+    margin-left: 32rpx;
+    width: 50rpx;
+    height: 1rpx;
+    background-color: #707070;
+    overflow: hidden;
+    margin-top: 21rpx;
+}
+
+.card-btn {
+    position: relative;
+}
+
+.card-btn image {
+    width: 374rpx;
+    height: 96rpx;
+}
+
+.card-get{
+    margin-top: 4rpx;
+    margin-bottom: 20rpx;
+    color: #ff4544;
+    font-size: 13pt;
+}

+ 33 - 33
wechat/commons/get-coupon/get-coupon.wxml

xqd
@@ -1,34 +1,34 @@
-<block wx:if="{{get_coupon_list&&get_coupon_list.length>0}}">
-    <view class="get-coupon flex-y-center flex-x-center">
-        <view class="get-coupon-box" style="overflow: visible">
-            <image mode="widthFix" class="get-coupon-bg" src="/images/img-get-coupon-bg.png"></image>
-            <view class="flex-x-center mb-20">
-                <image src="{{get_coupon_list[0].type==2?'/images/icon-receive-coupon.png':'/images/img-get-coupon-title.png'}}"
-                       style="width: 226rpx;height: 51rpx"></image>
-            </view>
-            <scroll-view class="coupon-list" scroll-y="true">
-                <view wx:for="{{get_coupon_list}}" class="coupon-item flex-y-center">
-                    <image mode="widthFix" src="/images/img-get-coupon-item-bg.png"
-                           style="width: 100%;height: 100%"></image>
-                    <view style="width: 100%">
-                        <view class="flex-row flex-y-center">
-                            <view class="flex-grow-1 flex-row flex-y-bottom">
-                                <view style="line-height: 1">¥</view>
-                                <view style="font-size: 23pt;line-height: .85">{{item.sub_price}}</view>
-                            </view>
-                            <view class="flex-grow-0" style="font-size: 9pt;line-height: 32rpx;">
-                                满{{item.min_price}}元可用
-                            </view>
-                        </view>
-                        <navigator bindtap="hideGetCoupon" class="use-now" data-url="/pages/list/list">立即使用</navigator>
-                        <view style="font-size: 9pt">{{item.desc}}</view>
-                    </view>
-                </view>
-            </scroll-view>
-            <view class='flex-x-center'>
-                <image src='/images/icon-close3.png' style='width:100rpx;height:100rpx;'
-                       bindtap='closeCouponBox'></image>
-            </view>
-        </view>
-    </view>
+<block wx:if="{{get_coupon_list&&get_coupon_list.length>0}}">
+    <view class="get-coupon flex-y-center flex-x-center">
+        <view class="get-coupon-box" style="overflow: visible">
+            <image mode="widthFix" class="get-coupon-bg" src="/images/img-get-coupon-bg.png"></image>
+            <view class="flex-x-center mb-20">
+                <image src="{{get_coupon_list[0].type==2?'/images/icon-receive-coupon.png':'/images/img-get-coupon-title.png'}}"
+                       style="width: 226rpx;height: 51rpx"></image>
+            </view>
+            <scroll-view class="coupon-list" scroll-y="true">
+                <view wx:for="{{get_coupon_list}}" class="coupon-item flex-y-center">
+                    <image mode="widthFix" src="/images/img-get-coupon-item-bg.png"
+                           style="width: 100%;height: 100%"></image>
+                    <view style="width: 100%">
+                        <view class="flex-row flex-y-center">
+                            <view class="flex-grow-1 flex-row flex-y-bottom">
+                                <view style="line-height: 1">¥</view>
+                                <view style="font-size: 23pt;line-height: .85">{{item.sub_price}}</view>
+                            </view>
+                            <view class="flex-grow-0" style="font-size: 9pt;line-height: 32rpx;">
+                                满{{item.min_price}}元可用
+                            </view>
+                        </view>
+                        <navigator bindtap="hideGetCoupon" class="use-now" data-url="/pages/list/list">立即使用</navigator>
+                        <view style="font-size: 9pt">{{item.desc}}</view>
+                    </view>
+                </view>
+            </scroll-view>
+            <view class='flex-x-center'>
+                <image src='/images/icon-close3.png' style='width:100rpx;height:100rpx;'
+                       bindtap='closeCouponBox'></image>
+            </view>
+        </view>
+    </view>
 </block>

+ 37 - 37
wechat/commons/navbar/navbar.wxml

xqd
@@ -1,38 +1,38 @@
-<block wx:if="{{_navbar && _navbar.navs && _navbar.navs.length>0}}">
-    <view class="navbar flex-row {{isIphoneX ? 'iphoneX' : ''}}" style="background-image: url({{_navbar.background_image}})">
-        <block wx:for="{{_navbar.navs}}">
-            <navigator wx:if='{{item.open_type == "wxapp"}}' class="flex-grow-1 flex-y-center" url="{{item.url}}" open-type="wxapp" bindtap='naveClick' data-appid='{{item.appid}}' data-path='{{item.path}}' data-open_type='{{item.open_type}}'>
-                <view>
-                    <image mode='widthFix' class="navbar-icon" src="{{item.active?item.active_icon:item.icon}}"></image>
-                    <view class="navbar-text" style="color: {{item.active?item.active_color:item.color}};">{{item.text}}
-                    </view>
-                </view>
-            </navigator>
-            <navigator wx:elif='{{item.open_type == "tel"}}' class="flex-grow-1 flex-y-center" url="{{item.url}}" open-type="tel" bindtap='naveClick' data-tel='{{item.tel}}' data-open_type='redirectTo'>
-                <view>
-                    <image mode='widthFix' class="navbar-icon" src="{{item.active?item.active_icon:item.icon}}"></image>
-                    <view class="navbar-text" style="color: {{item.active?item.active_color:item.color}};">{{item.text}}
-                    </view>
-                </view>
-            </navigator>
-            <block wx:elif='{{item.open_type == "contact"}}'>
-                <view class='flex-grow-1 flex-y-center' style='width:1%;padding-top:8rpx;'>
-                    <view style='width:100%;'>
-                        <button open-type="contact" session-from="{{_user_info.nickname}}|">
-                            <image mode='widthFix' class="navbar-icon" src="{{item.active?item.active_icon:item.icon}}"></image>
-                            <view class="navbar-text" style="color: {{item.active?item.active_color:item.color}};">{{item.text}}
-                            </view>
-                        </button>
-                    </view>
-                </view>
-            </block>
-            <navigator class="flex-grow-1 flex-y-center" url="{{item.url}}" open-type="redirect" data-open_type='{{item.open_type}}' wx:else>
-                <view>
-                    <image mode='widthFix' class="navbar-icon" src="{{item.active?item.active_icon:item.icon}}"></image>
-                    <view class="navbar-text" style="color: {{item.active?item.active_color:item.color}};">{{item.text}}
-                    </view>
-                </view>
-            </navigator>
-        </block>
-    </view>
+<block wx:if="{{_navbar && _navbar.navs && _navbar.navs.length>0}}">
+    <view class="navbar flex-row {{isIphoneX ? 'iphoneX' : ''}}" style="background-image: url({{_navbar.background_image}})">
+        <block wx:for="{{_navbar.navs}}">
+            <navigator wx:if='{{item.open_type == "wxapp"}}' class="flex-grow-1 flex-y-center" url="{{item.url}}" open-type="wxapp" bindtap='naveClick' data-appid='{{item.appid}}' data-path='{{item.path}}' data-open_type='{{item.open_type}}'>
+                <view>
+                    <image mode='widthFix' class="navbar-icon" src="{{item.active?item.active_icon:item.icon}}"></image>
+                    <view class="navbar-text" style="color: {{item.active?item.active_color:item.color}};">{{item.text}}
+                    </view>
+                </view>
+            </navigator>
+            <navigator wx:elif='{{item.open_type == "tel"}}' class="flex-grow-1 flex-y-center" url="{{item.url}}" open-type="tel" bindtap='naveClick' data-tel='{{item.tel}}' data-open_type='redirectTo'>
+                <view>
+                    <image mode='widthFix' class="navbar-icon" src="{{item.active?item.active_icon:item.icon}}"></image>
+                    <view class="navbar-text" style="color: {{item.active?item.active_color:item.color}};">{{item.text}}
+                    </view>
+                </view>
+            </navigator>
+            <block wx:elif='{{item.open_type == "contact"}}'>
+                <view class='flex-grow-1 flex-y-center' style='width:1%;padding-top:8rpx;'>
+                    <view style='width:100%;'>
+                        <button open-type="contact" session-from="{{_user_info.nickname}}|">
+                            <image mode='widthFix' class="navbar-icon" src="{{item.active?item.active_icon:item.icon}}"></image>
+                            <view class="navbar-text" style="color: {{item.active?item.active_color:item.color}};">{{item.text}}
+                            </view>
+                        </button>
+                    </view>
+                </view>
+            </block>
+            <navigator class="flex-grow-1 flex-y-center" url="{{item.url}}" open-type="redirect" data-open_type='{{item.open_type}}' wx:else>
+                <view>
+                    <image mode='widthFix' class="navbar-icon" src="{{item.active?item.active_icon:item.icon}}"></image>
+                    <view class="navbar-text" style="color: {{item.active?item.active_color:item.color}};">{{item.text}}
+                    </view>
+                </view>
+            </navigator>
+        </block>
+    </view>
 </block>

+ 31 - 31
wechat/images/loading.svg

xqd
@@ -1,32 +1,32 @@
-<svg class="lds-message" width="200px" height="50px" xmlns="http://www.w3.org/2000/svg"
-     xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 37 100 25" preserveAspectRatio="xMidYMid"
-     style="background: none;">
-    <g transform="translate(20 50)">
-        <circle cx="0" cy="0" r="6" fill="#030303" transform="scale(0.376157 0.376157)">
-            <animateTransform attributeName="transform" type="scale" begin="-0.375s" calcMode="spline"
-                              keySplines="0.3 0 0.7 1;0.3 0 0.7 1" values="0;1;0" keyTimes="0;0.5;1" dur="1s"
-                              repeatCount="indefinite"></animateTransform>
-        </circle>
-    </g>
-    <g transform="translate(40 50)">
-        <circle cx="0" cy="0" r="6" fill="#d39182" transform="scale(0.731132 0.731132)">
-            <animateTransform attributeName="transform" type="scale" begin="-0.25s" calcMode="spline"
-                              keySplines="0.3 0 0.7 1;0.3 0 0.7 1" values="0;1;0" keyTimes="0;0.5;1" dur="1s"
-                              repeatCount="indefinite"></animateTransform>
-        </circle>
-    </g>
-    <g transform="translate(60 50)">
-        <circle cx="0" cy="0" r="6" fill="#e0e0d0" transform="scale(0.977127 0.977127)">
-            <animateTransform attributeName="transform" type="scale" begin="-0.125s" calcMode="spline"
-                              keySplines="0.3 0 0.7 1;0.3 0 0.7 1" values="0;1;0" keyTimes="0;0.5;1" dur="1s"
-                              repeatCount="indefinite"></animateTransform>
-        </circle>
-    </g>
-    <g transform="translate(80 50)">
-        <circle cx="0" cy="0" r="6" fill="#b4b524" transform="scale(0.917903 0.917903)">
-            <animateTransform attributeName="transform" type="scale" begin="0s" calcMode="spline"
-                              keySplines="0.3 0 0.7 1;0.3 0 0.7 1" values="0;1;0" keyTimes="0;0.5;1" dur="1s"
-                              repeatCount="indefinite"></animateTransform>
-        </circle>
-    </g>
+<svg class="lds-message" width="200px" height="50px" xmlns="http://www.w3.org/2000/svg"
+     xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 37 100 25" preserveAspectRatio="xMidYMid"
+     style="background: none;">
+    <g transform="translate(20 50)">
+        <circle cx="0" cy="0" r="6" fill="#030303" transform="scale(0.376157 0.376157)">
+            <animateTransform attributeName="transform" type="scale" begin="-0.375s" calcMode="spline"
+                              keySplines="0.3 0 0.7 1;0.3 0 0.7 1" values="0;1;0" keyTimes="0;0.5;1" dur="1s"
+                              repeatCount="indefinite"></animateTransform>
+        </circle>
+    </g>
+    <g transform="translate(40 50)">
+        <circle cx="0" cy="0" r="6" fill="#d39182" transform="scale(0.731132 0.731132)">
+            <animateTransform attributeName="transform" type="scale" begin="-0.25s" calcMode="spline"
+                              keySplines="0.3 0 0.7 1;0.3 0 0.7 1" values="0;1;0" keyTimes="0;0.5;1" dur="1s"
+                              repeatCount="indefinite"></animateTransform>
+        </circle>
+    </g>
+    <g transform="translate(60 50)">
+        <circle cx="0" cy="0" r="6" fill="#e0e0d0" transform="scale(0.977127 0.977127)">
+            <animateTransform attributeName="transform" type="scale" begin="-0.125s" calcMode="spline"
+                              keySplines="0.3 0 0.7 1;0.3 0 0.7 1" values="0;1;0" keyTimes="0;0.5;1" dur="1s"
+                              repeatCount="indefinite"></animateTransform>
+        </circle>
+    </g>
+    <g transform="translate(80 50)">
+        <circle cx="0" cy="0" r="6" fill="#b4b524" transform="scale(0.917903 0.917903)">
+            <animateTransform attributeName="transform" type="scale" begin="0s" calcMode="spline"
+                              keySplines="0.3 0 0.7 1;0.3 0 0.7 1" values="0;1;0" keyTimes="0;0.5;1" dur="1s"
+                              repeatCount="indefinite"></animateTransform>
+        </circle>
+    </g>
 </svg>

+ 39 - 39
wechat/images/loading2.svg

xqd
@@ -1,40 +1,40 @@
-<svg width="200px" height="200px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"
-     preserveAspectRatio="xMidYMid" class="lds-hourglass" style="background: none;">
-    <defs>
-        <clipPath ng-attr-id="{{config.cpid}}" id="lds-hourglass-cpid-943b587b2a65e8">
-            <rect x="0" y="28.2737" width="100" height="21.7263">
-                <animate attributeName="y" calcMode="spline" values="0;50;0;0;0" keyTimes="0;0.4;0.5;0.9;1" dur="2.2"
-                         keySplines="0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7" begin="0s"
-                         repeatCount="indefinite"></animate>
-                <animate attributeName="height" calcMode="spline" values="50;0;0;50;50" keyTimes="0;0.4;0.5;0.9;1"
-                         dur="2.2" keySplines="0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7" begin="0s"
-                         repeatCount="indefinite"></animate>
-            </rect>
-            <rect x="0" y="71.7263" width="100" height="28.2737">
-                <animate attributeName="y" calcMode="spline" values="100;50;50;50;50" keyTimes="0;0.4;0.5;0.9;1"
-                         dur="2.2" keySplines="0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7" begin="0s"
-                         repeatCount="indefinite"></animate>
-                <animate attributeName="height" calcMode="spline" values="0;50;50;0;0" keyTimes="0;0.4;0.5;0.9;1"
-                         dur="2.2" keySplines="0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7" begin="0s"
-                         repeatCount="indefinite"></animate>
-            </rect>
-        </clipPath>
-    </defs>
-    <g transform="translate(50,50)">
-        <g transform="scale(0.9)">
-            <g transform="translate(-50,-50)">
-                <g transform="rotate(0)">
-                    <animateTransform attributeName="transform" type="rotate" calcMode="linear"
-                                      values="0 50 50;0 50 50;180 50 50;180 50 50;360 50 50" keyTimes="0;0.4;0.5;0.9;1"
-                                      dur="2.2s" begin="0s" repeatCount="indefinite"></animateTransform>
-                    <path ng-attr-clip-path="url(#{{config.cpid}})" ng-attr-fill="{{config.sand}}"
-                          d="M54.864,50L54.864,50c0-1.291,0.689-2.412,1.671-2.729c9.624-3.107,17.154-12.911,19.347-25.296 c0.681-3.844-1.698-7.475-4.791-7.475H28.908c-3.093,0-5.472,3.631-4.791,7.475c2.194,12.385,9.723,22.189,19.347,25.296 c0.982,0.317,1.671,1.438,1.671,2.729v0c0,1.291-0.689,2.412-1.671,2.729C33.84,55.836,26.311,65.64,24.117,78.025 c-0.681,3.844,1.698,7.475,4.791,7.475h42.184c3.093,0,5.472-3.631,4.791-7.475C73.689,65.64,66.16,55.836,56.536,52.729 C55.553,52.412,54.864,51.291,54.864,50z"
-                          clip-path="url(#lds-hourglass-cpid-943b587b2a65e8)" fill="#6b6b71"></path>
-                    <path ng-attr-fill="{{config.frame}}"
-                          d="M81,81.5h-2.724l0.091-0.578c0.178-1.122,0.17-2.243-0.022-3.333C76.013,64.42,68.103,54.033,57.703,50.483l-0.339-0.116 v-0.715l0.339-0.135c10.399-3.552,18.31-13.938,20.642-27.107c0.192-1.089,0.2-2.211,0.022-3.333L78.276,18.5H81 c2.481,0,4.5-2.019,4.5-4.5S83.481,9.5,81,9.5H19c-2.481,0-4.5,2.019-4.5,4.5s2.019,4.5,4.5,4.5h2.724l-0.092,0.578 c-0.178,1.122-0.17,2.243,0.023,3.333c2.333,13.168,10.242,23.555,20.642,27.107l0.338,0.116v0.715l-0.338,0.135 c-10.4,3.551-18.31,13.938-20.642,27.106c-0.193,1.09-0.201,2.211-0.023,3.333l0.092,0.578H19c-2.481,0-4.5,2.019-4.5,4.5 s2.019,4.5,4.5,4.5h62c2.481,0,4.5-2.019,4.5-4.5S83.481,81.5,81,81.5z M73.14,81.191L73.012,81.5H26.988l-0.128-0.309 c-0.244-0.588-0.491-1.538-0.28-2.729c2.014-11.375,8.944-20.542,17.654-23.354c2.035-0.658,3.402-2.711,3.402-5.108 c0-2.398-1.368-4.451-3.403-5.108c-8.71-2.812-15.639-11.979-17.653-23.353c-0.211-1.191,0.036-2.143,0.281-2.731l0.128-0.308 h46.024l0.128,0.308c0.244,0.589,0.492,1.541,0.281,2.731c-2.015,11.375-8.944,20.541-17.654,23.353 c-2.035,0.658-3.402,2.71-3.402,5.108c0,2.397,1.368,4.45,3.403,5.108c8.71,2.812,15.64,11.979,17.653,23.354 C73.632,79.651,73.384,80.604,73.14,81.191z"
-                          fill="#bbbbc2"></path>
-                </g>
-            </g>
-        </g>
-    </g>
+<svg width="200px" height="200px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"
+     preserveAspectRatio="xMidYMid" class="lds-hourglass" style="background: none;">
+    <defs>
+        <clipPath ng-attr-id="{{config.cpid}}" id="lds-hourglass-cpid-943b587b2a65e8">
+            <rect x="0" y="28.2737" width="100" height="21.7263">
+                <animate attributeName="y" calcMode="spline" values="0;50;0;0;0" keyTimes="0;0.4;0.5;0.9;1" dur="2.2"
+                         keySplines="0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7" begin="0s"
+                         repeatCount="indefinite"></animate>
+                <animate attributeName="height" calcMode="spline" values="50;0;0;50;50" keyTimes="0;0.4;0.5;0.9;1"
+                         dur="2.2" keySplines="0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7" begin="0s"
+                         repeatCount="indefinite"></animate>
+            </rect>
+            <rect x="0" y="71.7263" width="100" height="28.2737">
+                <animate attributeName="y" calcMode="spline" values="100;50;50;50;50" keyTimes="0;0.4;0.5;0.9;1"
+                         dur="2.2" keySplines="0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7" begin="0s"
+                         repeatCount="indefinite"></animate>
+                <animate attributeName="height" calcMode="spline" values="0;50;50;0;0" keyTimes="0;0.4;0.5;0.9;1"
+                         dur="2.2" keySplines="0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7;0.3 0 1 0.7" begin="0s"
+                         repeatCount="indefinite"></animate>
+            </rect>
+        </clipPath>
+    </defs>
+    <g transform="translate(50,50)">
+        <g transform="scale(0.9)">
+            <g transform="translate(-50,-50)">
+                <g transform="rotate(0)">
+                    <animateTransform attributeName="transform" type="rotate" calcMode="linear"
+                                      values="0 50 50;0 50 50;180 50 50;180 50 50;360 50 50" keyTimes="0;0.4;0.5;0.9;1"
+                                      dur="2.2s" begin="0s" repeatCount="indefinite"></animateTransform>
+                    <path ng-attr-clip-path="url(#{{config.cpid}})" ng-attr-fill="{{config.sand}}"
+                          d="M54.864,50L54.864,50c0-1.291,0.689-2.412,1.671-2.729c9.624-3.107,17.154-12.911,19.347-25.296 c0.681-3.844-1.698-7.475-4.791-7.475H28.908c-3.093,0-5.472,3.631-4.791,7.475c2.194,12.385,9.723,22.189,19.347,25.296 c0.982,0.317,1.671,1.438,1.671,2.729v0c0,1.291-0.689,2.412-1.671,2.729C33.84,55.836,26.311,65.64,24.117,78.025 c-0.681,3.844,1.698,7.475,4.791,7.475h42.184c3.093,0,5.472-3.631,4.791-7.475C73.689,65.64,66.16,55.836,56.536,52.729 C55.553,52.412,54.864,51.291,54.864,50z"
+                          clip-path="url(#lds-hourglass-cpid-943b587b2a65e8)" fill="#6b6b71"></path>
+                    <path ng-attr-fill="{{config.frame}}"
+                          d="M81,81.5h-2.724l0.091-0.578c0.178-1.122,0.17-2.243-0.022-3.333C76.013,64.42,68.103,54.033,57.703,50.483l-0.339-0.116 v-0.715l0.339-0.135c10.399-3.552,18.31-13.938,20.642-27.107c0.192-1.089,0.2-2.211,0.022-3.333L78.276,18.5H81 c2.481,0,4.5-2.019,4.5-4.5S83.481,9.5,81,9.5H19c-2.481,0-4.5,2.019-4.5,4.5s2.019,4.5,4.5,4.5h2.724l-0.092,0.578 c-0.178,1.122-0.17,2.243,0.023,3.333c2.333,13.168,10.242,23.555,20.642,27.107l0.338,0.116v0.715l-0.338,0.135 c-10.4,3.551-18.31,13.938-20.642,27.106c-0.193,1.09-0.201,2.211-0.023,3.333l0.092,0.578H19c-2.481,0-4.5,2.019-4.5,4.5 s2.019,4.5,4.5,4.5h62c2.481,0,4.5-2.019,4.5-4.5S83.481,81.5,81,81.5z M73.14,81.191L73.012,81.5H26.988l-0.128-0.309 c-0.244-0.588-0.491-1.538-0.28-2.729c2.014-11.375,8.944-20.542,17.654-23.354c2.035-0.658,3.402-2.711,3.402-5.108 c0-2.398-1.368-4.451-3.403-5.108c-8.71-2.812-15.639-11.979-17.653-23.353c-0.211-1.191,0.036-2.143,0.281-2.731l0.128-0.308 h46.024l0.128,0.308c0.244,0.589,0.492,1.541,0.281,2.731c-2.015,11.375-8.944,20.541-17.654,23.353 c-2.035,0.658-3.402,2.71-3.402,5.108c0,2.397,1.368,4.45,3.403,5.108c8.71,2.812,15.64,11.979,17.653,23.354 C73.632,79.651,73.384,80.604,73.14,81.191z"
+                          fill="#bbbbc2"></path>
+                </g>
+            </g>
+        </g>
+    </g>
 </svg>

+ 186 - 186
wechat/pages/add-share/index.js

xqd
@@ -1,187 +1,187 @@
-// pages/add-share/index.js
-var api = require('../../api.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        form: {
-            name: '',
-            mobile: '',
-        },
-        img: "/images/img-share-un.png",
-        agree: 0
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        var page = this;
-        var user_info = wx.getStorageSync("user_info");
-        var store = wx.getStorageSync("store");
-        var share_setting = wx.getStorageSync("share_setting");
-        wx.showLoading({
-            title: '加载中',
-        });
-        app.pageOnShow(page);
-        page.setData({
-            user_info: user_info,
-            store: store,
-            share_setting: share_setting
-        });
-        app.request({
-            url: api.share.check,
-            method: 'POST',
-            success: function (res) {
-                if (res.code == 0) {
-                    user_info.is_distributor = res.data;
-                    wx.setStorageSync("user_info", user_info);
-                    if(res.data == 1){
-                        wx.redirectTo({
-                            url: '/pages/share/index',
-                        })
-                    }
-                }
-                page.setData({
-                    user_info: user_info,
-                });
-            },
-            complete:function(){
-                wx.hideLoading();
-            }
-        });
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-    formSubmit: function (e) {
-        var page = this;
-        var user_info = wx.getStorageSync("user_info");
-        page.data.form = e.detail.value;
-        if (page.data.form.name == undefined || page.data.form.name == '') {
-            wx.showToast({
-                title: "请填写姓名!",
-                image: "/images/icon-warning.png",
-            });
-            return;
-        }
-        if (page.data.form.mobile == undefined || page.data.form.mobile == '') {
-            wx.showToast({
-                title: "请填写联系方式!",
-                image: "/images/icon-warning.png",
-            });
-            return;
-        }
-        var data = e.detail.value;
-        data.form_id = e.detail.formId;
-        if (page.data.agree == 0) {
-            wx.showToast({
-                title: "请先阅读并确认分销申请协议!!",
-                image: "/images/icon-warning.png",
-            });
-            return;
-        }
-        console.log(page.data.agree);
-        wx.showLoading({
-            title: "正在提交",
-            mask: true,
-        });
-        app.request({
-            url: api.share.join,
-            method: 'POST',
-            data: data,
-            success: function (res) {
-                if (res.code == 0) {
-                    user_info.is_distributor = 2;
-                    wx.setStorageSync(
-                        "user_info", user_info
-                    );
-                    wx.redirectTo({
-                        url: '/pages/add-share/index',
-                    })
-                } else {
-                    wx.showToast({
-                        title: res.msg,
-                        image: "/images/icon-warning.png",
-                    });
-                }
-            }
-        });
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
-    agreement: function () {
-        var share_setting = wx.getStorageSync("share_setting");
-        wx.showModal({
-            title: '分销协议',
-            content: share_setting.agree,
-            showCancel: false,
-            confirmText: "我已阅读",
-            confirmColor: "#ff4544",
-            success: function (res) {
-                if (res.confirm) {
-                    console.log('用户点击确定')
-                }
-            }
-        });
-    },
-    agree: function () {
-        var page = this;
-        var agree = page.data.agree;
-        if (agree == 0) {
-            agree = 1;
-            page.setData({
-                img: "/images/img-share-agree.png",
-                agree: agree
-            });
-        }
-        else if (agree == 1) {
-            agree = 0;
-            page.setData({
-                img: "/images/img-share-un.png",
-                agree: agree
-            });
-        }
-    }
+// pages/add-share/index.js
+var api = require('../../api.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        form: {
+            name: '',
+            mobile: '',
+        },
+        img: "/images/img-share-un.png",
+        agree: 0
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        var page = this;
+        var user_info = wx.getStorageSync("user_info");
+        var store = wx.getStorageSync("store");
+        var share_setting = wx.getStorageSync("share_setting");
+        wx.showLoading({
+            title: '加载中',
+        });
+        app.pageOnShow(page);
+        page.setData({
+            user_info: user_info,
+            store: store,
+            share_setting: share_setting
+        });
+        app.request({
+            url: api.share.check,
+            method: 'POST',
+            success: function (res) {
+                if (res.code == 0) {
+                    user_info.is_distributor = res.data;
+                    wx.setStorageSync("user_info", user_info);
+                    if(res.data == 1){
+                        wx.redirectTo({
+                            url: '/pages/share/index',
+                        })
+                    }
+                }
+                page.setData({
+                    user_info: user_info,
+                });
+            },
+            complete:function(){
+                wx.hideLoading();
+            }
+        });
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+    formSubmit: function (e) {
+        var page = this;
+        var user_info = wx.getStorageSync("user_info");
+        page.data.form = e.detail.value;
+        if (page.data.form.name == undefined || page.data.form.name == '') {
+            wx.showToast({
+                title: "请填写姓名!",
+                image: "/images/icon-warning.png",
+            });
+            return;
+        }
+        if (page.data.form.mobile == undefined || page.data.form.mobile == '') {
+            wx.showToast({
+                title: "请填写联系方式!",
+                image: "/images/icon-warning.png",
+            });
+            return;
+        }
+        var data = e.detail.value;
+        data.form_id = e.detail.formId;
+        if (page.data.agree == 0) {
+            wx.showToast({
+                title: "请先阅读并确认分销申请协议!!",
+                image: "/images/icon-warning.png",
+            });
+            return;
+        }
+        console.log(page.data.agree);
+        wx.showLoading({
+            title: "正在提交",
+            mask: true,
+        });
+        app.request({
+            url: api.share.join,
+            method: 'POST',
+            data: data,
+            success: function (res) {
+                if (res.code == 0) {
+                    user_info.is_distributor = 2;
+                    wx.setStorageSync(
+                        "user_info", user_info
+                    );
+                    wx.redirectTo({
+                        url: '/pages/add-share/index',
+                    })
+                } else {
+                    wx.showToast({
+                        title: res.msg,
+                        image: "/images/icon-warning.png",
+                    });
+                }
+            }
+        });
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+    agreement: function () {
+        var share_setting = wx.getStorageSync("share_setting");
+        wx.showModal({
+            title: '分销协议',
+            content: share_setting.agree,
+            showCancel: false,
+            confirmText: "我已阅读",
+            confirmColor: "#ff4544",
+            success: function (res) {
+                if (res.confirm) {
+                    console.log('用户点击确定')
+                }
+            }
+        });
+    },
+    agree: function () {
+        var page = this;
+        var agree = page.data.agree;
+        if (agree == 0) {
+            agree = 1;
+            page.setData({
+                img: "/images/img-share-agree.png",
+                agree: agree
+            });
+        }
+        else if (agree == 1) {
+            agree = 0;
+            page.setData({
+                img: "/images/img-share-un.png",
+                agree: agree
+            });
+        }
+    }
 })

+ 2 - 2
wechat/pages/add-share/index.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": "申请成为分销商"
+{
+  "navigationBarTitleText": "申请成为分销商"
   }

+ 91 - 91
wechat/pages/add-share/index.wxml

xqd
@@ -1,92 +1,92 @@
-<view class="step1" wx:if="{{user_info.is_distributor==0}}">
-  <view class="info-bg">
-    <image src="{{share_setting.pic_url_1}}" class="bg" />
-  </view>
-
-  <form bindsubmit="formSubmit" report-submit='true'>
-    <view class="info">
-      <view class="info-label flex-row">
-        <view class="flex-y-center">
-          欢迎加入
-          <view class="info-red" style="width:260rpx; overflow: hidden;-webkit-line-clamp: 1;display: -webkit-box;-webkit-box-orient: vertical;">{{store.name}}</view>请填写申请信息
-        </view>
-      </view>
-
-      <view class="info-label info-content flex-row">
-        <view class="info-left flex-y-center">邀请人</view>
-        <view class="info-right flex-row">
-          <view class="info-red flex-grow-0 flex-y-center">{{user_info.parent}}</view>
-          <view class="info-gray flex-group-1 flex-y-center">(请核对)</view>
-        </view>
-      </view>
-
-      <view class="info-label info-content flex-row">
-        <view class="info-left flex-y-center required">姓名</view>
-        <view class="info-right flex-row flex-y-center">
-          <input class="name-input" name="name" placeholder="请填写真实姓名" value="{{form.name}}" />
-        </view>
-      </view>
-
-      <view class="info-label info-content flex-row">
-        <view class="info-left flex-y-center required">手机号码</view>
-        <view class="info-right flex-row flex-y-center">
-          <input class="mobile-input" type="number" name="mobile" placeholder="请填写手机号码" value="{{form.mobile}}" />
-        </view>
-      </view>
-      <view class="info-label info-content flex-row">
-        <view class="info-agree flex-row flex-y-center" bindtap="agree">
-          <input hidden="true" name="agree" value="{{agree}}"/>
-          <image src="{{img}}" style="width:32rpx;height:32rpx;"></image>
-          <text style="margin-left:10rpx;">我已经阅读并了解</text>
-          <view style="color:#014c8c" bindtap="agreement">【分销商申请协议】</view>
-        </view>
-      </view>
-    </view>
-    <view class="info-btn flex-row">
-      <button class="flex-y-content info-btn-content" formType="submit">申请成为分销商</button>
-    </view>
-  </form>
-  <view class="info">
-    <view class="info-label flex-row">
-      <view class="flex-y-center">分销商特权</view>
-    </view>
-
-    <view class="info-label info-height flex-row" wx:if="{{false}}">
-      <view class="flex-y-center">
-        <image src="/images/img-share-shop.png" class="info-icon"></image>
-      </view>
-      <view class="info-block">
-        <view class="info-top bold">独立小店</view>
-        <view class="info-bottom">拥有自己的小店及二维码</view>
-      </view>
-    </view>
-
-    <view class="info-label info-height flex-row">
-      <view class="flex-y-center">
-        <image src="/images/img-share-money.png" class="info-icon"></image>
-      </view>
-      <view class="info-block">
-        <view class="info-top bold">销售拿佣金</view>
-        <view class="info-bottom">成为分销商后卖出商品,您可以获得佣金</view>
-      </view>
-    </view>
-
-    <view class="info-label info-height flex-row">
-      <view class="flex-y-center info-block">分销商的商品销售统一由厂家直接收款、直接发货,并提供产品的售后服务,分销佣金由厂家统一设置。</view>
-    </view>
-  </view>
-</view>
-<view class="step2" wx:else>
-  <view class="info-bg" style="height:300rpx">
-    <image src="{{share_setting.pic_url_2}}" class="bg" />
-  </view>
-  <view class="info">
-    <view class="info-title">
-      <image class="info-images" src="/images/img-share-info.png"></image>
-    </view>
-    <view class="info-content">谢谢您的支持,请等待审核!</view>
-    <view class="flex-row info-btn1">
-      <navigator open-type="redirect" url="/pages/index/index" class="flex-y-content btn">去商城逛逛</navigator>
-    </view>
-  </view>
+<view class="step1" wx:if="{{user_info.is_distributor==0}}">
+  <view class="info-bg">
+    <image src="{{share_setting.pic_url_1}}" class="bg" />
+  </view>
+
+  <form bindsubmit="formSubmit" report-submit='true'>
+    <view class="info">
+      <view class="info-label flex-row">
+        <view class="flex-y-center">
+          欢迎加入
+          <view class="info-red" style="width:260rpx; overflow: hidden;-webkit-line-clamp: 1;display: -webkit-box;-webkit-box-orient: vertical;">{{store.name}}</view>请填写申请信息
+        </view>
+      </view>
+
+      <view class="info-label info-content flex-row">
+        <view class="info-left flex-y-center">邀请人</view>
+        <view class="info-right flex-row">
+          <view class="info-red flex-grow-0 flex-y-center">{{user_info.parent}}</view>
+          <view class="info-gray flex-group-1 flex-y-center">(请核对)</view>
+        </view>
+      </view>
+
+      <view class="info-label info-content flex-row">
+        <view class="info-left flex-y-center required">姓名</view>
+        <view class="info-right flex-row flex-y-center">
+          <input class="name-input" name="name" placeholder="请填写真实姓名" value="{{form.name}}" />
+        </view>
+      </view>
+
+      <view class="info-label info-content flex-row">
+        <view class="info-left flex-y-center required">手机号码</view>
+        <view class="info-right flex-row flex-y-center">
+          <input class="mobile-input" type="number" name="mobile" placeholder="请填写手机号码" value="{{form.mobile}}" />
+        </view>
+      </view>
+      <view class="info-label info-content flex-row">
+        <view class="info-agree flex-row flex-y-center" bindtap="agree">
+          <input hidden="true" name="agree" value="{{agree}}"/>
+          <image src="{{img}}" style="width:32rpx;height:32rpx;"></image>
+          <text style="margin-left:10rpx;">我已经阅读并了解</text>
+          <view style="color:#014c8c" bindtap="agreement">【分销商申请协议】</view>
+        </view>
+      </view>
+    </view>
+    <view class="info-btn flex-row">
+      <button class="flex-y-content info-btn-content" formType="submit">申请成为分销商</button>
+    </view>
+  </form>
+  <view class="info">
+    <view class="info-label flex-row">
+      <view class="flex-y-center">分销商特权</view>
+    </view>
+
+    <view class="info-label info-height flex-row" wx:if="{{false}}">
+      <view class="flex-y-center">
+        <image src="/images/img-share-shop.png" class="info-icon"></image>
+      </view>
+      <view class="info-block">
+        <view class="info-top bold">独立小店</view>
+        <view class="info-bottom">拥有自己的小店及二维码</view>
+      </view>
+    </view>
+
+    <view class="info-label info-height flex-row">
+      <view class="flex-y-center">
+        <image src="/images/img-share-money.png" class="info-icon"></image>
+      </view>
+      <view class="info-block">
+        <view class="info-top bold">销售拿佣金</view>
+        <view class="info-bottom">成为分销商后卖出商品,您可以获得佣金</view>
+      </view>
+    </view>
+
+    <view class="info-label info-height flex-row">
+      <view class="flex-y-center info-block">分销商的商品销售统一由厂家直接收款、直接发货,并提供产品的售后服务,分销佣金由厂家统一设置。</view>
+    </view>
+  </view>
+</view>
+<view class="step2" wx:else>
+  <view class="info-bg" style="height:300rpx">
+    <image src="{{share_setting.pic_url_2}}" class="bg" />
+  </view>
+  <view class="info">
+    <view class="info-title">
+      <image class="info-images" src="/images/img-share-info.png"></image>
+    </view>
+    <view class="info-content">谢谢您的支持,请等待审核!</view>
+    <view class="flex-row info-btn1">
+      <navigator open-type="redirect" url="/pages/index/index" class="flex-y-content btn">去商城逛逛</navigator>
+    </view>
+  </view>
 </view>

+ 107 - 107
wechat/pages/add-share/index.wxss

xqd
@@ -1,108 +1,108 @@
-/* pages/add-share/index.wxss */
-.info-bg{
-  width: 100%;
-  height: 300rpx;
-  background-color: #f7f7f7;
-  margin-bottom: 20rpx;
-}
-.info-bg .bg{
-  width: 100%;
-  height: 300rpx;
-}
-.step1 .info{
-  width: 100%;
-  background-color: #ffffff;
-  border-bottom: 1rpx #e3e3e3 solid;
-  border-top: 1rpx #e3e3e3 solid;
-  padding: 0 24rpx;
-}
-.info .info-label{
-  width: 100%;
-  height: 100rpx;
-  border-bottom: 1rpx #e3e3e3 solid;
-  color:#353535;
-}
-.info .info-label:last-child{
-   border-bottom: none; 
-}
-.info .info-label .info-red{
-  color:#ff4544;
-}
-.info .info-label .info-gray{
-  color:#666666;
-}
-.info .info-label.info-content{
-  height: 100rpx;
-}
-.info-label .info-left{
-  width: 176rpx;
-}
-.info-label .info-left.required::after{
-  content: "*";
-  color: #ff4544;
-}
- .info-label .info-agree{
-   font-size: 10pt;
- } 
-.info-btn{
-  padding: 24rpx;
-  background-color: #f7f7f7;
-  width: 100%;
-}
-.info-btn .info-btn-content{
-  width: 100%;
-   background-color: #ff4544; 
-  color: #ffffff;
-  font-weight: bold;
-  height: 100rpx;
-  line-height: 100rpx;
-}
-.info-label .info-icon{
-  width: 60rpx;
-  height: 60rpx;
-  margin-right: 24rpx;
-}
-.info .bold{
-  font-weight: bold;
-}
-.info .info-label.info-height{
-  height: auto;
-}
-.info .info-label .info-block{
-  padding: 24rpx 0;
-}
-.info-block .info-top{
-  margin-bottom: 16rpx;
-}
-.info-block .info-bottom{
-  font-size: 9pt;
-}
-
-.step2 .info{
-  padding: 48rpx 24rpx;
-  text-align: center;
-}
-.step2 .info .info-title{
-  width: 100%;
-  padding: 40rpx 0;
-}
-.info-title .info-images{
-  width: 80rpx;
-  height: 80rpx;
-}
-
-.step2 .info-btn1{
-  margin-top: 88rpx;
-  padding: 0 24rpx;
-  width: 100%;
-}
-
-.step2 .info-btn1 .btn{
-  width: 100%;
-   background-color: #ff4544; 
-  color: #ffffff;
-  font-weight: bold;
-  height: 100rpx;
-  line-height: 100rpx;
-  border-radius: 10rpx;
+/* pages/add-share/index.wxss */
+.info-bg{
+  width: 100%;
+  height: 300rpx;
+  background-color: #f7f7f7;
+  margin-bottom: 20rpx;
+}
+.info-bg .bg{
+  width: 100%;
+  height: 300rpx;
+}
+.step1 .info{
+  width: 100%;
+  background-color: #ffffff;
+  border-bottom: 1rpx #e3e3e3 solid;
+  border-top: 1rpx #e3e3e3 solid;
+  padding: 0 24rpx;
+}
+.info .info-label{
+  width: 100%;
+  height: 100rpx;
+  border-bottom: 1rpx #e3e3e3 solid;
+  color:#353535;
+}
+.info .info-label:last-child{
+   border-bottom: none; 
+}
+.info .info-label .info-red{
+  color:#ff4544;
+}
+.info .info-label .info-gray{
+  color:#666666;
+}
+.info .info-label.info-content{
+  height: 100rpx;
+}
+.info-label .info-left{
+  width: 176rpx;
+}
+.info-label .info-left.required::after{
+  content: "*";
+  color: #ff4544;
+}
+ .info-label .info-agree{
+   font-size: 10pt;
+ } 
+.info-btn{
+  padding: 24rpx;
+  background-color: #f7f7f7;
+  width: 100%;
+}
+.info-btn .info-btn-content{
+  width: 100%;
+   background-color: #ff4544; 
+  color: #ffffff;
+  font-weight: bold;
+  height: 100rpx;
+  line-height: 100rpx;
+}
+.info-label .info-icon{
+  width: 60rpx;
+  height: 60rpx;
+  margin-right: 24rpx;
+}
+.info .bold{
+  font-weight: bold;
+}
+.info .info-label.info-height{
+  height: auto;
+}
+.info .info-label .info-block{
+  padding: 24rpx 0;
+}
+.info-block .info-top{
+  margin-bottom: 16rpx;
+}
+.info-block .info-bottom{
+  font-size: 9pt;
+}
+
+.step2 .info{
+  padding: 48rpx 24rpx;
+  text-align: center;
+}
+.step2 .info .info-title{
+  width: 100%;
+  padding: 40rpx 0;
+}
+.info-title .info-images{
+  width: 80rpx;
+  height: 80rpx;
+}
+
+.step2 .info-btn1{
+  margin-top: 88rpx;
+  padding: 0 24rpx;
+  width: 100%;
+}
+
+.step2 .info-btn1 .btn{
+  width: 100%;
+   background-color: #ff4544; 
+  color: #ffffff;
+  font-weight: bold;
+  height: 100rpx;
+  line-height: 100rpx;
+  border-radius: 10rpx;
 }

+ 232 - 232
wechat/pages/address-edit/address-edit.js

xqd
@@ -1,233 +1,233 @@
-// pages/address-edit/address-edit.js
-var api = require('../../api.js');
-var area_picker = require('../../area-picker/area-picker.js');
-var app = getApp();
-Page({
-    data: {
-        name: "",
-        mobile: "",
-        detail: "",
-        district: null,
-        is_default: 0,
-        // check: false
-    },
-
-    changeState: function(e){
-        if(e.detail.value){
-            this.setData({
-                is_default: 1
-            })
-        }
-        else{
-            this.setData({
-                is_default: 0
-            })
-        }
-    },
-
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-        var page = this;
-        page.getDistrictData(function (data) {
-            area_picker.init({
-                page: page,
-                data: data,
-            });
-        });
-
-        page.setData({
-            address_id: options.id,
-        });
-        if (options.id) {
-            wx.setNavigationBarTitle({
-                title: '编辑地址'
-            })
-            wx.showLoading({
-                title: "正在加载",
-                mask: true,
-            });
-            app.request({
-                url: api.user.address_detail,
-                data: {
-                    id: options.id,
-                },
-                success: function (res) {
-                    wx.hideLoading();
-                    if (res.code == 0) {
-                        page.setData(res.data);
-                    }
-                }
-            });
-        }
-        else{
-            wx.setNavigationBarTitle({
-                title: '新增地址',
-            })
-        }
-    },
-
-    getDistrictData: function (cb) {
-        var district = wx.getStorageSync("district");
-        if (!district || district.length == 0) {
-            wx.showLoading({
-                title: "正在加载",
-                mask: true,
-            });
-            app.request({
-                url: api.default.district,
-                success: function (res) {
-                    wx.hideLoading();
-                    if (res.code == 0) {
-                        district = res.data;
-                        wx.setStorageSync("district", district);
-                        cb(district);
-                    }
-                }
-            });
-            return;
-        }
-        cb(district);
-    },
-
-    onAreaPickerConfirm: function (e) {
-        //console.log(e);
-        var page = this;
-        page.setData({
-            district: {
-                province: {
-                    id: e[0].id,
-                    name: e[0].name,
-                },
-                city: {
-                    id: e[1].id,
-                    name: e[1].name,
-                },
-                district: {
-                    id: e[2].id,
-                    name: e[2].name,
-                },
-            }
-        });
-    },
-
-    saveAddress: function () {
-        var page = this;
-        var myreg = /^([0-9]{6,12})$/;
-        var myreg2 = /^(\d{3,4}-\d{6,9})$/;
-        console.log(myreg2.test(page.data.mobile));
-        if (!myreg.test(page.data.mobile) && !myreg2.test(page.data.mobile)) {
-            wx.showToast({
-                title: "电话格式不正确",
-                image: "/images/icon-warning.png",
-            });
-            return false;
-        }
-        wx.showLoading({
-            title: "正在保存",
-            mask: true,
-        });
-        var district = page.data.district;
-        if (!district) {
-            district = {
-                province: {
-                    id: ""
-                },
-                city: {
-                    id: ""
-                },
-                district: {
-                    id: ""
-                }
-            };
-        }
-        app.request({
-            url: api.user.address_save,
-            method: "post",
-            data: {
-                address_id: page.data.address_id || "",
-                name: page.data.name,
-                mobile: page.data.mobile,
-                province_id: district.province.id,
-                city_id: district.city.id,
-                district_id: district.district.id,
-                detail: page.data.detail,
-                is_default: page.data.is_default
-            },
-            success: function (res) {
-                wx.hideLoading();
-                if (res.code == 0) {
-                    wx.showModal({
-                        title: "提示",
-                        content: res.msg,
-                        showCancel: false,
-                        success: function (res) {
-                            if (res.confirm) {
-                                wx.navigateBack();
-                            }
-                        }
-                    });
-                }
-                if (res.code == 1) {
-                    wx.showToast({
-                        title: res.msg,
-                        image: "/images/icon-warning.png",
-                    });
-                }
-            }
-        });
-    },
-
-    inputBlur: function (e) {
-        //console.log(JSON.stringify(e));
-        var name = e.currentTarget.dataset.name;
-        var value = e.detail.value;
-        //var data = '{"form":{"' + name + '":"' + value + '"}}';
-        var data = '{"' + name + '":"' + value + '"}';
-        this.setData(JSON.parse(data));
-    },
-
-    getWechatAddress: function (e) {
-        var page = this;
-        wx.chooseAddress({
-            success: function (e) {
-                if (e.errMsg != 'chooseAddress:ok')
-                    return;
-                wx.showLoading();
-                app.request({
-                    url: api.user.wechat_district,
-                    data: {
-                        national_code: e.nationalCode,
-                        province_name: e.provinceName,
-                        city_name: e.cityName,
-                        county_name: e.countyName,
-                    },
-                    success: function (res) {
-                        if (res.code == 1) {
-                            wx.showModal({
-                                title: '提示',
-                                content: res.msg,
-                                showCancel: false,
-                            });
-                        }
-                        page.setData({
-                            name: e.userName || "",
-                            mobile: e.telNumber || "",
-                            detail: e.detailInfo || "",
-                            district: res.data.district,
-                        });
-                    },
-                    complete: function () {
-                        wx.hideLoading();
-                    }
-                });
-            }
-        });
-    },
-
-    onReady: function () {
-
-    },
-    onShow: function () {
-
-    },
+// pages/address-edit/address-edit.js
+var api = require('../../api.js');
+var area_picker = require('../../area-picker/area-picker.js');
+var app = getApp();
+Page({
+    data: {
+        name: "",
+        mobile: "",
+        detail: "",
+        district: null,
+        is_default: 0,
+        // check: false
+    },
+
+    changeState: function(e){
+        if(e.detail.value){
+            this.setData({
+                is_default: 1
+            })
+        }
+        else{
+            this.setData({
+                is_default: 0
+            })
+        }
+    },
+
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+        var page = this;
+        page.getDistrictData(function (data) {
+            area_picker.init({
+                page: page,
+                data: data,
+            });
+        });
+
+        page.setData({
+            address_id: options.id,
+        });
+        if (options.id) {
+            wx.setNavigationBarTitle({
+                title: '编辑地址'
+            })
+            wx.showLoading({
+                title: "正在加载",
+                mask: true,
+            });
+            app.request({
+                url: api.user.address_detail,
+                data: {
+                    id: options.id,
+                },
+                success: function (res) {
+                    wx.hideLoading();
+                    if (res.code == 0) {
+                        page.setData(res.data);
+                    }
+                }
+            });
+        }
+        else{
+            wx.setNavigationBarTitle({
+                title: '新增地址',
+            })
+        }
+    },
+
+    getDistrictData: function (cb) {
+        var district = wx.getStorageSync("district");
+        if (!district || district.length == 0) {
+            wx.showLoading({
+                title: "正在加载",
+                mask: true,
+            });
+            app.request({
+                url: api.default.district,
+                success: function (res) {
+                    wx.hideLoading();
+                    if (res.code == 0) {
+                        district = res.data;
+                        wx.setStorageSync("district", district);
+                        cb(district);
+                    }
+                }
+            });
+            return;
+        }
+        cb(district);
+    },
+
+    onAreaPickerConfirm: function (e) {
+        //console.log(e);
+        var page = this;
+        page.setData({
+            district: {
+                province: {
+                    id: e[0].id,
+                    name: e[0].name,
+                },
+                city: {
+                    id: e[1].id,
+                    name: e[1].name,
+                },
+                district: {
+                    id: e[2].id,
+                    name: e[2].name,
+                },
+            }
+        });
+    },
+
+    saveAddress: function () {
+        var page = this;
+        var myreg = /^([0-9]{6,12})$/;
+        var myreg2 = /^(\d{3,4}-\d{6,9})$/;
+        console.log(myreg2.test(page.data.mobile));
+        if (!myreg.test(page.data.mobile) && !myreg2.test(page.data.mobile)) {
+            wx.showToast({
+                title: "电话格式不正确",
+                image: "/images/icon-warning.png",
+            });
+            return false;
+        }
+        wx.showLoading({
+            title: "正在保存",
+            mask: true,
+        });
+        var district = page.data.district;
+        if (!district) {
+            district = {
+                province: {
+                    id: ""
+                },
+                city: {
+                    id: ""
+                },
+                district: {
+                    id: ""
+                }
+            };
+        }
+        app.request({
+            url: api.user.address_save,
+            method: "post",
+            data: {
+                address_id: page.data.address_id || "",
+                name: page.data.name,
+                mobile: page.data.mobile,
+                province_id: district.province.id,
+                city_id: district.city.id,
+                district_id: district.district.id,
+                detail: page.data.detail,
+                is_default: page.data.is_default
+            },
+            success: function (res) {
+                wx.hideLoading();
+                if (res.code == 0) {
+                    wx.showModal({
+                        title: "提示",
+                        content: res.msg,
+                        showCancel: false,
+                        success: function (res) {
+                            if (res.confirm) {
+                                wx.navigateBack();
+                            }
+                        }
+                    });
+                }
+                if (res.code == 1) {
+                    wx.showToast({
+                        title: res.msg,
+                        image: "/images/icon-warning.png",
+                    });
+                }
+            }
+        });
+    },
+
+    inputBlur: function (e) {
+        //console.log(JSON.stringify(e));
+        var name = e.currentTarget.dataset.name;
+        var value = e.detail.value;
+        //var data = '{"form":{"' + name + '":"' + value + '"}}';
+        var data = '{"' + name + '":"' + value + '"}';
+        this.setData(JSON.parse(data));
+    },
+
+    getWechatAddress: function (e) {
+        var page = this;
+        wx.chooseAddress({
+            success: function (e) {
+                if (e.errMsg != 'chooseAddress:ok')
+                    return;
+                wx.showLoading();
+                app.request({
+                    url: api.user.wechat_district,
+                    data: {
+                        national_code: e.nationalCode,
+                        province_name: e.provinceName,
+                        city_name: e.cityName,
+                        county_name: e.countyName,
+                    },
+                    success: function (res) {
+                        if (res.code == 1) {
+                            wx.showModal({
+                                title: '提示',
+                                content: res.msg,
+                                showCancel: false,
+                            });
+                        }
+                        page.setData({
+                            name: e.userName || "",
+                            mobile: e.telNumber || "",
+                            detail: e.detailInfo || "",
+                            district: res.data.district,
+                        });
+                    },
+                    complete: function () {
+                        wx.hideLoading();
+                    }
+                });
+            }
+        });
+    },
+
+    onReady: function () {
+
+    },
+    onShow: function () {
+
+    },
 });

+ 2 - 2
wechat/pages/address-edit/address-edit.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": ""
+{
+  "navigationBarTitleText": ""
 }

+ 47 - 47
wechat/pages/address-edit/address-edit.wxml

xqd
@@ -1,48 +1,48 @@
-<!--pages/address-edit/address-edit.wxml-->
-<view class="bottom-bar">
-    <navigator bindtap="saveAddress">提交保存</navigator>
-</view>
-<view>
-    <view class="flex-row flex-y-center edit-row">
-        <view class="flex-grow-0 row-label">收货人</view>
-        <view class="flex-grow-1">
-            <input placeholder="请填写" value="{{name}}" data-name="name" bindinput="inputBlur"/>
-        </view>
-    </view>
-
-    <view class="flex-row flex-y-center edit-row">
-        <view class="flex-grow-0 row-label">联系电话</view>
-        <view class="flex-grow-1">
-            <input placeholder="请填写" value="{{mobile}}" data-name="mobile" type="number" bindinput="inputBlur"/>
-        </view>
-    </view>
-
-    <view class="flex-row flex-y-center edit-row">
-        <view class="flex-grow-0 row-label">省/市/县</view>
-        <view class="flex-grow-1 flex-row" bindtap="showAreaPicker">
-            <view class="flex-grow-1" style="text-align: right;padding-right: 24rpx">
-                <block wx:if="{{district==null}}" style="color: #808080;">请选择</block>
-                <block wx:else>{{district.province.name}} {{district.city.name}} {{district.district.name}}</block>
-            </view>
-            <view class="flex-grow-0 flex-y-center">
-                <image src="/images/icon-jiantou-r.png" style="width: 12rpx;height: 22rpx"/>
-            </view>
-        </view>
-    </view>
-
-    <view class="flex-row flex-y-center edit-row">
-        <view class="flex-grow-0 row-label">街道</view>
-        <view class="flex-grow-1">
-            <input placeholder="请填写详细地址" value="{{detail}}" data-name="detail" bindinput="inputBlur"/>
-        </view>
-    </view>
-
-    <view class="flex-row flex-y-center edit-row">
-        <view style='width: 50%;'>设为默认</view>
-        <view style='width: 50%; text-align: right;'><switch bindchange='changeState' checked='{{is_default == 1}}'></switch></view>
-    </view>
-
-    <!-- <view bindtap="getWechatAddress" class="get-wechat-address">一键获取微信地址</view>  -->
-
-</view>
+<!--pages/address-edit/address-edit.wxml-->
+<view class="bottom-bar">
+    <navigator bindtap="saveAddress">提交保存</navigator>
+</view>
+<view>
+    <view class="flex-row flex-y-center edit-row">
+        <view class="flex-grow-0 row-label">收货人</view>
+        <view class="flex-grow-1">
+            <input placeholder="请填写" value="{{name}}" data-name="name" bindinput="inputBlur"/>
+        </view>
+    </view>
+
+    <view class="flex-row flex-y-center edit-row">
+        <view class="flex-grow-0 row-label">联系电话</view>
+        <view class="flex-grow-1">
+            <input placeholder="请填写" value="{{mobile}}" data-name="mobile" type="number" bindinput="inputBlur"/>
+        </view>
+    </view>
+
+    <view class="flex-row flex-y-center edit-row">
+        <view class="flex-grow-0 row-label">省/市/县</view>
+        <view class="flex-grow-1 flex-row" bindtap="showAreaPicker">
+            <view class="flex-grow-1" style="text-align: right;padding-right: 24rpx">
+                <block wx:if="{{district==null}}" style="color: #808080;">请选择</block>
+                <block wx:else>{{district.province.name}} {{district.city.name}} {{district.district.name}}</block>
+            </view>
+            <view class="flex-grow-0 flex-y-center">
+                <image src="/images/icon-jiantou-r.png" style="width: 12rpx;height: 22rpx"/>
+            </view>
+        </view>
+    </view>
+
+    <view class="flex-row flex-y-center edit-row">
+        <view class="flex-grow-0 row-label">街道</view>
+        <view class="flex-grow-1">
+            <input placeholder="请填写详细地址" value="{{detail}}" data-name="detail" bindinput="inputBlur"/>
+        </view>
+    </view>
+
+    <view class="flex-row flex-y-center edit-row">
+        <view style='width: 50%;'>设为默认</view>
+        <view style='width: 50%; text-align: right;'><switch bindchange='changeState' checked='{{is_default == 1}}'></switch></view>
+    </view>
+
+    <!-- <view bindtap="getWechatAddress" class="get-wechat-address">一键获取微信地址</view>  -->
+
+</view>
 <include src="../../area-picker/area-picker.wxml"/>

+ 51 - 51
wechat/pages/address-edit/address-edit.wxss

xqd
@@ -1,52 +1,52 @@
-/* pages/address-edit/address-edit.wxss */
-
-.bottom-bar{
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    width: 100%;
-    z-index: 1000;
-}
-.bottom-bar navigator{
-    background: #EB4851;
-    text-align: center;
-    height: 100rpx;
-    line-height: 100rpx;
-    color: #fff;
-}
-
-
-.edit-row{
-    background: #fff;
-    height: 100rpx;
-    border-bottom: 1rpx solid #eeeeee;
-    padding: 0 24rpx;
-}
-
-.edit-row:first-child{
-    border-top: 1rpx solid #eeeeee;
-}
-
-.edit-row .row-label{
-    margin-right: 24rpx;
-    min-width: 140rpx;
-}
-
-.get-wechat-address{
-    text-align: center;
-    background: #09BB07;
-    color: #fff;
-    padding: 18rpx 0;
-    margin: 50rpx 100rpx;
-    border-radius: 10rpx;
-    display: block;
-}
-
-.get-wechat-address:active{
-    opacity: .85;
-}
-.setting {
-    background: #ffffff;
-    margin-top: 15rpx;
-    padding: 15rpx;
+/* pages/address-edit/address-edit.wxss */
+
+.bottom-bar{
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    z-index: 1000;
+}
+.bottom-bar navigator{
+    background: #EB4851;
+    text-align: center;
+    height: 100rpx;
+    line-height: 100rpx;
+    color: #fff;
+}
+
+
+.edit-row{
+    background: #fff;
+    height: 100rpx;
+    border-bottom: 1rpx solid #eeeeee;
+    padding: 0 24rpx;
+}
+
+.edit-row:first-child{
+    border-top: 1rpx solid #eeeeee;
+}
+
+.edit-row .row-label{
+    margin-right: 24rpx;
+    min-width: 140rpx;
+}
+
+.get-wechat-address{
+    text-align: center;
+    background: #09BB07;
+    color: #fff;
+    padding: 18rpx 0;
+    margin: 50rpx 100rpx;
+    border-radius: 10rpx;
+    display: block;
+}
+
+.get-wechat-address:active{
+    opacity: .85;
+}
+.setting {
+    background: #ffffff;
+    margin-top: 15rpx;
+    padding: 15rpx;
 }

+ 92 - 92
wechat/pages/address-picker/address-picker.js

xqd
@@ -1,93 +1,93 @@
-var api = require('../../api.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        address_list: null,
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        var page = this;
-        wx.showNavigationBarLoading();
-        app.request({
-            url: api.user.address_list,
-            success: function (res) {
-                wx.hideNavigationBarLoading();
-                if (res.code == 0) {
-                    page.setData({
-                        address_list: res.data.list,
-                    });
-                }
-            }
-        });
-    },
-
-    pickAddress: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var address = page.data.address_list[index];
-        wx.setStorageSync("picker_address", address);
-        wx.navigateBack();
-    },
-
-    getWechatAddress: function (e) {
-        var page = this;
-        wx.chooseAddress({
-            success: function (e) {
-                if (e.errMsg != 'chooseAddress:ok')
-                    return;
-                wx.showLoading();
-                app.request({
-                    url: api.user.add_wechat_address,
-                    method: "post",
-                    data: {
-                        national_code: e.nationalCode,
-                        name: e.userName,
-                        mobile: e.telNumber,
-                        detail: e.detailInfo,
-                        province_name: e.provinceName,
-                        city_name: e.cityName,
-                        county_name: e.countyName,
-                    },
-                    success: function (res) {
-                        if (res.code == 1) {
-                            wx.showModal({
-                                title: '提示',
-                                content: res.msg,
-                                showCancel: false,
-                            });
-                            return;
-                        }
-                        if (res.code == 0) {
-                            wx.setStorageSync("picker_address", res.data);
-                            wx.navigateBack();
-                        }
-                    },
-                    complete: function () {
-                        wx.hideLoading();
-                    }
-                });
-            }
-        });
-    },
+var api = require('../../api.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        address_list: null,
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        var page = this;
+        wx.showNavigationBarLoading();
+        app.request({
+            url: api.user.address_list,
+            success: function (res) {
+                wx.hideNavigationBarLoading();
+                if (res.code == 0) {
+                    page.setData({
+                        address_list: res.data.list,
+                    });
+                }
+            }
+        });
+    },
+
+    pickAddress: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var address = page.data.address_list[index];
+        wx.setStorageSync("picker_address", address);
+        wx.navigateBack();
+    },
+
+    getWechatAddress: function (e) {
+        var page = this;
+        wx.chooseAddress({
+            success: function (e) {
+                if (e.errMsg != 'chooseAddress:ok')
+                    return;
+                wx.showLoading();
+                app.request({
+                    url: api.user.add_wechat_address,
+                    method: "post",
+                    data: {
+                        national_code: e.nationalCode,
+                        name: e.userName,
+                        mobile: e.telNumber,
+                        detail: e.detailInfo,
+                        province_name: e.provinceName,
+                        city_name: e.cityName,
+                        county_name: e.countyName,
+                    },
+                    success: function (res) {
+                        if (res.code == 1) {
+                            wx.showModal({
+                                title: '提示',
+                                content: res.msg,
+                                showCancel: false,
+                            });
+                            return;
+                        }
+                        if (res.code == 0) {
+                            wx.setStorageSync("picker_address", res.data);
+                            wx.navigateBack();
+                        }
+                    },
+                    complete: function () {
+                        wx.hideLoading();
+                    }
+                });
+            }
+        });
+    },
 });

+ 2 - 2
wechat/pages/address-picker/address-picker.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": "选择收货地址"
+{
+  "navigationBarTitleText": "选择收货地址"
 }

+ 29 - 29
wechat/pages/address-picker/address-picker.wxml

xqd
@@ -1,30 +1,30 @@
-<view class="bottom-bar" style="display: none">
-    <navigator url="/pages/address-edit/address-edit">添加新地址</navigator>
-</view>
-<view class="address-list">
-    <view style="margin-bottom: 32rpx">
-        <view wx:if="{{address_list.length==0}}" style="color: #888;text-align: center;padding: 32rpx 0;">暂无收货地址</view>
-        <bloc wx:else>
-            <view bindtap="pickAddress" data-index="{{index}}" class="address-item" wx:for="{{address_list}}">
-                <view class="userinfo flex-row">
-                    <view class="flex-grow-1">收货人:{{item.name}}</view>
-                    <view class="flex-grow-0">{{item.mobile}}</view>
-                </view>
-                <view class="address-detail">收货地址:{{item.address}}</view>
-            </view>
-        </bloc>
-    </view>
-    <!-- <view class="btn btn-red">
-        <navigator url="/pages/address-edit/address-edit">
-            <image src='/images/add.png'></image>   手动添加地址
-        </navigator>
-    </view> -->
-    <view class="flex-row">
-        <view class="flex-grow-1 px-24">
-            <navigator class="btn btn-red" url="/pages/address-edit/address-edit">手动添加地址</navigator>
-        </view>
-        <!-- <view class="flex-grow-1 px-24">
-            <button class="btn btn-green" bindtap="getWechatAddress">一键获取地址</button>
-        </view> -->
-    </view> 
+<view class="bottom-bar" style="display: none">
+    <navigator url="/pages/address-edit/address-edit">添加新地址</navigator>
+</view>
+<view class="address-list">
+    <view style="margin-bottom: 32rpx">
+        <view wx:if="{{address_list.length==0}}" style="color: #888;text-align: center;padding: 32rpx 0;">暂无收货地址</view>
+        <bloc wx:else>
+            <view bindtap="pickAddress" data-index="{{index}}" class="address-item" wx:for="{{address_list}}">
+                <view class="userinfo flex-row">
+                    <view class="flex-grow-1">收货人:{{item.name}}</view>
+                    <view class="flex-grow-0">{{item.mobile}}</view>
+                </view>
+                <view class="address-detail">收货地址:{{item.address}}</view>
+            </view>
+        </bloc>
+    </view>
+    <!-- <view class="btn btn-red">
+        <navigator url="/pages/address-edit/address-edit">
+            <image src='/images/add.png'></image>   手动添加地址
+        </navigator>
+    </view> -->
+    <view class="flex-row">
+        <view class="flex-grow-1 px-24">
+            <navigator class="btn btn-red" url="/pages/address-edit/address-edit">手动添加地址</navigator>
+        </view>
+        <!-- <view class="flex-grow-1 px-24">
+            <button class="btn btn-green" bindtap="getWechatAddress">一键获取地址</button>
+        </view> -->
+    </view> 
 </view>

+ 78 - 78
wechat/pages/address-picker/address-picker.wxss

xqd
@@ -1,79 +1,79 @@
-
-.bottom-bar{
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    width: 100%;
-    z-index: 1000;
-}
-
-.bottom-bar navigator{
-    background: #ff4544;
-    text-align: center;
-    height: 100rpx;
-    line-height: 100rpx;
-    color: #fff;
-}
-
-.address-list{
-    padding-bottom: 100rpx;
-}
-
-.address-item{
-    background: #fff;
-    padding: 32rpx 24rpx;
-    border-bottom: 1rpx solid #E3E3E3;
-}
-.userinfo{
-    margin-bottom: 24rpx;
-}
-.address-option{
-    margin-left: 48rpx;
-}
-
-.address-option image{
-    width: 32rpx;
-    height: 32rpx;
-    margin-right: 16rpx;
-}
-
-.btn{
-    /* display: block; */
-    border: 1rpx solid #ddd;
-    /* position: fixed; */
-    bottom: 0;
-    width: 100%;
-    font-size: 11pt;
-    /* color: #555; */
-    padding: 25rpx 0;
-    line-height: normal;
-    /* background: #fff; */
-    border-radius: 10rpx; 
-    display: flex;
-    align-items: center;
-    justify-content: center;
-}
-
-.btn:active{
-    background: #fff;
-    opacity: .65;
-}
-
-.btn:after{
-    display: none;
-}
-
-.btn.btn-green{
-    background: #09bb07;
-    color: #fff;
-    border-color: #09bb07;
-}
-.btn.btn-red{
-    background: #EB4851;
-    color: #fff;
-    /* border-color: #ff4544; */
-}
-.btn image{
-    width: 30rpx; 
-    height: 30rpx;
+
+.bottom-bar{
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    z-index: 1000;
+}
+
+.bottom-bar navigator{
+    background: #ff4544;
+    text-align: center;
+    height: 100rpx;
+    line-height: 100rpx;
+    color: #fff;
+}
+
+.address-list{
+    padding-bottom: 100rpx;
+}
+
+.address-item{
+    background: #fff;
+    padding: 32rpx 24rpx;
+    border-bottom: 1rpx solid #E3E3E3;
+}
+.userinfo{
+    margin-bottom: 24rpx;
+}
+.address-option{
+    margin-left: 48rpx;
+}
+
+.address-option image{
+    width: 32rpx;
+    height: 32rpx;
+    margin-right: 16rpx;
+}
+
+.btn{
+    /* display: block; */
+    border: 1rpx solid #ddd;
+    /* position: fixed; */
+    bottom: 0;
+    width: 100%;
+    font-size: 11pt;
+    /* color: #555; */
+    padding: 25rpx 0;
+    line-height: normal;
+    /* background: #fff; */
+    border-radius: 10rpx; 
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.btn:active{
+    background: #fff;
+    opacity: .65;
+}
+
+.btn:after{
+    display: none;
+}
+
+.btn.btn-green{
+    background: #09bb07;
+    color: #fff;
+    border-color: #09bb07;
+}
+.btn.btn-red{
+    background: #EB4851;
+    color: #fff;
+    /* border-color: #ff4544; */
+}
+.btn image{
+    width: 30rpx; 
+    height: 30rpx;
 }

+ 118 - 118
wechat/pages/address/address.js

xqd
@@ -1,119 +1,119 @@
-// pages/address/address.js
-var api = require('../../api.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        address_list: [],
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        var page = this;
-        wx.showNavigationBarLoading();
-        app.request({
-            url: api.user.address_list,
-            success: function (res) {
-                wx.hideNavigationBarLoading();
-                if (res.code == 0) {
-                    page.setData({
-                        address_list: res.data.list,
-                    });
-                }
-                page.setData({
-                    show_no_data_tip: (page.data.address_list.length == 0),
-                });
-            }
-        });
-    },
-
-    setDefaultAddress: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var address = page.data.address_list[index];
-        wx.showLoading({
-            title: "正在保存",
-            mask: true,
-        });
-        app.request({
-            url: api.user.address_set_default,
-            data: {
-                address_id: address.id,
-            },
-            success: function (res) {
-                wx.hideLoading();
-                if (res.code == 0) {
-                    var address_list = page.data.address_list;
-                    for (var i in address_list) {
-                        if (i == index) {
-                            address_list[i].is_default = 1;
-                        } else {
-                            address_list[i].is_default = 0;
-                        }
-                    }
-                    page.setData({
-                        address_list: address_list,
-                    });
-                }
-            }
-        });
-    },
-
-    deleteAddress: function (e) {
-        var page = this;
-        var address_id = e.currentTarget.dataset.id;
-        var index = e.currentTarget.dataset.index;
-        wx.showModal({
-            title: "提示",
-            content: "确认删除改收货地址?",
-            success: function (res) {
-                if (res.confirm) {
-                    wx.showLoading({
-                        title: "正在删除",
-                        mask: true,
-                    });
-                    app.request({
-                        url: api.user.address_delete,
-                        data: {
-                            address_id: address_id,
-                        },
-                        success: function (res) {
-                            if (res.code == 0) {
-                                wx.redirectTo({
-                                    url: "/pages/address/address",
-                                });
-                            }
-                            if (res.code == 1) {
-                                wx.hideLoading();
-                                wx.showToast({
-                                    title: res.msg,
-                                    image: "/images/icon-warning.png",
-                                });
-                            }
-                        }
-                    });
-                }
-            }
-        });
-    },
-
+// pages/address/address.js
+var api = require('../../api.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        address_list: [],
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        var page = this;
+        wx.showNavigationBarLoading();
+        app.request({
+            url: api.user.address_list,
+            success: function (res) {
+                wx.hideNavigationBarLoading();
+                if (res.code == 0) {
+                    page.setData({
+                        address_list: res.data.list,
+                    });
+                }
+                page.setData({
+                    show_no_data_tip: (page.data.address_list.length == 0),
+                });
+            }
+        });
+    },
+
+    setDefaultAddress: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var address = page.data.address_list[index];
+        wx.showLoading({
+            title: "正在保存",
+            mask: true,
+        });
+        app.request({
+            url: api.user.address_set_default,
+            data: {
+                address_id: address.id,
+            },
+            success: function (res) {
+                wx.hideLoading();
+                if (res.code == 0) {
+                    var address_list = page.data.address_list;
+                    for (var i in address_list) {
+                        if (i == index) {
+                            address_list[i].is_default = 1;
+                        } else {
+                            address_list[i].is_default = 0;
+                        }
+                    }
+                    page.setData({
+                        address_list: address_list,
+                    });
+                }
+            }
+        });
+    },
+
+    deleteAddress: function (e) {
+        var page = this;
+        var address_id = e.currentTarget.dataset.id;
+        var index = e.currentTarget.dataset.index;
+        wx.showModal({
+            title: "提示",
+            content: "确认删除改收货地址?",
+            success: function (res) {
+                if (res.confirm) {
+                    wx.showLoading({
+                        title: "正在删除",
+                        mask: true,
+                    });
+                    app.request({
+                        url: api.user.address_delete,
+                        data: {
+                            address_id: address_id,
+                        },
+                        success: function (res) {
+                            if (res.code == 0) {
+                                wx.redirectTo({
+                                    url: "/pages/address/address",
+                                });
+                            }
+                            if (res.code == 1) {
+                                wx.hideLoading();
+                                wx.showToast({
+                                    title: res.msg,
+                                    image: "/images/icon-warning.png",
+                                });
+                            }
+                        }
+                    });
+                }
+            }
+        });
+    },
+
 });

+ 2 - 2
wechat/pages/address/address.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": "地址管理"
+{
+  "navigationBarTitleText": "地址管理"
 }

+ 39 - 39
wechat/pages/address/address.wxml

xqd
@@ -1,40 +1,40 @@
-<!--pages/address/address.wxml-->
-<view class="bottom-bar">
-    <navigator url="/pages/address-edit/address-edit">
-        <image style='width: 30rpx; height: 30rpx;' src='/images/add.png'></image>   新增地址
-    </navigator>
-</view>
-<view wx:if="{{show_no_data_tip}}" class="no-data-tip">暂无收货地址</view>
-<view class="address-list">
-    <view class="address-item" wx:for="{{address_list}}">
-        <view class="userinfo flex-row">
-            <view class="flex-grow-1">收货人:{{item.name}}</view>
-            <view class="flex-grow-0">{{item.mobile}}</view>
-        </view>
-        <view class="address-detail">收货地址:{{item.address}}</view>
-        <view class="flex-row">
-            <view class="flex-grow-1">
-                <view style="display: inline-block">
-                    <navigator wx:if="{{item.is_default==1}}" class="default-address flex-row flex-y-center">
-                        <image style="width: 40rpx;height: 40rpx;margin-right: 12rpx" src="/images/icon-shop-checked.png"/>
-                        <text>默认地址</text>
-                    </navigator>
-                    <navigator wx:else bindtap="setDefaultAddress" data-index="{{index}}" class="default-address flex-row flex-y-center">
-                        <image style="width: 40rpx;height: 40rpx;margin-right: 12rpx" src="/images/icon-uncheck.png"/>
-                        <navigator>设为默认</navigator>
-                    </navigator>
-                </view>
-            </view>
-            <view class="flex-grow-0 flex-row">
-                <navigator class="address-option flex-y-center" url="/pages/address-edit/address-edit?id={{item.id}}">
-                    <image src="/images/icon-edit.png"/>
-                    <text>编辑</text>
-                </navigator>
-                <navigator bindtap="deleteAddress" class="address-option flex-y-center" data-index="{{index}}" data-id="{{item.id}}">
-                    <image src="/images/icon-delete.png"/>
-                    <text>删除</text>
-                </navigator>
-            </view>
-        </view>
-    </view>
+<!--pages/address/address.wxml-->
+<view class="bottom-bar">
+    <navigator url="/pages/address-edit/address-edit">
+        <image style='width: 30rpx; height: 30rpx;' src='/images/add.png'></image>   新增地址
+    </navigator>
+</view>
+<view wx:if="{{show_no_data_tip}}" class="no-data-tip">暂无收货地址</view>
+<view class="address-list">
+    <view class="address-item" wx:for="{{address_list}}">
+        <view class="userinfo flex-row">
+            <view class="flex-grow-1">收货人:{{item.name}}</view>
+            <view class="flex-grow-0">{{item.mobile}}</view>
+        </view>
+        <view class="address-detail">收货地址:{{item.address}}</view>
+        <view class="flex-row">
+            <view class="flex-grow-1">
+                <view style="display: inline-block">
+                    <navigator wx:if="{{item.is_default==1}}" class="default-address flex-row flex-y-center">
+                        <image style="width: 40rpx;height: 40rpx;margin-right: 12rpx" src="/images/icon-shop-checked.png"/>
+                        <text>默认地址</text>
+                    </navigator>
+                    <navigator wx:else bindtap="setDefaultAddress" data-index="{{index}}" class="default-address flex-row flex-y-center">
+                        <image style="width: 40rpx;height: 40rpx;margin-right: 12rpx" src="/images/icon-uncheck.png"/>
+                        <navigator>设为默认</navigator>
+                    </navigator>
+                </view>
+            </view>
+            <view class="flex-grow-0 flex-row">
+                <navigator class="address-option flex-y-center" url="/pages/address-edit/address-edit?id={{item.id}}">
+                    <image src="/images/icon-edit.png"/>
+                    <text>编辑</text>
+                </navigator>
+                <navigator bindtap="deleteAddress" class="address-option flex-y-center" data-index="{{index}}" data-id="{{item.id}}">
+                    <image src="/images/icon-delete.png"/>
+                    <text>删除</text>
+                </navigator>
+            </view>
+        </view>
+    </view>
 </view>

+ 48 - 48
wechat/pages/address/address.wxss

xqd
@@ -1,49 +1,49 @@
-/* pages/address/address.wxss */
-.bottom-bar{
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    width: 100%;
-    z-index: 1000;
-}
-.bottom-bar navigator{
-    background: #DB434C;
-    text-align: center;
-    height: 100rpx;
-    line-height: 100rpx;
-    color: #fff;
-}
-.address-list{
-    padding-bottom: 100rpx;
-}
-
-.address-item{
-    background: #fff;
-    margin-bottom: 20rpx;
-    padding: 32rpx 24rpx;
-}
-.userinfo{
-    margin-bottom: 24rpx;
-}
-.address-detail{
-    border-bottom: 1rpx solid #eee;
-    margin-bottom: 24rpx;
-    padding-bottom: 24rpx;
-}
-.address-option{
-    margin-left: 48rpx;
-    color: #ED5760;
-}
-.address-option image{
-    width: 32rpx;
-    height: 32rpx;
-    margin-right: 16rpx;
-}
-
-.default-address{
-    width: auto;
-}
-
-.default-address.active{
-    color: #DB434C;
+/* pages/address/address.wxss */
+.bottom-bar{
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    z-index: 1000;
+}
+.bottom-bar navigator{
+    background: #DB434C;
+    text-align: center;
+    height: 100rpx;
+    line-height: 100rpx;
+    color: #fff;
+}
+.address-list{
+    padding-bottom: 100rpx;
+}
+
+.address-item{
+    background: #fff;
+    margin-bottom: 20rpx;
+    padding: 32rpx 24rpx;
+}
+.userinfo{
+    margin-bottom: 24rpx;
+}
+.address-detail{
+    border-bottom: 1rpx solid #eee;
+    margin-bottom: 24rpx;
+    padding-bottom: 24rpx;
+}
+.address-option{
+    margin-left: 48rpx;
+    color: #ED5760;
+}
+.address-option image{
+    width: 32rpx;
+    height: 32rpx;
+    margin-right: 16rpx;
+}
+
+.default-address{
+    width: auto;
+}
+
+.default-address.active{
+    color: #DB434C;
 }

+ 86 - 86
wechat/pages/article-detail/article-detail.js

xqd
@@ -1,87 +1,87 @@
-// pages/article-detail/article-detail.js
-var api = require('../../api.js');
-var app = getApp();
-var WxParse = require('../../wxParse/wxParse.js');
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {},
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-        var page = this;
-        app.request({
-            url: api.default.article_detail,
-            data: {
-                id: options.id,
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    wx.setNavigationBarTitle({
-                        title: res.data.title,
-                    });
-                    WxParse.wxParse("content", "html", res.data.content, page);
-                }
-                if (res.code == 1) {
-                    wx.showModal({
-                        title: "提示",
-                        content: res.msg,
-                        showCancel: false,
-                        confirm: function (e) {
-                            if (e.confirm) {
-                                wx.navigateBack();
-                            }
-                        }
-                    });
-                }
-            }
-        });
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
+// pages/article-detail/article-detail.js
+var api = require('../../api.js');
+var app = getApp();
+var WxParse = require('../../wxParse/wxParse.js');
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {},
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+        var page = this;
+        app.request({
+            url: api.default.article_detail,
+            data: {
+                id: options.id,
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    wx.setNavigationBarTitle({
+                        title: res.data.title,
+                    });
+                    WxParse.wxParse("content", "html", res.data.content, page);
+                }
+                if (res.code == 1) {
+                    wx.showModal({
+                        title: "提示",
+                        content: res.msg,
+                        showCancel: false,
+                        confirm: function (e) {
+                            if (e.confirm) {
+                                wx.navigateBack();
+                            }
+                        }
+                    });
+                }
+            }
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
 })

+ 2 - 2
wechat/pages/article-detail/article-detail.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": "详情"
+{
+  "navigationBarTitleText": "详情"
 }

+ 5 - 5
wechat/pages/article-detail/article-detail.wxml

xqd
@@ -1,5 +1,5 @@
-<!--pages/article-detail/article-detail.wxml-->
-<view style="background: #fff;padding:32rpx 0">
-    <import src="../../wxParse/wxParse.wxml"/>
-    <template is="wxParse" data="{{wxParseData:content.nodes}}"/>
-</view>
+<!--pages/article-detail/article-detail.wxml-->
+<view style="background: #fff;padding:32rpx 0">
+    <import src="../../wxParse/wxParse.wxml"/>
+    <template is="wxParse" data="{{wxParseData:content.nodes}}"/>
+</view>

+ 6 - 6
wechat/pages/article-detail/article-detail.wxss

xqd
@@ -1,7 +1,7 @@
-/* pages/article-detail/article-detail.wxss */
-@import "../../wxParse/wxParse.wxss";
-page{
-    min-height: 100%;
-    background: #fff;
-    overflow-x: hidden;
+/* pages/article-detail/article-detail.wxss */
+@import "../../wxParse/wxParse.wxss";
+page{
+    min-height: 100%;
+    background: #fff;
+    overflow-x: hidden;
 }

+ 75 - 75
wechat/pages/article-list/article-list.js

xqd
@@ -1,76 +1,76 @@
-// pages/article-list/article-list.js
-var api = require('../../api.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        article_list: [],
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-        var page = this;
-        wx.showLoading();
-        app.request({
-            url: api.default.article_list,
-            data: {
-                cat_id: 2,
-            },
-            success: function (res) {
-                wx.hideLoading();
-                page.setData({
-                    article_list: res.data.list,
-                });
-            }
-        });
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-        
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
-
+// pages/article-list/article-list.js
+var api = require('../../api.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        article_list: [],
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+        var page = this;
+        wx.showLoading();
+        app.request({
+            url: api.default.article_list,
+            data: {
+                cat_id: 2,
+            },
+            success: function (res) {
+                wx.hideLoading();
+                page.setData({
+                    article_list: res.data.list,
+                });
+            }
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+        
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
 })

+ 2 - 2
wechat/pages/article-list/article-list.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": "服务中心"
+{
+  "navigationBarTitleText": "服务中心"
 }

+ 11 - 11
wechat/pages/article-list/article-list.wxml

xqd
@@ -1,12 +1,12 @@
-<!--pages/article-list/article-list.wxml-->
-<view class="article-list">
-    <navigator class="flex-row article-item" wx:for="{{article_list}}"
-               url="/pages/article-detail/article-detail?id={{item.id}}">
-        <view class="flex-grow-1 flex-y-center title">
-            {{item.title}}
-        </view>
-        <view class="flex-grow-0 flex-y-center">
-            <image class="pointer" src="/images/icon-jiantou-r.png"></image>
-        </view>
-    </navigator>
+<!--pages/article-list/article-list.wxml-->
+<view class="article-list">
+    <navigator class="flex-row article-item" wx:for="{{article_list}}"
+               url="/pages/article-detail/article-detail?id={{item.id}}">
+        <view class="flex-grow-1 flex-y-center title">
+            {{item.title}}
+        </view>
+        <view class="flex-grow-0 flex-y-center">
+            <image class="pointer" src="/images/icon-jiantou-r.png"></image>
+        </view>
+    </navigator>
 </view>

+ 21 - 21
wechat/pages/article-list/article-list.wxss

xqd
@@ -1,22 +1,22 @@
-/* pages/article-list/article-list.wxss */
-.article-list{
-    border-top: 1rpx solid #e3e3e3;
-}
-
-.article-item{
-    background: #fff;
-    border-bottom: 1rpx solid #e3e3e3;
-    padding: 0 24rpx;
-    height: 100rpx;
-}
-.article-item .title{
-    white-space: nowrap;
-    text-overflow: ellipsis;
-    overflow: hidden;
-}
-
-.article-item .pointer{
-    width: 12rpx;
-    height: 24rpx;
-    margin-left: 24rpx;
+/* pages/article-list/article-list.wxss */
+.article-list{
+    border-top: 1rpx solid #e3e3e3;
+}
+
+.article-item{
+    background: #fff;
+    border-bottom: 1rpx solid #e3e3e3;
+    padding: 0 24rpx;
+    height: 100rpx;
+}
+.article-item .title{
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+}
+
+.article-item .pointer{
+    width: 12rpx;
+    height: 24rpx;
+    margin-left: 24rpx;
 }

+ 165 - 165
wechat/pages/balance/balance.js

xqd
@@ -1,166 +1,166 @@
-var api = require('../../api.js');
-var app = getApp();
-var is_more = false;
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        show: false
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-    },
-
-    getData: function () {
-        var page = this;
-        wx.showLoading({
-            title: '加载中',
-        });
-        app.request({
-            url: api.recharge.record,
-            data: {
-                date: page.data.date_1 || ''
-            },
-            success: function (res) {
-                page.setData({
-                    list: res.data.list,
-                });
-                wx.hideLoading();
-                is_more = false;
-            }
-        });
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-        app.pageOnReady(this);
-        var page = this;
-        wx.showLoading({
-            title: '加载中',
-        });
-        var user_info = wx.getStorageSync('user_info');
-        app.request({
-            url: api.recharge.index,
-            success: function (res) {
-                user_info.money = res.data.money;
-                wx.setStorageSync('user_info', user_info);
-                page.setData({
-                    user_info: user_info,
-                    list: res.data.list,
-                    setting: res.data.setting,
-                    date_1: res.data.date,
-                    date: res.data.date.replace('-', '年') + '月'
-                });
-                wx.hideLoading();
-            }
-        });
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        app.pageOnShow(this);
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-        app.pageOnHide(this);
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-        app.pageOnUnload(this);
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
-
-    dateChange: function (e) {
-        if (is_more) {
-            return;
-        }
-        is_more = true;
-        var date_1 = e.detail.value;
-        var date = date_1.replace('-', '年') + '月';
-        this.setData({
-            date: date,
-            date_1: date_1
-        });
-        this.getData();
-    },
-
-    dateUp: function () {
-        var page = this;
-        if (is_more) {
-            return;
-        }
-        is_more = true;
-        var date_1 = page.data.date_1;
-        var date = page.data.date;
-        var d = new Date(date_1);
-        d.setMonth(d.getMonth() + 1);
-        var m = d.getMonth() + 1;
-        m = m.toString();
-        m = m[1] ? m : '0' + m;
-        page.setData({
-            date: d.getFullYear() + '年' + m + '月',
-            date_1: d.getFullYear() + '-' + m
-        });
-        page.getData();
-    },
-
-    dateDown: function () {
-        var page = this;
-        if (is_more) {
-            return;
-        }
-        is_more = true;
-        var date_1 = page.data.date_1;
-        var date = page.data.date;
-        var d = new Date(date_1);
-        d.setMonth(d.getMonth() - 1);
-        var m = d.getMonth() + 1;
-        m = m.toString();
-        m = m[1] ? m : '0' + m;
-        page.setData({
-            date: d.getFullYear() + '年' + m + '月',
-            date_1: d.getFullYear() + '-' + m
-        });
-        page.getData();
-    },
-
-    click: function () {
-        this.setData({
-            show: true
-        });
-    },
-    close: function () {
-        this.setData({
-            show: false
-        });
-    }
+var api = require('../../api.js');
+var app = getApp();
+var is_more = false;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        show: false
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+    },
+
+    getData: function () {
+        var page = this;
+        wx.showLoading({
+            title: '加载中',
+        });
+        app.request({
+            url: api.recharge.record,
+            data: {
+                date: page.data.date_1 || ''
+            },
+            success: function (res) {
+                page.setData({
+                    list: res.data.list,
+                });
+                wx.hideLoading();
+                is_more = false;
+            }
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+        app.pageOnReady(this);
+        var page = this;
+        wx.showLoading({
+            title: '加载中',
+        });
+        var user_info = wx.getStorageSync('user_info');
+        app.request({
+            url: api.recharge.index,
+            success: function (res) {
+                user_info.money = res.data.money;
+                wx.setStorageSync('user_info', user_info);
+                page.setData({
+                    user_info: user_info,
+                    list: res.data.list,
+                    setting: res.data.setting,
+                    date_1: res.data.date,
+                    date: res.data.date.replace('-', '年') + '月'
+                });
+                wx.hideLoading();
+            }
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        app.pageOnShow(this);
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+        app.pageOnHide(this);
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+        app.pageOnUnload(this);
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    dateChange: function (e) {
+        if (is_more) {
+            return;
+        }
+        is_more = true;
+        var date_1 = e.detail.value;
+        var date = date_1.replace('-', '年') + '月';
+        this.setData({
+            date: date,
+            date_1: date_1
+        });
+        this.getData();
+    },
+
+    dateUp: function () {
+        var page = this;
+        if (is_more) {
+            return;
+        }
+        is_more = true;
+        var date_1 = page.data.date_1;
+        var date = page.data.date;
+        var d = new Date(date_1);
+        d.setMonth(d.getMonth() + 1);
+        var m = d.getMonth() + 1;
+        m = m.toString();
+        m = m[1] ? m : '0' + m;
+        page.setData({
+            date: d.getFullYear() + '年' + m + '月',
+            date_1: d.getFullYear() + '-' + m
+        });
+        page.getData();
+    },
+
+    dateDown: function () {
+        var page = this;
+        if (is_more) {
+            return;
+        }
+        is_more = true;
+        var date_1 = page.data.date_1;
+        var date = page.data.date;
+        var d = new Date(date_1);
+        d.setMonth(d.getMonth() - 1);
+        var m = d.getMonth() + 1;
+        m = m.toString();
+        m = m[1] ? m : '0' + m;
+        page.setData({
+            date: d.getFullYear() + '年' + m + '月',
+            date_1: d.getFullYear() + '-' + m
+        });
+        page.getData();
+    },
+
+    click: function () {
+        this.setData({
+            show: true
+        });
+    },
+    close: function () {
+        this.setData({
+            show: false
+        });
+    }
 });

+ 2 - 2
wechat/pages/balance/balance.json

xqd
@@ -1,3 +1,3 @@
-{
-    "navigationBarTitleText":"余额"
+{
+    "navigationBarTitleText":"余额"
 }

+ 73 - 73
wechat/pages/balance/balance.wxml

xqd
@@ -1,74 +1,74 @@
-<!--pages/balance/balance.wxml-->
-<view>
-    <view class='info'>
-        <image src='{{setting.pic_url}}' class='bg'></image>
-        <view class='flex-row'>
-            <view class='flex-grow-1'>
-                <view class='info-1'>
-                    <view class='flex-row'>
-                        <view class='flex-grow-1 flex-x-center'>账户余额(元)</view>
-                    </view>
-                </view>
-                <view class='info-2 flex-x-center'>{{user_info.money}}</view>
-                <view class='info-3 flex-x-center'>
-                    <navigator url='/pages/recharge/recharge' hover-class='none'>
-                        <view class='info-btn flex-x-center flex-y-center'>充值</view>
-                    </navigator>
-                </view>
-            </view>
-        </view>
-        <view bindtap='click' style='position:absolute;right:0;top:48rpx;'>
-            <image src='{{setting.p_pic_url}}' class='info-img'></image>
-        </view>
-    </view>
-    <view class='modal-h flex-y-center flex-x-center {{show ? "" : "hidden"}}'>
-        <view>
-            <view class='w-100 body-h'>
-                <view class='flex-x-center'>充值说明</view>
-                <scroll-view scroll-y='true' style='color:#666;max-height:250rpx;margin-top:40rpx;'>
-                    <text>{{setting.help}}</text>
-                </scroll-view>
-                <view class='flex-x-center' bindtap='close'>
-                    <view class='btn-h flex-x-center flex-y-center'>我知道了</view>
-                </view>
-            </view>
-        </view>
-    </view>
-    <view class='ad'>
-        <navigator class='ad' hover-class='none' url="{{setting.page_url}}" open-type="navigate">
-            <image src='{{setting.ad_pic_url}}'></image>
-        </navigator>
-    </view>
-    <view class='record'>
-        <view class='record-time flex-x-center flex-y-center'>
-            <view class='flex-row'>
-                <view class='flex-grow-0' bindtap='dateDown'>
-                    <image src='/images/icon-balance-left.png' class='record-img' style='margin:0 84rpx;'></image>
-                </view>
-                <picker class='flex-grow-1' mode='date' value='{{date_1}}' fields='month' bindchange='dateChange'>
-                    <view>{{date}}</view>
-                </picker>
-                <view class='flex-grow-0' bindtap='dateUp'>
-                    <image src='/images/icon-balance-right.png' class='record-img' style='margin:0 84rpx;'></image>
-                </view>
-            </view>
-        </view>
-        <view class='record-list'>
-            <block wx:for='{{list}}'>
-                <view class='record-one flex-row'>
-                    <view class='flex-grow-1'>
-                        <view wx:if='{{item.flag == 0}}'>
-                            <view class='record-1 text-more'>充值</view>
-                            <view class='record-2'>{{item.date}}</view>
-                        </view>
-                        <view wx:if='{{item.flag == 1}}'>
-                            <view class='record-1 text-more'>消费-订单15845648979812134165</view>
-                            <view class='record-2'>{{item.date}}</view>
-                        </view>
-                    </view>
-                    <view class='flex-grow-0 flex-y-center {{item.flag == 0 ? "record-3" : "record-4"}}'>{{item.price}}</view>
-                </view>
-            </block>
-        </view>
-    </view>
+<!--pages/balance/balance.wxml-->
+<view>
+    <view class='info'>
+        <image src='{{setting.pic_url}}' class='bg'></image>
+        <view class='flex-row'>
+            <view class='flex-grow-1'>
+                <view class='info-1'>
+                    <view class='flex-row'>
+                        <view class='flex-grow-1 flex-x-center'>账户余额(元)</view>
+                    </view>
+                </view>
+                <view class='info-2 flex-x-center'>{{user_info.money}}</view>
+                <view class='info-3 flex-x-center'>
+                    <navigator url='/pages/recharge/recharge' hover-class='none'>
+                        <view class='info-btn flex-x-center flex-y-center'>充值</view>
+                    </navigator>
+                </view>
+            </view>
+        </view>
+        <view bindtap='click' style='position:absolute;right:0;top:48rpx;'>
+            <image src='{{setting.p_pic_url}}' class='info-img'></image>
+        </view>
+    </view>
+    <view class='modal-h flex-y-center flex-x-center {{show ? "" : "hidden"}}'>
+        <view>
+            <view class='w-100 body-h'>
+                <view class='flex-x-center'>充值说明</view>
+                <scroll-view scroll-y='true' style='color:#666;max-height:250rpx;margin-top:40rpx;'>
+                    <text>{{setting.help}}</text>
+                </scroll-view>
+                <view class='flex-x-center' bindtap='close'>
+                    <view class='btn-h flex-x-center flex-y-center'>我知道了</view>
+                </view>
+            </view>
+        </view>
+    </view>
+    <view class='ad'>
+        <navigator class='ad' hover-class='none' url="{{setting.page_url}}" open-type="navigate">
+            <image src='{{setting.ad_pic_url}}'></image>
+        </navigator>
+    </view>
+    <view class='record'>
+        <view class='record-time flex-x-center flex-y-center'>
+            <view class='flex-row'>
+                <view class='flex-grow-0' bindtap='dateDown'>
+                    <image src='/images/icon-balance-left.png' class='record-img' style='margin:0 84rpx;'></image>
+                </view>
+                <picker class='flex-grow-1' mode='date' value='{{date_1}}' fields='month' bindchange='dateChange'>
+                    <view>{{date}}</view>
+                </picker>
+                <view class='flex-grow-0' bindtap='dateUp'>
+                    <image src='/images/icon-balance-right.png' class='record-img' style='margin:0 84rpx;'></image>
+                </view>
+            </view>
+        </view>
+        <view class='record-list'>
+            <block wx:for='{{list}}'>
+                <view class='record-one flex-row'>
+                    <view class='flex-grow-1'>
+                        <view wx:if='{{item.flag == 0}}'>
+                            <view class='record-1 text-more'>充值</view>
+                            <view class='record-2'>{{item.date}}</view>
+                        </view>
+                        <view wx:if='{{item.flag == 1}}'>
+                            <view class='record-1 text-more'>消费-订单15845648979812134165</view>
+                            <view class='record-2'>{{item.date}}</view>
+                        </view>
+                    </view>
+                    <view class='flex-grow-0 flex-y-center {{item.flag == 0 ? "record-3" : "record-4"}}'>{{item.price}}</view>
+                </view>
+            </block>
+        </view>
+    </view>
 </view>

+ 125 - 125
wechat/pages/balance/balance.wxss

xqd
@@ -1,125 +1,125 @@
-/* pages/balance/balance.wxss */
-
-.info {
-    position: relative;
-    width: 750rpx;
-    height: 324rpx;
-    color: #fff;
-    padding: 48rpx 0;
-    margin-bottom: 20rpx;
-}
-
-.bg {
-    position: absolute;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: 324rpx;
-    z-index: -1;
-}
-
-.info-img {
-    width: 36rpx;
-    height: 36rpx;
-    margin-right: 20rpx;
-}
-
-.info-2 {
-    margin: 30rpx 0;
-    font-size: 30pt;
-    line-height: 1;
-}
-
-.info-btn {
-    width: 168rpx;
-    height: 56rpx;
-    font-size: 13pt;
-    border-radius: 28rpx;
-    border: 1rpx solid #fff;
-}
-
-.ad {
-    width: 100%;
-    height: 180rpx;
-    margin-bottom: 20rpx;
-}
-
-.ad image {
-    width: 100%;
-    height: 100%;
-}
-
-.record {
-    background-color: #fff;
-    width: 100%;
-}
-
-.record-time {
-    width: 100%;
-    height: 80rpx;
-    color: #353535;
-}
-
-.record-img {
-    width: 12rpx;
-    height: 20rpx;
-}
-
-.record-list {
-    width: 100%;
-    background-color: #fff;
-}
-
-.record-one {
-    width: 100%;
-    height: 140rpx;
-    border-top: 1rpx solid #e2e2e2;
-    padding: 0 24rpx;
-}
-
-.record-1 {
-    color: #353535;
-    margin-top: 30rpx;
-    margin-bottom: 15rpx;
-}
-
-.record-2 {
-    color: #666;
-    font-size: 9pt;
-}
-
-.record-3 {
-    font-size: 13pt;
-    color: #ff4544;
-}
-
-.record-4 {
-    font-size: 13pt;
-    color: #3fc24c;
-}
-
-.modal-h {
-    position: fixed;
-    left: 0;
-    top: 0;
-    width: 100%;
-    height: 100%;
-    background-color: rgba(0, 0, 0, 0.5);
-    z-index: 1000;
-}
-
-.body-h {
-    padding: 50rpx;
-    background-color: #fff;
-    width: 600rpx;
-    border-radius: 10rpx;
-}
-
-.btn-h {
-    margin-top: 64rpx;
-    width: 100%;
-    height: 80rpx;
-    background-color: #ff4544;
-    border-radius: 10rpx;
-    color: #fff;
-}
+/* pages/balance/balance.wxss */
+
+.info {
+    position: relative;
+    width: 750rpx;
+    height: 324rpx;
+    color: #fff;
+    padding: 48rpx 0;
+    margin-bottom: 20rpx;
+}
+
+.bg {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 324rpx;
+    z-index: -1;
+}
+
+.info-img {
+    width: 36rpx;
+    height: 36rpx;
+    margin-right: 20rpx;
+}
+
+.info-2 {
+    margin: 30rpx 0;
+    font-size: 30pt;
+    line-height: 1;
+}
+
+.info-btn {
+    width: 168rpx;
+    height: 56rpx;
+    font-size: 13pt;
+    border-radius: 28rpx;
+    border: 1rpx solid #fff;
+}
+
+.ad {
+    width: 100%;
+    height: 180rpx;
+    margin-bottom: 20rpx;
+}
+
+.ad image {
+    width: 100%;
+    height: 100%;
+}
+
+.record {
+    background-color: #fff;
+    width: 100%;
+}
+
+.record-time {
+    width: 100%;
+    height: 80rpx;
+    color: #353535;
+}
+
+.record-img {
+    width: 12rpx;
+    height: 20rpx;
+}
+
+.record-list {
+    width: 100%;
+    background-color: #fff;
+}
+
+.record-one {
+    width: 100%;
+    height: 140rpx;
+    border-top: 1rpx solid #e2e2e2;
+    padding: 0 24rpx;
+}
+
+.record-1 {
+    color: #353535;
+    margin-top: 30rpx;
+    margin-bottom: 15rpx;
+}
+
+.record-2 {
+    color: #666;
+    font-size: 9pt;
+}
+
+.record-3 {
+    font-size: 13pt;
+    color: #ff4544;
+}
+
+.record-4 {
+    font-size: 13pt;
+    color: #3fc24c;
+}
+
+.modal-h {
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(0, 0, 0, 0.5);
+    z-index: 1000;
+}
+
+.body-h {
+    padding: 50rpx;
+    background-color: #fff;
+    width: 600rpx;
+    border-radius: 10rpx;
+}
+
+.btn-h {
+    margin-top: 64rpx;
+    width: 100%;
+    height: 80rpx;
+    background-color: #ff4544;
+    border-radius: 10rpx;
+    color: #fff;
+}

+ 173 - 173
wechat/pages/book/clerk/clerk.js

xqd
@@ -1,174 +1,174 @@
-// pages/book/order/details.js
-var api = require('../../../api.js');
-var utils = require('../../../utils.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        hide: 1,
-        qrcode: ""
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        console.log(options);
-        this.getOrderDetails(options);
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        app.pageOnShow(this);
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function () {
-
-    },
-
-    /**
-     * 订单详情
-     */
-    getOrderDetails: function (e) {
-        var oid = e.scene;
-        var page = this;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        // wx.showNavigationBarLoading();
-        app.request({
-            url: api.book.clerk_order_details,
-            method: "get",
-            data: { id: oid },
-            success: function (res) {
-                if (res.code == 0) {
-                    page.setData({
-                        goods: res.data,
-                    });
-                } else {
-                    wx.showModal({
-                        title: '提示',
-                        content: res.msg,
-                        showCancel: false,
-                        success: function (res) {
-                            if (res.confirm) {
-                                wx.redirectTo({
-                                    url: '/pages/user/user'
-                                });
-                            }
-                        }
-                    });
-                }
-            },
-            complete: function (res) {
-                setTimeout(function () {
-                    // 延长一秒取消加载动画
-                    wx.hideLoading();
-                }, 1000);
-            }
-        });
-    },
-    /**
-     * 跳转至商品详情
-     */
-    goToGoodsDetails: function (e) {
-        wx.redirectTo({
-            url: '/pages/book/details/details?id=' + this.data.goods.goods_id,
-        })
-    },
-    /**
-     * 确认核销
-     */
-    nowWriteOff:function(e)
-    {
-        var page = this;
-        console.log(page.data.order)
-        wx.showModal({
-            title: '提示',
-            content: '是否确认核销?',
-            success: function (res) {
-                if (res.confirm) {
-                    wx.showLoading({
-                        title: "正在加载",
-                    });
-                    app.request({
-                        url: api.book.clerk,
-                        data: {
-                            order_id: page.data.goods.id
-                        },
-                        success: function (res) {
-                            if (res.code == 0) {
-                                wx.redirectTo({
-                                    url: '/pages/user/user',
-                                })
-                            } else {
-                                wx.showModal({
-                                    title: '警告!',
-                                    showCancel: false,
-                                    content: res.msg,
-                                    confirmText: '确认',
-                                    success: function (res) {
-                                        if (res.confirm) {
-                                            wx.redirectTo({
-                                                url: '/pages/index/index',
-                                            })
-                                        }
-                                    }
-                                });
-                            }
-                        },
-                        complete: function () {
-                            wx.hideLoading();
-                        }
-                    });
-                } else if (res.cancel) {
-                }
-            }
-        })
-    }
+// pages/book/order/details.js
+var api = require('../../../api.js');
+var utils = require('../../../utils.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        hide: 1,
+        qrcode: ""
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        console.log(options);
+        this.getOrderDetails(options);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        app.pageOnShow(this);
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+
+    /**
+     * 订单详情
+     */
+    getOrderDetails: function (e) {
+        var oid = e.scene;
+        var page = this;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        // wx.showNavigationBarLoading();
+        app.request({
+            url: api.book.clerk_order_details,
+            method: "get",
+            data: { id: oid },
+            success: function (res) {
+                if (res.code == 0) {
+                    page.setData({
+                        goods: res.data,
+                    });
+                } else {
+                    wx.showModal({
+                        title: '提示',
+                        content: res.msg,
+                        showCancel: false,
+                        success: function (res) {
+                            if (res.confirm) {
+                                wx.redirectTo({
+                                    url: '/pages/user/user'
+                                });
+                            }
+                        }
+                    });
+                }
+            },
+            complete: function (res) {
+                setTimeout(function () {
+                    // 延长一秒取消加载动画
+                    wx.hideLoading();
+                }, 1000);
+            }
+        });
+    },
+    /**
+     * 跳转至商品详情
+     */
+    goToGoodsDetails: function (e) {
+        wx.redirectTo({
+            url: '/pages/book/details/details?id=' + this.data.goods.goods_id,
+        })
+    },
+    /**
+     * 确认核销
+     */
+    nowWriteOff:function(e)
+    {
+        var page = this;
+        console.log(page.data.order)
+        wx.showModal({
+            title: '提示',
+            content: '是否确认核销?',
+            success: function (res) {
+                if (res.confirm) {
+                    wx.showLoading({
+                        title: "正在加载",
+                    });
+                    app.request({
+                        url: api.book.clerk,
+                        data: {
+                            order_id: page.data.goods.id
+                        },
+                        success: function (res) {
+                            if (res.code == 0) {
+                                wx.redirectTo({
+                                    url: '/pages/user/user',
+                                })
+                            } else {
+                                wx.showModal({
+                                    title: '警告!',
+                                    showCancel: false,
+                                    content: res.msg,
+                                    confirmText: '确认',
+                                    success: function (res) {
+                                        if (res.confirm) {
+                                            wx.redirectTo({
+                                                url: '/pages/index/index',
+                                            })
+                                        }
+                                    }
+                                });
+                            }
+                        },
+                        complete: function () {
+                            wx.hideLoading();
+                        }
+                    });
+                } else if (res.cancel) {
+                }
+            }
+        })
+    }
 })

+ 2 - 2
wechat/pages/book/clerk/clerk.json

xqd
@@ -1,3 +1,3 @@
-{
-    "navigationBarTitleText": "核销"
+{
+    "navigationBarTitleText": "核销"
 }

+ 45 - 45
wechat/pages/book/clerk/clerk.wxml

xqd
@@ -1,46 +1,46 @@
-<!--pages/book/order/details.wxml-->
-<view style='padding-bottom:120rpx'>
-    <view class='goods flex-row' bindtap='goToGoodsDetails'>
-        <view class='goods-pic flex-grow-0'>
-                <image src='{{goods.cover_pic}}'></image>
-        </view>
-        <view class='goods-info flex-grow-1 flex-col'>
-                <view class='goods-name flex-grow-1'>
-                        {{goods.name}}
-                </view>
-                <view class='money flex-grow-0 flex-row flex-y-bottom '>
-                    <view class='original_price flex-gorw-0'>
-                        ¥ {{goods.original_price}}
-                    </view>
-                    <view class='price flex-grow-0'>
-                        ¥ {{goods.pay_price}}
-                    </view>
-                </view>
-        </view>
-        <view class='goods-right flex-grow-0 flex-y-center'>
-                <image src='/images/img-share-right.png'></image>
-        </view>
-    </view>
-    <view class='order'>
-        <view class='order-title flex-y-center'>
-            订单信息
-        </view>
-        <view class='order-info'>
-            <view class='order-info-item'>
-                订单号:{{goods.order_no}}
-            </view>
-            <view class='order-info-item'>
-                下单时间:{{goods.addtime}}
-            </view>
-            <view class='order-info-item' wx:for='{{goods.orderForm}}'>
-                {{item.key}}:{{item.value}}
-            </view>
-        </view>
-    </view>
-</view>
-
-<view class='btn-group flex-row'>
-    <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='nowWriteOff'>
-            确认核销
-    </view>
+<!--pages/book/order/details.wxml-->
+<view style='padding-bottom:120rpx'>
+    <view class='goods flex-row' bindtap='goToGoodsDetails'>
+        <view class='goods-pic flex-grow-0'>
+                <image src='{{goods.cover_pic}}'></image>
+        </view>
+        <view class='goods-info flex-grow-1 flex-col'>
+                <view class='goods-name flex-grow-1'>
+                        {{goods.name}}
+                </view>
+                <view class='money flex-grow-0 flex-row flex-y-bottom '>
+                    <view class='original_price flex-gorw-0'>
+                        ¥ {{goods.original_price}}
+                    </view>
+                    <view class='price flex-grow-0'>
+                        ¥ {{goods.pay_price}}
+                    </view>
+                </view>
+        </view>
+        <view class='goods-right flex-grow-0 flex-y-center'>
+                <image src='/images/img-share-right.png'></image>
+        </view>
+    </view>
+    <view class='order'>
+        <view class='order-title flex-y-center'>
+            订单信息
+        </view>
+        <view class='order-info'>
+            <view class='order-info-item'>
+                订单号:{{goods.order_no}}
+            </view>
+            <view class='order-info-item'>
+                下单时间:{{goods.addtime}}
+            </view>
+            <view class='order-info-item' wx:for='{{goods.orderForm}}'>
+                {{item.key}}:{{item.value}}
+            </view>
+        </view>
+    </view>
+</view>
+
+<view class='btn-group flex-row'>
+    <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='nowWriteOff'>
+            确认核销
+    </view>
 </view>

+ 133 - 133
wechat/pages/book/clerk/clerk.wxss

xqd
@@ -1,134 +1,134 @@
-/* pages/book/order/details.wxss */
-.goods{
-    padding: 24rpx;
-    background-color: #fff;
-}
-.goods-pic{
-    margin-right: 24rpx;
-}
-.goods-pic image{
-    width: 208rpx;
-    height: 160rpx;
-}
-.goods-right image{
-    width: 16rpx;
-    height: 26rpx;
-}
-.goods-info{
-    margin-top: 10rpx;
-    margin-bottom: 32rpx;
-    margin-right: 56rpx;
-}
-.goods-name{
-    font-size: 11pt;
-    color: #353535;
-}
-.money{
-    margin-top: 20rpx;
-    justify-content:flex-end;
-}
-.original_price{
-    text-decoration: line-through;
-    color: #a4a4a4;
-    font-size: 10pt;
-}
-.price{
-    color: #ff4544;
-    font-size: 12.5pt;
-    margin-left: 24rpx;
-}
-.shop-more image{
-    width: 16rpx;
-    height: 26rpx;
-}
-
-.shop{
-    background-color: #ffffff;
-    margin-bottom: 20rpx;
-    padding: 0 24rpx;
-    font-size: 11pt;
-    margin-top: 20rpx;
-}
-.shop-title{
-    height: 72rpx;
-    font-size: 10pt;
-    color: #a4a4a4;
-    border-bottom: 1rpx solid #e2e2e2;
-}
-.shop-info{
-    border-bottom: 1rpx solid #e2e2e2; 
-    padding: 30rpx 0;
-}
-.shop-name{
-    margin-bottom: 20rpx;
-    color: #353535;
-}
-.shop-addres,.shop-time{
-    color: #999999;
-}
-.all-shop{
-    color: #00a0e9;
-    height: 80rpx;
-}
-.order{
-    background-color: #fff;
-    padding: 0 24rpx;
-    margin-top: 24rpx;
-}
-.order-title{
-    font-size: 10pt;
-    color: #a4a4a4;
-    height: 72rpx;
-    border-bottom: 1rpx solid #e2e2e2;
-    margin-bottom: 30rpx;
-}
-.order-info{
-    font-size: 11pt;
-    color: #353535;
-    line-height: 1.5;
-}
-.order-info-item{
-    padding-bottom: 16rpx;  
-}
-
-.btn-group{
-    border-top: 1rpx solid #e2e2e2;
-    padding: 24rpx;
-    justify-content:flex-end;
-    background-color:#fff;
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    width: 100%; 
-}
-.btn-group-item{
-    font-size: 30rpx;
-    height: 60rpx;
-    width: 180rpx;
-    border-radius: 30rpx;
-    margin-left: 16rpx;
-    line-height: 60rpx;
-}
-.btn-group-item.apply{
-    border: 1rpx solid #c9c9c9;
-    color: #666666;
-    background-color:#fff; 
-}
-.btn-group-item.promptly{
-    border: 1rpx solid #ff4545;
-    color: #ff4544;
-    background-color: #fff5f5;
-}
-
-.hide{
-  display: none;
-}
-.modal{
-  position: fixed;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-  background-color: rgba(0, 0, 0, 0.5);
-  z-index: 9999;
+/* pages/book/order/details.wxss */
+.goods{
+    padding: 24rpx;
+    background-color: #fff;
+}
+.goods-pic{
+    margin-right: 24rpx;
+}
+.goods-pic image{
+    width: 208rpx;
+    height: 160rpx;
+}
+.goods-right image{
+    width: 16rpx;
+    height: 26rpx;
+}
+.goods-info{
+    margin-top: 10rpx;
+    margin-bottom: 32rpx;
+    margin-right: 56rpx;
+}
+.goods-name{
+    font-size: 11pt;
+    color: #353535;
+}
+.money{
+    margin-top: 20rpx;
+    justify-content:flex-end;
+}
+.original_price{
+    text-decoration: line-through;
+    color: #a4a4a4;
+    font-size: 10pt;
+}
+.price{
+    color: #ff4544;
+    font-size: 12.5pt;
+    margin-left: 24rpx;
+}
+.shop-more image{
+    width: 16rpx;
+    height: 26rpx;
+}
+
+.shop{
+    background-color: #ffffff;
+    margin-bottom: 20rpx;
+    padding: 0 24rpx;
+    font-size: 11pt;
+    margin-top: 20rpx;
+}
+.shop-title{
+    height: 72rpx;
+    font-size: 10pt;
+    color: #a4a4a4;
+    border-bottom: 1rpx solid #e2e2e2;
+}
+.shop-info{
+    border-bottom: 1rpx solid #e2e2e2; 
+    padding: 30rpx 0;
+}
+.shop-name{
+    margin-bottom: 20rpx;
+    color: #353535;
+}
+.shop-addres,.shop-time{
+    color: #999999;
+}
+.all-shop{
+    color: #00a0e9;
+    height: 80rpx;
+}
+.order{
+    background-color: #fff;
+    padding: 0 24rpx;
+    margin-top: 24rpx;
+}
+.order-title{
+    font-size: 10pt;
+    color: #a4a4a4;
+    height: 72rpx;
+    border-bottom: 1rpx solid #e2e2e2;
+    margin-bottom: 30rpx;
+}
+.order-info{
+    font-size: 11pt;
+    color: #353535;
+    line-height: 1.5;
+}
+.order-info-item{
+    padding-bottom: 16rpx;  
+}
+
+.btn-group{
+    border-top: 1rpx solid #e2e2e2;
+    padding: 24rpx;
+    justify-content:flex-end;
+    background-color:#fff;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%; 
+}
+.btn-group-item{
+    font-size: 30rpx;
+    height: 60rpx;
+    width: 180rpx;
+    border-radius: 30rpx;
+    margin-left: 16rpx;
+    line-height: 60rpx;
+}
+.btn-group-item.apply{
+    border: 1rpx solid #c9c9c9;
+    color: #666666;
+    background-color:#fff; 
+}
+.btn-group-item.promptly{
+    border: 1rpx solid #ff4545;
+    color: #ff4544;
+    background-color: #fff5f5;
+}
+
+.hide{
+  display: none;
+}
+.modal{
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.5);
+  z-index: 9999;
 }

+ 160 - 160
wechat/pages/book/comment/comment.js

xqd
@@ -1,161 +1,161 @@
-// pages/pt/comment/comment.js
-var api = require('../../../api.js');
-var app = getApp();
-var is_no_more = false;
-var is_loading = false;
-var p = 2;
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-  
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-        app.pageOnLoad(this);
-        is_no_more = false;
-        is_loading = false;
-        p = 2;
-        var page = this;
-        page.setData({
-            gid: options.id,
-        });
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        app.request({
-            url: api.group.comment,
-            data: {
-                gid: options.id,
-            },
-            success: function (res) {
-                wx.hideLoading();
-                if (res.code == 1) {
-                    wx.showModal({
-                        title: "提示",
-                        content: res.msg,
-                        showCancel: false,
-                        success: function (e) {
-                            if (e.confirm) {
-                                wx.navigateBack();
-                            }
-                        }
-                    });
-                }
-
-                if (res.code == 0) {
-                    if (res.data.comment.length==0){
-                        wx.showModal({
-                            title: "提示",
-                            content: '暂无评价',
-                            showCancel: false,
-                            success: function (e) {
-                                if (e.confirm) {
-                                    wx.navigateBack();
-                                }
-                            }
-                        });
-                    }
-                    page.setData({
-                        comment: res.data.comment,
-                    });
-                }
-                page.setData({
-                    show_no_data_tip: (page.data.comment.length == 0),
-                });
-
-            }
-        });
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-  
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-  
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-  
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-  
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-  
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-        var page = this;
-        if (is_loading || is_no_more)
-            return;
-        is_loading = true;
-        app.request({
-            url: api.group.comment,
-            data: {
-                gid: page.data.gid,
-                page: p,
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    var comment = page.data.comment.concat(res.data.comment);
-                    page.setData({
-                        comment: comment,
-                    });
-                    if (res.data.comment.length == 0) {
-                        is_no_more = true;
-                    }
-                }
-                p++;
-            },
-            complete: function () {
-                is_loading = false;
-            }
-        });
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-  
-  } ,
-  /**
-   * 图片放大
-   */
-  bigToImage: function (e) {
-      var urls = this.data.comment[e.target.dataset.index]['pic_list'];
-      wx.previewImage({
-          current: e.target.dataset.url, // 当前显示图片的http链接
-          urls: urls // 需要预览的图片http链接列表
-      })
-  }
+// pages/pt/comment/comment.js
+var api = require('../../../api.js');
+var app = getApp();
+var is_no_more = false;
+var is_loading = false;
+var p = 2;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+        app.pageOnLoad(this);
+        is_no_more = false;
+        is_loading = false;
+        p = 2;
+        var page = this;
+        page.setData({
+            gid: options.id,
+        });
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        app.request({
+            url: api.group.comment,
+            data: {
+                gid: options.id,
+            },
+            success: function (res) {
+                wx.hideLoading();
+                if (res.code == 1) {
+                    wx.showModal({
+                        title: "提示",
+                        content: res.msg,
+                        showCancel: false,
+                        success: function (e) {
+                            if (e.confirm) {
+                                wx.navigateBack();
+                            }
+                        }
+                    });
+                }
+
+                if (res.code == 0) {
+                    if (res.data.comment.length==0){
+                        wx.showModal({
+                            title: "提示",
+                            content: '暂无评价',
+                            showCancel: false,
+                            success: function (e) {
+                                if (e.confirm) {
+                                    wx.navigateBack();
+                                }
+                            }
+                        });
+                    }
+                    page.setData({
+                        comment: res.data.comment,
+                    });
+                }
+                page.setData({
+                    show_no_data_tip: (page.data.comment.length == 0),
+                });
+
+            }
+        });
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+        var page = this;
+        if (is_loading || is_no_more)
+            return;
+        is_loading = true;
+        app.request({
+            url: api.group.comment,
+            data: {
+                gid: page.data.gid,
+                page: p,
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    var comment = page.data.comment.concat(res.data.comment);
+                    page.setData({
+                        comment: comment,
+                    });
+                    if (res.data.comment.length == 0) {
+                        is_no_more = true;
+                    }
+                }
+                p++;
+            },
+            complete: function () {
+                is_loading = false;
+            }
+        });
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+  
+  } ,
+  /**
+   * 图片放大
+   */
+  bigToImage: function (e) {
+      var urls = this.data.comment[e.target.dataset.index]['pic_list'];
+      wx.previewImage({
+          current: e.target.dataset.url, // 当前显示图片的http链接
+          urls: urls // 需要预览的图片http链接列表
+      })
+  }
 })

+ 2 - 2
wechat/pages/book/comment/comment.json

xqd
@@ -1,3 +1,3 @@
-{
-        "navigationBarTitleText": "商品评价"
+{
+        "navigationBarTitleText": "商品评价"
 }

+ 38 - 38
wechat/pages/book/comment/comment.wxml

xqd
@@ -1,38 +1,38 @@
-<!--pages/pt/comment/comment.wxml-->
-<!--     商品评论     -->
-<view class='goods-comment'>
-    <!-- <view  class='goods-comment-title flex-row flex-y-center' bindtap='goToComment'>
-            <view class='comment-left-text flex-grow-1'>
-                买家评论{{comment_num}} | 销量 {{goods.virtual_sales}}
-            </view>
-            <view class='comment-more flex-grow-0'>
-                <image src='/images/img-share-right.png'></image>
-            </view>
-    </view> -->
-    <view class='goods-comment-item flex-col' wx:for='{{comment}}' wx:for-index='ckey'>
-            <view class='goods-comment-user flex-grow-0 flex-row flex-y-center'>
-                <view class='comment-user-pic flex-grow-0'>
-                    <image src='{{item.avatar_url}}'></image>
-                </view>
-                <view class='comment-user-name flex-grow-0'>
-                    {{item.nickname}}
-                </view>
-            </view>
-            <view class='goods-comment-conent flex-grow-1'>
-                {{item.content}}
-            </view>
-            <view class='goods-comment-ginfo'>
-                    {{item.addtime}}
-                    <block wx:for='{{item.attr}}' wx:for-item="attr">
-                        {{attr.attr_group_name}}:{{attr.attr_name}}
-                    </block>
-            </view>
-            <view class='goods-comment-piclist'>
-                <block wx:for='{{item.pic_list}}' wx:for-item="pic" >
-                    <view class='comment-pic-shell'>
-                        <image bindtap='bigToImage' data-url='{{pic}}' data-index='{{ckey}}' src='{{pic}}'></image>
-                    </view>
-                </block>
-            </view>
-    </view>
-</view>
+<!--pages/pt/comment/comment.wxml-->
+<!--     商品评论     -->
+<view class='goods-comment'>
+    <!-- <view  class='goods-comment-title flex-row flex-y-center' bindtap='goToComment'>
+            <view class='comment-left-text flex-grow-1'>
+                买家评论{{comment_num}} | 销量 {{goods.virtual_sales}}
+            </view>
+            <view class='comment-more flex-grow-0'>
+                <image src='/images/img-share-right.png'></image>
+            </view>
+    </view> -->
+    <view class='goods-comment-item flex-col' wx:for='{{comment}}' wx:for-index='ckey'>
+            <view class='goods-comment-user flex-grow-0 flex-row flex-y-center'>
+                <view class='comment-user-pic flex-grow-0'>
+                    <image src='{{item.avatar_url}}'></image>
+                </view>
+                <view class='comment-user-name flex-grow-0'>
+                    {{item.nickname}}
+                </view>
+            </view>
+            <view class='goods-comment-conent flex-grow-1'>
+                {{item.content}}
+            </view>
+            <view class='goods-comment-ginfo'>
+                    {{item.addtime}}
+                    <block wx:for='{{item.attr}}' wx:for-item="attr">
+                        {{attr.attr_group_name}}:{{attr.attr_name}}
+                    </block>
+            </view>
+            <view class='goods-comment-piclist'>
+                <block wx:for='{{item.pic_list}}' wx:for-item="pic" >
+                    <view class='comment-pic-shell'>
+                        <image bindtap='bigToImage' data-url='{{pic}}' data-index='{{ckey}}' src='{{pic}}'></image>
+                    </view>
+                </block>
+            </view>
+    </view>
+</view>

+ 54 - 54
wechat/pages/book/comment/comment.wxss

xqd
@@ -1,55 +1,55 @@
-/* pages/pt/comment/comment.wxss */
-page{
-    /* border-top: 1rpx solid #e2e2e2; */
-}
-.goods-comment{
-    padding: 0 24rpx;
-    background-color: #ffffff;
-}
-.goods-comment-title{
-    height: 80rpx;
-    font-size: 9pt;
-    color: #919191;
-}
-.comment-user-pic image{
-    width: 66rpx;
-    height: 66rpx;
-    border-radius: 33rpx;
-    margin-right: 20rpx;
-}
-.goods-comment-item{
-    border-top: 1rpx solid #e2e2e2;
-    padding-bottom: 36rpx;
-}
-.goods-comment-user{
-    margin-top: 32rpx;
-}
-.comment-user-name{
-    font-size: 11pt;
-    color: #353535;
-}
-.goods-comment-conent{
-    font-size: 10pt;
-    color: #353535;
-    margin: 20rpx 0;
-    line-height:1.3;
-}
-.goods-comment-ginfo{
-    font-size: 9pt;
-    color: #919191;
-    margin-bottom:16rpx; 
-}
-/* .goods-comment-piclist image{
-    width: 160rpx;
-    height: 160rpx;
-    border-radius: 4rpx;
-    margin-right: 16rpx;
-} */
-.comment-pic-shell{
-    width: 160rpx;
-    height: 160rpx;
-    border-radius: 4rpx;
-    margin-right: 16rpx;
-    overflow: hidden;
-    display: inline-block;
+/* pages/pt/comment/comment.wxss */
+page{
+    /* border-top: 1rpx solid #e2e2e2; */
+}
+.goods-comment{
+    padding: 0 24rpx;
+    background-color: #ffffff;
+}
+.goods-comment-title{
+    height: 80rpx;
+    font-size: 9pt;
+    color: #919191;
+}
+.comment-user-pic image{
+    width: 66rpx;
+    height: 66rpx;
+    border-radius: 33rpx;
+    margin-right: 20rpx;
+}
+.goods-comment-item{
+    border-top: 1rpx solid #e2e2e2;
+    padding-bottom: 36rpx;
+}
+.goods-comment-user{
+    margin-top: 32rpx;
+}
+.comment-user-name{
+    font-size: 11pt;
+    color: #353535;
+}
+.goods-comment-conent{
+    font-size: 10pt;
+    color: #353535;
+    margin: 20rpx 0;
+    line-height:1.3;
+}
+.goods-comment-ginfo{
+    font-size: 9pt;
+    color: #919191;
+    margin-bottom:16rpx; 
+}
+/* .goods-comment-piclist image{
+    width: 160rpx;
+    height: 160rpx;
+    border-radius: 4rpx;
+    margin-right: 16rpx;
+} */
+.comment-pic-shell{
+    width: 160rpx;
+    height: 160rpx;
+    border-radius: 4rpx;
+    margin-right: 16rpx;
+    overflow: hidden;
+    display: inline-block;
 }

+ 388 - 388
wechat/pages/book/details/details.js

xqd
@@ -1,389 +1,389 @@
- // pages/book/details/details.js
-var api = require('../../../api.js');
-var utils = require('../../../utils.js');
-var app = getApp();
-var WxParse = require('../../../wxParse/wxParse.js');
-var p = 1;
-var is_loading_comment = false;
-var is_more_comment = true;
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        tab_detail: "active",
-        tab_comment: "",
-        comment_list: [],
-        comment_count: {
-            score_all: 0,
-            score_3: 0,
-            score_2: 0,
-            score_1: 0,
-        },
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-
-        var parent_id = 0;
-        var user_id = options.user_id;
-        console.log("options=>" + JSON.stringify(options));
-        var scene = decodeURIComponent(options.scene);
-        if (user_id != undefined) {
-            parent_id = user_id;
-        } else if (scene != undefined) {
-            console.log("scene string=>" + scene);
-            var scene_obj = utils.scene_decode(scene);
-            console.log("scene obj=>" + JSON.stringify(scene_obj));
-            if (scene_obj.uid && scene_obj.gid) {
-                parent_id = scene_obj.uid;
-                options.id = scene_obj.gid;
-            } else {
-                parent_id = scene;
-            }
-        }
-        app.loginBindParent({ parent_id: parent_id });
-
-        this.setData({
-            id: options.id,
-        });
-        p = 1;
-        this.getGoodsInfo(options);
-        this.getCommentList(false);
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        app.pageOnShow(this);
-        
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-    
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-    
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-        var page = this;
-        page.getCommentList(true);
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function () {
-        var page = this;
-        var user_info = wx.getStorageSync("user_info");
-        return {
-            title: page.data.goods.name,
-            path: '/pages/book/details/details?id=' + page.data.goods.id + '&user_id='+ user_info.id,
-            imageUrl: page.data.goods.cover_pic,
-            success: function (res) {
-                // 转发成功
-            }
-        }
-    },
-    /**
-     * 获取商品详情
-     */
-    getGoodsInfo: function (e) {
-        var gid = e.id;
-        var page = this;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        // wx.showNavigationBarLoading();
-        app.request({
-            url: api.book.details,
-            method: "get",
-            data: { gid: gid },
-            success: function (res) {
-                if (res.code == 0) {
-                    var detail = res.data.info.detail;
-                    WxParse.wxParse("detail", "html", detail, page);
-                    // wx.setNavigationBarTitle({
-                    //     title: res.data.info.name,
-                    // })
-                    // wx.hideNavigationBarLoading();
-                    var sales = (parseInt(res.data.info.virtual_sales) + parseInt(res.data.info.sales));
-                    page.setData({
-                        goods: res.data.info,
-                        shop:res.data.shopList,
-                        sales: sales,
-                    });
-                } else {
-                    wx.showModal({
-                        title: '提示',
-                        content: res.msg,
-                        showCancel: false,
-                        success: function (res) {
-                            if (res.confirm) {
-                                wx.redirectTo({
-                                    url: '/pages/book/index/index'
-                                });
-                            }
-                        }
-                    });
-                }
-            },
-            complete: function (res) {
-                setTimeout(function () {
-                    // 延长一秒取消加载动画
-                    wx.hideLoading();
-                }, 1000);
-            }
-        });
-    },
-
-    tabSwitch: function (e) {
-        var page = this;
-        var tab = e.currentTarget.dataset.tab;
-        if (tab == "detail") {
-            page.setData({
-                tab_detail: "active",
-                tab_comment: "",
-            });
-        } else {
-            page.setData({
-                tab_detail: "",
-                tab_comment: "active",
-            });
-        }
-    },
-    commentPicView: function (e) {
-        console.log(e);
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var pic_index = e.currentTarget.dataset.picIndex;
-        wx.previewImage({
-            current: page.data.comment_list[index].pic_list[pic_index],
-            urls: page.data.comment_list[index].pic_list,
-        });
-    },
-    /**
-     * 立即预约
-     */
-    bespeakNow:function(e){
-        wx.redirectTo({
-            url: '/pages/book/submit/submit?id=' + this.data.goods.id,
-        });
-    },
-    /**
-     * 门店列表
-     */
-    goToShopList: function (e) {
-        wx.navigateTo({
-            url: '/pages/book/shop/shop?ids=' + this.data.goods.shop_id,
-            success: function(res) {},
-            fail: function(res) {},
-            complete: function(res) {},
-        });
-    },
-    /**
-     * 获取评论列表
-     */
-    getCommentList: function (more) {
-        console.log(more);
-        var page = this;
-        if (more && page.data.tab_comment != "active")
-            return;
-        if (is_loading_comment)
-            return;
-        if (!is_more_comment)
-            return;
-        is_loading_comment = true;
-        app.request({
-            url: api.book.goods_comment,
-            data: {
-                goods_id: page.data.id,
-                page: p,
-            },
-            success: function (res) {
-                if (res.code != 0)
-                    return;
-                is_loading_comment = false;
-                p++;
-                console.log(res.data.list);
-                page.setData({
-                    comment_count: res.data.comment_count,
-                    comment_list: more ? page.data.comment_list.concat(res.data.list) : res.data.list,
-                });
-                if (res.data.list.length == 0)
-                    is_more_comment = false;
-            }
-        });
-    },
-    showShareModal: function () {
-        var page = this;
-        page.setData({
-            share_modal_active: "active",
-            no_scroll: true,
-        });
-    },
-
-    shareModalClose: function () {
-        var page = this;
-        page.setData({
-            share_modal_active: "",
-            no_scroll: false,
-        });
-    },
-    getGoodsQrcode: function () {
-        var page = this;
-        page.setData({
-            goods_qrcode_active: "active",
-            share_modal_active: "",
-        });
-        if (page.data.goods_qrcode)
-            return true;
-        app.request({
-            url: api.book.goods_qrcode,
-            data: {
-                goods_id: page.data.id,
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    page.setData({
-                        goods_qrcode: res.data.pic_url,
-                    });
-                }
-                if (res.code == 1) {
-                    page.goodsQrcodeClose();
-                    wx.showModal({
-                        title: "提示",
-                        content: res.msg,
-                        showCancel: false,
-                        success: function (res) {
-                            if (res.confirm) {
-
-                            }
-                        }
-                    });
-                }
-            },
-        });
-    },
-    goodsQrcodeClose: function () {
-        var page = this;
-        page.setData({
-            goods_qrcode_active: "",
-            no_scroll: false,
-        });
-    },
-    goodsQrcodeClose: function () {
-        var page = this;
-        page.setData({
-            goods_qrcode_active: "",
-            no_scroll: false,
-        });
-    },
-
-    saveGoodsQrcode: function () {
-        var page = this;
-        if (!wx.saveImageToPhotosAlbum) {
-            // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
-            wx.showModal({
-                title: '提示',
-                content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。',
-                showCancel: false,
-            });
-            return;
-        }
-
-        wx.showLoading({
-            title: "正在保存图片",
-            mask: false,
-        });
-
-        wx.downloadFile({
-            url: page.data.goods_qrcode,
-            success: function (e) {
-                wx.showLoading({
-                    title: "正在保存图片",
-                    mask: false,
-                });
-                wx.saveImageToPhotosAlbum({
-                    filePath: e.tempFilePath,
-                    success: function () {
-                        wx.showModal({
-                            title: '提示',
-                            content: '商品海报保存成功',
-                            showCancel: false,
-                        });
-                    },
-                    fail: function (e) {
-                        wx.showModal({
-                            title: '图片保存失败',
-                            content: e.errMsg,
-                            showCancel: false,
-                        });
-                    },
-                    complete: function (e) {
-                        console.log(e);
-                        wx.hideLoading();
-                    }
-                });
-            },
-            fail: function (e) {
-                wx.showModal({
-                    title: '图片下载失败',
-                    content: e.errMsg + ";" + page.data.goods_qrcode,
-                    showCancel: false,
-                });
-            },
-            complete: function (e) {
-                console.log(e);
-                wx.hideLoading();
-            }
-        });
-
-    },
-
-    goodsQrcodeClick: function (e) {
-        var src = e.currentTarget.dataset.src;
-        wx.previewImage({
-            urls: [src],
-        });
-    },
-    goHome:function(e){
-        wx.redirectTo({
-            url: '/pages/book/index/index',
-            success: function(res) {},
-            fail: function(res) {},
-            complete: function(res) {},
-        })
-    }
+ // pages/book/details/details.js
+var api = require('../../../api.js');
+var utils = require('../../../utils.js');
+var app = getApp();
+var WxParse = require('../../../wxParse/wxParse.js');
+var p = 1;
+var is_loading_comment = false;
+var is_more_comment = true;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        tab_detail: "active",
+        tab_comment: "",
+        comment_list: [],
+        comment_count: {
+            score_all: 0,
+            score_3: 0,
+            score_2: 0,
+            score_1: 0,
+        },
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+
+        var parent_id = 0;
+        var user_id = options.user_id;
+        console.log("options=>" + JSON.stringify(options));
+        var scene = decodeURIComponent(options.scene);
+        if (user_id != undefined) {
+            parent_id = user_id;
+        } else if (scene != undefined) {
+            console.log("scene string=>" + scene);
+            var scene_obj = utils.scene_decode(scene);
+            console.log("scene obj=>" + JSON.stringify(scene_obj));
+            if (scene_obj.uid && scene_obj.gid) {
+                parent_id = scene_obj.uid;
+                options.id = scene_obj.gid;
+            } else {
+                parent_id = scene;
+            }
+        }
+        app.loginBindParent({ parent_id: parent_id });
+
+        this.setData({
+            id: options.id,
+        });
+        p = 1;
+        this.getGoodsInfo(options);
+        this.getCommentList(false);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        app.pageOnShow(this);
+        
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+    
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+    
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+        var page = this;
+        page.getCommentList(true);
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+        var page = this;
+        var user_info = wx.getStorageSync("user_info");
+        return {
+            title: page.data.goods.name,
+            path: '/pages/book/details/details?id=' + page.data.goods.id + '&user_id='+ user_info.id,
+            imageUrl: page.data.goods.cover_pic,
+            success: function (res) {
+                // 转发成功
+            }
+        }
+    },
+    /**
+     * 获取商品详情
+     */
+    getGoodsInfo: function (e) {
+        var gid = e.id;
+        var page = this;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        // wx.showNavigationBarLoading();
+        app.request({
+            url: api.book.details,
+            method: "get",
+            data: { gid: gid },
+            success: function (res) {
+                if (res.code == 0) {
+                    var detail = res.data.info.detail;
+                    WxParse.wxParse("detail", "html", detail, page);
+                    // wx.setNavigationBarTitle({
+                    //     title: res.data.info.name,
+                    // })
+                    // wx.hideNavigationBarLoading();
+                    var sales = (parseInt(res.data.info.virtual_sales) + parseInt(res.data.info.sales));
+                    page.setData({
+                        goods: res.data.info,
+                        shop:res.data.shopList,
+                        sales: sales,
+                    });
+                } else {
+                    wx.showModal({
+                        title: '提示',
+                        content: res.msg,
+                        showCancel: false,
+                        success: function (res) {
+                            if (res.confirm) {
+                                wx.redirectTo({
+                                    url: '/pages/book/index/index'
+                                });
+                            }
+                        }
+                    });
+                }
+            },
+            complete: function (res) {
+                setTimeout(function () {
+                    // 延长一秒取消加载动画
+                    wx.hideLoading();
+                }, 1000);
+            }
+        });
+    },
+
+    tabSwitch: function (e) {
+        var page = this;
+        var tab = e.currentTarget.dataset.tab;
+        if (tab == "detail") {
+            page.setData({
+                tab_detail: "active",
+                tab_comment: "",
+            });
+        } else {
+            page.setData({
+                tab_detail: "",
+                tab_comment: "active",
+            });
+        }
+    },
+    commentPicView: function (e) {
+        console.log(e);
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var pic_index = e.currentTarget.dataset.picIndex;
+        wx.previewImage({
+            current: page.data.comment_list[index].pic_list[pic_index],
+            urls: page.data.comment_list[index].pic_list,
+        });
+    },
+    /**
+     * 立即预约
+     */
+    bespeakNow:function(e){
+        wx.redirectTo({
+            url: '/pages/book/submit/submit?id=' + this.data.goods.id,
+        });
+    },
+    /**
+     * 门店列表
+     */
+    goToShopList: function (e) {
+        wx.navigateTo({
+            url: '/pages/book/shop/shop?ids=' + this.data.goods.shop_id,
+            success: function(res) {},
+            fail: function(res) {},
+            complete: function(res) {},
+        });
+    },
+    /**
+     * 获取评论列表
+     */
+    getCommentList: function (more) {
+        console.log(more);
+        var page = this;
+        if (more && page.data.tab_comment != "active")
+            return;
+        if (is_loading_comment)
+            return;
+        if (!is_more_comment)
+            return;
+        is_loading_comment = true;
+        app.request({
+            url: api.book.goods_comment,
+            data: {
+                goods_id: page.data.id,
+                page: p,
+            },
+            success: function (res) {
+                if (res.code != 0)
+                    return;
+                is_loading_comment = false;
+                p++;
+                console.log(res.data.list);
+                page.setData({
+                    comment_count: res.data.comment_count,
+                    comment_list: more ? page.data.comment_list.concat(res.data.list) : res.data.list,
+                });
+                if (res.data.list.length == 0)
+                    is_more_comment = false;
+            }
+        });
+    },
+    showShareModal: function () {
+        var page = this;
+        page.setData({
+            share_modal_active: "active",
+            no_scroll: true,
+        });
+    },
+
+    shareModalClose: function () {
+        var page = this;
+        page.setData({
+            share_modal_active: "",
+            no_scroll: false,
+        });
+    },
+    getGoodsQrcode: function () {
+        var page = this;
+        page.setData({
+            goods_qrcode_active: "active",
+            share_modal_active: "",
+        });
+        if (page.data.goods_qrcode)
+            return true;
+        app.request({
+            url: api.book.goods_qrcode,
+            data: {
+                goods_id: page.data.id,
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    page.setData({
+                        goods_qrcode: res.data.pic_url,
+                    });
+                }
+                if (res.code == 1) {
+                    page.goodsQrcodeClose();
+                    wx.showModal({
+                        title: "提示",
+                        content: res.msg,
+                        showCancel: false,
+                        success: function (res) {
+                            if (res.confirm) {
+
+                            }
+                        }
+                    });
+                }
+            },
+        });
+    },
+    goodsQrcodeClose: function () {
+        var page = this;
+        page.setData({
+            goods_qrcode_active: "",
+            no_scroll: false,
+        });
+    },
+    goodsQrcodeClose: function () {
+        var page = this;
+        page.setData({
+            goods_qrcode_active: "",
+            no_scroll: false,
+        });
+    },
+
+    saveGoodsQrcode: function () {
+        var page = this;
+        if (!wx.saveImageToPhotosAlbum) {
+            // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
+            wx.showModal({
+                title: '提示',
+                content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。',
+                showCancel: false,
+            });
+            return;
+        }
+
+        wx.showLoading({
+            title: "正在保存图片",
+            mask: false,
+        });
+
+        wx.downloadFile({
+            url: page.data.goods_qrcode,
+            success: function (e) {
+                wx.showLoading({
+                    title: "正在保存图片",
+                    mask: false,
+                });
+                wx.saveImageToPhotosAlbum({
+                    filePath: e.tempFilePath,
+                    success: function () {
+                        wx.showModal({
+                            title: '提示',
+                            content: '商品海报保存成功',
+                            showCancel: false,
+                        });
+                    },
+                    fail: function (e) {
+                        wx.showModal({
+                            title: '图片保存失败',
+                            content: e.errMsg,
+                            showCancel: false,
+                        });
+                    },
+                    complete: function (e) {
+                        console.log(e);
+                        wx.hideLoading();
+                    }
+                });
+            },
+            fail: function (e) {
+                wx.showModal({
+                    title: '图片下载失败',
+                    content: e.errMsg + ";" + page.data.goods_qrcode,
+                    showCancel: false,
+                });
+            },
+            complete: function (e) {
+                console.log(e);
+                wx.hideLoading();
+            }
+        });
+
+    },
+
+    goodsQrcodeClick: function (e) {
+        var src = e.currentTarget.dataset.src;
+        wx.previewImage({
+            urls: [src],
+        });
+    },
+    goHome:function(e){
+        wx.redirectTo({
+            url: '/pages/book/index/index',
+            success: function(res) {},
+            fail: function(res) {},
+            complete: function(res) {},
+        })
+    }
 })

+ 2 - 2
wechat/pages/book/details/details.json

xqd
@@ -1,3 +1,3 @@
-{
-    "navigationBarTitleText": "预约"
+{
+    "navigationBarTitleText": "预约"
 }

+ 249 - 249
wechat/pages/book/details/details.wxml

xqd
@@ -1,250 +1,250 @@
-<!--pages/book/details/details.wxml-->
-<view class='{{show_attr_picker?"no-scroll":""}}'>
-    <swiper class="goods-image-swiper" autoplay="{{autoplay}}" interval="5000" duration="300" indicator-dots="true"
-            circular="true" bindchange="hide" indicator-active-color="#ff5c5c">
-        <block wx:for="{{goods.pic_list}}">
-            <swiper-item>
-                <block wx:if="{{goods.video_url}}">
-                    <!-- <view style='width:750rpx;height:700rpx;position:absolute;top:0;left:0;'> -->
-                    <image class="play {{img_hide}}" src="/images/video-play.png" data-url="{{goods.video_url}}"
-                            bindtap="play"></image>
-                    <!-- </view> -->
-                </block>
-                <image bindtap="onGoodsImageClick" data-index="{{index}}" class="goods-image" src="{{item}}"
-                        mode="aspectFill"/>
-            </swiper-item>
-        </block>
-    </swiper>
-
-    <view class='flex-row goods-name'>
-        {{goods.name}}
-    </view>
-    <view class='flex-row goods-money'>
-        <view class='flex-grow-1 flex-col'>
-            <view class='flex-grow-1 flex-row'>
-                <view class='flex-grow-0 flex-row flex-y-bottom'>
-                    
-                    <view class='flex-grow-0 flex-y-bottom' wx:if='{{goods.price>=0.01}}'>
-                        ¥
-                    </view>
-                    <view class='flex-grow-1flex-y-bottom goods-money-num' wx:if='{{goods.price>=0.01}}'>
-                        {{goods.price}}
-                    </view>
-                    <view class='flex-grow-1flex-y-bottom goods-money-num' wx:if='{{goods.price<0.01}}'>
-                        免费
-                    </view>
-                </view>
-                <view class='flex-grow-1 original-price-title flex-row flex-y-bottom'>
-                    原价:
-                    <view class='original-price flex-y-bottom'>
-                            {{goods.original_price}}
-                    </view>
-                </view>  
-            </view>
-            <view class='flex-grow-0 order-deal'>
-                已成交{{sales}}笔
-            </view>
-        </view>
-        <!-- <button class='flex-grow-0 flex-col group-share' open-type="share"> -->
-        <button class='flex-grow-0 flex-col group-share' bindtap='showShareModal'>
-            <view class='flex-grow-0'>
-                <image src='/images/icon-group-share.png'></image>
-            </view>
-            <view class='flex-grow-0 group-share-text'>
-                分享
-            </view>
-        </button>
-    </view>
-
-    <view class='flex-row' style='padding-right:24rpx;background-color:#f7f7f7;' wx:if='{{goods.service.length > 1}}'>
-        <view class='goods-service flex-row flex-gorw-1 flex-y-center' >
-                <view class='service-item flex-y-center' wx:for='{{goods.service}}'>
-                    <image src='/images/ico-pt-active.png'></image>
-                    <view class='flex-grow-1'>
-                        {{item}}
-                    </view>
-                </view>
-        </view>
-    </view>
-    <view class='shop' wx:if="{{goods.shopListNum > 0}}">
-        <view class='shop-title flex-y-center'>
-                门店信息
-        </view>
-        <view class='shop-info'>
-                <view class='shop-name'>
-                    {{shop[0].name}}
-                </view>
-                <view class='shop-addres'>
-                    地址:{{shop[0].address}}
-                </view>
-                <view class='shop-time'>
-                    营业时间:{{shop[0].shop_time?shop[0].shop_time:'7 x 24'}}
-                </view>
-        </view>
-        <view class='all-shop flex-row flex-y-center'  bindtap='goToShopList'>
-                <view class='shop-text flex-grow-1 flex-y-center'>
-                    查看全部{{goods.shopListNum}}家分店
-                </view>
-                <view class='shop-more flex-grow-0 flex-y-center'>
-                    <image src='/images/img-share-right.png'></image>
-                </view>
-        </view>
-    </view>
-
-
-
-
-        <view class="tab-group">
-            <view class="flex-row tab-group-header">
-                <view bindtap="tabSwitch" data-tab="detail"
-                      class="flex-grow-1 flex-x-center tab-group-item {{tab_detail}}">
-                    <text class="flex-y-center">商品详情</text>
-                </view>
-                <view bindtap="tabSwitch" data-tab="comment"
-                      class="flex-grow-1 flex-x-center tab-group-item {{tab_comment}}">
-                    <text class="flex-y-center">评价</text>
-                </view>
-            </view>
-            <view class="tab-group-body">
-                <view class="tab-group-item {{tab_detail}}">
-                    <view class="goods-detail">
-                        <import src="../../../wxParse/wxParse.wxml"/>
-                        <template is="wxParse" data="{{wxParseData:detail.nodes}}"/>
-                    </view>
-                </view>
-                <view class="tab-group-item {{tab_comment}}">
-                    <view class="comment-count flex-row">
-                        <view class="comment-count-item flex-grow-1 flex-x-center flex-col">
-                            <view>全部</view>
-                            <view>({{comment_count.score_all>999?'999+':comment_count.score_all}})</view>
-                        </view>
-                        <view class="comment-count-item flex-grow-1 flex-x-center flex-col">
-                            <view>好评</view>
-                            <view>({{comment_count.score_3>999?'999+':comment_count.score_3}})</view>
-                        </view>
-                        <view class="comment-count-item flex-grow-1 flex-x-center flex-col">
-                            <view>中评</view>
-                            <view>({{comment_count.score_2>999?'999+':comment_count.score_2}})</view>
-                        </view>
-                        <view class="comment-count-item flex-grow-1 flex-x-center flex-col">
-                            <view>差评</view>
-                            <view>({{comment_count.score_1>999?'999+':comment_count.score_1}})</view>
-                        </view>
-                    </view>
-                    <view class="comment-list">
-                        <view class="comment-item flex-row" wx:for="{{comment_list}}">
-                            <view class="flex-grow-0" style="overflow: visible">
-                                <image src="{{item.avatar_url}}"
-                                       style="width: 70rpx;height: 70rpx;border-radius: 1000rpx"
-                                       mode="aspectFill"></image>
-                            </view>
-                            <view class="flex-grow-1">
-                                <view class="flex-row mb-20">
-                                    <view class="flex-grow-1 flex-y-center nickname">{{item.nickname}}</view>
-                                    <view class="flex-grow-0 flex-y-center addtime">{{item.addtime}}</view>
-                                </view>
-                                <!--
-                                <view class="mb-20" wx:if="{{item.score==3}}">
-                                    <text class="score-tag">好评</text>
-                                </view>
-                                <view class="mb-20" wx:if="{{item.score==2}}">
-                                    <text class="score-tag">中评</text>
-                                </view>
-                                <view class="mb-20" wx:if="{{item.score==1}}">
-                                    <text class="score-tag">差评</text>
-                                </view>
-                                -->
-                                <view class="mb-20">{{item.content}}</view>
-                                <view class="pic-list" wx:if="{{item.pic_list&&item.pic_list.length>0}}">
-                                    <image bindtap="commentPicView" wx:for="{{item.pic_list}}"
-                                           wx:for-index="{{pic_index}}" data-index="{{index}}"
-                                           data-pic-index="{{pic_index}}" src="{{item}}" mode="aspectFill"
-                                           class="pic-item"></image>
-                                </view>
-                            </view>
-                        </view>
-                    </view>
-
-
-                </view>
-            </view>
-        </view>
-
-
-
-     <view class='pt-goods-footer flex-row'>
-        <button class='flex-grow-0 flex-col flex-y-center flex-x-center goods-footer-icon' open-type="contact">
-            <view class='flex-gorw-0 flex-x-center'>
-                <image src='/images/icon-user-kf.png'></image>
-            </view>
-            <view class='flex-gorw-0 flex-x-center'>
-                客服
-            </view>
-        </button>
-        <view class='flex-grow-0 flex-col flex-y-center flex-x-center goods-footer-icon' bindtap='goHome'>
-            <view class='flex-gorw-0 flex-x-center'>
-                <image src='/images/pt-go-home.png'></image>
-            </view>
-            <view class='flex-gorw-0 flex-x-center'>
-                首页
-            </view>
-        </view>
-        <view class='flex-grow-1 flex-y-center flex-x-center group-buy' bindtap="bespeakNow" style='{{goods.is_only==1?"width: 338rpx":""}}'>
-               立即预约
-        </view>
-    </view> 
-</view>
-
-<view class="share-modal {{share_modal_active}}">
-    <view class="share-modal-body">
-        <view class="flex-row">
-            <view class="flex-grow-1 flex-x-center">
-                <button open-type="share" class="share-bottom">
-                    <image src="/images/icon-share-friend.png"></image>
-                    <view>分享给朋友</view>
-                </button>
-            </view>
-            <view class="flex-grow-1 flex-x-center">
-                <view bindtap="getGoodsQrcode" class="share-bottom">
-                    <image src="/images/icon-share-qrcode.png"></image>
-                    <view>生成商品海报</view>
-                </view>
-            </view>
-        </view>
-        <view bindtap="shareModalClose" class="share-modal-close flex-y-center flex-x-center">关闭</view>
-    </view>
-</view>
-
-<view class="goods-qrcode-modal {{goods_qrcode_active}}">
-    <view class="goods-qrcode-body flex-col">
-        <view class="flex-grow-1" style="position: relative">
-            <view style="position: absolute;left: 0;top:0;width: 100%;height: 100%;padding: 100rpx 100rpx 60rpx">
-                <view class="goods-qrcode-box">
-                    <view class="goods-qrcode-loading flex-x-center flex-y-center">
-                        <view class="flex-x-center flex-col">
-                            <image style="width: 150rpx;height: 150rpx" src="/images/loading2.svg"></image>
-                            <view style="color: #888">海报生成中</view>
-                        </view>
-                    </view>
-                    <image bindtap="goodsQrcodeClick"
-                           mode="aspectFill"
-                           class="goods-qrcode {{goods_qrcode?'active':''}}"
-                           data-src="{{goods_qrcode}}"
-                           src="{{goods_qrcode}}"></image>
-                </view>
-            </view>
-        </view>
-        <view class="flex-grow-0 flex-col flex-x-center" style="padding: 0 60rpx 80rpx">
-            <view style="margin-bottom: 20rpx;padding: 0 40rpx">
-                <button wx:if="{{goods_qrcode}}" bindtap="saveGoodsQrcode" style="background: #ff4544;color: #fff;">
-                    保存图片
-                </button>
-                <button wx:else style="opacity: .4">保存图片</button>
-            </view>
-            <view style="color: #888;font-size: 9pt;text-align: center">保存至相册可以分享到朋友圈</view>
-        </view>
-        <view class="goods-qrcode-close" bindtap="goodsQrcodeClose">
-            <image src="/images/icon-close2.png" style="width: 50rpx;height: 50rpx;display: block"></image>
-        </view>
-    </view>
+<!--pages/book/details/details.wxml-->
+<view class='{{show_attr_picker?"no-scroll":""}}'>
+    <swiper class="goods-image-swiper" autoplay="{{autoplay}}" interval="5000" duration="300" indicator-dots="true"
+            circular="true" bindchange="hide" indicator-active-color="#ff5c5c">
+        <block wx:for="{{goods.pic_list}}">
+            <swiper-item>
+                <block wx:if="{{goods.video_url}}">
+                    <!-- <view style='width:750rpx;height:700rpx;position:absolute;top:0;left:0;'> -->
+                    <image class="play {{img_hide}}" src="/images/video-play.png" data-url="{{goods.video_url}}"
+                            bindtap="play"></image>
+                    <!-- </view> -->
+                </block>
+                <image bindtap="onGoodsImageClick" data-index="{{index}}" class="goods-image" src="{{item}}"
+                        mode="aspectFill"/>
+            </swiper-item>
+        </block>
+    </swiper>
+
+    <view class='flex-row goods-name'>
+        {{goods.name}}
+    </view>
+    <view class='flex-row goods-money'>
+        <view class='flex-grow-1 flex-col'>
+            <view class='flex-grow-1 flex-row'>
+                <view class='flex-grow-0 flex-row flex-y-bottom'>
+                    
+                    <view class='flex-grow-0 flex-y-bottom' wx:if='{{goods.price>=0.01}}'>
+                        ¥
+                    </view>
+                    <view class='flex-grow-1flex-y-bottom goods-money-num' wx:if='{{goods.price>=0.01}}'>
+                        {{goods.price}}
+                    </view>
+                    <view class='flex-grow-1flex-y-bottom goods-money-num' wx:if='{{goods.price<0.01}}'>
+                        免费
+                    </view>
+                </view>
+                <view class='flex-grow-1 original-price-title flex-row flex-y-bottom'>
+                    原价:
+                    <view class='original-price flex-y-bottom'>
+                            {{goods.original_price}}
+                    </view>
+                </view>  
+            </view>
+            <view class='flex-grow-0 order-deal'>
+                已成交{{sales}}笔
+            </view>
+        </view>
+        <!-- <button class='flex-grow-0 flex-col group-share' open-type="share"> -->
+        <button class='flex-grow-0 flex-col group-share' bindtap='showShareModal'>
+            <view class='flex-grow-0'>
+                <image src='/images/icon-group-share.png'></image>
+            </view>
+            <view class='flex-grow-0 group-share-text'>
+                分享
+            </view>
+        </button>
+    </view>
+
+    <view class='flex-row' style='padding-right:24rpx;background-color:#f7f7f7;' wx:if='{{goods.service.length > 1}}'>
+        <view class='goods-service flex-row flex-gorw-1 flex-y-center' >
+                <view class='service-item flex-y-center' wx:for='{{goods.service}}'>
+                    <image src='/images/ico-pt-active.png'></image>
+                    <view class='flex-grow-1'>
+                        {{item}}
+                    </view>
+                </view>
+        </view>
+    </view>
+    <view class='shop' wx:if="{{goods.shopListNum > 0}}">
+        <view class='shop-title flex-y-center'>
+                门店信息
+        </view>
+        <view class='shop-info'>
+                <view class='shop-name'>
+                    {{shop[0].name}}
+                </view>
+                <view class='shop-addres'>
+                    地址:{{shop[0].address}}
+                </view>
+                <view class='shop-time'>
+                    营业时间:{{shop[0].shop_time?shop[0].shop_time:'7 x 24'}}
+                </view>
+        </view>
+        <view class='all-shop flex-row flex-y-center'  bindtap='goToShopList'>
+                <view class='shop-text flex-grow-1 flex-y-center'>
+                    查看全部{{goods.shopListNum}}家分店
+                </view>
+                <view class='shop-more flex-grow-0 flex-y-center'>
+                    <image src='/images/img-share-right.png'></image>
+                </view>
+        </view>
+    </view>
+
+
+
+
+        <view class="tab-group">
+            <view class="flex-row tab-group-header">
+                <view bindtap="tabSwitch" data-tab="detail"
+                      class="flex-grow-1 flex-x-center tab-group-item {{tab_detail}}">
+                    <text class="flex-y-center">商品详情</text>
+                </view>
+                <view bindtap="tabSwitch" data-tab="comment"
+                      class="flex-grow-1 flex-x-center tab-group-item {{tab_comment}}">
+                    <text class="flex-y-center">评价</text>
+                </view>
+            </view>
+            <view class="tab-group-body">
+                <view class="tab-group-item {{tab_detail}}">
+                    <view class="goods-detail">
+                        <import src="../../../wxParse/wxParse.wxml"/>
+                        <template is="wxParse" data="{{wxParseData:detail.nodes}}"/>
+                    </view>
+                </view>
+                <view class="tab-group-item {{tab_comment}}">
+                    <view class="comment-count flex-row">
+                        <view class="comment-count-item flex-grow-1 flex-x-center flex-col">
+                            <view>全部</view>
+                            <view>({{comment_count.score_all>999?'999+':comment_count.score_all}})</view>
+                        </view>
+                        <view class="comment-count-item flex-grow-1 flex-x-center flex-col">
+                            <view>好评</view>
+                            <view>({{comment_count.score_3>999?'999+':comment_count.score_3}})</view>
+                        </view>
+                        <view class="comment-count-item flex-grow-1 flex-x-center flex-col">
+                            <view>中评</view>
+                            <view>({{comment_count.score_2>999?'999+':comment_count.score_2}})</view>
+                        </view>
+                        <view class="comment-count-item flex-grow-1 flex-x-center flex-col">
+                            <view>差评</view>
+                            <view>({{comment_count.score_1>999?'999+':comment_count.score_1}})</view>
+                        </view>
+                    </view>
+                    <view class="comment-list">
+                        <view class="comment-item flex-row" wx:for="{{comment_list}}">
+                            <view class="flex-grow-0" style="overflow: visible">
+                                <image src="{{item.avatar_url}}"
+                                       style="width: 70rpx;height: 70rpx;border-radius: 1000rpx"
+                                       mode="aspectFill"></image>
+                            </view>
+                            <view class="flex-grow-1">
+                                <view class="flex-row mb-20">
+                                    <view class="flex-grow-1 flex-y-center nickname">{{item.nickname}}</view>
+                                    <view class="flex-grow-0 flex-y-center addtime">{{item.addtime}}</view>
+                                </view>
+                                <!--
+                                <view class="mb-20" wx:if="{{item.score==3}}">
+                                    <text class="score-tag">好评</text>
+                                </view>
+                                <view class="mb-20" wx:if="{{item.score==2}}">
+                                    <text class="score-tag">中评</text>
+                                </view>
+                                <view class="mb-20" wx:if="{{item.score==1}}">
+                                    <text class="score-tag">差评</text>
+                                </view>
+                                -->
+                                <view class="mb-20">{{item.content}}</view>
+                                <view class="pic-list" wx:if="{{item.pic_list&&item.pic_list.length>0}}">
+                                    <image bindtap="commentPicView" wx:for="{{item.pic_list}}"
+                                           wx:for-index="{{pic_index}}" data-index="{{index}}"
+                                           data-pic-index="{{pic_index}}" src="{{item}}" mode="aspectFill"
+                                           class="pic-item"></image>
+                                </view>
+                            </view>
+                        </view>
+                    </view>
+
+
+                </view>
+            </view>
+        </view>
+
+
+
+     <view class='pt-goods-footer flex-row'>
+        <button class='flex-grow-0 flex-col flex-y-center flex-x-center goods-footer-icon' open-type="contact">
+            <view class='flex-gorw-0 flex-x-center'>
+                <image src='/images/icon-user-kf.png'></image>
+            </view>
+            <view class='flex-gorw-0 flex-x-center'>
+                客服
+            </view>
+        </button>
+        <view class='flex-grow-0 flex-col flex-y-center flex-x-center goods-footer-icon' bindtap='goHome'>
+            <view class='flex-gorw-0 flex-x-center'>
+                <image src='/images/pt-go-home.png'></image>
+            </view>
+            <view class='flex-gorw-0 flex-x-center'>
+                首页
+            </view>
+        </view>
+        <view class='flex-grow-1 flex-y-center flex-x-center group-buy' bindtap="bespeakNow" style='{{goods.is_only==1?"width: 338rpx":""}}'>
+               立即预约
+        </view>
+    </view> 
+</view>
+
+<view class="share-modal {{share_modal_active}}">
+    <view class="share-modal-body">
+        <view class="flex-row">
+            <view class="flex-grow-1 flex-x-center">
+                <button open-type="share" class="share-bottom">
+                    <image src="/images/icon-share-friend.png"></image>
+                    <view>分享给朋友</view>
+                </button>
+            </view>
+            <view class="flex-grow-1 flex-x-center">
+                <view bindtap="getGoodsQrcode" class="share-bottom">
+                    <image src="/images/icon-share-qrcode.png"></image>
+                    <view>生成商品海报</view>
+                </view>
+            </view>
+        </view>
+        <view bindtap="shareModalClose" class="share-modal-close flex-y-center flex-x-center">关闭</view>
+    </view>
+</view>
+
+<view class="goods-qrcode-modal {{goods_qrcode_active}}">
+    <view class="goods-qrcode-body flex-col">
+        <view class="flex-grow-1" style="position: relative">
+            <view style="position: absolute;left: 0;top:0;width: 100%;height: 100%;padding: 100rpx 100rpx 60rpx">
+                <view class="goods-qrcode-box">
+                    <view class="goods-qrcode-loading flex-x-center flex-y-center">
+                        <view class="flex-x-center flex-col">
+                            <image style="width: 150rpx;height: 150rpx" src="/images/loading2.svg"></image>
+                            <view style="color: #888">海报生成中</view>
+                        </view>
+                    </view>
+                    <image bindtap="goodsQrcodeClick"
+                           mode="aspectFill"
+                           class="goods-qrcode {{goods_qrcode?'active':''}}"
+                           data-src="{{goods_qrcode}}"
+                           src="{{goods_qrcode}}"></image>
+                </view>
+            </view>
+        </view>
+        <view class="flex-grow-0 flex-col flex-x-center" style="padding: 0 60rpx 80rpx">
+            <view style="margin-bottom: 20rpx;padding: 0 40rpx">
+                <button wx:if="{{goods_qrcode}}" bindtap="saveGoodsQrcode" style="background: #ff4544;color: #fff;">
+                    保存图片
+                </button>
+                <button wx:else style="opacity: .4">保存图片</button>
+            </view>
+            <view style="color: #888;font-size: 9pt;text-align: center">保存至相册可以分享到朋友圈</view>
+        </view>
+        <view class="goods-qrcode-close" bindtap="goodsQrcodeClose">
+            <image src="/images/icon-close2.png" style="width: 50rpx;height: 50rpx;display: block"></image>
+        </view>
+    </view>
 </view>

+ 523 - 523
wechat/pages/book/details/details.wxss

xqd
@@ -1,524 +1,524 @@
-/* pages/book/details/details.wxss */
-@import "../../../wxParse/wxParse.wxss";
-.goods-image-swiper {
-    height: 700rpx;
-}
-.goods-image {
-    width: 100%;
-    height: 100%;
-}
-.time-limit{
-    height: 88rpx;
-    background-color: #ffa360;
-    background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#ff5527), color-stop(0%,#ff2755));
-    background-image: linear-gradient(140deg, #ffa360, #ff5c5c);
-    padding: 0 24rpx;
-}
-.time-limit image{
-    width: 112rpx;
-    height: 56rpx;
-    margin-right: 20rpx;
-}
-.time-limit-logo-text{
-    font-size: 9pt;
-    color: #ffffff;
-    margin-top: 40rpx;
-}
-.time-top-text{
-    font-size: 7pt;
-    color: #ffeecc;
-}
-.time-info{
-    color: #ffffff;
-    font-size: 9pt;
-    line-height: 1;
-}
-.time-value{
-    /* width: 40rpx;
-    height: 36rpx; */
-    background-color: #ffffff;
-    border-radius: 5rpx;
-    color: #3f3f3f;
-    font-size: 9pt;
-    text-align: center;
-    margin: 0 6rpx;
-    padding: 9rpx 8rpx;
-}
-.group-share image{
-    width: 40rpx;
-    height: 34rpx;
-    margin-bottom: 6rpx;
-}
-.goods-money{
-    padding: 0 24rpx;
-    font-size:10pt; 
-    color: #ff5c5c;
-    background-color:#ffffff;
-    padding-bottom: 30rpx;
-}
-.goods-money-num{
-    font-size: 20pt;
-    line-height: 1;
-    font-weight: bold;
-    margin: 0rpx 20rpx 0 6rpx;
-}
-.original-price-title{
-    font-size:12pt;
-    color: #707070;
-}
-.original-price{
-    text-decoration: line-through; 
-}
-.group-descount{
-    font-size: 7pt;
-}
-.group-descount-one{
-    padding: 0 12rpx;
-    background-color: #feeeee;
-}
-.group-descount-center{
-    width: 6rpx;
-}
-.group-descount-tow{
-    padding: 0 12rpx;
-    background-color: #feeeee;
-}
-.order-deal{
-    color: #707070;
-    font-size: 10pt;
-    margin-top: 10rpx;
-}
-.group-share{
-    padding-right:15rpx;
-    background-color: transparent !important;
-    line-height: normal;
-}
-button::after {
-    content:normal !important;
-}
-
-.group-share-text{
-    font-size: 8pt;
-    color: #707070;
-}
-.goods-name{
-    font-size: 13pt;
-    color: #353535;
-    padding: 24rpx;
-    background-color:#ffffff;
-    line-height:1.5;
-}
-.goods-service{
-    /* height: 80rpx; */
-    padding: 20rpx 24rpx;
-    /* background-color: #f7f7f7; */
-    flex-wrap:wrap;
-}
-.service-item{
-    padding-right:20rpx; 
-    font-size: 9pt;
-    line-height: 1;
-    height: 40rpx; 
-}
-.service-item image{
-    width: 24rpx;
-    height: 24rpx;
-    margin-right: 8rpx;
-}
-.service-more image ,.shop-more image,.comment-more image{
-    width: 16rpx;
-    height: 26rpx;
-}
-.group-short{
-    font-size: 9pt;
-    color: #ff5c5c
-}
-.group-short-time{
-    font-size: 9pt;
-    color: #707070;
-}
-.go-offered{
-    width: 140rpx;
-    height: 100%;
-    background-color: #ff5c5c;
-    color: #ffffff;
-    font-size: 9pt;
-    margin-left: 36rpx;
-}
-.goods-comment{
-    padding: 0 24rpx;
-    background-color: #ffffff;
-    margin-top:16rpx;
-}
-.goods-comment-title{
-    height: 80rpx;
-    font-size: 9pt;
-    color: #919191;
-}
-.comment-user-pic image{
-    width: 66rpx;
-    height: 66rpx;
-    border-radius: 33rpx;
-    margin-right: 20rpx;
-}
-.goods-comment-item{
-    border-top: 1rpx solid #e2e2e2;
-    padding-bottom: 36rpx;
-}
-.goods-comment-user{
-    margin-top: 32rpx;
-}
-.comment-user-name{
-    font-size: 11pt;
-    color: #353535;
-}
-.goods-comment-conent{
-    font-size: 10pt;
-    color: #353535;
-    margin: 20rpx 0;
-    line-height:1.3;
-}
-.goods-comment-ginfo{
-    font-size: 9pt;
-    color: #919191;
-    margin-bottom:16rpx; 
-}
-.pt-goods-content{
-    margin-top: 16rpx;
-}
-.pt-goods-content-title{
-    height: 80rpx;
-    background-color: #ffffff;
-    padding: 0 24rpx;
-    color: #666666;
-    font-size: 11pt;
-    border-bottom: 1rpx solid #e2e2e2;
-}
-.pt-goods-details{
-    box-sizing:border-box;
-    padding:0 0 110rpx 0;
-    background:#fff;
-    overflow-x: hidden;
-}
-.shop-car{
-    position: fixed;
-    right: 24rpx;
-    top: 60rpx;
-    z-index: 999;
-}
-.shop-car image{
-    width: 86rpx;
-    height: 86rpx;
-}
-.pt-goods-footer{
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    height: 110rpx;
-    z-index: 999;
-    font-size:7pt;
-    color: #666666; 
-    width: 100%;
-}
-.pt-goods-footer image{
-    width:38rpx;
-    height: 38rpx;
-    margin-bottom:6rpx;
-}
-.goods-footer-icon{
-    background-color: #ffffff;
-    border-right: 1rpx solid #e2e2e2;
-    width: 110rpx;
-    padding:16rpx;
-    font-size:7pt;
-    color:#666666;
-    line-height:1;
-    border-radius:0 !important;
-}
-.alone-buy{
-    background-color: #feeeee;
-    font-size: 9pt;
-    color: #ff5c5c;
-    width: 226rpx;
-}
-
-.group-buy{
-    color: #ffffff;
-    font-size: 13pt;
-    background-color:#FF4545;
-    width:564rpx
-}
-
-
-.number-input-box{
-    height: 70rpx;
-}
-.number-input-box .number-input{
-    height: 70rpx !important;
-    border: none;
-    text-align: center;
-    width: 120rpx;
-    background: #eee;
-    margin: 0 4rpx !important;
-}
-.number-input-box .number-btn{
-    height: 100% !important;
-    width: 70rpx;
-    background: #eee;
-}
-
-.number-input-box .number-btn.disabled{
-    background: #f6f6f6;
-    color: #aaa;
-}
-/* .goods-comment-piclist image{
-    width: 160rpx;
-    height: 160rpx;
-    border-radius: 4rpx;
-    margin-right: 16rpx;
-} */
-.comment-pic-shell{
-    width: 160rpx;
-    height: 160rpx;
-    border-radius: 4rpx;
-    margin-right: 16rpx;
-    overflow: hidden;
-    display: inline-block;
-}
-/* 门店 */
-.shop{
-    background-color: #ffffff;
-    margin-bottom: 20rpx;
-    padding: 0 24rpx;
-    font-size: 11pt;
-}
-.shop-title{
-    height: 72rpx;
-    font-size: 10pt;
-    color: #a4a4a4;
-    border-bottom: 1rpx solid #e2e2e2;
-}
-.shop-info{
-    border-bottom: 1rpx solid #e2e2e2; 
-    padding: 30rpx 0;
-}
-.shop-name{
-    margin-bottom: 20rpx;
-    color: #353535;
-}
-.shop-addres,.shop-time{
-    color: #999999;
-}
-.all-shop{
-    color: #00a0e9;
-    height: 80rpx;
-}
-
-
-.tab-group .tab-group-header{
-    background: #fff;
-    border-bottom: 1rpx solid #e3e3e3;
-}
-
-.tab-group .tab-group-header .tab-group-item text{
-    height: 100rpx;
-    border-bottom: 2rpx solid transparent;
-}
-
-.tab-group .tab-group-header .tab-group-item.active text{
-    color: #ff4544;
-    border-bottom-color: #ff4544;
-}
-.tab-group .tab-group-body .tab-group-item{
-    display: none;
-}
-
-.tab-group .tab-group-body .tab-group-item.active{
-    display: block;
-}
-
-.comment-count{
-    background: #fff;
-    margin-bottom: 20rpx;
-}
-
-.comment-count .comment-count-item{
-    text-align: center;
-    padding: 20rpx 0;
-    font-size: 9pt;
-}
-.comment-item{
-    background: #fff;
-    border-bottom: 1rpx solid #e3e3e3;
-    padding: 32rpx 24rpx;
-}
-.comment-item .nickname{
-    padding-left: 24rpx;
-    height: 70rpx;
-    font-weight: bolder;
-}
-.comment-item .addtime{
-    color: #888;
-}
-.comment-item .pic-list{
-    margin-left: -8rpx;
-    margin-top: -8rpx;
-}
-.comment-item .pic-item{
-    width: 200rpx;
-    height: 200rpx;
-    margin-left: 8rpx;
-    margin-top: 8rpx;
-    display: inline-block;
-    float: left;
-}
-.comment-item .score-tag{
-    display: inline-block;
-    background: #eee;
-    font-size: 9pt;
-    padding: 4rpx 12rpx;
-    border-radius: 5rpx;
-}
-.tab-group{
-    padding-bottom:100rpx;
-}
-.goods-detail{
-    box-sizing: border-box;
-    padding: 24rpx 0;
-    background: #fff;
-}
-.goods-detail text,
-.goods-detail image,
-.goods-detail view{
-    box-sizing: border-box;
-    max-width: 100%;
-}
-
-.share-modal{
-    position: fixed;
-    top:0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    background: rgba(0,0,0,.0);
-    z-index: 1000;
-    transform: translateY(100%);
-    transition: background 250ms;
-}
-
-.share-modal .share-modal-body{
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    width: 100%;
-    background: #f2f2f2;
-    padding-top: 60rpx;
-    transform: translateY(100%);
-    transition: transform 250ms;
-}
-
-.share-modal.active{
-    transform: translateY(0);
-    background: rgba(0,0,0,.5);
-}
-
-.share-modal.active .share-modal-body{
-    transform: translateY(0);
-}
-
-.share-modal .share-bottom{
-    text-align: center;
-    font-size: 9pt;
-    margin: 0;
-    padding: 0;
-    margin-bottom: 60rpx;
-    line-height: inherit;
-    border: none;
-    background: none;
-    color: inherit;
-    font-family: inherit;
-    display: inline-block;
-}
-
-.share-modal .share-bottom:after{
-    display: none;
-}
-
-.share-modal .share-bottom image{
-    width: 120rpx;
-    height: 120rpx;
-    margin-bottom: 12rpx;
-    border-radius: 999rpx;
-    border: 1rpx solid #eee;
-}
-
-.share-modal .share-bottom:active image{
-    opacity: .7;
-}
-
-.share-modal .share-modal-close{
-    background: #fff;
-    height: 100rpx;
-    border-top: 1rpx solid #eee;
-}
-
-.goods-qrcode-modal{
-    position: fixed;
-    top:0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    z-index: 1000;
-    background: rgba(0,0,0,.5);
-    padding: 40rpx;
-    transform: translateY(100%);
-    opacity: .5;
-    transition: opacity 250ms;
-}
-
-.goods-qrcode-modal.active{
-    transform: translateY(0);
-    opacity: 1;
-}
-
-.goods-qrcode-body{
-    background: #fff;
-    height: 100%;
-    border-radius: 10rpx;
-    z-index: 99999;
-}
-
-.goods-qrcode-modal .goods-qrcode-box{
-    height: 100%;
-    position: relative;
-    box-shadow: 0 0 15rpx rgba(0,0,0,.15);
-}
-
-.goods-qrcode-modal .goods-qrcode-loading{
-    top:0;
-    left: 0;
-    position: absolute;
-    width: 100%;
-    height: 100%;
-}
-
-.goods-qrcode-modal .goods-qrcode{
-    top:0;
-    left: 0;
-    position: absolute;
-    width: 100%;
-    height: 100%;
-    background: #fff;
-    display: none;
-}
-
-.goods-qrcode-modal .goods-qrcode.active{
-    display: block;
-}
-
-.goods-qrcode-modal .goods-qrcode-close{
-    position: absolute;
-    top:40rpx;
-    right: 40rpx;
-    padding: 15rpx;
+/* pages/book/details/details.wxss */
+@import "../../../wxParse/wxParse.wxss";
+.goods-image-swiper {
+    height: 700rpx;
+}
+.goods-image {
+    width: 100%;
+    height: 100%;
+}
+.time-limit{
+    height: 88rpx;
+    background-color: #ffa360;
+    background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#ff5527), color-stop(0%,#ff2755));
+    background-image: linear-gradient(140deg, #ffa360, #ff5c5c);
+    padding: 0 24rpx;
+}
+.time-limit image{
+    width: 112rpx;
+    height: 56rpx;
+    margin-right: 20rpx;
+}
+.time-limit-logo-text{
+    font-size: 9pt;
+    color: #ffffff;
+    margin-top: 40rpx;
+}
+.time-top-text{
+    font-size: 7pt;
+    color: #ffeecc;
+}
+.time-info{
+    color: #ffffff;
+    font-size: 9pt;
+    line-height: 1;
+}
+.time-value{
+    /* width: 40rpx;
+    height: 36rpx; */
+    background-color: #ffffff;
+    border-radius: 5rpx;
+    color: #3f3f3f;
+    font-size: 9pt;
+    text-align: center;
+    margin: 0 6rpx;
+    padding: 9rpx 8rpx;
+}
+.group-share image{
+    width: 40rpx;
+    height: 34rpx;
+    margin-bottom: 6rpx;
+}
+.goods-money{
+    padding: 0 24rpx;
+    font-size:10pt; 
+    color: #ff5c5c;
+    background-color:#ffffff;
+    padding-bottom: 30rpx;
+}
+.goods-money-num{
+    font-size: 20pt;
+    line-height: 1;
+    font-weight: bold;
+    margin: 0rpx 20rpx 0 6rpx;
+}
+.original-price-title{
+    font-size:12pt;
+    color: #707070;
+}
+.original-price{
+    text-decoration: line-through; 
+}
+.group-descount{
+    font-size: 7pt;
+}
+.group-descount-one{
+    padding: 0 12rpx;
+    background-color: #feeeee;
+}
+.group-descount-center{
+    width: 6rpx;
+}
+.group-descount-tow{
+    padding: 0 12rpx;
+    background-color: #feeeee;
+}
+.order-deal{
+    color: #707070;
+    font-size: 10pt;
+    margin-top: 10rpx;
+}
+.group-share{
+    padding-right:15rpx;
+    background-color: transparent !important;
+    line-height: normal;
+}
+button::after {
+    content:normal !important;
+}
+
+.group-share-text{
+    font-size: 8pt;
+    color: #707070;
+}
+.goods-name{
+    font-size: 13pt;
+    color: #353535;
+    padding: 24rpx;
+    background-color:#ffffff;
+    line-height:1.5;
+}
+.goods-service{
+    /* height: 80rpx; */
+    padding: 20rpx 24rpx;
+    /* background-color: #f7f7f7; */
+    flex-wrap:wrap;
+}
+.service-item{
+    padding-right:20rpx; 
+    font-size: 9pt;
+    line-height: 1;
+    height: 40rpx; 
+}
+.service-item image{
+    width: 24rpx;
+    height: 24rpx;
+    margin-right: 8rpx;
+}
+.service-more image ,.shop-more image,.comment-more image{
+    width: 16rpx;
+    height: 26rpx;
+}
+.group-short{
+    font-size: 9pt;
+    color: #ff5c5c
+}
+.group-short-time{
+    font-size: 9pt;
+    color: #707070;
+}
+.go-offered{
+    width: 140rpx;
+    height: 100%;
+    background-color: #ff5c5c;
+    color: #ffffff;
+    font-size: 9pt;
+    margin-left: 36rpx;
+}
+.goods-comment{
+    padding: 0 24rpx;
+    background-color: #ffffff;
+    margin-top:16rpx;
+}
+.goods-comment-title{
+    height: 80rpx;
+    font-size: 9pt;
+    color: #919191;
+}
+.comment-user-pic image{
+    width: 66rpx;
+    height: 66rpx;
+    border-radius: 33rpx;
+    margin-right: 20rpx;
+}
+.goods-comment-item{
+    border-top: 1rpx solid #e2e2e2;
+    padding-bottom: 36rpx;
+}
+.goods-comment-user{
+    margin-top: 32rpx;
+}
+.comment-user-name{
+    font-size: 11pt;
+    color: #353535;
+}
+.goods-comment-conent{
+    font-size: 10pt;
+    color: #353535;
+    margin: 20rpx 0;
+    line-height:1.3;
+}
+.goods-comment-ginfo{
+    font-size: 9pt;
+    color: #919191;
+    margin-bottom:16rpx; 
+}
+.pt-goods-content{
+    margin-top: 16rpx;
+}
+.pt-goods-content-title{
+    height: 80rpx;
+    background-color: #ffffff;
+    padding: 0 24rpx;
+    color: #666666;
+    font-size: 11pt;
+    border-bottom: 1rpx solid #e2e2e2;
+}
+.pt-goods-details{
+    box-sizing:border-box;
+    padding:0 0 110rpx 0;
+    background:#fff;
+    overflow-x: hidden;
+}
+.shop-car{
+    position: fixed;
+    right: 24rpx;
+    top: 60rpx;
+    z-index: 999;
+}
+.shop-car image{
+    width: 86rpx;
+    height: 86rpx;
+}
+.pt-goods-footer{
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    height: 110rpx;
+    z-index: 999;
+    font-size:7pt;
+    color: #666666; 
+    width: 100%;
+}
+.pt-goods-footer image{
+    width:38rpx;
+    height: 38rpx;
+    margin-bottom:6rpx;
+}
+.goods-footer-icon{
+    background-color: #ffffff;
+    border-right: 1rpx solid #e2e2e2;
+    width: 110rpx;
+    padding:16rpx;
+    font-size:7pt;
+    color:#666666;
+    line-height:1;
+    border-radius:0 !important;
+}
+.alone-buy{
+    background-color: #feeeee;
+    font-size: 9pt;
+    color: #ff5c5c;
+    width: 226rpx;
+}
+
+.group-buy{
+    color: #ffffff;
+    font-size: 13pt;
+    background-color:#FF4545;
+    width:564rpx
+}
+
+
+.number-input-box{
+    height: 70rpx;
+}
+.number-input-box .number-input{
+    height: 70rpx !important;
+    border: none;
+    text-align: center;
+    width: 120rpx;
+    background: #eee;
+    margin: 0 4rpx !important;
+}
+.number-input-box .number-btn{
+    height: 100% !important;
+    width: 70rpx;
+    background: #eee;
+}
+
+.number-input-box .number-btn.disabled{
+    background: #f6f6f6;
+    color: #aaa;
+}
+/* .goods-comment-piclist image{
+    width: 160rpx;
+    height: 160rpx;
+    border-radius: 4rpx;
+    margin-right: 16rpx;
+} */
+.comment-pic-shell{
+    width: 160rpx;
+    height: 160rpx;
+    border-radius: 4rpx;
+    margin-right: 16rpx;
+    overflow: hidden;
+    display: inline-block;
+}
+/* 门店 */
+.shop{
+    background-color: #ffffff;
+    margin-bottom: 20rpx;
+    padding: 0 24rpx;
+    font-size: 11pt;
+}
+.shop-title{
+    height: 72rpx;
+    font-size: 10pt;
+    color: #a4a4a4;
+    border-bottom: 1rpx solid #e2e2e2;
+}
+.shop-info{
+    border-bottom: 1rpx solid #e2e2e2; 
+    padding: 30rpx 0;
+}
+.shop-name{
+    margin-bottom: 20rpx;
+    color: #353535;
+}
+.shop-addres,.shop-time{
+    color: #999999;
+}
+.all-shop{
+    color: #00a0e9;
+    height: 80rpx;
+}
+
+
+.tab-group .tab-group-header{
+    background: #fff;
+    border-bottom: 1rpx solid #e3e3e3;
+}
+
+.tab-group .tab-group-header .tab-group-item text{
+    height: 100rpx;
+    border-bottom: 2rpx solid transparent;
+}
+
+.tab-group .tab-group-header .tab-group-item.active text{
+    color: #ff4544;
+    border-bottom-color: #ff4544;
+}
+.tab-group .tab-group-body .tab-group-item{
+    display: none;
+}
+
+.tab-group .tab-group-body .tab-group-item.active{
+    display: block;
+}
+
+.comment-count{
+    background: #fff;
+    margin-bottom: 20rpx;
+}
+
+.comment-count .comment-count-item{
+    text-align: center;
+    padding: 20rpx 0;
+    font-size: 9pt;
+}
+.comment-item{
+    background: #fff;
+    border-bottom: 1rpx solid #e3e3e3;
+    padding: 32rpx 24rpx;
+}
+.comment-item .nickname{
+    padding-left: 24rpx;
+    height: 70rpx;
+    font-weight: bolder;
+}
+.comment-item .addtime{
+    color: #888;
+}
+.comment-item .pic-list{
+    margin-left: -8rpx;
+    margin-top: -8rpx;
+}
+.comment-item .pic-item{
+    width: 200rpx;
+    height: 200rpx;
+    margin-left: 8rpx;
+    margin-top: 8rpx;
+    display: inline-block;
+    float: left;
+}
+.comment-item .score-tag{
+    display: inline-block;
+    background: #eee;
+    font-size: 9pt;
+    padding: 4rpx 12rpx;
+    border-radius: 5rpx;
+}
+.tab-group{
+    padding-bottom:100rpx;
+}
+.goods-detail{
+    box-sizing: border-box;
+    padding: 24rpx 0;
+    background: #fff;
+}
+.goods-detail text,
+.goods-detail image,
+.goods-detail view{
+    box-sizing: border-box;
+    max-width: 100%;
+}
+
+.share-modal{
+    position: fixed;
+    top:0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba(0,0,0,.0);
+    z-index: 1000;
+    transform: translateY(100%);
+    transition: background 250ms;
+}
+
+.share-modal .share-modal-body{
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    background: #f2f2f2;
+    padding-top: 60rpx;
+    transform: translateY(100%);
+    transition: transform 250ms;
+}
+
+.share-modal.active{
+    transform: translateY(0);
+    background: rgba(0,0,0,.5);
+}
+
+.share-modal.active .share-modal-body{
+    transform: translateY(0);
+}
+
+.share-modal .share-bottom{
+    text-align: center;
+    font-size: 9pt;
+    margin: 0;
+    padding: 0;
+    margin-bottom: 60rpx;
+    line-height: inherit;
+    border: none;
+    background: none;
+    color: inherit;
+    font-family: inherit;
+    display: inline-block;
+}
+
+.share-modal .share-bottom:after{
+    display: none;
+}
+
+.share-modal .share-bottom image{
+    width: 120rpx;
+    height: 120rpx;
+    margin-bottom: 12rpx;
+    border-radius: 999rpx;
+    border: 1rpx solid #eee;
+}
+
+.share-modal .share-bottom:active image{
+    opacity: .7;
+}
+
+.share-modal .share-modal-close{
+    background: #fff;
+    height: 100rpx;
+    border-top: 1rpx solid #eee;
+}
+
+.goods-qrcode-modal{
+    position: fixed;
+    top:0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    z-index: 1000;
+    background: rgba(0,0,0,.5);
+    padding: 40rpx;
+    transform: translateY(100%);
+    opacity: .5;
+    transition: opacity 250ms;
+}
+
+.goods-qrcode-modal.active{
+    transform: translateY(0);
+    opacity: 1;
+}
+
+.goods-qrcode-body{
+    background: #fff;
+    height: 100%;
+    border-radius: 10rpx;
+    z-index: 99999;
+}
+
+.goods-qrcode-modal .goods-qrcode-box{
+    height: 100%;
+    position: relative;
+    box-shadow: 0 0 15rpx rgba(0,0,0,.15);
+}
+
+.goods-qrcode-modal .goods-qrcode-loading{
+    top:0;
+    left: 0;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+}
+
+.goods-qrcode-modal .goods-qrcode{
+    top:0;
+    left: 0;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    background: #fff;
+    display: none;
+}
+
+.goods-qrcode-modal .goods-qrcode.active{
+    display: block;
+}
+
+.goods-qrcode-modal .goods-qrcode-close{
+    position: absolute;
+    top:40rpx;
+    right: 40rpx;
+    padding: 15rpx;
 }

+ 205 - 205
wechat/pages/book/index/index.js

xqd
@@ -1,206 +1,206 @@
-// pages/book/index/index.js
-var api = require('../../../api.js');
-var app = getApp();
-var pageNum = 2;
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        cid: 0,
-        scrollLeft: 600,
-        scrollTop: 0,
-        emptyGoods: 0,
-        page_count: 0,
-        cat_show:1,
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        this.systemInfo = wx.getSystemInfoSync()
-        app.pageOnLoad(this);
-        this.loadIndexInfo(this);
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        app.pageOnShow(this);
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-    
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-    
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function () {
-    
-    },
-    /**
-     * 预约首页加载
-     */
-    loadIndexInfo: function (e) {
-        var page = e;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        app.request({
-            url: api.book.index,
-            method: "get",
-            success: function (res) {
-                    if (res.code == 0) {
-                        setTimeout(function () {
-                            // 延长一秒取消加载动画
-                            wx.hideLoading();
-                        }, 1000);
-                        page.setData({
-                            cat: res.data.cat,
-                            banner: res.data.banner,
-                            ad: res.data.ad,
-                            goods: res.data.goods.list,
-                            cat_show: res.data.cat_show,
-                            page_count: res.data.goods.page_count,
-                        });
-                        if (res.data.goods.page >= res.data.goods.page_count){
-                            page.setData({
-                                emptyGoods:1,
-                            });
-                        }
-                    }
-            }
-        });
-    },
-    /**
-     * 顶部导航事件
-     */
-    switchNav: function (e) {
-        var page = this;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        var cid = 0;
-        pageNum = 2;
-        if (cid == e.currentTarget.dataset.id && e.currentTarget.dataset.id != 0) return;
-        cid = e.currentTarget.dataset.id;
-        console.log(this.systemInfo);
-        var windowWidth = this.systemInfo.windowWidth
-        var offsetLeft = e.currentTarget.offsetLeft
-        var scrollLeft = this.data.scrollLeft;
-        if (offsetLeft > windowWidth / 2) {
-            scrollLeft = offsetLeft
-        } else {
-            scrollLeft = 0
-        }
-        page.setData({
-            cid: cid,
-            page: 1,
-            scrollLeft: scrollLeft,
-            scrollTop: 0,
-            emptyGoods: 0,
-            goods: [],
-            show_loading_bar: 1,
-        })
-        app.request({
-            url: api.book.list,
-            method: "get",
-            data: { cid: cid },
-            success: function (res) {
-                if (res.code == 0) {
-                    setTimeout(function () {
-                        // 延长一秒取消加载动画
-                        wx.hideLoading();
-                    }, 1000);
-                    var goods = res.data.list;
-                    if (res.data.page_count >= res.data.page) {
-                        page.setData({
-                            goods: goods,
-                            // page: res.data.page,
-                            page_count: res.data.page_count,
-                            row_count: res.data.row_count,
-                            show_loading_bar: 0,
-                        });
-                    } else {
-                        page.setData({
-                            emptyGoods: 1,
-                        });
-                    }
-                }
-            }
-        });
-    },
-    /**
- * 下拉加载
- */
-    onReachBottom: function (e) {
-        var page = this;
-        if (page.data.emptyGoods == 1 || page.data.show_loading_bar == 1) {
-            return;
-        }
-        page.setData({
-            show_loading_bar: 1
-        });
-        // var pageNum = parseInt(page.data.page + 1);
-        var cid = page.data.cid;
-        app.request({
-            url: api.book.list,
-            method: "get",
-            data: { page: pageNum, cid: cid },
-            success: function (res) {
-                if (res.code == 0) {
-                    var goods = page.data.goods;
-                    if (res.data.page >= pageNum) {
-                        Array.prototype.push.apply(goods, res.data.list);
-                    }
-                    console.log(goods);
-                    if (res.data.page_count >= pageNum) {
-                        page.setData({
-                            goods: goods,
-                            page: res.data.page,
-                            page_count: res.data.page_count,
-                            row_count: res.data.row_count,
-                            show_loading_bar: 0,
-                        });
-                    } else {
-                        page.setData({
-                            emptyGoods: 1,
-                        });
-                    }
-                    pageNum ++;
-                }
-            }
-        });
-    },
+// pages/book/index/index.js
+var api = require('../../../api.js');
+var app = getApp();
+var pageNum = 2;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        cid: 0,
+        scrollLeft: 600,
+        scrollTop: 0,
+        emptyGoods: 0,
+        page_count: 0,
+        cat_show:1,
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        this.systemInfo = wx.getSystemInfoSync()
+        app.pageOnLoad(this);
+        this.loadIndexInfo(this);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        app.pageOnShow(this);
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+    
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+    
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+    
+    },
+    /**
+     * 预约首页加载
+     */
+    loadIndexInfo: function (e) {
+        var page = e;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        app.request({
+            url: api.book.index,
+            method: "get",
+            success: function (res) {
+                    if (res.code == 0) {
+                        setTimeout(function () {
+                            // 延长一秒取消加载动画
+                            wx.hideLoading();
+                        }, 1000);
+                        page.setData({
+                            cat: res.data.cat,
+                            banner: res.data.banner,
+                            ad: res.data.ad,
+                            goods: res.data.goods.list,
+                            cat_show: res.data.cat_show,
+                            page_count: res.data.goods.page_count,
+                        });
+                        if (res.data.goods.page >= res.data.goods.page_count){
+                            page.setData({
+                                emptyGoods:1,
+                            });
+                        }
+                    }
+            }
+        });
+    },
+    /**
+     * 顶部导航事件
+     */
+    switchNav: function (e) {
+        var page = this;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        var cid = 0;
+        pageNum = 2;
+        if (cid == e.currentTarget.dataset.id && e.currentTarget.dataset.id != 0) return;
+        cid = e.currentTarget.dataset.id;
+        console.log(this.systemInfo);
+        var windowWidth = this.systemInfo.windowWidth
+        var offsetLeft = e.currentTarget.offsetLeft
+        var scrollLeft = this.data.scrollLeft;
+        if (offsetLeft > windowWidth / 2) {
+            scrollLeft = offsetLeft
+        } else {
+            scrollLeft = 0
+        }
+        page.setData({
+            cid: cid,
+            page: 1,
+            scrollLeft: scrollLeft,
+            scrollTop: 0,
+            emptyGoods: 0,
+            goods: [],
+            show_loading_bar: 1,
+        })
+        app.request({
+            url: api.book.list,
+            method: "get",
+            data: { cid: cid },
+            success: function (res) {
+                if (res.code == 0) {
+                    setTimeout(function () {
+                        // 延长一秒取消加载动画
+                        wx.hideLoading();
+                    }, 1000);
+                    var goods = res.data.list;
+                    if (res.data.page_count >= res.data.page) {
+                        page.setData({
+                            goods: goods,
+                            // page: res.data.page,
+                            page_count: res.data.page_count,
+                            row_count: res.data.row_count,
+                            show_loading_bar: 0,
+                        });
+                    } else {
+                        page.setData({
+                            emptyGoods: 1,
+                        });
+                    }
+                }
+            }
+        });
+    },
+    /**
+ * 下拉加载
+ */
+    onReachBottom: function (e) {
+        var page = this;
+        if (page.data.emptyGoods == 1 || page.data.show_loading_bar == 1) {
+            return;
+        }
+        page.setData({
+            show_loading_bar: 1
+        });
+        // var pageNum = parseInt(page.data.page + 1);
+        var cid = page.data.cid;
+        app.request({
+            url: api.book.list,
+            method: "get",
+            data: { page: pageNum, cid: cid },
+            success: function (res) {
+                if (res.code == 0) {
+                    var goods = page.data.goods;
+                    if (res.data.page >= pageNum) {
+                        Array.prototype.push.apply(goods, res.data.list);
+                    }
+                    console.log(goods);
+                    if (res.data.page_count >= pageNum) {
+                        page.setData({
+                            goods: goods,
+                            page: res.data.page,
+                            page_count: res.data.page_count,
+                            row_count: res.data.row_count,
+                            show_loading_bar: 0,
+                        });
+                    } else {
+                        page.setData({
+                            emptyGoods: 1,
+                        });
+                    }
+                    pageNum ++;
+                }
+            }
+        });
+    },
 })

+ 2 - 2
wechat/pages/book/index/index.json

xqd
@@ -1,3 +1,3 @@
-{
-    "navigationBarTitleText": "预约"
+{
+    "navigationBarTitleText": "预约"
 }

+ 55 - 55
wechat/pages/book/index/index.wxml

xqd
@@ -1,56 +1,56 @@
-<include src="/commons/navbar/navbar"/>
-<!--pages/book/index/index.wxml-->
-<!--pages/pt/index.wxml--> 
-<!-- //  顶部导航 -->
-<!-- <include src="../commons/cat/cat.wxml"/> -->
-<scroll-view scroll-x="true" class="scroll-view-x" scroll-with-animation="true" scroll-left="{{scrollLeft}}" wx:if="{{cat_show=='1'}}">
-    <view class="scroll-view-item {{cid==0 ? 'active' : ''}}" data-id='0' bindtap="switchNav">
-        全部
-    </view>
-    <block wx:for="{{cat}}" wx:key="unique">
-    <view data-id="{{item.id}}" class="scroll-view-item {{cid==item.id ? 'active' : ''}}"  bindtap="switchNav">
-         {{item.name}}
-    </view>
-  </block>
-</scroll-view>
-<include src="/commons/navbar/navbar"/>
-<scroll-view class="after-navber" scroll-y style="height: 100%;"bindscrolltolower="pullDownLoading" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}" style='{{cat_show=="1"?"padding-top: 100rpx;":""}}'>
-    <view class='goods'>
-        <navigator class='goods-item' wx:for="{{goods}}" url='/pages/book/details/details?id={{item.id}}'>
-            <view class='goods-pic'>
-                    <image src='{{item.cover_pic}}'></image>
-            </view>
-            <view class='goods-title'>
-                {{item.name}}
-            </view>
-            <view class='price flex-row flex-y-center'>
-                <view class='money flex-grow-1 flex-y-center' wx:if='{{item.price!=0}}'>
-                    ¥ {{item.price}}
-                </view>
-                <view class='money flex-grow-1 flex-y-center' wx:if='{{item.price==0}}'>
-                    免费预约
-                </view>
-                <view class='go-book flex-gorw-0 flex-x-center flex-y-center'>
-                        预约
-                </view>
-            </view>
-        </navigator>
-    </view>
-    <view class="loading-bar {{show_loading_bar?'active':''}}" style="text-align: center;{{emptyGoods==1?'display:none':''}}">
-        <image style="width: 160rpx;height: 80rpx" src="/images/loading.svg"></image>
-    </view>
-    <view class="empty-bar flex-row flex-x-center flex-y-center" style="{{emptyGoods!=1?'display:none':''}}">
-        没有更多商品了~
-    </view>
-</scroll-view>
-<!-- <view class='new-group flex-y-center'>
-        <view class='new-group-bg'></view>
-        <view class='new-group-info flex-row flex-y-center'>
-            <view class='flex-grow-0 flex-y-center'>
-                <image src='https://wx.qlogo.cn/mmopen/rXAA48ewV3srPUiahLv7f3HQVQiaiceqmM0Z2rhiaGaIN4TiclvniavVUqmNyicEaJMQpic2slkQ9V2OkjAs89s1D6CAQA/0'></image>
-            </view>
-            <view class='flex-grow-1 flex-y-center group-info-text'>
-                最新团来自疯狂的小土豆啊,100秒前
-            </view>
-        </view>
+<include src="/commons/navbar/navbar"/>
+<!--pages/book/index/index.wxml-->
+<!--pages/pt/index.wxml--> 
+<!-- //  顶部导航 -->
+<!-- <include src="../commons/cat/cat.wxml"/> -->
+<scroll-view scroll-x="true" class="scroll-view-x" scroll-with-animation="true" scroll-left="{{scrollLeft}}" wx:if="{{cat_show=='1'}}">
+    <view class="scroll-view-item {{cid==0 ? 'active' : ''}}" data-id='0' bindtap="switchNav">
+        全部
+    </view>
+    <block wx:for="{{cat}}" wx:key="unique">
+    <view data-id="{{item.id}}" class="scroll-view-item {{cid==item.id ? 'active' : ''}}"  bindtap="switchNav">
+         {{item.name}}
+    </view>
+  </block>
+</scroll-view>
+<include src="/commons/navbar/navbar"/>
+<scroll-view class="after-navber" scroll-y style="height: 100%;"bindscrolltolower="pullDownLoading" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}" style='{{cat_show=="1"?"padding-top: 100rpx;":""}}'>
+    <view class='goods'>
+        <navigator class='goods-item' wx:for="{{goods}}" url='/pages/book/details/details?id={{item.id}}'>
+            <view class='goods-pic'>
+                    <image src='{{item.cover_pic}}'></image>
+            </view>
+            <view class='goods-title'>
+                {{item.name}}
+            </view>
+            <view class='price flex-row flex-y-center'>
+                <view class='money flex-grow-1 flex-y-center' wx:if='{{item.price!=0}}'>
+                    ¥ {{item.price}}
+                </view>
+                <view class='money flex-grow-1 flex-y-center' wx:if='{{item.price==0}}'>
+                    免费预约
+                </view>
+                <view class='go-book flex-gorw-0 flex-x-center flex-y-center'>
+                        预约
+                </view>
+            </view>
+        </navigator>
+    </view>
+    <view class="loading-bar {{show_loading_bar?'active':''}}" style="text-align: center;{{emptyGoods==1?'display:none':''}}">
+        <image style="width: 160rpx;height: 80rpx" src="/images/loading.svg"></image>
+    </view>
+    <view class="empty-bar flex-row flex-x-center flex-y-center" style="{{emptyGoods!=1?'display:none':''}}">
+        没有更多商品了~
+    </view>
+</scroll-view>
+<!-- <view class='new-group flex-y-center'>
+        <view class='new-group-bg'></view>
+        <view class='new-group-info flex-row flex-y-center'>
+            <view class='flex-grow-0 flex-y-center'>
+                <image src='https://wx.qlogo.cn/mmopen/rXAA48ewV3srPUiahLv7f3HQVQiaiceqmM0Z2rhiaGaIN4TiclvniavVUqmNyicEaJMQpic2slkQ9V2OkjAs89s1D6CAQA/0'></image>
+            </view>
+            <view class='flex-grow-1 flex-y-center group-info-text'>
+                最新团来自疯狂的小土豆啊,100秒前
+            </view>
+        </view>
 </view> -->

+ 99 - 99
wechat/pages/book/index/index.wxss

xqd
@@ -1,100 +1,100 @@
-/* pages/book/index/index.wxss */
-.scroll-view-x{
-    background-color: #fff;
-    white-space: nowrap;
-    position: fixed;
-    top: 0;
-    z-index: 9999;
-    height: 92rpx;
-    background-color: #ffecec;
-}
-.scroll-view-x .scroll-view-item{
-    display:inline-block;
-    margin:16rpx 0rpx 16rpx 36rpx ;
-    padding: 0 24rpx;
-    font-size: 12pt;
-    color:#666666;
-    height:60rpx;
-    line-height: 60rpx;
-    white-space: nowrap;
-}
-.scroll-view-y{
-    border-top:1px solid #cccccc;
-    border-bottom:1px solid #cccccc;
-}
-swiper{
-    height: 304rpx;
-}
-.scroll-view-x .active{
-    color: #fff;
-    border-radius: 30rpx;
-    background-color: #ffa360;
-    background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#ffa360), color-stop(140%,#ff5c5c));
-    background-image: linear-gradient(140deg, #ffa360, #ff5c5c);
-    height: 60rpx;
-}
-.loading-bar{
-    visibility: hidden;
-}
-.loading-bar.active,empty-bar{
-    visibility: visible;
-}
-.empty-bar{
-    height:80rpx;
-    /* background-color:#e2e2e2; */
-    color:#919191;
-}
-
-/* 商品列表 */
-/* .after-navber{
-} */
-/* .goods{
-    padding: 16rpx 2rpx 16rpx 16rpx;
-} */
-.goods-pic image{
-    width: 352rpx;
-    height: 236rpx;
-}
-.goods-item{
-    display: inline-block;
-    margin: 16rpx 11.5rpx;
-    font-size: 11pt;
-    background-color: #ffffff;
-}
-/* .goods-title{
-    color: #353535;
-    width: 352rpx;
-    padding: 20rpx;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-    -webkit-line-clamp:2;
-} */
-.goods-title{
-    color: #353535;
-    width: 352rpx;
-    padding: 20rpx;
-    overflow:hidden; 
-    text-overflow:ellipsis;
-    display:-webkit-box; 
-    -webkit-box-orient:vertical;
-    -webkit-line-clamp:2; 
-    height: 90rpx;
-    line-height: 1.2;
-    font-size: 32rpx;
-}
-
-.price{
-    padding: 20rpx;
-    color: #ff4545;
-}
-.money{
-    font-size: 13pt;
-}
-.go-book{
-    width: 112rpx;
-    height: 48rpx;
-    border-radius: 24rpx;
-    border:1rpx solid #ff4544;
-    background-color: #fff5f5;
+/* pages/book/index/index.wxss */
+.scroll-view-x{
+    background-color: #fff;
+    white-space: nowrap;
+    position: fixed;
+    top: 0;
+    z-index: 9999;
+    height: 92rpx;
+    background-color: #ffecec;
+}
+.scroll-view-x .scroll-view-item{
+    display:inline-block;
+    margin:16rpx 0rpx 16rpx 36rpx ;
+    padding: 0 24rpx;
+    font-size: 12pt;
+    color:#666666;
+    height:60rpx;
+    line-height: 60rpx;
+    white-space: nowrap;
+}
+.scroll-view-y{
+    border-top:1px solid #cccccc;
+    border-bottom:1px solid #cccccc;
+}
+swiper{
+    height: 304rpx;
+}
+.scroll-view-x .active{
+    color: #fff;
+    border-radius: 30rpx;
+    background-color: #ffa360;
+    background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#ffa360), color-stop(140%,#ff5c5c));
+    background-image: linear-gradient(140deg, #ffa360, #ff5c5c);
+    height: 60rpx;
+}
+.loading-bar{
+    visibility: hidden;
+}
+.loading-bar.active,empty-bar{
+    visibility: visible;
+}
+.empty-bar{
+    height:80rpx;
+    /* background-color:#e2e2e2; */
+    color:#919191;
+}
+
+/* 商品列表 */
+/* .after-navber{
+} */
+/* .goods{
+    padding: 16rpx 2rpx 16rpx 16rpx;
+} */
+.goods-pic image{
+    width: 352rpx;
+    height: 236rpx;
+}
+.goods-item{
+    display: inline-block;
+    margin: 16rpx 11.5rpx;
+    font-size: 11pt;
+    background-color: #ffffff;
+}
+/* .goods-title{
+    color: #353535;
+    width: 352rpx;
+    padding: 20rpx;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    -webkit-line-clamp:2;
+} */
+.goods-title{
+    color: #353535;
+    width: 352rpx;
+    padding: 20rpx;
+    overflow:hidden; 
+    text-overflow:ellipsis;
+    display:-webkit-box; 
+    -webkit-box-orient:vertical;
+    -webkit-line-clamp:2; 
+    height: 90rpx;
+    line-height: 1.2;
+    font-size: 32rpx;
+}
+
+.price{
+    padding: 20rpx;
+    color: #ff4545;
+}
+.money{
+    font-size: 13pt;
+}
+.go-book{
+    width: 112rpx;
+    height: 48rpx;
+    border-radius: 24rpx;
+    border:1rpx solid #ff4544;
+    background-color: #fff5f5;
 }

+ 224 - 224
wechat/pages/book/order-comment/order-comment.js

xqd
@@ -1,225 +1,225 @@
-// pages/order-comment/order-comment.js
-var api = require('../../../api.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        goods_list: []
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-        var page = this;
-        page.setData({
-            order_id: options.id,
-        });
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        app.request({
-            url: api.book.comment_preview,
-            data: {
-                order_id: options.id,
-            },
-            success: function (res) {
-                wx.hideLoading();
-                if (res.code == 1) {
-                    wx.showModal({
-                        title: "提示",
-                        content: res.msg,
-                        showCancel: false,
-                        success: function (e) {
-                            if (e.confirm) {
-                                wx.navigateBack();
-                            }
-                        }
-                    });
-                }
-                if (res.code == 0) {
-                    console.log(res.data.goods_list);
-                    for (var i in res.data.goods_list) {
-                        res.data.goods_list[i].score = 3;
-                        res.data.goods_list[i].content = "";
-                        res.data.goods_list[i].pic_list = [];
-                        res.data.goods_list[i].uploaded_pic_list = [];
-                    }
-                    page.setData({
-                        goods_list: res.data.goods_list,
-                    });
-                }
-            }
-        });
-    },
-
-    setScore: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var score = e.currentTarget.dataset.score;
-        var goods_list = page.data.goods_list;
-        goods_list[index].score = score;
-        page.setData({
-            goods_list: goods_list,
-        });
-    },
-    contentInput: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        page.data.goods_list[index].content = e.detail.value;
-        page.setData({
-            goods_list: page.data.goods_list,
-        });
-    },
-    chooseImage: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var max_count = 6;
-        var goods_list = page.data.goods_list;
-        var current_count = goods_list[index].pic_list.length;
-        wx.chooseImage({
-            count: (max_count - current_count),
-            success: function (res) {
-                goods_list[index].pic_list = goods_list[index].pic_list.concat(res.tempFilePaths);
-                page.setData({
-                    goods_list: goods_list,
-                });
-            }
-        });
-    },
-    deleteImage: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var pic_index = e.currentTarget.dataset.picIndex;
-        var goods_list = page.data.goods_list;
-        goods_list[index].pic_list.splice(pic_index, 1);
-        page.setData({
-            goods_list: goods_list
-        });
-    },
-
-    commentSubmit: function (e) {
-        var page = this;
-        wx.showLoading({
-            title: "正在提交",
-            mask: true,
-        });
-        var goods_list = page.data.goods_list;
-        uploadImages(0);
-
-
-        function uploadImages(i) {
-            if (i == goods_list.length) {
-                return submit();
-            }
-            var complete_count = 0;
-            if (!goods_list[i].pic_list.length || goods_list[i].pic_list.length == 0) {
-                return uploadImages((i + 1));
-            }
-            for (var j in goods_list[i].pic_list) {
-                (function (j) {
-                    wx.uploadFile({
-                        url: api.default.upload_image,
-                        name: "image",
-                        filePath: goods_list[i].pic_list[j],
-                        complete: function (e) {
-                            if (e.data) {
-                                var res = JSON.parse(e.data);
-                                if (res.code == 0) {
-                                    goods_list[i].uploaded_pic_list[j] = res.data.url;
-                                }
-                            }
-                            complete_count++;
-                            if (complete_count == goods_list[i].pic_list.length) {
-                                return uploadImages((i + 1));
-                            }
-                        }
-                    });
-                })(j);
-            }
-        }
-
-        function submit() {
-            app.request({
-                url: api.book.submit_comment,
-                method: "post",
-                data: {
-                    order_id: page.data.order_id,
-                    goods_list: JSON.stringify(goods_list),
-                },
-                success: function (res) {
-                    wx.hideLoading();
-                    if (res.code == 0) {
-                        wx.showModal({
-                            title: "提示",
-                            content: res.msg,
-                            showCancel: false,
-                            success: function (e) {
-                                if (e.confirm) {
-                                    wx.redirectTo({
-                                        url: "/pages/book/order/order?status=2",
-                                    });
-                                }
-                            }
-                        });
-                    }
-                    if (res.code == 1) {
-                        wx.showToast({
-                            title: res.msg,
-                            image: "/images/icon-warning.png",
-                        });
-                    }
-                }
-            });
-
-        }
-
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
+// pages/order-comment/order-comment.js
+var api = require('../../../api.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        goods_list: []
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+        var page = this;
+        page.setData({
+            order_id: options.id,
+        });
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        app.request({
+            url: api.book.comment_preview,
+            data: {
+                order_id: options.id,
+            },
+            success: function (res) {
+                wx.hideLoading();
+                if (res.code == 1) {
+                    wx.showModal({
+                        title: "提示",
+                        content: res.msg,
+                        showCancel: false,
+                        success: function (e) {
+                            if (e.confirm) {
+                                wx.navigateBack();
+                            }
+                        }
+                    });
+                }
+                if (res.code == 0) {
+                    console.log(res.data.goods_list);
+                    for (var i in res.data.goods_list) {
+                        res.data.goods_list[i].score = 3;
+                        res.data.goods_list[i].content = "";
+                        res.data.goods_list[i].pic_list = [];
+                        res.data.goods_list[i].uploaded_pic_list = [];
+                    }
+                    page.setData({
+                        goods_list: res.data.goods_list,
+                    });
+                }
+            }
+        });
+    },
+
+    setScore: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var score = e.currentTarget.dataset.score;
+        var goods_list = page.data.goods_list;
+        goods_list[index].score = score;
+        page.setData({
+            goods_list: goods_list,
+        });
+    },
+    contentInput: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        page.data.goods_list[index].content = e.detail.value;
+        page.setData({
+            goods_list: page.data.goods_list,
+        });
+    },
+    chooseImage: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var max_count = 6;
+        var goods_list = page.data.goods_list;
+        var current_count = goods_list[index].pic_list.length;
+        wx.chooseImage({
+            count: (max_count - current_count),
+            success: function (res) {
+                goods_list[index].pic_list = goods_list[index].pic_list.concat(res.tempFilePaths);
+                page.setData({
+                    goods_list: goods_list,
+                });
+            }
+        });
+    },
+    deleteImage: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var pic_index = e.currentTarget.dataset.picIndex;
+        var goods_list = page.data.goods_list;
+        goods_list[index].pic_list.splice(pic_index, 1);
+        page.setData({
+            goods_list: goods_list
+        });
+    },
+
+    commentSubmit: function (e) {
+        var page = this;
+        wx.showLoading({
+            title: "正在提交",
+            mask: true,
+        });
+        var goods_list = page.data.goods_list;
+        uploadImages(0);
+
+
+        function uploadImages(i) {
+            if (i == goods_list.length) {
+                return submit();
+            }
+            var complete_count = 0;
+            if (!goods_list[i].pic_list.length || goods_list[i].pic_list.length == 0) {
+                return uploadImages((i + 1));
+            }
+            for (var j in goods_list[i].pic_list) {
+                (function (j) {
+                    wx.uploadFile({
+                        url: api.default.upload_image,
+                        name: "image",
+                        filePath: goods_list[i].pic_list[j],
+                        complete: function (e) {
+                            if (e.data) {
+                                var res = JSON.parse(e.data);
+                                if (res.code == 0) {
+                                    goods_list[i].uploaded_pic_list[j] = res.data.url;
+                                }
+                            }
+                            complete_count++;
+                            if (complete_count == goods_list[i].pic_list.length) {
+                                return uploadImages((i + 1));
+                            }
+                        }
+                    });
+                })(j);
+            }
+        }
+
+        function submit() {
+            app.request({
+                url: api.book.submit_comment,
+                method: "post",
+                data: {
+                    order_id: page.data.order_id,
+                    goods_list: JSON.stringify(goods_list),
+                },
+                success: function (res) {
+                    wx.hideLoading();
+                    if (res.code == 0) {
+                        wx.showModal({
+                            title: "提示",
+                            content: res.msg,
+                            showCancel: false,
+                            success: function (e) {
+                                if (e.confirm) {
+                                    wx.redirectTo({
+                                        url: "/pages/book/order/order?status=2",
+                                    });
+                                }
+                            }
+                        });
+                    }
+                    if (res.code == 1) {
+                        wx.showToast({
+                            title: res.msg,
+                            image: "/images/icon-warning.png",
+                        });
+                    }
+                }
+            });
+
+        }
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
 });

+ 2 - 2
wechat/pages/book/order-comment/order-comment.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": "评价"
+{
+  "navigationBarTitleText": "评价"
 }

+ 57 - 57
wechat/pages/book/order-comment/order-comment.wxml

xqd
@@ -1,58 +1,58 @@
-<view class="goods-list">
-    <view class="goods-item" wx:for="{{goods_list}}">
-
-        <view class="flex-row score-row">
-            <view class="flex-grow-0 ">
-                <image class="goods-pic" src="{{item.cover_pic}}"></image>
-            </view>
-            <view class="flex-grow-1 flex-row">
-                <view bindtap="setScore" data-index="{{index}}" data-score="3"
-                      class="flex-grow-1 score-item flex-y-center flex-x-center {{item.score==3?'active':''}}">
-                    <image src="/images/icon-comment-score-3{{item.score==3?'.active':''}}.png"></image>
-                    <text>好评</text>
-                </view>
-                <view bindtap="setScore" data-index="{{index}}" data-score="2"
-                      class="flex-grow-1 score-item flex-y-center flex-x-center {{item.score==2?'active':''}}">
-                    <image src="/images/icon-comment-score-2{{item.score==2?'.active':''}}.png"></image>
-                    <text>中评</text>
-                </view>
-                <view bindtap="setScore" data-index="{{index}}" data-score="1"
-                      class="flex-grow-1 score-item flex-y-center flex-x-center {{item.score==1?'active':''}}">
-                    <image src="/images/icon-comment-score-1{{item.score==1?'.active':''}}.png"></image>
-                    <text>差评</text>
-                </view>
-            </view>
-        </view>
-
-        <view class="flex-row content-row">
-            <view class="flex-grow-0 nowrap form-label">评价内容</view>
-            <view class="flex-grow-1">
-                <textarea bindinput="contentInput"
-                          data-index="{{index}}"
-                          placeholder="请输入评价内容"
-                          placeholder-style="color:#ccc"
-                          maxlength="2000"></textarea>
-            </view>
-        </view>
-
-        <view class="pic-list">
-            <view class="image-preview" wx:for="{{item.pic_list}}" wx:for-index="pic_index">
-                <text class="flex-x-center flex-y-center image-del"
-                      bindtap="deleteImage"
-                      data-index="{{index}}"
-                      data-pic-index="{{pic_index}}">×
-                </text>
-                <image src="{{item}}" style="width: 160rpx;height: 160rpx" mode="aspectFill"></image>
-            </view>
-            <view wx:if="{{!item.pic_list||item.pic_list.length<6}}"
-                  class="image-picker"
-                  bindtap="chooseImage" data-index="{{index}}">
-                <image style="width: 160rpx;height: 160rpx" src="/images/icon-image-picker.png"></image>
-            </view>
-        </view>
-
-    </view>
-</view>
-<view class="bar-bottom">
-    <view class="submit-btn flex-x-center flex-y-center" bindtap="commentSubmit">提交</view>
+<view class="goods-list">
+    <view class="goods-item" wx:for="{{goods_list}}">
+
+        <view class="flex-row score-row">
+            <view class="flex-grow-0 ">
+                <image class="goods-pic" src="{{item.cover_pic}}"></image>
+            </view>
+            <view class="flex-grow-1 flex-row">
+                <view bindtap="setScore" data-index="{{index}}" data-score="3"
+                      class="flex-grow-1 score-item flex-y-center flex-x-center {{item.score==3?'active':''}}">
+                    <image src="/images/icon-comment-score-3{{item.score==3?'.active':''}}.png"></image>
+                    <text>好评</text>
+                </view>
+                <view bindtap="setScore" data-index="{{index}}" data-score="2"
+                      class="flex-grow-1 score-item flex-y-center flex-x-center {{item.score==2?'active':''}}">
+                    <image src="/images/icon-comment-score-2{{item.score==2?'.active':''}}.png"></image>
+                    <text>中评</text>
+                </view>
+                <view bindtap="setScore" data-index="{{index}}" data-score="1"
+                      class="flex-grow-1 score-item flex-y-center flex-x-center {{item.score==1?'active':''}}">
+                    <image src="/images/icon-comment-score-1{{item.score==1?'.active':''}}.png"></image>
+                    <text>差评</text>
+                </view>
+            </view>
+        </view>
+
+        <view class="flex-row content-row">
+            <view class="flex-grow-0 nowrap form-label">评价内容</view>
+            <view class="flex-grow-1">
+                <textarea bindinput="contentInput"
+                          data-index="{{index}}"
+                          placeholder="请输入评价内容"
+                          placeholder-style="color:#ccc"
+                          maxlength="2000"></textarea>
+            </view>
+        </view>
+
+        <view class="pic-list">
+            <view class="image-preview" wx:for="{{item.pic_list}}" wx:for-index="pic_index">
+                <text class="flex-x-center flex-y-center image-del"
+                      bindtap="deleteImage"
+                      data-index="{{index}}"
+                      data-pic-index="{{pic_index}}">×
+                </text>
+                <image src="{{item}}" style="width: 160rpx;height: 160rpx" mode="aspectFill"></image>
+            </view>
+            <view wx:if="{{!item.pic_list||item.pic_list.length<6}}"
+                  class="image-picker"
+                  bindtap="chooseImage" data-index="{{index}}">
+                <image style="width: 160rpx;height: 160rpx" src="/images/icon-image-picker.png"></image>
+            </view>
+        </view>
+
+    </view>
+</view>
+<view class="bar-bottom">
+    <view class="submit-btn flex-x-center flex-y-center" bindtap="commentSubmit">提交</view>
 </view>

+ 90 - 90
wechat/pages/book/order-comment/order-comment.wxss

xqd
@@ -1,91 +1,91 @@
-/* pages/order-comment/order-comment.wxss */
-.bar-bottom {
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    width: 100%;
-}
-
-.submit-btn{
-    background: #ff4544;
-    color: #fff;
-    height: 100rpx;
-}
-
-.goods-list{
-    border-top: 1rpx solid #e3e3e3;
-    padding-bottom: 100rpx;
-}
-
-.goods-item{
-    background: #fff;
-    border-bottom: 1rpx solid #e3e3e3;
-    margin-bottom: 20rpx;
-}
-
-.goods-item .score-row{
-    padding: 24rpx 20rpx;
-    border-bottom: 1rpx #eee solid;
-
-}
-
-.goods-item .score-row .goods-pic{
-    width: 72rpx;
-    height: 72rpx;
-}
-
-.goods-item .score-row .score-item image{
-    width: 40rpx;
-    height: 40rpx;
-    margin-right: 20rpx;
-}
-
-.goods-item .score-row .score-item.active{
-    color: #ff4544;
-}
-
-.goods-item .content-row{
-    padding: 24rpx 20rpx;
-}
-
-.goods-item .form-label{
-    margin-right: 24rpx;
-}
-
-.goods-item textarea{
-    width: 100%;
-    height: 200rpx;
-    padding: 0 0;
-}
-
-.goods-item .pic-list{
-    padding: 24rpx 20rpx;
-    margin-left: -20rpx;
-    margin-top: -20rpx;
-}
-
-.image-picker{
-    font-size: 0;
-}
-.image-picker,.image-preview{
-    display: inline-block;
-    margin-left: 20rpx;
-    margin-top: 20rpx;
-}
-.image-preview {
-    position: relative;
-}
-.image-preview .image-del{
-    position: absolute;
-    top:-15rpx;
-    right: -15rpx;
-    height: 50rpx;
-    width: 50rpx;
-    background: #ff4544;
-    color: #fff;
-    font-weight: bolder;
-    border-radius: 999rpx;
-    font-size: 9pt;
-    box-shadow: 0 1rpx 2rpx rgba(0,0,0,.2);
-    z-index: 999;
+/* pages/order-comment/order-comment.wxss */
+.bar-bottom {
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+}
+
+.submit-btn{
+    background: #ff4544;
+    color: #fff;
+    height: 100rpx;
+}
+
+.goods-list{
+    border-top: 1rpx solid #e3e3e3;
+    padding-bottom: 100rpx;
+}
+
+.goods-item{
+    background: #fff;
+    border-bottom: 1rpx solid #e3e3e3;
+    margin-bottom: 20rpx;
+}
+
+.goods-item .score-row{
+    padding: 24rpx 20rpx;
+    border-bottom: 1rpx #eee solid;
+
+}
+
+.goods-item .score-row .goods-pic{
+    width: 72rpx;
+    height: 72rpx;
+}
+
+.goods-item .score-row .score-item image{
+    width: 40rpx;
+    height: 40rpx;
+    margin-right: 20rpx;
+}
+
+.goods-item .score-row .score-item.active{
+    color: #ff4544;
+}
+
+.goods-item .content-row{
+    padding: 24rpx 20rpx;
+}
+
+.goods-item .form-label{
+    margin-right: 24rpx;
+}
+
+.goods-item textarea{
+    width: 100%;
+    height: 200rpx;
+    padding: 0 0;
+}
+
+.goods-item .pic-list{
+    padding: 24rpx 20rpx;
+    margin-left: -20rpx;
+    margin-top: -20rpx;
+}
+
+.image-picker{
+    font-size: 0;
+}
+.image-picker,.image-preview{
+    display: inline-block;
+    margin-left: 20rpx;
+    margin-top: 20rpx;
+}
+.image-preview {
+    position: relative;
+}
+.image-preview .image-del{
+    position: absolute;
+    top:-15rpx;
+    right: -15rpx;
+    height: 50rpx;
+    width: 50rpx;
+    background: #ff4544;
+    color: #fff;
+    font-weight: bolder;
+    border-radius: 999rpx;
+    font-size: 9pt;
+    box-shadow: 0 1rpx 2rpx rgba(0,0,0,.2);
+    z-index: 999;
 }

+ 284 - 284
wechat/pages/book/order/details.js

xqd
@@ -1,285 +1,285 @@
-    // pages/book/order/details.js
-var api = require('../../../api.js');
-var utils = require('../../../utils.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        hide: 1,
-        qrcode: ""
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-        this.getOrderDetails(options);
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        app.pageOnShow(this);
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-    
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-    
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-    
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function () {
-    
-    },
-
-    /**
-     * 订单详情
-     */
-    getOrderDetails:function(e){
-        var oid = e.oid;
-        var page = this;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        // wx.showNavigationBarLoading();
-        app.request({
-            url: api.book.order_details,
-            method: "get",
-            data: { id: oid },
-            success: function (res) {
-                if (res.code == 0) {
-                    page.setData({
-                        goods: res.data,
-                    });
-                } else {
-                    wx.showModal({
-                        title: '提示',
-                        content: res.msg,
-                        showCancel: false,
-                        success: function (res) {
-                            if (res.confirm) {
-                                wx.redirectTo({
-                                    url: '/pages/book/order/order?status=1'
-                                });
-                            }
-                        }
-                    });
-                }
-            },
-            complete: function (res) {
-                setTimeout(function () {
-                    // 延长一秒取消加载动画
-                    wx.hideLoading();
-                }, 1000);
-            }
-        });
-    },
-    /**
-     * 跳转至商品详情
-     */
-    goToGoodsDetails:function(e){
-        wx.redirectTo({
-            url: '/pages/book/details/details?id=' + this.data.goods.goods_id,
-        })
-    },
-    /**
- * 点击取消
- */
-    orderCancel: function (e) {
-        var page = this;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        var id = e.currentTarget.dataset.id;
-        app.request({
-            url: api.book.order_cancel,
-            data: {
-                id: id,
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    wx.redirectTo({
-                        url: '/pages/book/order/order?status=0'
-                    })
-                }
-            },
-            complete: function () {
-                wx.hideLoading();
-            }
-        });
-    },
-    /**
-     * 订单列表点击支付
-     */
-    GoToPay(e) {
-        wx.showLoading({
-            title: "正在提交",
-            mask: true,
-        });
-        app.request({
-            url: api.book.order_pay,
-            data: {
-                id: e.currentTarget.dataset.id,
-            },
-            complete: function () {
-                wx.hideLoading();
-            },
-            success: function (res) {
-                console.log(res);
-                if (res.code == 0) {
-                    wx.requestPayment({
-                        timeStamp: res.data.timeStamp,
-                        nonceStr: res.data.nonceStr,
-                        package: res.data.package,
-                        signType: res.data.signType,
-                        paySign: res.data.paySign,
-                        success: function (e) {
-                            console.log("success");
-                            console.log(e);
-                        },
-                        fail: function (e) {
-                            console.log("fail");
-                            console.log(e);
-                        },
-                        complete: function (e) {
-                            console.log("complete");
-                            console.log(e);
-
-                            if (e.errMsg == "requestPayment:fail" || e.errMsg == "requestPayment:fail cancel") {//支付失败转到待支付订单列表
-                                wx.showModal({
-                                    title: "提示",
-                                    content: "订单尚未支付",
-                                    showCancel: false,
-                                    confirmText: "确认",
-                                    success: function (res) {
-                                        if (res.confirm) {
-                                            wx.redirectTo({
-                                                url: "/pages/book/order/order?status=0",
-                                            });
-                                        }
-                                    }
-                                });
-                                return;
-                            }
-                            wx.redirectTo({
-                                url: "/pages/book/order/order?status=1",
-                            });
-                        },
-                    });
-                }
-                if (res.code == 1) {
-                    wx.showToast({
-                        title: res.msg,
-                        image: "/images/icon-warning.png",
-                    });
-                }
-            }
-        });
-    },
-    /**
-     * 门店列表
-     */
-    goToShopList:function(e)
-    {
-        wx.redirectTo({
-            url: '/pages/book/shop/shop?ids=' + this.data.goods.shop_id,
-        })
-    },
-    /**
-     * 核销码
-     */
-    orderQrcode: function (e) {
-        var page = this;
-        var index = e.target.dataset.index;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        if (page.data.goods.offline_qrcode) {
-            page.setData({
-                hide: 0,
-                qrcode: page.data.goods.offline_qrcode
-            });
-            wx.hideLoading();
-        } else {
-            app.request({
-                url: api.book.get_qrcode,
-                data: {
-                    order_no: page.data.goods.order_no
-                },
-                success: function (res) {
-                    if (res.code == 0) {
-                        page.setData({
-                            hide: 0,
-                            qrcode: res.data.url
-                        });
-                    } else {
-                        wx.showModal({
-                            title: '提示',
-                            content: res.msg,
-                        })
-                    }
-                },
-                complete: function () {
-                    wx.hideLoading();
-                }
-            });
-        }
-    },
-    hide: function (e) {
-        this.setData({
-            hide: 1
-        });
-    },
-    /**
-     * 前往评价
-     */
-    comment: function (e) {
-        wx.navigateTo({
-            url: '/pages/book/order-comment/order-comment?id=' + e.target.dataset.id,
-            success: function (res) { },
-            fail: function (res) { },
-            complete: function (res) { },
-        })
-    }
+    // pages/book/order/details.js
+var api = require('../../../api.js');
+var utils = require('../../../utils.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        hide: 1,
+        qrcode: ""
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+        this.getOrderDetails(options);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        app.pageOnShow(this);
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+    
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+    
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+    
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+    
+    },
+
+    /**
+     * 订单详情
+     */
+    getOrderDetails:function(e){
+        var oid = e.oid;
+        var page = this;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        // wx.showNavigationBarLoading();
+        app.request({
+            url: api.book.order_details,
+            method: "get",
+            data: { id: oid },
+            success: function (res) {
+                if (res.code == 0) {
+                    page.setData({
+                        goods: res.data,
+                    });
+                } else {
+                    wx.showModal({
+                        title: '提示',
+                        content: res.msg,
+                        showCancel: false,
+                        success: function (res) {
+                            if (res.confirm) {
+                                wx.redirectTo({
+                                    url: '/pages/book/order/order?status=1'
+                                });
+                            }
+                        }
+                    });
+                }
+            },
+            complete: function (res) {
+                setTimeout(function () {
+                    // 延长一秒取消加载动画
+                    wx.hideLoading();
+                }, 1000);
+            }
+        });
+    },
+    /**
+     * 跳转至商品详情
+     */
+    goToGoodsDetails:function(e){
+        wx.redirectTo({
+            url: '/pages/book/details/details?id=' + this.data.goods.goods_id,
+        })
+    },
+    /**
+ * 点击取消
+ */
+    orderCancel: function (e) {
+        var page = this;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        var id = e.currentTarget.dataset.id;
+        app.request({
+            url: api.book.order_cancel,
+            data: {
+                id: id,
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    wx.redirectTo({
+                        url: '/pages/book/order/order?status=0'
+                    })
+                }
+            },
+            complete: function () {
+                wx.hideLoading();
+            }
+        });
+    },
+    /**
+     * 订单列表点击支付
+     */
+    GoToPay(e) {
+        wx.showLoading({
+            title: "正在提交",
+            mask: true,
+        });
+        app.request({
+            url: api.book.order_pay,
+            data: {
+                id: e.currentTarget.dataset.id,
+            },
+            complete: function () {
+                wx.hideLoading();
+            },
+            success: function (res) {
+                console.log(res);
+                if (res.code == 0) {
+                    wx.requestPayment({
+                        timeStamp: res.data.timeStamp,
+                        nonceStr: res.data.nonceStr,
+                        package: res.data.package,
+                        signType: res.data.signType,
+                        paySign: res.data.paySign,
+                        success: function (e) {
+                            console.log("success");
+                            console.log(e);
+                        },
+                        fail: function (e) {
+                            console.log("fail");
+                            console.log(e);
+                        },
+                        complete: function (e) {
+                            console.log("complete");
+                            console.log(e);
+
+                            if (e.errMsg == "requestPayment:fail" || e.errMsg == "requestPayment:fail cancel") {//支付失败转到待支付订单列表
+                                wx.showModal({
+                                    title: "提示",
+                                    content: "订单尚未支付",
+                                    showCancel: false,
+                                    confirmText: "确认",
+                                    success: function (res) {
+                                        if (res.confirm) {
+                                            wx.redirectTo({
+                                                url: "/pages/book/order/order?status=0",
+                                            });
+                                        }
+                                    }
+                                });
+                                return;
+                            }
+                            wx.redirectTo({
+                                url: "/pages/book/order/order?status=1",
+                            });
+                        },
+                    });
+                }
+                if (res.code == 1) {
+                    wx.showToast({
+                        title: res.msg,
+                        image: "/images/icon-warning.png",
+                    });
+                }
+            }
+        });
+    },
+    /**
+     * 门店列表
+     */
+    goToShopList:function(e)
+    {
+        wx.redirectTo({
+            url: '/pages/book/shop/shop?ids=' + this.data.goods.shop_id,
+        })
+    },
+    /**
+     * 核销码
+     */
+    orderQrcode: function (e) {
+        var page = this;
+        var index = e.target.dataset.index;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        if (page.data.goods.offline_qrcode) {
+            page.setData({
+                hide: 0,
+                qrcode: page.data.goods.offline_qrcode
+            });
+            wx.hideLoading();
+        } else {
+            app.request({
+                url: api.book.get_qrcode,
+                data: {
+                    order_no: page.data.goods.order_no
+                },
+                success: function (res) {
+                    if (res.code == 0) {
+                        page.setData({
+                            hide: 0,
+                            qrcode: res.data.url
+                        });
+                    } else {
+                        wx.showModal({
+                            title: '提示',
+                            content: res.msg,
+                        })
+                    }
+                },
+                complete: function () {
+                    wx.hideLoading();
+                }
+            });
+        }
+    },
+    hide: function (e) {
+        this.setData({
+            hide: 1
+        });
+    },
+    /**
+     * 前往评价
+     */
+    comment: function (e) {
+        wx.navigateTo({
+            url: '/pages/book/order-comment/order-comment?id=' + e.target.dataset.id,
+            success: function (res) { },
+            fail: function (res) { },
+            complete: function (res) { },
+        })
+    }
 });

+ 2 - 2
wechat/pages/book/order/details.json

xqd
@@ -1,3 +1,3 @@
-{
-    "navigationBarTitleText": "订单详情"
+{
+    "navigationBarTitleText": "订单详情"
 }

+ 98 - 98
wechat/pages/book/order/details.wxml

xqd
@@ -1,99 +1,99 @@
-<!--pages/book/order/details.wxml-->
-<view style='padding-bottom:120rpx;'>
-    <view class='goods flex-row' bindtap='goToGoodsDetails'>
-        <view class='goods-pic flex-grow-0'>
-                <image src='{{goods.cover_pic}}'></image>
-        </view>
-        <view class='goods-info flex-grow-1 flex-col'>
-                <view class='goods-name flex-grow-1'>
-                        {{goods.name}}
-                </view>
-                <view class='money flex-grow-0 flex-row flex-y-bottom '>
-                    <view class='original_price flex-gorw-0'>
-                        ¥ {{goods.original_price}}
-                    </view>
-                    <view class='price flex-grow-0'>
-                        ¥ {{goods.pay_price}}
-                    </view>
-                </view>
-        </view>
-        <view class='goods-right flex-grow-0 flex-y-center'>
-                <image src='/images/img-share-right.png'></image>
-        </view>
-    </view>
-
-    <view class='shop'>
-        <view class='shop-title flex-y-center'>
-                门店信息
-        </view>
-        <view class='shop-info'>
-                <view class='shop-name'>
-                    {{goods.shopList[0].name}}
-                </view>
-                <view class='shop-addres'>
-                    地址:{{goods.shopList[0].address}}
-                </view>
-                <view class='shop-time'>
-                    营业时间:{{goods.shopList[0].shop_time?goods.shopList[0].shop_time:'7 x 24'}}
-                </view>
-        </view>
-        <view class='all-shop flex-row flex-y-center' bindtap='goToShopList'>
-                <view class='shop-text flex-grow-1 flex-y-center'>
-                    查看全部{{goods.shopListNum}}家分店
-                </view>
-                <view class='shop-more flex-grow-0 flex-y-center'>
-                    <image src='/images/img-share-right.png'></image>
-                </view>
-        </view>
-    </view>
-    <view class='order'>
-        <view class='order-title flex-y-center'>
-            订单信息
-        </view>
-        <view class='order-info'>
-            <view class='order-info-item'>
-                订单号:{{goods.order_no}}
-            </view>
-            <view class='order-info-item'>
-                下单时间:{{goods.addtime}}
-            </view>
-            <view class='order-info-item' wx:for='{{goods.orderForm}}'>
-                {{item.key}}:{{item.value}}
-            </view>
-        </view>
-    </view>
-</view>
-
-
-<view class='btn-group flex-row' wx:if='{{goods.apply_delete != 1&&goods.is_refund != 1&&goods.is_comment != 1}}'>
-    <block wx:if='{{goods.is_pay==1&&goods.is_use==0&&goods.apply_delete==0}}'>
-        <view class='btn-group-item apply flex-x-center flex-y-cneter' wx:if='{{goods.pay_price > 0}}'>
-            申请退款
-        </view>
-        <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='orderQrcode'>
-            立即使用
-        </view>
-    </block>
-    <block wx:if='{{goods.is_pay==0&&goods.is_cancel==0}}'>
-        <view class='btn-group-item apply flex-x-center flex-y-cneter' bindtap='orderCancel' data-id='{{goods.id}}'>
-            取消
-        </view>
-        <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='GoToPay' data-id='{{goods.id}}'>
-            支付
-        </view>
-    </block>
-    <block wx:if='{{goods.is_use==1&&goods.is_comment==0}}'>
-        <view class='btn-group-item apply flex-x-center flex-y-cneter' bindtap='comment' data-id='{{goods.id}}'>
-            评价
-        </view>
-    </block>
-</view>
-
-<view class='flex-row flex-y-center modal {{hide==1?"hide":""}}' bindtap='hide'>
-    <view class='flex-y-center' style='width:100%;height:800rpx;padding:100rpx;'>
-        <view style='background-color:#fff;width:100%;height:100%;border-radius:10rpx;padding:0 50rpx;'>
-            <view class='flex-x-center' style='width:100%;height:50rpx;margin-top:50rpx;font-size:13pt;margin-bottom:20rpx'>提货二维码</view>
-            <image src='{{qrcode}}' style='width:450rpx;height:450rpx;'></image>
-        </view>
-    </view>
+<!--pages/book/order/details.wxml-->
+<view style='padding-bottom:120rpx;'>
+    <view class='goods flex-row' bindtap='goToGoodsDetails'>
+        <view class='goods-pic flex-grow-0'>
+                <image src='{{goods.cover_pic}}'></image>
+        </view>
+        <view class='goods-info flex-grow-1 flex-col'>
+                <view class='goods-name flex-grow-1'>
+                        {{goods.name}}
+                </view>
+                <view class='money flex-grow-0 flex-row flex-y-bottom '>
+                    <view class='original_price flex-gorw-0'>
+                        ¥ {{goods.original_price}}
+                    </view>
+                    <view class='price flex-grow-0'>
+                        ¥ {{goods.pay_price}}
+                    </view>
+                </view>
+        </view>
+        <view class='goods-right flex-grow-0 flex-y-center'>
+                <image src='/images/img-share-right.png'></image>
+        </view>
+    </view>
+
+    <view class='shop'>
+        <view class='shop-title flex-y-center'>
+                门店信息
+        </view>
+        <view class='shop-info'>
+                <view class='shop-name'>
+                    {{goods.shopList[0].name}}
+                </view>
+                <view class='shop-addres'>
+                    地址:{{goods.shopList[0].address}}
+                </view>
+                <view class='shop-time'>
+                    营业时间:{{goods.shopList[0].shop_time?goods.shopList[0].shop_time:'7 x 24'}}
+                </view>
+        </view>
+        <view class='all-shop flex-row flex-y-center' bindtap='goToShopList'>
+                <view class='shop-text flex-grow-1 flex-y-center'>
+                    查看全部{{goods.shopListNum}}家分店
+                </view>
+                <view class='shop-more flex-grow-0 flex-y-center'>
+                    <image src='/images/img-share-right.png'></image>
+                </view>
+        </view>
+    </view>
+    <view class='order'>
+        <view class='order-title flex-y-center'>
+            订单信息
+        </view>
+        <view class='order-info'>
+            <view class='order-info-item'>
+                订单号:{{goods.order_no}}
+            </view>
+            <view class='order-info-item'>
+                下单时间:{{goods.addtime}}
+            </view>
+            <view class='order-info-item' wx:for='{{goods.orderForm}}'>
+                {{item.key}}:{{item.value}}
+            </view>
+        </view>
+    </view>
+</view>
+
+
+<view class='btn-group flex-row' wx:if='{{goods.apply_delete != 1&&goods.is_refund != 1&&goods.is_comment != 1}}'>
+    <block wx:if='{{goods.is_pay==1&&goods.is_use==0&&goods.apply_delete==0}}'>
+        <view class='btn-group-item apply flex-x-center flex-y-cneter' wx:if='{{goods.pay_price > 0}}'>
+            申请退款
+        </view>
+        <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='orderQrcode'>
+            立即使用
+        </view>
+    </block>
+    <block wx:if='{{goods.is_pay==0&&goods.is_cancel==0}}'>
+        <view class='btn-group-item apply flex-x-center flex-y-cneter' bindtap='orderCancel' data-id='{{goods.id}}'>
+            取消
+        </view>
+        <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='GoToPay' data-id='{{goods.id}}'>
+            支付
+        </view>
+    </block>
+    <block wx:if='{{goods.is_use==1&&goods.is_comment==0}}'>
+        <view class='btn-group-item apply flex-x-center flex-y-cneter' bindtap='comment' data-id='{{goods.id}}'>
+            评价
+        </view>
+    </block>
+</view>
+
+<view class='flex-row flex-y-center modal {{hide==1?"hide":""}}' bindtap='hide'>
+    <view class='flex-y-center' style='width:100%;height:800rpx;padding:100rpx;'>
+        <view style='background-color:#fff;width:100%;height:100%;border-radius:10rpx;padding:0 50rpx;'>
+            <view class='flex-x-center' style='width:100%;height:50rpx;margin-top:50rpx;font-size:13pt;margin-bottom:20rpx'>提货二维码</view>
+            <image src='{{qrcode}}' style='width:450rpx;height:450rpx;'></image>
+        </view>
+    </view>
 </view>

+ 132 - 132
wechat/pages/book/order/details.wxss

xqd
@@ -1,133 +1,133 @@
-/* pages/book/order/details.wxss */
-.goods{
-    padding: 24rpx;
-    background-color: #fff;
-}
-.goods-pic{
-    margin-right: 24rpx;
-}
-.goods-pic image{
-    width: 208rpx;
-    height: 160rpx;
-}
-.goods-right image{
-    width: 16rpx;
-    height: 26rpx;
-}
-.goods-info{
-    margin-top: 10rpx;
-    margin-bottom: 32rpx;
-    margin-right: 56rpx;
-}
-.goods-name{
-    font-size: 11pt;
-    color: #353535;
-}
-.money{
-    margin-top: 20rpx;
-    justify-content:flex-end;
-}
-.original_price{
-    text-decoration: line-through;
-    color: #a4a4a4;
-    font-size: 10pt;
-}
-.price{
-    color: #ff4544;
-    font-size: 12.5pt;
-    margin-left: 24rpx;
-}
-.shop-more image{
-    width: 16rpx;
-    height: 26rpx;
-}
-
-.shop{
-    background-color: #ffffff;
-    margin-bottom: 20rpx;
-    padding: 0 24rpx;
-    font-size: 11pt;
-    margin-top: 20rpx;
-}
-.shop-title{
-    height: 72rpx;
-    font-size: 10pt;
-    color: #a4a4a4;
-    border-bottom: 1rpx solid #e2e2e2;
-}
-.shop-info{
-    border-bottom: 1rpx solid #e2e2e2; 
-    padding: 30rpx 0;
-}
-.shop-name{
-    margin-bottom: 20rpx;
-    color: #353535;
-}
-.shop-addres,.shop-time{
-    color: #999999;
-}
-.all-shop{
-    color: #00a0e9;
-    height: 80rpx;
-}
-.order{
-    background-color: #fff;
-    padding: 0 24rpx;
-}
-.order-title{
-    font-size: 10pt;
-    color: #a4a4a4;
-    height: 72rpx;
-    border-bottom: 1rpx solid #e2e2e2;
-    margin-bottom: 30rpx;
-}
-.order-info{
-    font-size: 11pt;
-    color: #353535;
-    line-height: 1.5;
-}
-.order-info-item{
-    padding-bottom: 16rpx;  
-}
-
-.btn-group{
-    border-top: 1rpx solid #e2e2e2;
-    padding: 24rpx;
-    justify-content:flex-end;
-    background-color:#fff;
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    width: 100%; 
-}
-.btn-group-item{
-    font-size: 30rpx;
-    height: 60rpx;
-    width: 180rpx;
-    border-radius: 30rpx;
-    margin-left: 16rpx;
-    line-height: 60rpx;
-}
-.btn-group-item.apply{
-    border: 1rpx solid #c9c9c9;
-    color: #666666;
-    background-color:#fff; 
-}
-.btn-group-item.promptly{
-    border: 1rpx solid #ff4545;
-    color: #ff4544;
-    background-color: #fff5f5;
-}
-
-.hide{
-  display: none;
-}
-.modal{
-  position: fixed;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-  background-color: rgba(0, 0, 0, 0.5);
-  z-index: 9999;
+/* pages/book/order/details.wxss */
+.goods{
+    padding: 24rpx;
+    background-color: #fff;
+}
+.goods-pic{
+    margin-right: 24rpx;
+}
+.goods-pic image{
+    width: 208rpx;
+    height: 160rpx;
+}
+.goods-right image{
+    width: 16rpx;
+    height: 26rpx;
+}
+.goods-info{
+    margin-top: 10rpx;
+    margin-bottom: 32rpx;
+    margin-right: 56rpx;
+}
+.goods-name{
+    font-size: 11pt;
+    color: #353535;
+}
+.money{
+    margin-top: 20rpx;
+    justify-content:flex-end;
+}
+.original_price{
+    text-decoration: line-through;
+    color: #a4a4a4;
+    font-size: 10pt;
+}
+.price{
+    color: #ff4544;
+    font-size: 12.5pt;
+    margin-left: 24rpx;
+}
+.shop-more image{
+    width: 16rpx;
+    height: 26rpx;
+}
+
+.shop{
+    background-color: #ffffff;
+    margin-bottom: 20rpx;
+    padding: 0 24rpx;
+    font-size: 11pt;
+    margin-top: 20rpx;
+}
+.shop-title{
+    height: 72rpx;
+    font-size: 10pt;
+    color: #a4a4a4;
+    border-bottom: 1rpx solid #e2e2e2;
+}
+.shop-info{
+    border-bottom: 1rpx solid #e2e2e2; 
+    padding: 30rpx 0;
+}
+.shop-name{
+    margin-bottom: 20rpx;
+    color: #353535;
+}
+.shop-addres,.shop-time{
+    color: #999999;
+}
+.all-shop{
+    color: #00a0e9;
+    height: 80rpx;
+}
+.order{
+    background-color: #fff;
+    padding: 0 24rpx;
+}
+.order-title{
+    font-size: 10pt;
+    color: #a4a4a4;
+    height: 72rpx;
+    border-bottom: 1rpx solid #e2e2e2;
+    margin-bottom: 30rpx;
+}
+.order-info{
+    font-size: 11pt;
+    color: #353535;
+    line-height: 1.5;
+}
+.order-info-item{
+    padding-bottom: 16rpx;  
+}
+
+.btn-group{
+    border-top: 1rpx solid #e2e2e2;
+    padding: 24rpx;
+    justify-content:flex-end;
+    background-color:#fff;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%; 
+}
+.btn-group-item{
+    font-size: 30rpx;
+    height: 60rpx;
+    width: 180rpx;
+    border-radius: 30rpx;
+    margin-left: 16rpx;
+    line-height: 60rpx;
+}
+.btn-group-item.apply{
+    border: 1rpx solid #c9c9c9;
+    color: #666666;
+    background-color:#fff; 
+}
+.btn-group-item.promptly{
+    border: 1rpx solid #ff4545;
+    color: #ff4544;
+    background-color: #fff5f5;
+}
+
+.hide{
+  display: none;
+}
+.modal{
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.5);
+  z-index: 9999;
 }

+ 342 - 342
wechat/pages/book/order/order.js

xqd
@@ -1,343 +1,343 @@
-// pages/book/order/order.js
-var api = require('../../../api.js');
-var app = getApp();
-var is_no_more = false;
-var is_loading = false;
-var p = 2;
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-    data: {
-        hide: 1,
-        qrcode: ""
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-      app.pageOnLoad(this);
-      var page = this;
-      is_no_more = false;
-      is_loading = false;
-      p = 2;
-      page.loadOrderList(options.status || -1);
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-  
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-      app.pageOnShow(this);
-  
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-  
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-  
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-  
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-      var page = this;
-      if (is_loading || is_no_more)
-          return;
-      is_loading = true;
-      app.request({
-          url: api.book.order_list,
-          data: {
-              status: page.data.status,
-              page: p,
-          },
-          success: function (res) {
-              if (res.code == 0) {
-                  var order_list = page.data.order_list.concat(res.data.list);
-                  page.setData({
-                      order_list: order_list,
-                  });
-                  if (res.data.list.length == 0) {
-                      is_no_more = true;
-                  }
-              }
-              p++;
-          },
-          complete: function () {
-              is_loading = false;
-          }
-      });
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-  
-  },
-    /**
-     * 初次加载数据
-     */
-    loadOrderList: function (status) {
-        if (status == undefined)
-            status = -1;
-        var page = this;
-        page.setData({
-            status: status,
-        });
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        app.request({
-            url: api.book.order_list,
-            data: {
-                status: page.data.status,
-
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    page.setData({
-                        order_list: res.data.list,
-                    });
-                }
-                page.setData({
-                    show_no_data_tip: (page.data.order_list.length == 0),
-                });
-            },
-            complete: function () {
-                wx.hideLoading();
-            }
-        });
-    },
-
-    /**
-     * 点击取消
-     */
-    orderCancel:function(e)
-    {
-        var page = this;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        var id = e.currentTarget.dataset.id;
-        app.request({
-            url: api.book.order_cancel,
-            data: {
-                id: id,
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    wx.redirectTo({
-                        url: '/pages/book/order/order?status=0'
-                    })
-                }
-            },
-            complete: function () {
-                wx.hideLoading();
-            }
-        });
-    },
-    /**
-     * 订单列表点击支付
-     */
-    GoToPay(e){
-        wx.showLoading({
-            title: "正在提交",
-            mask: true,
-        });
-        app.request({
-            url: api.book.order_pay,
-            data: {
-                id: e.currentTarget.dataset.id,
-            },
-            complete: function () {
-                wx.hideLoading();
-            },
-            success: function (res) {
-                console.log(res);
-                if (res.code == 0) {
-                    wx.requestPayment({
-                        timeStamp: res.data.timeStamp,
-                        nonceStr: res.data.nonceStr,
-                        package: res.data.package,
-                        signType: res.data.signType,
-                        paySign: res.data.paySign,
-                        success: function (e) {
-                            console.log("success");
-                            console.log(e);
-                        },
-                        fail: function (e) {
-                            console.log("fail");
-                            console.log(e);
-                        },
-                        complete: function (e) {
-                            console.log("complete");
-                            console.log(e);
-
-                            if (e.errMsg == "requestPayment:fail" || e.errMsg == "requestPayment:fail cancel") {//支付失败转到待支付订单列表
-                                wx.showModal({
-                                    title: "提示",
-                                    content: "订单尚未支付",
-                                    showCancel: false,
-                                    confirmText: "确认",
-                                    success: function (res) {
-                                        if (res.confirm) {
-                                            wx.redirectTo({
-                                                url: "/pages/book/order/order?status=0",
-                                            });
-                                        }
-                                    }
-                                });
-                                return;
-                            }
-                            wx.redirectTo({
-                                url: "/pages/book/order/order?status=1",
-                            });
-                        },
-                    });
-                }
-                if (res.code == 1) {
-                    wx.showToast({
-                        title: res.msg,
-                        image: "/images/icon-warning.png",
-                    });
-                }
-            }
-        });
-    },
-    /**
-     * 前往详情
-     */
-    goToDetails:function(e){
-        console.log(e);
-        wx.navigateTo({
-            url: '/pages/book/order/details?oid=' + e.currentTarget.dataset.id,
-        });
-    },
-    /**
-     * 核销码
-     */
-    orderQrcode: function (e) {
-        var page = this;
-        var index = e.target.dataset.index;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        if (page.data.order_list[index].offline_qrcode) {
-            page.setData({
-                hide: 0,
-                qrcode: page.data.order_list[index].offline_qrcode
-            });
-            wx.hideLoading();
-        } else {
-            app.request({
-                url: api.book.get_qrcode,
-                data: {
-                    order_no: page.data.order_list[index].order_no
-                },
-                success: function (res) {
-                    if (res.code == 0) {
-                        page.setData({
-                            hide: 0,
-                            qrcode: res.data.url
-                        });
-                    } else {
-                        wx.showModal({
-                            title: '提示',
-                            content: res.msg,
-                        })
-                    }
-                },
-                complete: function () {
-                    wx.hideLoading();
-                }
-            });
-        }
-    },
-    hide: function (e) {
-        this.setData({
-            hide: 1
-        });
-    },
-    /**
-     * 申请退款
-     */
-    applyRefund:function(e)
-    {
-        var page = this;
-        var id = e.target.dataset.id;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        app.request({
-            url: api.book.apply_refund,
-            data: {
-                order_id: id
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    wx.showModal({
-                        title: '提示',
-                        content: '申请退款成功',
-                        showCancel:false,
-                        success: function (res) {
-                            if (res.confirm) {
-                                wx.redirectTo({
-                                    url: "/pages/book/order/order?status=3",
-                                });
-                            }
-                        }
-                    })
-                } else {
-                    wx.showModal({
-                        title: '提示',
-                        content: res.msg,
-                    })
-                }
-            },
-            complete: function () {
-                wx.hideLoading();
-            }
-        });
-    },
-    /**
-     * 前往评价
-     */
-    comment:function(e){
-        wx.navigateTo({
-            url: '/pages/book/order-comment/order-comment?id='+e.target.dataset.id,
-            success: function(res) {},
-            fail: function(res) {},
-            complete: function(res) {},
-        })
-    }
+// pages/book/order/order.js
+var api = require('../../../api.js');
+var app = getApp();
+var is_no_more = false;
+var is_loading = false;
+var p = 2;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+    data: {
+        hide: 1,
+        qrcode: ""
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+      app.pageOnLoad(this);
+      var page = this;
+      is_no_more = false;
+      is_loading = false;
+      p = 2;
+      page.loadOrderList(options.status || -1);
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+      app.pageOnShow(this);
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+      var page = this;
+      if (is_loading || is_no_more)
+          return;
+      is_loading = true;
+      app.request({
+          url: api.book.order_list,
+          data: {
+              status: page.data.status,
+              page: p,
+          },
+          success: function (res) {
+              if (res.code == 0) {
+                  var order_list = page.data.order_list.concat(res.data.list);
+                  page.setData({
+                      order_list: order_list,
+                  });
+                  if (res.data.list.length == 0) {
+                      is_no_more = true;
+                  }
+              }
+              p++;
+          },
+          complete: function () {
+              is_loading = false;
+          }
+      });
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+  
+  },
+    /**
+     * 初次加载数据
+     */
+    loadOrderList: function (status) {
+        if (status == undefined)
+            status = -1;
+        var page = this;
+        page.setData({
+            status: status,
+        });
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        app.request({
+            url: api.book.order_list,
+            data: {
+                status: page.data.status,
+
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    page.setData({
+                        order_list: res.data.list,
+                    });
+                }
+                page.setData({
+                    show_no_data_tip: (page.data.order_list.length == 0),
+                });
+            },
+            complete: function () {
+                wx.hideLoading();
+            }
+        });
+    },
+
+    /**
+     * 点击取消
+     */
+    orderCancel:function(e)
+    {
+        var page = this;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        var id = e.currentTarget.dataset.id;
+        app.request({
+            url: api.book.order_cancel,
+            data: {
+                id: id,
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    wx.redirectTo({
+                        url: '/pages/book/order/order?status=0'
+                    })
+                }
+            },
+            complete: function () {
+                wx.hideLoading();
+            }
+        });
+    },
+    /**
+     * 订单列表点击支付
+     */
+    GoToPay(e){
+        wx.showLoading({
+            title: "正在提交",
+            mask: true,
+        });
+        app.request({
+            url: api.book.order_pay,
+            data: {
+                id: e.currentTarget.dataset.id,
+            },
+            complete: function () {
+                wx.hideLoading();
+            },
+            success: function (res) {
+                console.log(res);
+                if (res.code == 0) {
+                    wx.requestPayment({
+                        timeStamp: res.data.timeStamp,
+                        nonceStr: res.data.nonceStr,
+                        package: res.data.package,
+                        signType: res.data.signType,
+                        paySign: res.data.paySign,
+                        success: function (e) {
+                            console.log("success");
+                            console.log(e);
+                        },
+                        fail: function (e) {
+                            console.log("fail");
+                            console.log(e);
+                        },
+                        complete: function (e) {
+                            console.log("complete");
+                            console.log(e);
+
+                            if (e.errMsg == "requestPayment:fail" || e.errMsg == "requestPayment:fail cancel") {//支付失败转到待支付订单列表
+                                wx.showModal({
+                                    title: "提示",
+                                    content: "订单尚未支付",
+                                    showCancel: false,
+                                    confirmText: "确认",
+                                    success: function (res) {
+                                        if (res.confirm) {
+                                            wx.redirectTo({
+                                                url: "/pages/book/order/order?status=0",
+                                            });
+                                        }
+                                    }
+                                });
+                                return;
+                            }
+                            wx.redirectTo({
+                                url: "/pages/book/order/order?status=1",
+                            });
+                        },
+                    });
+                }
+                if (res.code == 1) {
+                    wx.showToast({
+                        title: res.msg,
+                        image: "/images/icon-warning.png",
+                    });
+                }
+            }
+        });
+    },
+    /**
+     * 前往详情
+     */
+    goToDetails:function(e){
+        console.log(e);
+        wx.navigateTo({
+            url: '/pages/book/order/details?oid=' + e.currentTarget.dataset.id,
+        });
+    },
+    /**
+     * 核销码
+     */
+    orderQrcode: function (e) {
+        var page = this;
+        var index = e.target.dataset.index;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        if (page.data.order_list[index].offline_qrcode) {
+            page.setData({
+                hide: 0,
+                qrcode: page.data.order_list[index].offline_qrcode
+            });
+            wx.hideLoading();
+        } else {
+            app.request({
+                url: api.book.get_qrcode,
+                data: {
+                    order_no: page.data.order_list[index].order_no
+                },
+                success: function (res) {
+                    if (res.code == 0) {
+                        page.setData({
+                            hide: 0,
+                            qrcode: res.data.url
+                        });
+                    } else {
+                        wx.showModal({
+                            title: '提示',
+                            content: res.msg,
+                        })
+                    }
+                },
+                complete: function () {
+                    wx.hideLoading();
+                }
+            });
+        }
+    },
+    hide: function (e) {
+        this.setData({
+            hide: 1
+        });
+    },
+    /**
+     * 申请退款
+     */
+    applyRefund:function(e)
+    {
+        var page = this;
+        var id = e.target.dataset.id;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        app.request({
+            url: api.book.apply_refund,
+            data: {
+                order_id: id
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    wx.showModal({
+                        title: '提示',
+                        content: '申请退款成功',
+                        showCancel:false,
+                        success: function (res) {
+                            if (res.confirm) {
+                                wx.redirectTo({
+                                    url: "/pages/book/order/order?status=3",
+                                });
+                            }
+                        }
+                    })
+                } else {
+                    wx.showModal({
+                        title: '提示',
+                        content: res.msg,
+                    })
+                }
+            },
+            complete: function () {
+                wx.hideLoading();
+            }
+        });
+    },
+    /**
+     * 前往评价
+     */
+    comment:function(e){
+        wx.navigateTo({
+            url: '/pages/book/order-comment/order-comment?id='+e.target.dataset.id,
+            success: function(res) {},
+            fail: function(res) {},
+            complete: function(res) {},
+        })
+    }
 })

+ 2 - 2
wechat/pages/book/order/order.json

xqd
@@ -1,3 +1,3 @@
-{
-    "navigationBarTitleText": "我的预约"
+{
+    "navigationBarTitleText": "我的预约"
 }

+ 86 - 86
wechat/pages/book/order/order.wxml

xqd
@@ -1,87 +1,87 @@
-<!--pages/book/order/order.wxml-->
-<view class="flex-row tab-bar">
-  <view class="flex-grow-1">
-    <navigator class="{{status==-1?'active':''}}" url="/pages/book/order/order?status=-1" open-type="redirect">
-      <text>全部</text>
-    </navigator>
-  </view> 
-  <view class="flex-grow-1">
-    <navigator class="{{status==0?'active':''}}" url="/pages/book/order/order?status=0" open-type="redirect">
-      <text>待支付</text>
-    </navigator>
-  </view>
-  <view class="flex-grow-1">
-    <navigator class="{{status==1?'active':''}}" url="/pages/book/order/order?status=1" open-type="redirect">
-      <text>待使用</text>
-    </navigator>
-  </view> 
-  <view class="flex-grow-1">
-    <navigator class="{{status==2?'active':''}}" url="/pages/book/order/order?status=2" open-type="redirect">
-      <text>已使用</text>
-    </navigator>
-  </view>
-  <view class="flex-grow-1">
-    <navigator class="{{status==3?'active':''}}" url="/pages/book/order/order?status=3" open-type="redirect">
-      <text>退款</text>
-    </navigator>
-  </view>
-</view>
-<view class='order-list'>
-    <view class='order-item'  wx:for='{{order_list}}'>
-        <view class='flex-row' bindtap='goToDetails' data-id='{{item.id}}'>
-            <view class='goods-pic flex-grow-0'>
-                <view class=' order-leabl' wx:if='{{item.is_pay==1&&item.is_use==0&&item.apply_delete==0}}'>待使用</view>
-                <view class=' order-leabl' wx:if='{{item.is_pay==0&&item.is_cancel==0}}'>待支付</view>
-                <image src='{{item.cover_pic}}'></image>
-            </view>
-            <view class='flex-grow-1 goods-info'>
-                <view class='goods-name'>
-                        {{item.goods_name}}
-                </view>
-                <view class='flex-gorw-0 flex-row money flex-y-bottom'>
-                        <view class='original_price flex-grow-0'>
-                            ¥ {{item.original_price}}
-                        </view>
-                        <view class='price flex-grow-0'>
-                            ¥ {{item.pay_price}}
-                        </view>
-                </view>
-            </view>        
-        </view>
-        <view class='btn-group flex-row' wx:if='{{item.apply_delete != 1&&item.is_refund != 1&&item.is_comment != 1}}'>
-            <block wx:if='{{item.is_pay==1&&item.is_use==0&&item.apply_delete==0}}'>
-                <view class='btn-group-item apply flex-x-center flex-y-cneter' bindtap='applyRefund' data-id='{{item.id}}' wx:if='{{item.pay_price > 0}}'>
-                    申请退款
-                </view>
-                <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='orderQrcode' data-index='{{index}}'>
-                    立即使用
-                </view>
-            </block>
-            <block wx:if='{{item.is_pay==0&&item.is_cancel==0}}'>
-                <view class='btn-group-item apply flex-x-center flex-y-cneter' bindtap='orderCancel' data-id='{{item.id}}'>
-                    取消
-                </view>
-                <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='GoToPay' data-id='{{item.id}}'>
-                    支付
-                </view>
-            </block>
-            <block wx:if='{{item.is_use==1&&item.is_comment==0}}'>
-                <view class='btn-group-item apply flex-x-center flex-y-cneter' data-id='{{item.id}}' bindtap='comment'>
-                    评价
-                </view>
-            </block>
-        </view>
-
-    </view>
-    <view class='no-data-tip' wx:if='{{show_no_data_tip}}'>
-            暂无相关订单
-    </view>
-</view>
-<view class='flex-row flex-y-center modal {{hide==1?"hide":""}}' bindtap='hide'>
-    <view class='flex-y-center' style='width:100%;height:800rpx;padding:100rpx;'>
-        <view style='background-color:#fff;width:100%;height:100%;border-radius:10rpx;padding:0 50rpx;'>
-            <view class='flex-x-center' style='width:100%;height:50rpx;margin-top:50rpx;font-size:13pt;margin-bottom:20rpx'>核销二维码</view>
-            <image src='{{qrcode}}' style='width:450rpx;height:450rpx;'></image>
-        </view>
-    </view>
+<!--pages/book/order/order.wxml-->
+<view class="flex-row tab-bar">
+  <view class="flex-grow-1">
+    <navigator class="{{status==-1?'active':''}}" url="/pages/book/order/order?status=-1" open-type="redirect">
+      <text>全部</text>
+    </navigator>
+  </view> 
+  <view class="flex-grow-1">
+    <navigator class="{{status==0?'active':''}}" url="/pages/book/order/order?status=0" open-type="redirect">
+      <text>待支付</text>
+    </navigator>
+  </view>
+  <view class="flex-grow-1">
+    <navigator class="{{status==1?'active':''}}" url="/pages/book/order/order?status=1" open-type="redirect">
+      <text>待使用</text>
+    </navigator>
+  </view> 
+  <view class="flex-grow-1">
+    <navigator class="{{status==2?'active':''}}" url="/pages/book/order/order?status=2" open-type="redirect">
+      <text>已使用</text>
+    </navigator>
+  </view>
+  <view class="flex-grow-1">
+    <navigator class="{{status==3?'active':''}}" url="/pages/book/order/order?status=3" open-type="redirect">
+      <text>退款</text>
+    </navigator>
+  </view>
+</view>
+<view class='order-list'>
+    <view class='order-item'  wx:for='{{order_list}}'>
+        <view class='flex-row' bindtap='goToDetails' data-id='{{item.id}}'>
+            <view class='goods-pic flex-grow-0'>
+                <view class=' order-leabl' wx:if='{{item.is_pay==1&&item.is_use==0&&item.apply_delete==0}}'>待使用</view>
+                <view class=' order-leabl' wx:if='{{item.is_pay==0&&item.is_cancel==0}}'>待支付</view>
+                <image src='{{item.cover_pic}}'></image>
+            </view>
+            <view class='flex-grow-1 goods-info'>
+                <view class='goods-name'>
+                        {{item.goods_name}}
+                </view>
+                <view class='flex-gorw-0 flex-row money flex-y-bottom'>
+                        <view class='original_price flex-grow-0'>
+                            ¥ {{item.original_price}}
+                        </view>
+                        <view class='price flex-grow-0'>
+                            ¥ {{item.pay_price}}
+                        </view>
+                </view>
+            </view>        
+        </view>
+        <view class='btn-group flex-row' wx:if='{{item.apply_delete != 1&&item.is_refund != 1&&item.is_comment != 1}}'>
+            <block wx:if='{{item.is_pay==1&&item.is_use==0&&item.apply_delete==0}}'>
+                <view class='btn-group-item apply flex-x-center flex-y-cneter' bindtap='applyRefund' data-id='{{item.id}}' wx:if='{{item.pay_price > 0}}'>
+                    申请退款
+                </view>
+                <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='orderQrcode' data-index='{{index}}'>
+                    立即使用
+                </view>
+            </block>
+            <block wx:if='{{item.is_pay==0&&item.is_cancel==0}}'>
+                <view class='btn-group-item apply flex-x-center flex-y-cneter' bindtap='orderCancel' data-id='{{item.id}}'>
+                    取消
+                </view>
+                <view class='btn-group-item promptly flex-x-center flex-y-cneter' bindtap='GoToPay' data-id='{{item.id}}'>
+                    支付
+                </view>
+            </block>
+            <block wx:if='{{item.is_use==1&&item.is_comment==0}}'>
+                <view class='btn-group-item apply flex-x-center flex-y-cneter' data-id='{{item.id}}' bindtap='comment'>
+                    评价
+                </view>
+            </block>
+        </view>
+
+    </view>
+    <view class='no-data-tip' wx:if='{{show_no_data_tip}}'>
+            暂无相关订单
+    </view>
+</view>
+<view class='flex-row flex-y-center modal {{hide==1?"hide":""}}' bindtap='hide'>
+    <view class='flex-y-center' style='width:100%;height:800rpx;padding:100rpx;'>
+        <view style='background-color:#fff;width:100%;height:100%;border-radius:10rpx;padding:0 50rpx;'>
+            <view class='flex-x-center' style='width:100%;height:50rpx;margin-top:50rpx;font-size:13pt;margin-bottom:20rpx'>核销二维码</view>
+            <image src='{{qrcode}}' style='width:450rpx;height:450rpx;'></image>
+        </view>
+    </view>
 </view>

+ 122 - 122
wechat/pages/book/order/order.wxss

xqd
@@ -1,122 +1,122 @@
-/* pages/book/order/order.wxss */
-.tab-bar{
-    background: #fff;
-    border-bottom: 1rpx solid #e2e2e2;
-    position: fixed;
-    top:0;
-    left: 0;
-    width: 100%;
-    z-index: 1000;
-    font-size: 11pt;
-    color: #666666;
-}
-.tab-bar ~ .order-list{
-    padding-top: 100rpx;
-}
-.order-itme{
-    border-bottom: 1rpx solid #f7f7f7;
-}
-.tab-bar navigator{
-    display: block;
-    padding:0 24rpx;
-    text-align: center;
-}
-.tab-bar navigator text{
-    height: 100rpx;
-    line-height: 100rpx;
-    display: inline-block;
-}
-
-.tab-bar navigator.active text{
-    color: #ff5c5c;
-    border-bottom: 2rpx solid #f00;
-}
-.tab-bar ~ .order-list{
-    padding-top: 100rpx;
-}
-.order-item{
-    background-color: #fff;
-    /* padding: 0 24rpx; */
-    margin-top: 20rpx;
-}
-.goods-pic{
-    position: relative;
-    margin: 24rpx;
-}
-.order-leabl{
-    position: absolute;
-    left: 0;
-    top: 0;
-    width: 100rpx;
-    height: 48rpx;
-    font-size: 10pt;
-    background-color: #ff6868;
-    color: #fff;
-    line-height: 48rpx;
-    text-align: center;
-    border-radius: 8rpx 0 0 0;
-}
-.goods-pic image{
-    width: 208rpx;
-    height: 160rpx;
-    border-radius: 8rpx;
-}
-.goods-info{
-    margin: 34rpx 24rpx 32rpx 0;
-}
-.goods-name{
-    font-size: 11pt;
-    color: #353535;
-}
-.money {
-    margin-top: 24rpx;
-    justify-content:flex-end;
-}
-.original_price{
-    text-decoration: line-through;
-    color: #a4a4a4;
-}
-.price{
-    margin-left: 24rpx;
-    color: #ff5444;
-    font-size: 13pt;
-}
-.btn-group{
-    border-top: 1rpx solid #e2e2e2;
-    padding: 24rpx;
-    justify-content:flex-end;
-}
-.btn-group-item{
-    font-size: 30rpx;
-    height: 60rpx;
-    width: 180rpx;
-    border-radius: 30rpx;
-    margin-left: 16rpx;
-    line-height: 60rpx;
-}
-.btn-group-item.apply{
-    border: 1rpx solid #c9c9c9;
-    color: #666666;
-    background-color:#fff; 
-}
-.btn-group-item.promptly{
-    border: 1rpx solid #ff4545;
-    color: #ff4544;
-    background-color: #fff5f5;
-}
-
-.hide{
-  display: none;
-}
-.modal{
-  position: fixed;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-  background-color: rgba(0, 0, 0, 0.5);
-  z-index: 9999;
-}
-
-
-
+/* pages/book/order/order.wxss */
+.tab-bar{
+    background: #fff;
+    border-bottom: 1rpx solid #e2e2e2;
+    position: fixed;
+    top:0;
+    left: 0;
+    width: 100%;
+    z-index: 1000;
+    font-size: 11pt;
+    color: #666666;
+}
+.tab-bar ~ .order-list{
+    padding-top: 100rpx;
+}
+.order-itme{
+    border-bottom: 1rpx solid #f7f7f7;
+}
+.tab-bar navigator{
+    display: block;
+    padding:0 24rpx;
+    text-align: center;
+}
+.tab-bar navigator text{
+    height: 100rpx;
+    line-height: 100rpx;
+    display: inline-block;
+}
+
+.tab-bar navigator.active text{
+    color: #ff5c5c;
+    border-bottom: 2rpx solid #f00;
+}
+.tab-bar ~ .order-list{
+    padding-top: 100rpx;
+}
+.order-item{
+    background-color: #fff;
+    /* padding: 0 24rpx; */
+    margin-top: 20rpx;
+}
+.goods-pic{
+    position: relative;
+    margin: 24rpx;
+}
+.order-leabl{
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100rpx;
+    height: 48rpx;
+    font-size: 10pt;
+    background-color: #ff6868;
+    color: #fff;
+    line-height: 48rpx;
+    text-align: center;
+    border-radius: 8rpx 0 0 0;
+}
+.goods-pic image{
+    width: 208rpx;
+    height: 160rpx;
+    border-radius: 8rpx;
+}
+.goods-info{
+    margin: 34rpx 24rpx 32rpx 0;
+}
+.goods-name{
+    font-size: 11pt;
+    color: #353535;
+}
+.money {
+    margin-top: 24rpx;
+    justify-content:flex-end;
+}
+.original_price{
+    text-decoration: line-through;
+    color: #a4a4a4;
+}
+.price{
+    margin-left: 24rpx;
+    color: #ff5444;
+    font-size: 13pt;
+}
+.btn-group{
+    border-top: 1rpx solid #e2e2e2;
+    padding: 24rpx;
+    justify-content:flex-end;
+}
+.btn-group-item{
+    font-size: 30rpx;
+    height: 60rpx;
+    width: 180rpx;
+    border-radius: 30rpx;
+    margin-left: 16rpx;
+    line-height: 60rpx;
+}
+.btn-group-item.apply{
+    border: 1rpx solid #c9c9c9;
+    color: #666666;
+    background-color:#fff; 
+}
+.btn-group-item.promptly{
+    border: 1rpx solid #ff4545;
+    color: #ff4544;
+    background-color: #fff5f5;
+}
+
+.hide{
+  display: none;
+}
+.modal{
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.5);
+  z-index: 9999;
+}
+
+
+

+ 303 - 303
wechat/pages/book/shop/shop.js

xqd
@@ -1,304 +1,304 @@
-// pages/shop/shop.js
-var api = require('../../../api.js');
-var utils = require('../../../utils.js');
-var app = getApp();
-var is_loading = false;
-var is_no_more = false;
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        page: 1,
-        page_count: 1,
-        longitude: '',
-        latitude: '',
-        score: [1, 2, 3, 4, 5],
-        keyword: ''
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-        var page = this;
-        page.setData({
-            ids: options.ids,
-        });
-        wx.getLocation({
-            success: function (res) {
-                page.setData({
-                    longitude: res.longitude,
-                    latitude: res.latitude
-                });
-            },
-            complete: function () {
-                console.log(11)
-                page.loadData();
-            }
-        })
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-      app.pageOnShow(this);
-        var page = this;
-    },
-    loadData: function () {
-        var page = this;
-        wx.showLoading({
-            title: '加载中',
-        });
-        app.request({
-            url: api.book.shop_list,
-            method: 'GET',
-            data: {
-                longitude: page.data.longitude,
-                latitude: page.data.latitude,
-                ids: page.data.ids,
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    console.log(22)
-                    page.setData(res.data);
-                }
-            },
-            fail:function(res){
-                console.log(res)
-            },
-            complete: function () {
-                console.log(33)
-                wx.hideLoading();
-            }
-
-        });
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-        var page = this;
-        page.setData({
-            keyword: '',
-            page: 1
-        });
-        wx.getLocation({
-            success: function (res) {
-                page.setData({
-                    longitude: res.longitude,
-                    latitude: res.latitude
-                });
-            },
-            complete: function () {
-                page.loadData();
-                wx.stopPullDownRefresh();
-            }
-        })
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-        var page = this;
-        if (page.data.page >= page.data.page_count) {
-            return;
-        }
-        page.loadMoreData();
-    },
-
-    loadMoreData: function () {
-        var page = this;
-        var p = page.data.page;
-        if (is_loading) {
-            return;
-        }
-        is_loading = true;
-        wx.showLoading({
-            title: '加载中',
-        });
-        app.request({
-            url: api.book.shop_list,
-            method: 'GET',
-            data: {
-                page: p,
-                longitude: page.data.longitude,
-                latitude: page.data.latitude,
-                ids: page.data.ids,
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    var shop_list = page.data.list.concat(res.data.list);
-                    page.setData({
-                        list: shop_list,
-                        page_count: res.data.page_count,
-                        row_count: res.data.row_count,
-                        page: (p + 1)
-                    });
-                }
-            },
-            complete: function () {
-                wx.hideLoading();
-                is_loading = false;
-            }
-        });
-    },
-
-    goto: function (e) {
-        var page = this;
-        wx.getSetting({
-            success: function (res) {
-                if (!res.authSetting['scope.userLocation']) {
-                    app.getauth({
-                        content: '需要获取您的地理位置授权,请到小程序设置中打开授权!',
-                        cancel: false,
-                        success: function (res) {
-                            if (res.authSetting['scope.userLocation']) {
-                                page.location(e);
-                            }
-                        }
-                    });
-                } else {
-                    page.location(e);
-                }
-            }
-        })
-    },
-
-    location: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var shop_list = page.data.list;
-        console.log(1)
-        wx.openLocation({
-            latitude: parseFloat(shop_list[index].latitude),
-            longitude: parseFloat(shop_list[index].longitude),
-            name: shop_list[index].name,
-            address: shop_list[index].address,
-        })
-    },
-
-    inputFocus: function (e) {
-        this.setData({
-            show: true
-        });
-    },
-
-    inputBlur: function (e) {
-        this.setData({
-            show: false
-        });
-    },
-
-    inputConfirm: function (e) {
-        var page = this;
-        page.search();
-    },
-
-    input: function (e) {
-        var page = this;
-        page.setData({
-            keyword: e.detail.value
-        });
-    },
-
-    search: function (e) {
-        var page = this;
-        wx.showLoading({
-            title: '搜索中',
-        });
-        app.request({
-            url: api.book.shop_list,
-            method: 'GET',
-            data: {
-                keyword: page.data.keyword,
-                longitude: page.data.longitude,
-                latitude: page.data.latitude,
-                ids: page.data.ids,
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    page.setData(res.data);
-                }
-            },
-            complete: function () {
-                wx.hideLoading();
-            }
-        });
-    },
-
-    go: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var shop_list = page.data.list;
-        wx.navigateTo({
-            url: '/pages/shop-detail/shop-detail?shop_id=' + shop_list[index].id,
-        })
-    },
-
-    navigatorClick: function (e) {
-        var page = this;
-        var open_type = e.currentTarget.dataset.open_type;
-        var url = e.currentTarget.dataset.url;
-        if (open_type != 'wxapp')
-            return true;
-        //console.log(url);
-        url = parseQueryString(url);
-        url.path = url.path ? decodeURIComponent(url.path) : "";
-        console.log("Open New App");
-        wx.navigateToMiniProgram({
-            appId: url.appId,
-            path: url.path,
-            complete: function (e) {
-                console.log(e);
-            }
-        });
-        return false;
-
-        function parseQueryString(url) {
-            var reg_url = /^[^\?]+\?([\w\W]+)$/,
-                reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
-                arr_url = reg_url.exec(url),
-                ret = {};
-            if (arr_url && arr_url[1]) {
-                var str_para = arr_url[1], result;
-                while ((result = reg_para.exec(str_para)) != null) {
-                    ret[result[1]] = result[2];
-                }
-            }
-            return ret;
-        }
-    },
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function (options) {
-
-    },
+// pages/shop/shop.js
+var api = require('../../../api.js');
+var utils = require('../../../utils.js');
+var app = getApp();
+var is_loading = false;
+var is_no_more = false;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        page: 1,
+        page_count: 1,
+        longitude: '',
+        latitude: '',
+        score: [1, 2, 3, 4, 5],
+        keyword: ''
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+        var page = this;
+        page.setData({
+            ids: options.ids,
+        });
+        wx.getLocation({
+            success: function (res) {
+                page.setData({
+                    longitude: res.longitude,
+                    latitude: res.latitude
+                });
+            },
+            complete: function () {
+                console.log(11)
+                page.loadData();
+            }
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+      app.pageOnShow(this);
+        var page = this;
+    },
+    loadData: function () {
+        var page = this;
+        wx.showLoading({
+            title: '加载中',
+        });
+        app.request({
+            url: api.book.shop_list,
+            method: 'GET',
+            data: {
+                longitude: page.data.longitude,
+                latitude: page.data.latitude,
+                ids: page.data.ids,
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    console.log(22)
+                    page.setData(res.data);
+                }
+            },
+            fail:function(res){
+                console.log(res)
+            },
+            complete: function () {
+                console.log(33)
+                wx.hideLoading();
+            }
+
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+        var page = this;
+        page.setData({
+            keyword: '',
+            page: 1
+        });
+        wx.getLocation({
+            success: function (res) {
+                page.setData({
+                    longitude: res.longitude,
+                    latitude: res.latitude
+                });
+            },
+            complete: function () {
+                page.loadData();
+                wx.stopPullDownRefresh();
+            }
+        })
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+        var page = this;
+        if (page.data.page >= page.data.page_count) {
+            return;
+        }
+        page.loadMoreData();
+    },
+
+    loadMoreData: function () {
+        var page = this;
+        var p = page.data.page;
+        if (is_loading) {
+            return;
+        }
+        is_loading = true;
+        wx.showLoading({
+            title: '加载中',
+        });
+        app.request({
+            url: api.book.shop_list,
+            method: 'GET',
+            data: {
+                page: p,
+                longitude: page.data.longitude,
+                latitude: page.data.latitude,
+                ids: page.data.ids,
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    var shop_list = page.data.list.concat(res.data.list);
+                    page.setData({
+                        list: shop_list,
+                        page_count: res.data.page_count,
+                        row_count: res.data.row_count,
+                        page: (p + 1)
+                    });
+                }
+            },
+            complete: function () {
+                wx.hideLoading();
+                is_loading = false;
+            }
+        });
+    },
+
+    goto: function (e) {
+        var page = this;
+        wx.getSetting({
+            success: function (res) {
+                if (!res.authSetting['scope.userLocation']) {
+                    app.getauth({
+                        content: '需要获取您的地理位置授权,请到小程序设置中打开授权!',
+                        cancel: false,
+                        success: function (res) {
+                            if (res.authSetting['scope.userLocation']) {
+                                page.location(e);
+                            }
+                        }
+                    });
+                } else {
+                    page.location(e);
+                }
+            }
+        })
+    },
+
+    location: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var shop_list = page.data.list;
+        console.log(1)
+        wx.openLocation({
+            latitude: parseFloat(shop_list[index].latitude),
+            longitude: parseFloat(shop_list[index].longitude),
+            name: shop_list[index].name,
+            address: shop_list[index].address,
+        })
+    },
+
+    inputFocus: function (e) {
+        this.setData({
+            show: true
+        });
+    },
+
+    inputBlur: function (e) {
+        this.setData({
+            show: false
+        });
+    },
+
+    inputConfirm: function (e) {
+        var page = this;
+        page.search();
+    },
+
+    input: function (e) {
+        var page = this;
+        page.setData({
+            keyword: e.detail.value
+        });
+    },
+
+    search: function (e) {
+        var page = this;
+        wx.showLoading({
+            title: '搜索中',
+        });
+        app.request({
+            url: api.book.shop_list,
+            method: 'GET',
+            data: {
+                keyword: page.data.keyword,
+                longitude: page.data.longitude,
+                latitude: page.data.latitude,
+                ids: page.data.ids,
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    page.setData(res.data);
+                }
+            },
+            complete: function () {
+                wx.hideLoading();
+            }
+        });
+    },
+
+    go: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var shop_list = page.data.list;
+        wx.navigateTo({
+            url: '/pages/shop-detail/shop-detail?shop_id=' + shop_list[index].id,
+        })
+    },
+
+    navigatorClick: function (e) {
+        var page = this;
+        var open_type = e.currentTarget.dataset.open_type;
+        var url = e.currentTarget.dataset.url;
+        if (open_type != 'wxapp')
+            return true;
+        //console.log(url);
+        url = parseQueryString(url);
+        url.path = url.path ? decodeURIComponent(url.path) : "";
+        console.log("Open New App");
+        wx.navigateToMiniProgram({
+            appId: url.appId,
+            path: url.path,
+            complete: function (e) {
+                console.log(e);
+            }
+        });
+        return false;
+
+        function parseQueryString(url) {
+            var reg_url = /^[^\?]+\?([\w\W]+)$/,
+                reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
+                arr_url = reg_url.exec(url),
+                ret = {};
+            if (arr_url && arr_url[1]) {
+                var str_para = arr_url[1], result;
+                while ((result = reg_para.exec(str_para)) != null) {
+                    ret[result[1]] = result[2];
+                }
+            }
+            return ret;
+        }
+    },
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function (options) {
+
+    },
 })

+ 3 - 3
wechat/pages/book/shop/shop.json

xqd
@@ -1,4 +1,4 @@
-{
-    "navigationBarTitleText": "附近",
-    "enablePullDownRefresh": true
+{
+    "navigationBarTitleText": "附近",
+    "enablePullDownRefresh": true
 }

+ 42 - 42
wechat/pages/book/shop/shop.wxml

xqd
@@ -1,43 +1,43 @@
-<!--pages/shop/shop.wxml-->
-<include src="/commons/navbar/navbar"/>
-<view class="after-navber">
-    <view class='search flex-y-center'>
-        <view class='search-input flex-row'>
-            <input placeholder-class='input-pp' class='input flex-grow-1' placeholder='请输入关键字' bindfocus='inputFocus' bindblur='inputBlur' bindconfirm='inputConfirm' confirm-type='search' bindinput='input' value='{{keyword}}'></input>
-            <view class='search-btn flex-grow-0 flex-y-center flex-x-center flex-row {{show?"":"hidden"}}' bindtap='search'>
-                <image class='flex-grow-0' src='/images/icon-shop-search.png' style='width:24rpx;height:24rpx;margin-right:10rpx;'></image>
-                <view class='flex-grow-1'>搜索</view>
-            </view>
-        </view>
-    </view>
-    <view class='shop-list w-100'>
-        <block wx:for='{{list}}' wx:for-index='index' wx:for-item='item'>
-            <view class='shop-one flex-row' bindtap='go' data-index='{{index}}'>
-                <view class='flex-grow-0 flex-y-center'>
-                    <image src='{{item.pic_url}}' style='width:150rpx;height:150rpx;border-radius:150rpx;'></image>
-                </view>
-                <view class='w-100 flex-grow-1' style='margin:0 20rpx;'>
-                    <view class='text-more' style='color:#353535;'>{{item.name}}</view>
-                    <view class='fs-sm flex-row' style='margin-top:22rpx;'>
-                        <view class='flex-grow-0' style='margin-right:12rpx;'>评分:</view>
-                        <view class='flex-grow-1'>
-                            <block wx:for='{{score}}' wx:for-index='idx' wx:for-item='itemn' wx:if='{{idx <= (item.score-1)}}'>
-                                <image src='/images/icon-shop-love.png' style='margin-right:4rpx;width:20rpx;height:18rpx;'></image>
-                            </block>
-                        </view>
-                    </view>
-                    <view class='fs-sm' style='margin-top:22rpx;'>电话:{{item.mobile}}</view>
-                    <view class='fs-sm' style='margin-top:22rpx;'>距离:{{item.distance==-1?"无":item.distance}}</view>
-                </view>
-                <view class='flex-grow-0 flex-y-center'>
-                    <view catchtap='goto' data-index='{{index}}'>
-                        <view style='text-align: right'>
-                            <image src='/images/icon-shop-nav-1.png' style='width:50rpx;height:50rpx;margin-right:18rpx;margin-bottom:16rpx;'></image>
-                        </view>
-                        <view class='fs-sm flex-x-center'>一键导航</view>
-                    </view>
-                </view>
-            </view>
-        </block>
-    </view>
+<!--pages/shop/shop.wxml-->
+<include src="/commons/navbar/navbar"/>
+<view class="after-navber">
+    <view class='search flex-y-center'>
+        <view class='search-input flex-row'>
+            <input placeholder-class='input-pp' class='input flex-grow-1' placeholder='请输入关键字' bindfocus='inputFocus' bindblur='inputBlur' bindconfirm='inputConfirm' confirm-type='search' bindinput='input' value='{{keyword}}'></input>
+            <view class='search-btn flex-grow-0 flex-y-center flex-x-center flex-row {{show?"":"hidden"}}' bindtap='search'>
+                <image class='flex-grow-0' src='/images/icon-shop-search.png' style='width:24rpx;height:24rpx;margin-right:10rpx;'></image>
+                <view class='flex-grow-1'>搜索</view>
+            </view>
+        </view>
+    </view>
+    <view class='shop-list w-100'>
+        <block wx:for='{{list}}' wx:for-index='index' wx:for-item='item'>
+            <view class='shop-one flex-row' bindtap='go' data-index='{{index}}'>
+                <view class='flex-grow-0 flex-y-center'>
+                    <image src='{{item.pic_url}}' style='width:150rpx;height:150rpx;border-radius:150rpx;'></image>
+                </view>
+                <view class='w-100 flex-grow-1' style='margin:0 20rpx;'>
+                    <view class='text-more' style='color:#353535;'>{{item.name}}</view>
+                    <view class='fs-sm flex-row' style='margin-top:22rpx;'>
+                        <view class='flex-grow-0' style='margin-right:12rpx;'>评分:</view>
+                        <view class='flex-grow-1'>
+                            <block wx:for='{{score}}' wx:for-index='idx' wx:for-item='itemn' wx:if='{{idx <= (item.score-1)}}'>
+                                <image src='/images/icon-shop-love.png' style='margin-right:4rpx;width:20rpx;height:18rpx;'></image>
+                            </block>
+                        </view>
+                    </view>
+                    <view class='fs-sm' style='margin-top:22rpx;'>电话:{{item.mobile}}</view>
+                    <view class='fs-sm' style='margin-top:22rpx;'>距离:{{item.distance==-1?"无":item.distance}}</view>
+                </view>
+                <view class='flex-grow-0 flex-y-center'>
+                    <view catchtap='goto' data-index='{{index}}'>
+                        <view style='text-align: right'>
+                            <image src='/images/icon-shop-nav-1.png' style='width:50rpx;height:50rpx;margin-right:18rpx;margin-bottom:16rpx;'></image>
+                        </view>
+                        <view class='fs-sm flex-x-center'>一键导航</view>
+                    </view>
+                </view>
+            </view>
+        </block>
+    </view>
 </view>

+ 42 - 42
wechat/pages/book/shop/shop.wxss

xqd
@@ -1,43 +1,43 @@
-/* pages/shop/shop.wxss */
-.search{
-    width: 100%;
-    height: 90rpx;
-}
-
-.search-input{
-    width: 100%;
-    height: 56rpx;
-    border-radius: 10rpx;
-    margin:0 24rpx;
-    background-color: #fff;
-}
-
-.input-pp{
-    height: 100%;
-    line-height: 56rpx;
-}
-
-.input{
-    height: 100%;
-    line-height: 56rpx;
-    padding-left: 30rpx;
-}
-
-.search-btn{
-    background-color: #ddd;
-    border-radius: 0 10rpx 10rpx 0;
-    padding: 0 20rpx;
-}
-
-.shop-one{
-    background-color: #fff;
-    width: 100%;
-    padding: 26rpx 24rpx;
-    border-bottom: 1rpx solid #e2e2e2;
-    color:#707070;
-}
-
-.shop-one:last-child{
-    border: 0;
-    
+/* pages/shop/shop.wxss */
+.search{
+    width: 100%;
+    height: 90rpx;
+}
+
+.search-input{
+    width: 100%;
+    height: 56rpx;
+    border-radius: 10rpx;
+    margin:0 24rpx;
+    background-color: #fff;
+}
+
+.input-pp{
+    height: 100%;
+    line-height: 56rpx;
+}
+
+.input{
+    height: 100%;
+    line-height: 56rpx;
+    padding-left: 30rpx;
+}
+
+.search-btn{
+    background-color: #ddd;
+    border-radius: 0 10rpx 10rpx 0;
+    padding: 0 20rpx;
+}
+
+.shop-one{
+    background-color: #fff;
+    width: 100%;
+    padding: 26rpx 24rpx;
+    border-bottom: 1rpx solid #e2e2e2;
+    color:#707070;
+}
+
+.shop-one:last-child{
+    border: 0;
+    
 }

+ 267 - 267
wechat/pages/book/submit/submit.js

xqd
@@ -1,268 +1,268 @@
-// pages/book/submit/submit.js
-var api = require('../../../api.js');
-var utils = require('../../../utils/utils.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-        this.getPreview(options);
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        app.pageOnShow(this);
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-    
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-    
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-    
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-    
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function () {
-    
-    },
-    /**
-     * 复选
-     */
-    checkboxChange:function(e){
-        console.log(e.target.dataset.id);
-        var page = this;
-        var pid = e.target.dataset.pid;
-        var id = e.target.dataset.id;
-        var form_list = page.data.form_list;
-            var is_selected = form_list[pid].default[id]['selected'];
-            if (is_selected==true) {
-                form_list[pid].default[id]['selected'] = false;
-            }else{
-                form_list[pid].default[id]['selected'] = true;
-            }
-        page.setData({
-            form_list: form_list,
-        });
-    },
-    /**
-     * 单选
-     */
-    radioChange:function(e){
-        var page = this;
-        var pid = e.target.dataset.pid;
-        var form_list = page.data.form_list;
-        for (var i in form_list[pid].default){
-            if (e.target.dataset.id == i){
-                form_list[pid].default[i]['selected'] = true;
-            }else{
-                form_list[pid].default[i]['selected'] = false;
-            }
-        }
-        page.setData({
-            form_list:form_list,
-        });
-    },
-    /**
-     * input 改变
-     */
-    inputChenge:function(e){
-        console.log(e);
-        var page = this;
-        var id = e.target.dataset.id;
-        var form_list = page.data.form_list;
-        form_list[id].default = e.detail.value;
-        page.setData({
-            form_list : form_list,
-        });
-    },
-
-    /**
-     * 获取数据
-     * getsubmit_preview
-     */
-    getPreview:function(e){
-        var page = this;
-        var gid = e.id;
-        wx.showLoading({
-            title: "正在加载",
-            mask: true,
-        });
-        // wx.showNavigationBarLoading();
-        app.request({
-            url: api.book.submit_preview,
-            method: "get",
-            data: { gid: gid },
-            success: function (res) {
-                if (res.code == 0) {
-                    for (var i in res.data.form_list){
-                        if (res.data.form_list[i].type=='date'){
-                            res.data.form_list[i].default = res.data.form_list[i].default ? res.data.form_list[i].default : utils.formatData(new Date);
-                        }
-                        if (res.data.form_list[i].type == 'time') {
-                            res.data.form_list[i].default = res.data.form_list[i].default ? res.data.form_list[i].default : '00:00';
-                        }
-                    }
-                    page.setData({
-                        goods: res.data.goods,
-                        form_list: res.data.form_list,
-                    });
-                } else {
-                    wx.showModal({
-                        title: '提示',
-                        content: res.msg,
-                        showCancel: false,
-                        success: function (res) {
-                            if (res.confirm) {
-                                wx.redirectTo({
-                                    url: '/pages/book/index/index'
-                                });
-                            }
-                        }
-                    });
-                }
-            },
-            complete: function (res) {
-                setTimeout(function () {
-                    // 延长一秒取消加载动画
-                    wx.hideLoading();
-                }, 1000);
-            }
-        });
-    },
-    submit:function(e){
-        var form_id = e.detail.formId;
-        var page = this;
-        var gid = page.data.goods.id;
-        var form_list = JSON.stringify(page.data.form_list);
-        console.log(form_list);
-        wx.showLoading({
-            title: "正在提交",
-            mask: true,
-        });
-        // wx.showNavigationBarLoading();
-        app.request({
-            url: api.book.submit,
-            method: "post",
-            data: { gid: gid, form_list: form_list, form_id: form_id},
-            success: function (res) {
-                if (res.code == 0) {
-                    if(res.type==1){
-                        // 免费
-                        wx.redirectTo({
-                            url: "/pages/book/order/order?status=1",
-                        });
-                    }else{
-                        wx.showLoading({
-                            title: "正在提交",
-                            mask: true,
-                        });
-                        //发起支付
-                        wx.requestPayment({
-                            timeStamp: res.data.timeStamp,
-                            nonceStr: res.data.nonceStr,
-                            package: res.data.package,
-                            signType: res.data.signType,
-                            paySign: res.data.paySign,
-                            success: function (e) {
-                                wx.redirectTo({
-                                    url: "/pages/book/order/order?status=1",
-                                });
-                            },
-                            fail: function (e) {
-                            },
-                            complete: function (e) {
-                                setTimeout(function () {
-                                    // 延长一秒取消加载动画
-                                    wx.hideLoading();
-                                }, 1000);
-                                if (e.errMsg == "requestPayment:fail" || e.errMsg == "requestPayment:fail cancel") {//支付失败转到待支付订单列表
-                                    wx.showModal({
-                                        title: "提示",
-                                        content: "订单尚未支付",
-                                        showCancel: false,
-                                        confirmText: "确认",
-                                        success: function (res) {
-                                            if (res.confirm) {
-                                                wx.redirectTo({
-                                                    url: "/pages/book/order/order?status=0",
-                                                });
-                                            }
-                                        }
-                                    });
-                                    return;
-                                }
-                                if (e.errMsg == "requestPayment:ok") {
-                                    return;
-                                }
-                                wx.redirectTo({
-                                    url: "/pages/book/order/order?status=-1",
-                                });
-                            },
-                        });
-                        return;
-                    }
-                } else {
-                    wx.showModal({
-                        title: '提示',
-                        content: res.msg,
-                        showCancel: false,
-                        success: function (res) {
-                            // if (res.confirm) {
-                            //     wx.redirectTo({
-                            //         url: '/pages/book/index/index'
-                            //     });
-                            // }
-                        }
-                    });
-                }
-            },
-            complete: function (res) {
-                setTimeout(function () {
-                    // 延长一秒取消加载动画
-                    wx.hideLoading();
-                }, 1000);
-            }
-        });
-    }
+// pages/book/submit/submit.js
+var api = require('../../../api.js');
+var utils = require('../../../utils/utils.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+        this.getPreview(options);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        app.pageOnShow(this);
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+    
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+    
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+    
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+    
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+    
+    },
+    /**
+     * 复选
+     */
+    checkboxChange:function(e){
+        console.log(e.target.dataset.id);
+        var page = this;
+        var pid = e.target.dataset.pid;
+        var id = e.target.dataset.id;
+        var form_list = page.data.form_list;
+            var is_selected = form_list[pid].default[id]['selected'];
+            if (is_selected==true) {
+                form_list[pid].default[id]['selected'] = false;
+            }else{
+                form_list[pid].default[id]['selected'] = true;
+            }
+        page.setData({
+            form_list: form_list,
+        });
+    },
+    /**
+     * 单选
+     */
+    radioChange:function(e){
+        var page = this;
+        var pid = e.target.dataset.pid;
+        var form_list = page.data.form_list;
+        for (var i in form_list[pid].default){
+            if (e.target.dataset.id == i){
+                form_list[pid].default[i]['selected'] = true;
+            }else{
+                form_list[pid].default[i]['selected'] = false;
+            }
+        }
+        page.setData({
+            form_list:form_list,
+        });
+    },
+    /**
+     * input 改变
+     */
+    inputChenge:function(e){
+        console.log(e);
+        var page = this;
+        var id = e.target.dataset.id;
+        var form_list = page.data.form_list;
+        form_list[id].default = e.detail.value;
+        page.setData({
+            form_list : form_list,
+        });
+    },
+
+    /**
+     * 获取数据
+     * getsubmit_preview
+     */
+    getPreview:function(e){
+        var page = this;
+        var gid = e.id;
+        wx.showLoading({
+            title: "正在加载",
+            mask: true,
+        });
+        // wx.showNavigationBarLoading();
+        app.request({
+            url: api.book.submit_preview,
+            method: "get",
+            data: { gid: gid },
+            success: function (res) {
+                if (res.code == 0) {
+                    for (var i in res.data.form_list){
+                        if (res.data.form_list[i].type=='date'){
+                            res.data.form_list[i].default = res.data.form_list[i].default ? res.data.form_list[i].default : utils.formatData(new Date);
+                        }
+                        if (res.data.form_list[i].type == 'time') {
+                            res.data.form_list[i].default = res.data.form_list[i].default ? res.data.form_list[i].default : '00:00';
+                        }
+                    }
+                    page.setData({
+                        goods: res.data.goods,
+                        form_list: res.data.form_list,
+                    });
+                } else {
+                    wx.showModal({
+                        title: '提示',
+                        content: res.msg,
+                        showCancel: false,
+                        success: function (res) {
+                            if (res.confirm) {
+                                wx.redirectTo({
+                                    url: '/pages/book/index/index'
+                                });
+                            }
+                        }
+                    });
+                }
+            },
+            complete: function (res) {
+                setTimeout(function () {
+                    // 延长一秒取消加载动画
+                    wx.hideLoading();
+                }, 1000);
+            }
+        });
+    },
+    submit:function(e){
+        var form_id = e.detail.formId;
+        var page = this;
+        var gid = page.data.goods.id;
+        var form_list = JSON.stringify(page.data.form_list);
+        console.log(form_list);
+        wx.showLoading({
+            title: "正在提交",
+            mask: true,
+        });
+        // wx.showNavigationBarLoading();
+        app.request({
+            url: api.book.submit,
+            method: "post",
+            data: { gid: gid, form_list: form_list, form_id: form_id},
+            success: function (res) {
+                if (res.code == 0) {
+                    if(res.type==1){
+                        // 免费
+                        wx.redirectTo({
+                            url: "/pages/book/order/order?status=1",
+                        });
+                    }else{
+                        wx.showLoading({
+                            title: "正在提交",
+                            mask: true,
+                        });
+                        //发起支付
+                        wx.requestPayment({
+                            timeStamp: res.data.timeStamp,
+                            nonceStr: res.data.nonceStr,
+                            package: res.data.package,
+                            signType: res.data.signType,
+                            paySign: res.data.paySign,
+                            success: function (e) {
+                                wx.redirectTo({
+                                    url: "/pages/book/order/order?status=1",
+                                });
+                            },
+                            fail: function (e) {
+                            },
+                            complete: function (e) {
+                                setTimeout(function () {
+                                    // 延长一秒取消加载动画
+                                    wx.hideLoading();
+                                }, 1000);
+                                if (e.errMsg == "requestPayment:fail" || e.errMsg == "requestPayment:fail cancel") {//支付失败转到待支付订单列表
+                                    wx.showModal({
+                                        title: "提示",
+                                        content: "订单尚未支付",
+                                        showCancel: false,
+                                        confirmText: "确认",
+                                        success: function (res) {
+                                            if (res.confirm) {
+                                                wx.redirectTo({
+                                                    url: "/pages/book/order/order?status=0",
+                                                });
+                                            }
+                                        }
+                                    });
+                                    return;
+                                }
+                                if (e.errMsg == "requestPayment:ok") {
+                                    return;
+                                }
+                                wx.redirectTo({
+                                    url: "/pages/book/order/order?status=-1",
+                                });
+                            },
+                        });
+                        return;
+                    }
+                } else {
+                    wx.showModal({
+                        title: '提示',
+                        content: res.msg,
+                        showCancel: false,
+                        success: function (res) {
+                            // if (res.confirm) {
+                            //     wx.redirectTo({
+                            //         url: '/pages/book/index/index'
+                            //     });
+                            // }
+                        }
+                    });
+                }
+            },
+            complete: function (res) {
+                setTimeout(function () {
+                    // 延长一秒取消加载动画
+                    wx.hideLoading();
+                }, 1000);
+            }
+        });
+    }
 })

+ 2 - 2
wechat/pages/book/submit/submit.json

xqd
@@ -1,3 +1,3 @@
-{
-    "navigationBarTitleText": "提交预约"
+{
+    "navigationBarTitleText": "提交预约"
 }

+ 187 - 187
wechat/pages/book/submit/submit.wxml

xqd
@@ -1,188 +1,188 @@
-<!--pages/book/submit/submit.wxml-->
-
-<form bindsubmit="submit" report-submit="true">
-    <view class='population'>
-        <view class='goods flex-row'>
-            <view class='goods-img flex-grow-0'>
-                <image src='{{goods.cover_pic}}'></image>
-            </view>
-            <view class='flex-grow-1 flex-col goods-info'>
-                <view class='flex-grow-1 goods-name'>
-                    {{goods.name}}
-                </view>
-                <view class='flex-gorw-0 flex-row money flex-y-bottom'>
-                    <view class='original_price flex-grow-0'>
-                        ¥{{goods.original_price}}
-                    </view>
-                    <view class='price flex-grow-0'>
-                        ¥{{goods.price}}
-                    </view>
-                </view>
-            </view>
-        </view>
-        <view class='form'>
-            <view class='form-image'>
-                <image src='/images/yy-form-title.png'></image>
-            </view>
-
-            <view class='group-form'>
-                <block wx:for='{{form_list}}'>
-                        <block wx:if="{{item.type=='text'}}">
-                            <view class='username flex-row input-shell flex-y-center'>
-                                <view class='flex-grow-0'>
-                                    {{item.name}}:
-                                </view>
-                                <view class='flex-grow-1'>  
-                                    <input  placeholder="{{item.tip}}" data-id='{{index}}' bindinput="inputChenge" value='{{item.default}}'/>
-                                </view> 
-                            </view>
-                            <!-- <view class='username flex-row input-shell flex-y-center'>
-                                <view class='flex-grow-0'>
-                                    手机号:
-                                </view>
-                                <view class='flex-grow-1'>
-                                    <input type='number' placeholder="必填"/>
-                                </view>
-                            </view>  -->
-                        </block>
-                        <block wx:if="{{item.type=='radio'}}">
-                            <view class='group-radio flex-row input-shell flex-y-center'>
-                                <view class='flex-grow-0'>
-                                    {{item.name}}:
-                                </view>
-                                <!-- <checkbox-group bindchange="checkboxChange">  -->
-                                    
-                                    <view class='flex-grow-1' style='padding-top:24rpx;'>
-                                        <block wx:for='{{item.default}}' wx:for-index="idx" wx:for-item="de">
-                                            <label class="checkbox group-radio-item {{de.selected?'active':''}} flex-y-cente"  bindtap="radioChange" data-pid='{{index}}' data-id='{{idx}}'>
-                                                <checkbox style='display:none'  value="{{de.name}}" checked="{{item.selected}}" data-id='0'/>{{de.name}} 
-                                            </label>
-                                        </block>
-                                    
-                                    </view>
-                                <!-- </checkbox-group>  -->
-                            </view> 
-                        </block>
-                        <block wx:if="{{item.type=='checkbox'}}">
-                            <view class='group-radio flex-row input-shell flex-y-center'>
-                                <view class='flex-grow-0'>
-                                    {{item.name}}:
-                                </view>
-                                <!-- <checkbox-group bindchange="checkboxChange">  -->
-                                    
-                                    <view class='flex-grow-1' style='padding-top:24rpx;'>
-                                        <block wx:for='{{item.default}}' wx:for-index="idx" wx:for-item="de">
-                                            <label class="checkbox group-radio-item {{de.selected?'active':''}} flex-y-cente"  bindtap="checkboxChange" data-pid='{{index}}' data-id='{{idx}}'>
-                                                <checkbox style='display:none'  value="{{de.name}}" checked="{{item.selected}}" data-id='0'/>{{de.name}} 
-                                            </label>
-                                        </block>
-                                    
-                                    </view>
-                                <!-- </checkbox-group>  -->
-                            </view> 
-                        </block>      
-                        <block wx:if="{{item.type=='time'}}">
-                            <view class='username flex-row input-shell flex-y-center'>
-                                <view class='flex-grow-0'>
-                                    {{item.name}}:
-                                </view>
-                                <view class='flex-grow-1 flex-row picker-data flex-y-center'> 
-                                    <picker mode="time" class='flex-grow-0' value="{{item.default}}" data-id='{{index}}'  bindchange="inputChenge" style='padding-right:20rpx;'> 
-                                        <view class="picker flex-y-center">
-                                            {{item.default}}
-                                        </view>
-                                    </picker> 
-                                    <view class='flex-grow-0 picker-time flex-y-center'>
-                                        <image src='/images/img-share-right.png'></image>
-                                    </view>
-                                </view> 
-                            </view>   
-                        </block>
-                        <block wx:if="{{item.type=='date'}}">
-                            <view class='username flex-row input-shell flex-y-center'>
-                                <view class='flex-grow-0'>
-                                    {{item.name}}:
-                                </view>
-                                <view class='flex-grow-1 flex-row picker-data flex-y-center'> 
-                                    <picker mode="date" class='flex-grow-0'  value="{{item.default}}" data-id='{{index}}'  bindchange="inputChenge" style='padding-right:20rpx;'> 
-                                        <view class="picker flex-y-center">
-                                            {{item.default}}
-                                        </view>
-                                    </picker> 
-                                    <view class='flex-grow-0 picker-time flex-y-center'>
-                                        <image src='/images/img-share-right.png'></image>
-                                    </view>
-                                </view> 
-                            </view>   
-                        </block>
-                        <block wx:if="{{item.type=='textarea'}}">
-                            <view class='username flex-row input-shell flex-y-top' style='padding:24rpx 0;'>
-                                <view class='flex-grow-0 flex-y-top'>
-                                    {{item.name}}:
-                                </view>
-                                <view class='flex-grow-1 flex-row flex-y-center'> 
-                                    <textarea data-id='{{index}}' bindinput="inputChenge" placeholder="{{item.tip}}"  />
-                                </view> 
-                            </view> 
-                        </block>
-                </block>
-
-        
-
-                <!-- <view class='group-radio flex-row input-shell flex-y-center'>
-                    <view class='flex-grow-0'>
-                        复选:
-                    </view>
-                        <view class='flex-grow-1' style='padding-top:24rpx;'>
-                            <label class="checkbox group-radio-item active flex-y-cente"  bindtap="checkboxChange" data-id='2'>
-                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='0'/>选项一
-                            </label>
-                            <label class="checkbox group-radio-item flex-y-cente"  bindtap="checkboxChange" data-id='2'>
-                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='1'/>选项一
-                            </label>
-                            <label class="checkbox group-radio-item active flex-y-cente"  bindtap="checkboxChange" data-id='2'>
-                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='2' />选项一
-                            </label>
-                            <label class="checkbox group-radio-item active flex-y-cente"  bindtap="checkboxChange" data-id='3'>
-                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='3'/>选项一
-                            </label>
-                            <label class="checkbox group-radio-item active flex-y-cente"  bindtap="checkboxChange" data-id='4'>
-                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='4'/>选项一
-                            </label>
-                        </view>
-                </view>  -->
-
-                <!-- <view class='username flex-row input-shell flex-y-center'>
-                    <view class='flex-grow-0'>
-                        预定日期:
-                    </view>
-                    <view class='flex-grow-1 flex-row picker-data flex-y-center'> 
-                        <picker mode="date" class='flex-grow-0' value="{{date}}"  bindchange="bindDateChange" style='padding-right:20rpx;'> 
-                            <view class="picker flex-y-center">
-                                {{date}}
-                            </view>
-                        </picker> 
-                        <view class='flex-grow-0 picker-time flex-y-center'>
-                            <image src='/images/img-share-right.png'></image>
-                        </view>
-                    </view> 
-                </view>  -->
-
-                <!-- <view class='username flex-row input-shell flex-y-top' style='padding:24rpx 0;'>
-                    <view class='flex-grow-0 flex-y-top'>
-                        备注:
-                    </view>
-                    <view class='flex-grow-1 flex-row flex-y-center'> 
-                        <textarea placeholder="备注"  />
-                    </view> 
-                </view>  -->
-            </view>
-        </view>
-    </view>
-    <!-- <view class='submit-btn flex-row flex-y-center flex-x-center' bindtap='submit'>
-        提交预约
-    </view> -->
-    <button form-type="submit" class='submit-btn flex-row flex-y-center flex-x-center'>
-        提交预约
-    </button>
+<!--pages/book/submit/submit.wxml-->
+
+<form bindsubmit="submit" report-submit="true">
+    <view class='population'>
+        <view class='goods flex-row'>
+            <view class='goods-img flex-grow-0'>
+                <image src='{{goods.cover_pic}}'></image>
+            </view>
+            <view class='flex-grow-1 flex-col goods-info'>
+                <view class='flex-grow-1 goods-name'>
+                    {{goods.name}}
+                </view>
+                <view class='flex-gorw-0 flex-row money flex-y-bottom'>
+                    <view class='original_price flex-grow-0'>
+                        ¥{{goods.original_price}}
+                    </view>
+                    <view class='price flex-grow-0'>
+                        ¥{{goods.price}}
+                    </view>
+                </view>
+            </view>
+        </view>
+        <view class='form'>
+            <view class='form-image'>
+                <image src='/images/yy-form-title.png'></image>
+            </view>
+
+            <view class='group-form'>
+                <block wx:for='{{form_list}}'>
+                        <block wx:if="{{item.type=='text'}}">
+                            <view class='username flex-row input-shell flex-y-center'>
+                                <view class='flex-grow-0'>
+                                    {{item.name}}:
+                                </view>
+                                <view class='flex-grow-1'>  
+                                    <input  placeholder="{{item.tip}}" data-id='{{index}}' bindinput="inputChenge" value='{{item.default}}'/>
+                                </view> 
+                            </view>
+                            <!-- <view class='username flex-row input-shell flex-y-center'>
+                                <view class='flex-grow-0'>
+                                    手机号:
+                                </view>
+                                <view class='flex-grow-1'>
+                                    <input type='number' placeholder="必填"/>
+                                </view>
+                            </view>  -->
+                        </block>
+                        <block wx:if="{{item.type=='radio'}}">
+                            <view class='group-radio flex-row input-shell flex-y-center'>
+                                <view class='flex-grow-0'>
+                                    {{item.name}}:
+                                </view>
+                                <!-- <checkbox-group bindchange="checkboxChange">  -->
+                                    
+                                    <view class='flex-grow-1' style='padding-top:24rpx;'>
+                                        <block wx:for='{{item.default}}' wx:for-index="idx" wx:for-item="de">
+                                            <label class="checkbox group-radio-item {{de.selected?'active':''}} flex-y-cente"  bindtap="radioChange" data-pid='{{index}}' data-id='{{idx}}'>
+                                                <checkbox style='display:none'  value="{{de.name}}" checked="{{item.selected}}" data-id='0'/>{{de.name}} 
+                                            </label>
+                                        </block>
+                                    
+                                    </view>
+                                <!-- </checkbox-group>  -->
+                            </view> 
+                        </block>
+                        <block wx:if="{{item.type=='checkbox'}}">
+                            <view class='group-radio flex-row input-shell flex-y-center'>
+                                <view class='flex-grow-0'>
+                                    {{item.name}}:
+                                </view>
+                                <!-- <checkbox-group bindchange="checkboxChange">  -->
+                                    
+                                    <view class='flex-grow-1' style='padding-top:24rpx;'>
+                                        <block wx:for='{{item.default}}' wx:for-index="idx" wx:for-item="de">
+                                            <label class="checkbox group-radio-item {{de.selected?'active':''}} flex-y-cente"  bindtap="checkboxChange" data-pid='{{index}}' data-id='{{idx}}'>
+                                                <checkbox style='display:none'  value="{{de.name}}" checked="{{item.selected}}" data-id='0'/>{{de.name}} 
+                                            </label>
+                                        </block>
+                                    
+                                    </view>
+                                <!-- </checkbox-group>  -->
+                            </view> 
+                        </block>      
+                        <block wx:if="{{item.type=='time'}}">
+                            <view class='username flex-row input-shell flex-y-center'>
+                                <view class='flex-grow-0'>
+                                    {{item.name}}:
+                                </view>
+                                <view class='flex-grow-1 flex-row picker-data flex-y-center'> 
+                                    <picker mode="time" class='flex-grow-0' value="{{item.default}}" data-id='{{index}}'  bindchange="inputChenge" style='padding-right:20rpx;'> 
+                                        <view class="picker flex-y-center">
+                                            {{item.default}}
+                                        </view>
+                                    </picker> 
+                                    <view class='flex-grow-0 picker-time flex-y-center'>
+                                        <image src='/images/img-share-right.png'></image>
+                                    </view>
+                                </view> 
+                            </view>   
+                        </block>
+                        <block wx:if="{{item.type=='date'}}">
+                            <view class='username flex-row input-shell flex-y-center'>
+                                <view class='flex-grow-0'>
+                                    {{item.name}}:
+                                </view>
+                                <view class='flex-grow-1 flex-row picker-data flex-y-center'> 
+                                    <picker mode="date" class='flex-grow-0'  value="{{item.default}}" data-id='{{index}}'  bindchange="inputChenge" style='padding-right:20rpx;'> 
+                                        <view class="picker flex-y-center">
+                                            {{item.default}}
+                                        </view>
+                                    </picker> 
+                                    <view class='flex-grow-0 picker-time flex-y-center'>
+                                        <image src='/images/img-share-right.png'></image>
+                                    </view>
+                                </view> 
+                            </view>   
+                        </block>
+                        <block wx:if="{{item.type=='textarea'}}">
+                            <view class='username flex-row input-shell flex-y-top' style='padding:24rpx 0;'>
+                                <view class='flex-grow-0 flex-y-top'>
+                                    {{item.name}}:
+                                </view>
+                                <view class='flex-grow-1 flex-row flex-y-center'> 
+                                    <textarea data-id='{{index}}' bindinput="inputChenge" placeholder="{{item.tip}}"  />
+                                </view> 
+                            </view> 
+                        </block>
+                </block>
+
+        
+
+                <!-- <view class='group-radio flex-row input-shell flex-y-center'>
+                    <view class='flex-grow-0'>
+                        复选:
+                    </view>
+                        <view class='flex-grow-1' style='padding-top:24rpx;'>
+                            <label class="checkbox group-radio-item active flex-y-cente"  bindtap="checkboxChange" data-id='2'>
+                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='0'/>选项一
+                            </label>
+                            <label class="checkbox group-radio-item flex-y-cente"  bindtap="checkboxChange" data-id='2'>
+                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='1'/>选项一
+                            </label>
+                            <label class="checkbox group-radio-item active flex-y-cente"  bindtap="checkboxChange" data-id='2'>
+                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='2' />选项一
+                            </label>
+                            <label class="checkbox group-radio-item active flex-y-cente"  bindtap="checkboxChange" data-id='3'>
+                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='3'/>选项一
+                            </label>
+                            <label class="checkbox group-radio-item active flex-y-cente"  bindtap="checkboxChange" data-id='4'>
+                                <checkbox style='display:none'  value="选项一" checked="{{item.checked}}" data-id='4'/>选项一
+                            </label>
+                        </view>
+                </view>  -->
+
+                <!-- <view class='username flex-row input-shell flex-y-center'>
+                    <view class='flex-grow-0'>
+                        预定日期:
+                    </view>
+                    <view class='flex-grow-1 flex-row picker-data flex-y-center'> 
+                        <picker mode="date" class='flex-grow-0' value="{{date}}"  bindchange="bindDateChange" style='padding-right:20rpx;'> 
+                            <view class="picker flex-y-center">
+                                {{date}}
+                            </view>
+                        </picker> 
+                        <view class='flex-grow-0 picker-time flex-y-center'>
+                            <image src='/images/img-share-right.png'></image>
+                        </view>
+                    </view> 
+                </view>  -->
+
+                <!-- <view class='username flex-row input-shell flex-y-top' style='padding:24rpx 0;'>
+                    <view class='flex-grow-0 flex-y-top'>
+                        备注:
+                    </view>
+                    <view class='flex-grow-1 flex-row flex-y-center'> 
+                        <textarea placeholder="备注"  />
+                    </view> 
+                </view>  -->
+            </view>
+        </view>
+    </view>
+    <!-- <view class='submit-btn flex-row flex-y-center flex-x-center' bindtap='submit'>
+        提交预约
+    </view> -->
+    <button form-type="submit" class='submit-btn flex-row flex-y-center flex-x-center'>
+        提交预约
+    </button>
 </form>

+ 103 - 103
wechat/pages/book/submit/submit.wxss

xqd
@@ -1,104 +1,104 @@
-/* pages/book/submit/submit.wxss */
-.population{
-    padding: 20rpx 24rpx 120rpx 24rpx;
-}
-.goods{
-    /* margin: 20rpx 24rpx; */
-    margin-bottom:20rpx; 
-    background-color: #fff;
-    padding: 24rpx;
-    border-radius: 16rpx;
-    -moz-box-shadow:0px 0px 10px #dddddd; 
-    -webkit-box-shadow:0px 0px 10px #dddddd; 
-    box-shadow:0px 0px 10px #dddddd;
-}
-.goods-img{
-    margin-right: 24rpx;
-}
-.goods-img image{
-    width: 208rpx;
-    height: 160rpx;
-}
-.goods-info{
-    margin: 8rpx 0;
-}
-.goods-name{
-    font-size: 11pt;
-    color: #353535;
-}
-.original_price{
-    font-size: 10pt;
-    color: #a4a4a4;
-    text-decoration: line-through;
-    margin-right: 40rpx;
-}
-.price{
-    color: #ff4544;
-    font-size: 12pt;
-}
-.money{
-    justify-content:flex-end;
-}
-
-.form{
-    background-color: #fff;
-    border-radius: 16rpx;
-    -moz-box-shadow:0px 0px 10px #dddddd; 
-    -webkit-box-shadow:0px 0px 10px #dddddd; 
-    box-shadow:0px 0px 10px #dddddd;
-}
-.form image{
-    width: 702rpx;
-    height: 96rpx;
-}
-.group-form{
-    padding: 0 24rpx;
-    font-size: 12pt;
-    color: #353535;
-}
-.input-shell{
-    min-height: 96rpx;
-    border-bottom: 1rpx solid #e2e2e2;
-}
-.picker-time image{
-    width: 16rpx;
-    height: 26rpx;
-}
-/* .picker-time{
-    margin-left: 20rpx;
-} */
-.picker-data{
-    justify-content:flex-end;
-}
-.group-radio-item{
-    color: #666666;
-    height: 56rpx;
-    border-radius: 28rpx;
-    border: 1rpx solid #cccccc;
-    padding: 0 24rpx;
-    display: inline-block;
-    margin-bottom:24rpx;
-    margin-right: 24rpx;
-}
-.active.group-radio-item{
-    background-color: #ff6845;
-    color: #fff;
-}
-.input-shell textarea {
-    height: 120rpx;
-}
-.submit-btn{
-    height: 100rpx;
-    background-color: #ff4544;
-    font-size: 13pt;
-    color: #ffffff;
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    width: 100%;
-    border-radius:0;
-}
-button::after {
-    content:normal;
-    border:0;
+/* pages/book/submit/submit.wxss */
+.population{
+    padding: 20rpx 24rpx 120rpx 24rpx;
+}
+.goods{
+    /* margin: 20rpx 24rpx; */
+    margin-bottom:20rpx; 
+    background-color: #fff;
+    padding: 24rpx;
+    border-radius: 16rpx;
+    -moz-box-shadow:0px 0px 10px #dddddd; 
+    -webkit-box-shadow:0px 0px 10px #dddddd; 
+    box-shadow:0px 0px 10px #dddddd;
+}
+.goods-img{
+    margin-right: 24rpx;
+}
+.goods-img image{
+    width: 208rpx;
+    height: 160rpx;
+}
+.goods-info{
+    margin: 8rpx 0;
+}
+.goods-name{
+    font-size: 11pt;
+    color: #353535;
+}
+.original_price{
+    font-size: 10pt;
+    color: #a4a4a4;
+    text-decoration: line-through;
+    margin-right: 40rpx;
+}
+.price{
+    color: #ff4544;
+    font-size: 12pt;
+}
+.money{
+    justify-content:flex-end;
+}
+
+.form{
+    background-color: #fff;
+    border-radius: 16rpx;
+    -moz-box-shadow:0px 0px 10px #dddddd; 
+    -webkit-box-shadow:0px 0px 10px #dddddd; 
+    box-shadow:0px 0px 10px #dddddd;
+}
+.form image{
+    width: 702rpx;
+    height: 96rpx;
+}
+.group-form{
+    padding: 0 24rpx;
+    font-size: 12pt;
+    color: #353535;
+}
+.input-shell{
+    min-height: 96rpx;
+    border-bottom: 1rpx solid #e2e2e2;
+}
+.picker-time image{
+    width: 16rpx;
+    height: 26rpx;
+}
+/* .picker-time{
+    margin-left: 20rpx;
+} */
+.picker-data{
+    justify-content:flex-end;
+}
+.group-radio-item{
+    color: #666666;
+    height: 56rpx;
+    border-radius: 28rpx;
+    border: 1rpx solid #cccccc;
+    padding: 0 24rpx;
+    display: inline-block;
+    margin-bottom:24rpx;
+    margin-right: 24rpx;
+}
+.active.group-radio-item{
+    background-color: #ff6845;
+    color: #fff;
+}
+.input-shell textarea {
+    height: 120rpx;
+}
+.submit-btn{
+    height: 100rpx;
+    background-color: #ff4544;
+    font-size: 13pt;
+    color: #ffffff;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    border-radius:0;
+}
+button::after {
+    content:normal;
+    border:0;
 }

+ 105 - 105
wechat/pages/card-clerk/card-clerk.js

xqd
@@ -1,106 +1,106 @@
-// pages/card-clerk/card-clerk.js
-var api = require('../../api.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-        var page = this;
-        var user_info = wx.getStorageSync("user_info");
-        page.setData({
-            store: wx.getStorageSync('store'),
-            user_info: user_info
-        });
-        wx.showModal({
-            title: '提示',
-            content: '是否核销预约?',
-            success: function (e) {
-                if (e.confirm) {
-                    wx.showLoading({
-                        title: '核销中',
-                    })
-                    app.request({
-                        url: api.user.card_clerk,
-                        data: {
-                            user_card_id: decodeURIComponent(options.scene)
-                        },
-                        success: function (res) {
-                            wx.showModal({
-                                title: '提示',
-                                content: res.msg,
-                                showCancel: false,
-                                success: function (res) {
-                                    if (res.confirm) {
-                                        wx.redirectTo({
-                                            url: '/pages/index/index',
-                                        })
-                                    }
-                                }
-                            })
-                        },
-                        complete: function () {
-                            wx.hideLoading();
-                        }
-                    });
-                }
-                else if (e.cancel) {
-                    wx.redirectTo({
-                        url: '/pages/index/index',
-                    })
-                }
-            }
-        })
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        app.pageOnShow(this);
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
+// pages/card-clerk/card-clerk.js
+var api = require('../../api.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+        var page = this;
+        var user_info = wx.getStorageSync("user_info");
+        page.setData({
+            store: wx.getStorageSync('store'),
+            user_info: user_info
+        });
+        wx.showModal({
+            title: '提示',
+            content: '是否核销预约?',
+            success: function (e) {
+                if (e.confirm) {
+                    wx.showLoading({
+                        title: '核销中',
+                    })
+                    app.request({
+                        url: api.user.card_clerk,
+                        data: {
+                            user_card_id: decodeURIComponent(options.scene)
+                        },
+                        success: function (res) {
+                            wx.showModal({
+                                title: '提示',
+                                content: res.msg,
+                                showCancel: false,
+                                success: function (res) {
+                                    if (res.confirm) {
+                                        wx.redirectTo({
+                                            url: '/pages/index/index',
+                                        })
+                                    }
+                                }
+                            })
+                        },
+                        complete: function () {
+                            wx.hideLoading();
+                        }
+                    });
+                }
+                else if (e.cancel) {
+                    wx.redirectTo({
+                        url: '/pages/index/index',
+                    })
+                }
+            }
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        app.pageOnShow(this);
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
 })

+ 2 - 2
wechat/pages/card-clerk/card-clerk.json

xqd
@@ -1,3 +1,3 @@
-{
-    "navigationBarTitleText": "卡券核销"
+{
+    "navigationBarTitleText": "卡券核销"
 }

+ 1 - 1
wechat/pages/card-clerk/card-clerk.wxml

xqd
@@ -1 +1 @@
-<!--pages/card-clerk/card-clerk.wxml-->
+<!--pages/card-clerk/card-clerk.wxml-->

+ 240 - 240
wechat/pages/card/card.js

xqd
@@ -1,241 +1,241 @@
-// pages/card/card.js
-var api = require('../../api.js');
-var app = getApp();
-var is_loading = false;
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        page: 1,
-        show_qrcode: false,
-        status: 1
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-        if (options.status) {
-            this.setData({
-                status: options.status
-            });
-        }
-        this.loadData();
-    },
-    loadData: function () {
-        var page = this;
-        wx.showLoading({
-            title: '加载中',
-        })
-        app.request({
-            url: api.user.card,
-            data: {
-                page: 1,
-                status: page.data.status
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    page.setData(res.data);
-                }
-            },
-            complete: function () {
-                wx.hideLoading();
-            }
-        });
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-        if (this.data.page == this.data.page_count) {
-            return;
-        }
-        this.loadMore();
-    },
-
-    loadMore: function () {
-        var page = this;
-        if (is_loading) {
-            return;
-        }
-        is_loading = true;
-        wx.showLoading({
-            title: '加载中',
-        });
-        var p = page.data.page;
-        app.request({
-            url: api.user.card,
-            data: {
-                page: (p + 1),
-                status: page.data.status
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    var list = page.data.list.concat(res.data.list);
-                    page.setData({
-                        list: list,
-                        page_count: res.data.page_count,
-                        row_count: res.data.row_count,
-                        page: p + 1
-                    });
-                }
-            },
-            complete: function () {
-                is_loading = false;
-                wx.hideLoading();
-            }
-        });
-    },
-    getQrcode: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var list = page.data.list;
-        var card = list[index];
-        wx.showLoading({
-            title: '加载中',
-        });
-        app.request({
-            url: api.user.card_qrcode,
-            data: {
-                user_card_id: card.id
-            },
-            success: function (res) {
-                if (res.code == 0) {
-                    page.setData({
-                        show_qrcode: true,
-                        qrcode: res.data.url
-                    });
-                } else {
-                    wx.showModal({
-                        title: '提示',
-                        content: res.msg,
-                        showCancel: false,
-                    })
-                }
-            },
-            complete: function () {
-                wx.hideLoading();
-            }
-        });
-    },
-    hide: function () {
-        this.setData({
-            show_qrcode: false
-        });
-    },
-    goto: function (e) {
-        var page = this;
-        var status = e.currentTarget.dataset.status;
-        wx.redirectTo({
-            url: '/pages/card/card?status=' + status,
-        })
-    },
-    save: function () {
-        var page = this;
-        if (wx.saveImageToPhotosAlbum) {
-            wx.showLoading({
-                title: "正在保存图片",
-                mask: false,
-            });
-
-            wx.downloadFile({
-                url: page.data.qrcode,
-                success: function (e) {
-                    wx.showLoading({
-                        title: "正在保存图片",
-                        mask: false,
-                    });
-                    page.saveImg(e);
-                },
-                fail: function (e) {
-                    wx.showModal({
-                        title: '下载失败',
-                        content: e.errMsg + ";" + page.data.goods_qrcode,
-                        showCancel: false,
-                    });
-                },
-                complete: function (e) {
-                    console.log(e);
-                    wx.hideLoading();
-                }
-            });
-        } else {
-            wx.showModal({
-                title: '提示',
-                content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
-            })
-        }
-    },
-    saveImg: function (e) {
-        var page = this;
-        wx.saveImageToPhotosAlbum({
-            filePath: e.tempFilePath,
-            success: function () {
-                wx.showModal({
-                    title: '提示',
-                    content: '保存成功',
-                    showCancel: false,
-                });
-            },
-            fail: function (e) {
-                wx.getSetting({
-                    success: function (r) {
-                        if (!r.authSetting['scope.writePhotosAlbum']) {
-                            app.getauth({
-                                content: "小程序需要授权保存到相册",
-                                success: function (res) {
-                                    if (res) {
-                                        console.log(res);
-                                        page.saveImg(e);
-                                    }
-                                }
-                            });
-                        }
-                    }
-                })
-            },
-            complete: function (e) {
-                wx.hideLoading();
-            }
-        });
-    }
+// pages/card/card.js
+var api = require('../../api.js');
+var app = getApp();
+var is_loading = false;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        page: 1,
+        show_qrcode: false,
+        status: 1
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+        if (options.status) {
+            this.setData({
+                status: options.status
+            });
+        }
+        this.loadData();
+    },
+    loadData: function () {
+        var page = this;
+        wx.showLoading({
+            title: '加载中',
+        })
+        app.request({
+            url: api.user.card,
+            data: {
+                page: 1,
+                status: page.data.status
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    page.setData(res.data);
+                }
+            },
+            complete: function () {
+                wx.hideLoading();
+            }
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+        if (this.data.page == this.data.page_count) {
+            return;
+        }
+        this.loadMore();
+    },
+
+    loadMore: function () {
+        var page = this;
+        if (is_loading) {
+            return;
+        }
+        is_loading = true;
+        wx.showLoading({
+            title: '加载中',
+        });
+        var p = page.data.page;
+        app.request({
+            url: api.user.card,
+            data: {
+                page: (p + 1),
+                status: page.data.status
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    var list = page.data.list.concat(res.data.list);
+                    page.setData({
+                        list: list,
+                        page_count: res.data.page_count,
+                        row_count: res.data.row_count,
+                        page: p + 1
+                    });
+                }
+            },
+            complete: function () {
+                is_loading = false;
+                wx.hideLoading();
+            }
+        });
+    },
+    getQrcode: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var list = page.data.list;
+        var card = list[index];
+        wx.showLoading({
+            title: '加载中',
+        });
+        app.request({
+            url: api.user.card_qrcode,
+            data: {
+                user_card_id: card.id
+            },
+            success: function (res) {
+                if (res.code == 0) {
+                    page.setData({
+                        show_qrcode: true,
+                        qrcode: res.data.url
+                    });
+                } else {
+                    wx.showModal({
+                        title: '提示',
+                        content: res.msg,
+                        showCancel: false,
+                    })
+                }
+            },
+            complete: function () {
+                wx.hideLoading();
+            }
+        });
+    },
+    hide: function () {
+        this.setData({
+            show_qrcode: false
+        });
+    },
+    goto: function (e) {
+        var page = this;
+        var status = e.currentTarget.dataset.status;
+        wx.redirectTo({
+            url: '/pages/card/card?status=' + status,
+        })
+    },
+    save: function () {
+        var page = this;
+        if (wx.saveImageToPhotosAlbum) {
+            wx.showLoading({
+                title: "正在保存图片",
+                mask: false,
+            });
+
+            wx.downloadFile({
+                url: page.data.qrcode,
+                success: function (e) {
+                    wx.showLoading({
+                        title: "正在保存图片",
+                        mask: false,
+                    });
+                    page.saveImg(e);
+                },
+                fail: function (e) {
+                    wx.showModal({
+                        title: '下载失败',
+                        content: e.errMsg + ";" + page.data.goods_qrcode,
+                        showCancel: false,
+                    });
+                },
+                complete: function (e) {
+                    console.log(e);
+                    wx.hideLoading();
+                }
+            });
+        } else {
+            wx.showModal({
+                title: '提示',
+                content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
+            })
+        }
+    },
+    saveImg: function (e) {
+        var page = this;
+        wx.saveImageToPhotosAlbum({
+            filePath: e.tempFilePath,
+            success: function () {
+                wx.showModal({
+                    title: '提示',
+                    content: '保存成功',
+                    showCancel: false,
+                });
+            },
+            fail: function (e) {
+                wx.getSetting({
+                    success: function (r) {
+                        if (!r.authSetting['scope.writePhotosAlbum']) {
+                            app.getauth({
+                                content: "小程序需要授权保存到相册",
+                                success: function (res) {
+                                    if (res) {
+                                        console.log(res);
+                                        page.saveImg(e);
+                                    }
+                                }
+                            });
+                        }
+                    }
+                })
+            },
+            complete: function (e) {
+                wx.hideLoading();
+            }
+        });
+    }
 })

+ 2 - 2
wechat/pages/card/card.json

xqd
@@ -1,3 +1,3 @@
-{
-    "navigationBarTitleText": "我的卡券"
+{
+    "navigationBarTitleText": "我的卡券"
 }

+ 42 - 42
wechat/pages/card/card.wxml

xqd
@@ -1,43 +1,43 @@
-<!--pages/card/card.wxml-->
-<view class='flex-row card-top'>
-    <view class='flex-grow-1 flex-x-center'>
-        <view class='flex-y-center {{status==2?"":"active"}}' bindtap='goto' data-status='1'>未使用</view>
-    </view>
-    <view class='flex-grow-1 flex-x-center'>
-        <view class='flex-y-center {{status==2?"active":""}}' bindtap='goto' data-status='2'>已失效</view>
-    </view>
-</view>
-<block wx:if='{{list.length>0}}'>
-    <view class='card-list'>
-        <block wx:for='{{list}}'>
-            <view class='card-one flex-col'>
-                <view class=' flex-row flex-y-center flex-grow-1'>
-                    <view class='flex-grow-0'>
-                        <image src='{{item.card_pic_url}}' class='img'></image>
-                    </view>
-                    <view class='flex-grow-1'>
-                        <view class='text-more-2'>{{item.card_content}}</view>
-                    </view>
-                    <view wx:if='{{item.is_use == 0}}' class='flex-grow-0' bindtap='getQrcode' data-index='{{index}}'>
-                        <image src='/images/icon-card-qrcode.png' class='img-1'></image>
-                    </view>
-                </view>
-                <view wx:if='{{item.is_use == 1}}' class='flex-row flex-grow-0 fs-sm' style='justify-content:flex-end;margin-bottom:20rpx;'>使用时间:{{item.clerk_time}}</view>
-            </view>
-        </block>
-    </view>
-</block>
-<block wx:else>
-    <view class='flex-x-center fs-sm' style='padding-top:140rpx'>暂无卡券</view>
-</block>
-<view class='flex-row flex-y-center modal {{show_qrcode?"":"hide"}}' bindtap='hide'>
-    <view class='flex-y-center' style='width:100%;padding:100rpx;'>
-        <view style='background-color:#fff;width:100%;height:100%;border-radius:10rpx;padding:50rpx 50rpx;'>
-            <view class='flex-x-center' style='width:100%;height:50rpx;font-size:13pt;margin-bottom:20rpx'>卡券二维码</view>
-            <image src='{{qrcode}}' style='width:450rpx;height:450rpx;'></image>
-            <view class='w-100 flex-x-center'>
-                <view class='save-btn flex-x-center flex-y-center' catchtap='save'>保存图片</view>
-            </view>
-        </view>
-    </view>
+<!--pages/card/card.wxml-->
+<view class='flex-row card-top'>
+    <view class='flex-grow-1 flex-x-center'>
+        <view class='flex-y-center {{status==2?"":"active"}}' bindtap='goto' data-status='1'>未使用</view>
+    </view>
+    <view class='flex-grow-1 flex-x-center'>
+        <view class='flex-y-center {{status==2?"active":""}}' bindtap='goto' data-status='2'>已失效</view>
+    </view>
+</view>
+<block wx:if='{{list.length>0}}'>
+    <view class='card-list'>
+        <block wx:for='{{list}}'>
+            <view class='card-one flex-col'>
+                <view class=' flex-row flex-y-center flex-grow-1'>
+                    <view class='flex-grow-0'>
+                        <image src='{{item.card_pic_url}}' class='img'></image>
+                    </view>
+                    <view class='flex-grow-1'>
+                        <view class='text-more-2'>{{item.card_content}}</view>
+                    </view>
+                    <view wx:if='{{item.is_use == 0}}' class='flex-grow-0' bindtap='getQrcode' data-index='{{index}}'>
+                        <image src='/images/icon-card-qrcode.png' class='img-1'></image>
+                    </view>
+                </view>
+                <view wx:if='{{item.is_use == 1}}' class='flex-row flex-grow-0 fs-sm' style='justify-content:flex-end;margin-bottom:20rpx;'>使用时间:{{item.clerk_time}}</view>
+            </view>
+        </block>
+    </view>
+</block>
+<block wx:else>
+    <view class='flex-x-center fs-sm' style='padding-top:140rpx'>暂无卡券</view>
+</block>
+<view class='flex-row flex-y-center modal {{show_qrcode?"":"hide"}}' bindtap='hide'>
+    <view class='flex-y-center' style='width:100%;padding:100rpx;'>
+        <view style='background-color:#fff;width:100%;height:100%;border-radius:10rpx;padding:50rpx 50rpx;'>
+            <view class='flex-x-center' style='width:100%;height:50rpx;font-size:13pt;margin-bottom:20rpx'>卡券二维码</view>
+            <image src='{{qrcode}}' style='width:450rpx;height:450rpx;'></image>
+            <view class='w-100 flex-x-center'>
+                <view class='save-btn flex-x-center flex-y-center' catchtap='save'>保存图片</view>
+            </view>
+        </view>
+    </view>
 </view>

+ 67 - 67
wechat/pages/card/card.wxss

xqd
@@ -1,67 +1,67 @@
-/* pages/card/card.wxss */
-
-.card-top {
-    width: 100%;
-    height: 90rpx;
-    border-top: 1rpx solid #e3e3e3;
-    border-bottom: 1rpx solid #e3e3e3;
-    background-color: #fff;
-    position: fixed;
-    top: 0;
-    left: 0;
-}
-
-.active{
-    color: #ff4544;
-    border-bottom: 4rpx solid #ff4544;
-}
-
-.card-list {
-    padding: 20rpx;
-    padding-top: 110rpx;
-}
-
-.card-one {
-    margin-bottom: 20rpx;
-    background-color: #fff;
-    width: 702rpx;
-    height: 180rpx;
-    padding-right: 40rpx;
-}
-
-.img {
-    width: 88rpx;
-    height: 88rpx;
-    border-radius: 88rpx;
-    margin-right: 34rpx;
-    margin-left: 24rpx;
-}
-
-.img-1 {
-    width: 50rpx;
-    height: 50rpx;
-    margin-left: 60rpx;
-}
-
-.hide {
-    display: none;
-}
-
-.modal {
-    position: fixed;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    background-color: rgba(0, 0, 0, 0.5);
-    z-index: 9999;
-}
-
-.save-btn{
-    width: 200rpx;
-    height: 60rpx;
-    background-color: #ff4544;
-    color: #fff;
-    border-radius: 10rpx;
-    margin-top: 10rpx;
-}
+/* pages/card/card.wxss */
+
+.card-top {
+    width: 100%;
+    height: 90rpx;
+    border-top: 1rpx solid #e3e3e3;
+    border-bottom: 1rpx solid #e3e3e3;
+    background-color: #fff;
+    position: fixed;
+    top: 0;
+    left: 0;
+}
+
+.active{
+    color: #ff4544;
+    border-bottom: 4rpx solid #ff4544;
+}
+
+.card-list {
+    padding: 20rpx;
+    padding-top: 110rpx;
+}
+
+.card-one {
+    margin-bottom: 20rpx;
+    background-color: #fff;
+    width: 702rpx;
+    height: 180rpx;
+    padding-right: 40rpx;
+}
+
+.img {
+    width: 88rpx;
+    height: 88rpx;
+    border-radius: 88rpx;
+    margin-right: 34rpx;
+    margin-left: 24rpx;
+}
+
+.img-1 {
+    width: 50rpx;
+    height: 50rpx;
+    margin-left: 60rpx;
+}
+
+.hide {
+    display: none;
+}
+
+.modal {
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(0, 0, 0, 0.5);
+    z-index: 9999;
+}
+
+.save-btn{
+    width: 200rpx;
+    height: 60rpx;
+    background-color: #ff4544;
+    color: #fff;
+    border-radius: 10rpx;
+    margin-top: 10rpx;
+}

+ 323 - 323
wechat/pages/cart/cart.js

xqd
@@ -1,324 +1,324 @@
-// cart.js
-var api = require('../../api.js');
-var app = getApp();
-Page({
-
-    /**
-     * 页面的初始数据
-     */ 
-    data: {
-        total_price: 0.00,
-        cart_check_all: false,
-        cart_list: [],
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        app.pageOnShow(this);
-        var page = this;
-        page.setData({
-            cart_check_all: false,
-            show_cart_edit: false,
-        });
-        page.getCartList();
-    },
-
-    getCartList: function () {
-        var page = this;
-        //wx.showNavigationBarLoading();
-        page.setData({
-            show_no_data_tip: false,
-        });
-        app.request({
-            url: api.cart.list,
-            success: function (res) {
-                if (res.code == 0) {
-                    page.setData({
-                        cart_list: res.data.list,
-                        total_price: 0.00,
-                        cart_check_all: false,
-                        show_cart_edit: false,
-                    });
-                }
-                if (page.data.cart_list.length == 0){
-                    page.setData({
-                        show_cart: false,
-                    });
-                }
-                else{
-                    page.setData({
-                        show_cart: true,
-                    });
-                }
-                page.setData({
-                    show_no_data_tip: (page.data.cart_list.length == 0),
-                });
-                //wx.hideNavigationBarLoading();
-                //wx.stopPullDownRefresh();
-            }
-        });
-    },
-
-    //购物车减少
-    cartLess: function(index){
-        var page = this;
-        var cart_list = page.data.cart_list;
-        for(var i in cart_list){
-            if(index.currentTarget.id == cart_list[i]['cart_id']){
-                 cart_list[i]['num'] = page.data.cart_list[i]['num']-1;
-                 cart_list[i]['price'] =page.data.cart_list[i]['unitPrice'] * cart_list[i]['num'];
-                 page.setData({
-                     cart_list:cart_list,
-                 });
-                 page.updateTotalPrice();
-            }
-        };
-    },
-    //购物车添加
-    cartAdd: function(index){
-        var page = this;
-        var cart_list = page.data.cart_list;
-        for(var i in cart_list){
-            if(index.currentTarget.id == cart_list[i]['cart_id']){
-                cart_list[i]['num'] = page.data.cart_list[i]['num'] + 1;
-                cart_list[i]['price'] =page.data.cart_list[i]['unitPrice'] * cart_list[i]['num'];
-
-                page.setData({
-                    cart_list:cart_list,
-                });
-                page.updateTotalPrice();
-            }
-        };
-    },
-    cartCheck: function (e) {
-        var page = this;
-        var index = e.currentTarget.dataset.index;
-        var cart_list = page.data.cart_list;
-        var num = 0;
-        if (cart_list[index].checked) {
-            cart_list[index].checked = false;
-        } else {
-            cart_list[index].checked = true;
-        }
-
-        for(var i in cart_list){
-            if(cart_list[i].checked==true){
-                num++;
-            }
-        }
-        page.setData({
-            cart_list: cart_list,
-        });
-
-        if(num == cart_list.length){
-            page.setData({
-                cart_check_all:true,
-            });          
-        }else{
-            page.setData({
-                cart_check_all:false,
-            });      
-        }
-        page.updateTotalPrice();
-    },
-
-    cartCheckAll: function () {
-        var page = this;
-        var cart_list = page.data.cart_list;
-        var checked = false;
-        if (page.data.cart_check_all) {
-            checked = false;
-        } else {
-            checked = true;
-        }
-        for (var i in cart_list) {
-            if (!cart_list[i].disabled || page.data.show_cart_edit)
-                cart_list[i].checked = checked;
-        }
-        page.setData({
-            cart_check_all: checked,
-            cart_list: cart_list,
-        });
-        page.updateTotalPrice();
-
-    },
-
-    updateTotalPrice: function () {
-        var page = this;
-        var total_price = 0.00;
-        var cart_list = page.data.cart_list;
-        for (var i in cart_list) {
-            if (cart_list[i].checked)
-                total_price += cart_list[i].price;
-        }
-        page.setData({
-          total_price: total_price.toFixed(2),
-        });
-    },
-
-    /**
-     * 提交
-     * 
-     */
-    cartSubmit: function () {
-        var page = this;
-        var submit = 0;
-        var cart = JSON.stringify(page.data.cart_list);
-        if(cart == []){
-            return;
-        }
-        app.request({
-            url: api.cart.cart_edit,
-            method: 'post',
-            data: {
-                list: cart,
-            },
-            success: function (res) {
-              if (res.code == 0) {
-
-
-                    var cart_list = page.data.cart_list;                
-                    var cart_id_list = [];
-                    for (var i in cart_list) {
-                        if (cart_list[i].checked)
-                            cart_id_list.push(cart_list[i].cart_id);
-                    }
-                    if (cart_id_list.length == 0) {
-                        return true;
-                    }
-                    wx.navigateTo({
-                        url: '/pages/order-submit/order-submit?cart_id_list=' + JSON.stringify(cart_id_list),
-                    });
-
-                }
-            }
-        }); 
-
-
-    },
-
-    cartEdit: function () {
-        var page = this;
-        var cart_list = page.data.cart_list;
-        for (var i in cart_list) {
-            cart_list[i].checked = false;
-        }
-        page.setData({
-            cart_list: cart_list,
-            show_cart_edit: true,
-            cart_check_all: false,
-        });
-        page.updateTotalPrice();
-    },
-
-    cartDone: function () {
-        var page = this;
-        var cart_list = page.data.cart_list;
-        for (var i in cart_list) {
-            cart_list[i].checked = false;
-        }
-        page.setData({
-            cart_list: cart_list,
-            show_cart_edit: false,
-            cart_check_all: false,
-        });
-        page.updateTotalPrice();
-    },
-
-    cartDelete: function () {
-        var page = this;
-        var cart_list = page.data.cart_list;
-        var cart_id_list = [];
-        for (var i in cart_list) {
-            if (cart_list[i].checked)
-                cart_id_list.push(cart_list[i].cart_id);
-        }
-        if (cart_id_list.length == 0) {
-            return true;
-        }
-        wx.showModal({
-            title: "提示",
-            content: "确认删除" + cart_id_list.length + "项内容?",
-            success: function (res) {
-                if (res.cancel)
-                    return true;
-                wx.showLoading({
-                    title: "正在删除",
-                    mask: true,
-                });
-                app.request({
-                    url: api.cart.delete,
-                    data: {
-                        cart_id_list: JSON.stringify(cart_id_list),
-                    },
-                    success: function (res) {
-                        wx.hideLoading();
-                        wx.showToast({
-                            title: res.msg,
-                        });
-                        if (res.code == 0) {
-                            //page.cartDone();
-                            page.getCartList();
-                        }
-                        if (res.code == 1) {
-                        }
-                    }
-                });
-            }
-        });
-    },   
-     onHide: function () {
-        var page = this;
-        var cart = JSON.stringify(page.data.cart_list);
-        if(cart == []){
-            return;
-        }
-        app.request({
-            url: api.cart.cart_edit,
-            method: 'post',
-            data: {
-                  list: cart,
-            },
-            success: function (res) {
-             if (res.code == 0) {
-                console.log(res.msg);
-                }
-            }
-        }); 
-    },
-    onUnload: function () {
-        var page = this;
-        var cart = JSON.stringify(page.data.cart_list);
-        if(cart == [])
-            return;
-        app.request({
-            url: api.cart.cart_edit,
-            method: 'post',
-            data: {
-                list: cart,
-            },
-            success: function (res) {
-             if (res.code == 0) {
-                console.log(res.msg);
-                }
-            }
-        }); 
-    },
-
+// cart.js
+var api = require('../../api.js');
+var app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */ 
+    data: {
+        total_price: 0.00,
+        cart_check_all: false,
+        cart_list: [],
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        app.pageOnShow(this);
+        var page = this;
+        page.setData({
+            cart_check_all: false,
+            show_cart_edit: false,
+        });
+        page.getCartList();
+    },
+
+    getCartList: function () {
+        var page = this;
+        //wx.showNavigationBarLoading();
+        page.setData({
+            show_no_data_tip: false,
+        });
+        app.request({
+            url: api.cart.list,
+            success: function (res) {
+                if (res.code == 0) {
+                    page.setData({
+                        cart_list: res.data.list,
+                        total_price: 0.00,
+                        cart_check_all: false,
+                        show_cart_edit: false,
+                    });
+                }
+                if (page.data.cart_list.length == 0){
+                    page.setData({
+                        show_cart: false,
+                    });
+                }
+                else{
+                    page.setData({
+                        show_cart: true,
+                    });
+                }
+                page.setData({
+                    show_no_data_tip: (page.data.cart_list.length == 0),
+                });
+                //wx.hideNavigationBarLoading();
+                //wx.stopPullDownRefresh();
+            }
+        });
+    },
+
+    //购物车减少
+    cartLess: function(index){
+        var page = this;
+        var cart_list = page.data.cart_list;
+        for(var i in cart_list){
+            if(index.currentTarget.id == cart_list[i]['cart_id']){
+                 cart_list[i]['num'] = page.data.cart_list[i]['num']-1;
+                 cart_list[i]['price'] =page.data.cart_list[i]['unitPrice'] * cart_list[i]['num'];
+                 page.setData({
+                     cart_list:cart_list,
+                 });
+                 page.updateTotalPrice();
+            }
+        };
+    },
+    //购物车添加
+    cartAdd: function(index){
+        var page = this;
+        var cart_list = page.data.cart_list;
+        for(var i in cart_list){
+            if(index.currentTarget.id == cart_list[i]['cart_id']){
+                cart_list[i]['num'] = page.data.cart_list[i]['num'] + 1;
+                cart_list[i]['price'] =page.data.cart_list[i]['unitPrice'] * cart_list[i]['num'];
+
+                page.setData({
+                    cart_list:cart_list,
+                });
+                page.updateTotalPrice();
+            }
+        };
+    },
+    cartCheck: function (e) {
+        var page = this;
+        var index = e.currentTarget.dataset.index;
+        var cart_list = page.data.cart_list;
+        var num = 0;
+        if (cart_list[index].checked) {
+            cart_list[index].checked = false;
+        } else {
+            cart_list[index].checked = true;
+        }
+
+        for(var i in cart_list){
+            if(cart_list[i].checked==true){
+                num++;
+            }
+        }
+        page.setData({
+            cart_list: cart_list,
+        });
+
+        if(num == cart_list.length){
+            page.setData({
+                cart_check_all:true,
+            });          
+        }else{
+            page.setData({
+                cart_check_all:false,
+            });      
+        }
+        page.updateTotalPrice();
+    },
+
+    cartCheckAll: function () {
+        var page = this;
+        var cart_list = page.data.cart_list;
+        var checked = false;
+        if (page.data.cart_check_all) {
+            checked = false;
+        } else {
+            checked = true;
+        }
+        for (var i in cart_list) {
+            if (!cart_list[i].disabled || page.data.show_cart_edit)
+                cart_list[i].checked = checked;
+        }
+        page.setData({
+            cart_check_all: checked,
+            cart_list: cart_list,
+        });
+        page.updateTotalPrice();
+
+    },
+
+    updateTotalPrice: function () {
+        var page = this;
+        var total_price = 0.00;
+        var cart_list = page.data.cart_list;
+        for (var i in cart_list) {
+            if (cart_list[i].checked)
+                total_price += cart_list[i].price;
+        }
+        page.setData({
+          total_price: total_price.toFixed(2),
+        });
+    },
+
+    /**
+     * 提交
+     * 
+     */
+    cartSubmit: function () {
+        var page = this;
+        var submit = 0;
+        var cart = JSON.stringify(page.data.cart_list);
+        if(cart == []){
+            return;
+        }
+        app.request({
+            url: api.cart.cart_edit,
+            method: 'post',
+            data: {
+                list: cart,
+            },
+            success: function (res) {
+              if (res.code == 0) {
+
+
+                    var cart_list = page.data.cart_list;                
+                    var cart_id_list = [];
+                    for (var i in cart_list) {
+                        if (cart_list[i].checked)
+                            cart_id_list.push(cart_list[i].cart_id);
+                    }
+                    if (cart_id_list.length == 0) {
+                        return true;
+                    }
+                    wx.navigateTo({
+                        url: '/pages/order-submit/order-submit?cart_id_list=' + JSON.stringify(cart_id_list),
+                    });
+
+                }
+            }
+        }); 
+
+
+    },
+
+    cartEdit: function () {
+        var page = this;
+        var cart_list = page.data.cart_list;
+        for (var i in cart_list) {
+            cart_list[i].checked = false;
+        }
+        page.setData({
+            cart_list: cart_list,
+            show_cart_edit: true,
+            cart_check_all: false,
+        });
+        page.updateTotalPrice();
+    },
+
+    cartDone: function () {
+        var page = this;
+        var cart_list = page.data.cart_list;
+        for (var i in cart_list) {
+            cart_list[i].checked = false;
+        }
+        page.setData({
+            cart_list: cart_list,
+            show_cart_edit: false,
+            cart_check_all: false,
+        });
+        page.updateTotalPrice();
+    },
+
+    cartDelete: function () {
+        var page = this;
+        var cart_list = page.data.cart_list;
+        var cart_id_list = [];
+        for (var i in cart_list) {
+            if (cart_list[i].checked)
+                cart_id_list.push(cart_list[i].cart_id);
+        }
+        if (cart_id_list.length == 0) {
+            return true;
+        }
+        wx.showModal({
+            title: "提示",
+            content: "确认删除" + cart_id_list.length + "项内容?",
+            success: function (res) {
+                if (res.cancel)
+                    return true;
+                wx.showLoading({
+                    title: "正在删除",
+                    mask: true,
+                });
+                app.request({
+                    url: api.cart.delete,
+                    data: {
+                        cart_id_list: JSON.stringify(cart_id_list),
+                    },
+                    success: function (res) {
+                        wx.hideLoading();
+                        wx.showToast({
+                            title: res.msg,
+                        });
+                        if (res.code == 0) {
+                            //page.cartDone();
+                            page.getCartList();
+                        }
+                        if (res.code == 1) {
+                        }
+                    }
+                });
+            }
+        });
+    },   
+     onHide: function () {
+        var page = this;
+        var cart = JSON.stringify(page.data.cart_list);
+        if(cart == []){
+            return;
+        }
+        app.request({
+            url: api.cart.cart_edit,
+            method: 'post',
+            data: {
+                  list: cart,
+            },
+            success: function (res) {
+             if (res.code == 0) {
+                console.log(res.msg);
+                }
+            }
+        }); 
+    },
+    onUnload: function () {
+        var page = this;
+        var cart = JSON.stringify(page.data.cart_list);
+        if(cart == [])
+            return;
+        app.request({
+            url: api.cart.cart_edit,
+            method: 'post',
+            data: {
+                list: cart,
+            },
+            success: function (res) {
+             if (res.code == 0) {
+                console.log(res.msg);
+                }
+            }
+        }); 
+    },
+
 });

+ 2 - 2
wechat/pages/cart/cart.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": "购物车"
+{
+  "navigationBarTitleText": "购物车"
 }

+ 87 - 87
wechat/pages/cart/cart.wxml

xqd
@@ -1,87 +1,87 @@
-<!--cart.wxml-->
-<include src="/commons/navbar/navbar"/>
-<view class="after-navber">
-    <view wx:if="{{show_cart}}" class="bottom-bar flex-row">
-        <view class="flex-y-center flex-grow-1" style="padding: 0 24rpx">
-            <view bindtap="cartCheckAll" class="flex-grow-0 flex-y-center" style="margin-right: 20rpx">
-                <view class="cart-checkbox {{cart_check_all?'active':''}}" style="margin-right: 10rpx"></view>
-                <text style="white-space: nowrap">全选</text>
-            </view>
-            <view class="flex-grow-1" style="color:#ff4544;white-space: nowrap">
-                总计: ¥{{total_price}}
-            </view>
-        </view>
-        <block wx:if="{{show_cart_edit}}">
-            <view class="flex-y-center flex-grow-0 flex-x-center edit-btn" bindtap="cartDone">完成</view>
-            <view class="flex-y-center flex-grow-0 flex-x-center submit-btn" bindtap="cartDelete">删除</view>
-        </block>
-        <block wx:else>
-            <view class="flex-y-center flex-grow-0 flex-x-center edit-btn" bindtap="cartEdit">编辑</view>
-            <view class="flex-y-center flex-grow-0 flex-x-center submit-btn" bindtap="cartSubmit">结算</view>
-        </block>
-    </view>
-
-    <view wx:if="{{show_no_data_tip}}" class="no-data-tip">
-        <!-- <view class="no-data-icon flex-y-center flex-x-center">
-            <image src="/images/nav-icon-cart.png" style="width: 81rpx;height: 81rpx"></image>
-        </view>
-        <view>购物车还是空的哦</view> -->
-        <view class="no-data-icon flex-y-center flex-x-center">
-            <image src="/images/cart-empty.png" style="width:100%; height: 100%;"></image>
-        </view>
-        <view>暂无数据</view>
-    </view>
-    <view class="cart-list">
-        <view class="cart-item flex-row" wx:for="{{cart_list}}">
-
-            <view wx:if="{{item.disabled&&!show_cart_edit}}" class="flex-grow-0 flex-y-center" style="padding: 24rpx">
-                <view style="width: 40rpx"></view>
-            </view>
-
-            <view wx:else data-index="{{index}}" bindtap="cartCheck" class="flex-grow-0 flex-y-center"
-                  style="padding: 24rpx">
-                <view class="cart-checkbox {{item.checked?'active':''}}"></view>
-            </view>
-
-            <view class="flex-grow-1">
-
-                <view class="flex-grow-1 flex-row">
-                    <view class="flex-grow-0">
-                        <image class="goods-pic" mode="aspectFill" src="{{item.goods_pic}}"/>
-                    </view>
-                    <view class="flex-grow-1 flex-col">
-                        <view class="flex-grow-1">
-                            <view class="goods-name">
-                                <navigator url="/pages/goods/goods?id={{item.goods_id}}">{{item.goods_name}}</navigator>
-                            </view>
-                            <view class="attr-list">
-                                <view class="attr-item" wx:for="{{item.attr_list}}" wx:for-item="attr">
-                                    {{attr.attr_group_name}}:{{attr.attr_name}}
-                                </view>
-                            </view>
-                        </view>
-                        <view class="flex-grow-0 flex-row">
-                            <view class="flex-grow-1 price">¥{{item.unitPrice}}</view>
-                            <view>
-                                <view class="flex-row">
-                                    <image wx:if="{{item.num!=1}}" bindtap="cartLess" id="{{item.cart_id}}" class="image1" src="/images/cart_less.png"/>
-                                    <image wx:if="{{item.num==1}}" class="image1" src="/images/cart_no_less.png"/>
-
-                                    <view class="row-data">{{item.num}}</view>
-
-                                    <image wx:if="{{item.num==item.max_num}}" class="image1" src="/images/cart_no_add.png"/>
-                                    <image wx:if="{{item.num!=item.max_num}}" bindtap="cartAdd" id="{{item.cart_id}}" class="image1" src="/images/cart_add.png"/> 
-                                </view>
-                            </view>
-                        </view>
-                    </view>
-                </view>
-                <view>
-                    <text wx:if="{{item.num>item.max_num}}" class="cart-tag">库存不足</text>
-                </view>
-            </view>
-        </view>
-    </view>
-</view>
-
-
+<!--cart.wxml-->
+<include src="/commons/navbar/navbar"/>
+<view class="after-navber">
+    <view wx:if="{{show_cart}}" class="bottom-bar flex-row">
+        <view class="flex-y-center flex-grow-1" style="padding: 0 24rpx">
+            <view bindtap="cartCheckAll" class="flex-grow-0 flex-y-center" style="margin-right: 20rpx">
+                <view class="cart-checkbox {{cart_check_all?'active':''}}" style="margin-right: 10rpx"></view>
+                <text style="white-space: nowrap">全选</text>
+            </view>
+            <view class="flex-grow-1" style="color:#ff4544;white-space: nowrap">
+                总计: ¥{{total_price}}
+            </view>
+        </view>
+        <block wx:if="{{show_cart_edit}}">
+            <view class="flex-y-center flex-grow-0 flex-x-center edit-btn" bindtap="cartDone">完成</view>
+            <view class="flex-y-center flex-grow-0 flex-x-center submit-btn" bindtap="cartDelete">删除</view>
+        </block>
+        <block wx:else>
+            <view class="flex-y-center flex-grow-0 flex-x-center edit-btn" bindtap="cartEdit">编辑</view>
+            <view class="flex-y-center flex-grow-0 flex-x-center submit-btn" bindtap="cartSubmit">结算</view>
+        </block>
+    </view>
+
+    <view wx:if="{{show_no_data_tip}}" class="no-data-tip">
+        <!-- <view class="no-data-icon flex-y-center flex-x-center">
+            <image src="/images/nav-icon-cart.png" style="width: 81rpx;height: 81rpx"></image>
+        </view>
+        <view>购物车还是空的哦</view> -->
+        <view class="no-data-icon flex-y-center flex-x-center">
+            <image src="/images/cart-empty.png" style="width:100%; height: 100%;"></image>
+        </view>
+        <view>暂无数据</view>
+    </view>
+    <view class="cart-list">
+        <view class="cart-item flex-row" wx:for="{{cart_list}}">
+
+            <view wx:if="{{item.disabled&&!show_cart_edit}}" class="flex-grow-0 flex-y-center" style="padding: 24rpx">
+                <view style="width: 40rpx"></view>
+            </view>
+
+            <view wx:else data-index="{{index}}" bindtap="cartCheck" class="flex-grow-0 flex-y-center"
+                  style="padding: 24rpx">
+                <view class="cart-checkbox {{item.checked?'active':''}}"></view>
+            </view>
+
+            <view class="flex-grow-1">
+
+                <view class="flex-grow-1 flex-row">
+                    <view class="flex-grow-0">
+                        <image class="goods-pic" mode="aspectFill" src="{{item.goods_pic}}"/>
+                    </view>
+                    <view class="flex-grow-1 flex-col">
+                        <view class="flex-grow-1">
+                            <view class="goods-name">
+                                <navigator url="/pages/goods/goods?id={{item.goods_id}}">{{item.goods_name}}</navigator>
+                            </view>
+                            <view class="attr-list">
+                                <view class="attr-item" wx:for="{{item.attr_list}}" wx:for-item="attr">
+                                    {{attr.attr_group_name}}:{{attr.attr_name}}
+                                </view>
+                            </view>
+                        </view>
+                        <view class="flex-grow-0 flex-row">
+                            <view class="flex-grow-1 price">¥{{item.unitPrice}}</view>
+                            <view>
+                                <view class="flex-row">
+                                    <image wx:if="{{item.num!=1}}" bindtap="cartLess" id="{{item.cart_id}}" class="image1" src="/images/cart_less.png"/>
+                                    <image wx:if="{{item.num==1}}" class="image1" src="/images/cart_no_less.png"/>
+
+                                    <view class="row-data">{{item.num}}</view>
+
+                                    <image wx:if="{{item.num==item.max_num}}" class="image1" src="/images/cart_no_add.png"/>
+                                    <image wx:if="{{item.num!=item.max_num}}" bindtap="cartAdd" id="{{item.cart_id}}" class="image1" src="/images/cart_add.png"/> 
+                                </view>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+                <view>
+                    <text wx:if="{{item.num>item.max_num}}" class="cart-tag">库存不足</text>
+                </view>
+            </view>
+        </view>
+    </view>
+</view>
+
+

File diff ditekan karena terlalu besar
+ 0 - 34
wechat/pages/cart/cart.wxss


+ 125 - 125
wechat/pages/cash-detail/cash-detail.js

xqd
@@ -1,126 +1,126 @@
-// pages/cash-detail/cash-detail.js
-var api = require('../../api.js');
-var app = getApp();
-var is_no_more = false;
-var is_loading = false;
-var p =2;
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    status:-1,
-    cash_list:[],
-    show_no_data_tip:false,
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-      app.pageOnLoad(this);
-    var page = this;
-    is_no_more = false;
-    is_loading = false;
-    p = 2;
-    page.LoadCashList(options.status || -1);
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-  
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-  LoadCashList: function (status){
-    var page = this;
-    page.setData({
-      status: parseInt(status || -1),
-    });
-    wx.showLoading({
-      title: "正在加载",
-      mask: true,
-    });
-    app.request({
-      url: api.share.cash_detail,
-      data: {
-        status: page.data.status,
-      },
-      success: function (res) {
-        if (res.code == 0) {
-          page.setData({
-            cash_list: res.data.list,
-          });
-        }
-        page.setData({
-          show_no_data_tip: (page.data.cash_list.length == 0),
-        });
-      },
-      complete: function () {
-        wx.hideLoading();
-      }
-    });
-  },
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-  
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-  
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-  
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-    var page = this;
-    if (is_loading || is_no_more)
-      return;
-    is_loading = true;
-    app.request({
-      url: api.share.cash_detail,
-      data: {
-        status: page.data.status,
-        page: p,
-      },
-      success: function (res) {
-        if (res.code == 0) {
-
-          var cash_list = page.data.cash_list.concat(res.data.list);
-          page.setData({
-            cash_list: cash_list,
-          });
-          if (res.data.list.length == 0) {
-            is_no_more = true;
-          }
-        }
-        p++;
-      },
-      complete: function () {
-        is_loading = false;
-      }
-    });
-  },
+// pages/cash-detail/cash-detail.js
+var api = require('../../api.js');
+var app = getApp();
+var is_no_more = false;
+var is_loading = false;
+var p =2;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    status:-1,
+    cash_list:[],
+    show_no_data_tip:false,
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+      app.pageOnLoad(this);
+    var page = this;
+    is_no_more = false;
+    is_loading = false;
+    p = 2;
+    page.LoadCashList(options.status || -1);
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+  LoadCashList: function (status){
+    var page = this;
+    page.setData({
+      status: parseInt(status || -1),
+    });
+    wx.showLoading({
+      title: "正在加载",
+      mask: true,
+    });
+    app.request({
+      url: api.share.cash_detail,
+      data: {
+        status: page.data.status,
+      },
+      success: function (res) {
+        if (res.code == 0) {
+          page.setData({
+            cash_list: res.data.list,
+          });
+        }
+        page.setData({
+          show_no_data_tip: (page.data.cash_list.length == 0),
+        });
+      },
+      complete: function () {
+        wx.hideLoading();
+      }
+    });
+  },
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+    var page = this;
+    if (is_loading || is_no_more)
+      return;
+    is_loading = true;
+    app.request({
+      url: api.share.cash_detail,
+      data: {
+        status: page.data.status,
+        page: p,
+      },
+      success: function (res) {
+        if (res.code == 0) {
+
+          var cash_list = page.data.cash_list.concat(res.data.list);
+          page.setData({
+            cash_list: cash_list,
+          });
+          if (res.data.list.length == 0) {
+            is_no_more = true;
+          }
+        }
+        p++;
+      },
+      complete: function () {
+        is_loading = false;
+      }
+    });
+  },
 })

+ 2 - 2
wechat/pages/cash-detail/cash-detail.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": "提现明细"
+{
+  "navigationBarTitleText": "提现明细"
   }

+ 36 - 36
wechat/pages/cash-detail/cash-detail.wxml

xqd
@@ -1,37 +1,37 @@
-<view class="info">
-  <view class="info-title flex-row">
-    <navigator class="flex-x-center   width" url="/pages/cash-detail/cash-detail?status=-1" open-type="redirect">
-      <view class="info-text {{status == -1?'active':''}}">全部</view>
-    </navigator>
-    <navigator class="flex-x-center  width" url="/pages/cash-detail/cash-detail?status=0" open-type="redirect">
-      <view class="info-text {{status == 0?'active':''}}">待审核</view>
-    </navigator>
-    <navigator class="flex-x-center  width" url="/pages/cash-detail/cash-detail?status=1" open-type="redirect">
-      <view class="info-text {{status == 1?'active':''}}">待打款</view>
-    </navigator>
-    <navigator class="flex-x-center  width" url="/pages/cash-detail/cash-detail?status=2" open-type="redirect">
-      <view class="info-text {{status == 2?'active':''}}">已打款</view>
-    </navigator>
-    <navigator class="flex-x-center  width" url="/pages/cash-detail/cash-detail?status=3" open-type="redirect">
-      <view class="info-text {{status == 3?'active':''}}">无效</view>
-    </navigator>
-  </view>
-  <view style="margin-top:100rpx;">
-    <block wx:if="{{show_no_data_tip}}">
-      <view class="info-no">暂无信息</view>
-    </block>
-    <block wx:else>
-      <block wx:for="{{cash_list}}">
-        <view class="info-content">
-          <view class="info-label flex-row">
-            <view class="info-left">
-              <view class="info-up">提现 {{item.price}}</view>
-              <view class="info-down">{{item.addtime}}</view>
-            </view>
-            <view class="info-right">{{item.status}}</view>
-          </view>
-        </view>
-      </block>
-    </block>
-  </view>
+<view class="info">
+  <view class="info-title flex-row">
+    <navigator class="flex-x-center   width" url="/pages/cash-detail/cash-detail?status=-1" open-type="redirect">
+      <view class="info-text {{status == -1?'active':''}}">全部</view>
+    </navigator>
+    <navigator class="flex-x-center  width" url="/pages/cash-detail/cash-detail?status=0" open-type="redirect">
+      <view class="info-text {{status == 0?'active':''}}">待审核</view>
+    </navigator>
+    <navigator class="flex-x-center  width" url="/pages/cash-detail/cash-detail?status=1" open-type="redirect">
+      <view class="info-text {{status == 1?'active':''}}">待打款</view>
+    </navigator>
+    <navigator class="flex-x-center  width" url="/pages/cash-detail/cash-detail?status=2" open-type="redirect">
+      <view class="info-text {{status == 2?'active':''}}">已打款</view>
+    </navigator>
+    <navigator class="flex-x-center  width" url="/pages/cash-detail/cash-detail?status=3" open-type="redirect">
+      <view class="info-text {{status == 3?'active':''}}">无效</view>
+    </navigator>
+  </view>
+  <view style="margin-top:100rpx;">
+    <block wx:if="{{show_no_data_tip}}">
+      <view class="info-no">暂无信息</view>
+    </block>
+    <block wx:else>
+      <block wx:for="{{cash_list}}">
+        <view class="info-content">
+          <view class="info-label flex-row">
+            <view class="info-left">
+              <view class="info-up">提现 {{item.price}}</view>
+              <view class="info-down">{{item.addtime}}</view>
+            </view>
+            <view class="info-right">{{item.status}}</view>
+          </view>
+        </view>
+      </block>
+    </block>
+  </view>
 </view>

+ 69 - 69
wechat/pages/cash-detail/cash-detail.wxss

xqd
@@ -1,70 +1,70 @@
-/* pages/cash-detail/cash-detail.wxss */
-.info{
-  width: 100%;
-  /* padding-top: 20rpx; */
-}
-.width{
-  width: 20%;
-  text-align: center;
-}
-
-.active{
-  color:#ff4544;
-  border-bottom: 4rpx #ff4544 solid;
-}
-.info .info-title{
-  width: 100%;
-  height: 100rpx;
-  padding: 0 24rpx;
-  border-bottom: 1rpx #ccc solid;
-  /* font-weight: bold; */
-  background-color: #fff;
-  position: fixed;
-  left: 0;
-  top: 0;
-  z-index: 1000;
-}
-.info .info-title .info-text{
-  height: 100rpx;
-  line-height: 100rpx;
-}
-.info .info-content{
-  width: 100%;
-  padding: 0 24rpx;
-  background-color: #fff;
-}
-.info .info-content .info-label{
-  border-bottom: 1rpx #ccc solid;
-  padding: 24rpx 0;
-  width: 100%;
-}
-.info .info-content:last-child .info-label{
-  border: none;
-}
-.info-content .info-label .info-left{
-  width: 60%;
-}
-.info-content .info-label .info-left .info-up{
-  /* font-weight: bold; */
-  color: #353535;
-  margin-bottom: 20rpx;
-}
-.info-content .info-label .info-left .info-down{
-  font-size: 9pt;
-  color: #666;
-}
-.info-content .info-label .info-right{
-  width: 40%;
-  text-align: right;
-  line-height: 100rpx;
-  color: #ff4544;
-  /* font-weight: bold; */
-}
-.info-no{
-  width: 100%;
-  height: 90rpx;
-  line-height: 90rpx;
-  text-align: center;
-  padding: 10rpx;
-  color: #666;
+/* pages/cash-detail/cash-detail.wxss */
+.info{
+  width: 100%;
+  /* padding-top: 20rpx; */
+}
+.width{
+  width: 20%;
+  text-align: center;
+}
+
+.active{
+  color:#ff4544;
+  border-bottom: 4rpx #ff4544 solid;
+}
+.info .info-title{
+  width: 100%;
+  height: 100rpx;
+  padding: 0 24rpx;
+  border-bottom: 1rpx #ccc solid;
+  /* font-weight: bold; */
+  background-color: #fff;
+  position: fixed;
+  left: 0;
+  top: 0;
+  z-index: 1000;
+}
+.info .info-title .info-text{
+  height: 100rpx;
+  line-height: 100rpx;
+}
+.info .info-content{
+  width: 100%;
+  padding: 0 24rpx;
+  background-color: #fff;
+}
+.info .info-content .info-label{
+  border-bottom: 1rpx #ccc solid;
+  padding: 24rpx 0;
+  width: 100%;
+}
+.info .info-content:last-child .info-label{
+  border: none;
+}
+.info-content .info-label .info-left{
+  width: 60%;
+}
+.info-content .info-label .info-left .info-up{
+  /* font-weight: bold; */
+  color: #353535;
+  margin-bottom: 20rpx;
+}
+.info-content .info-label .info-left .info-down{
+  font-size: 9pt;
+  color: #666;
+}
+.info-content .info-label .info-right{
+  width: 40%;
+  text-align: right;
+  line-height: 100rpx;
+  color: #ff4544;
+  /* font-weight: bold; */
+}
+.info-no{
+  width: 100%;
+  height: 90rpx;
+  line-height: 90rpx;
+  text-align: center;
+  padding: 10rpx;
+  color: #666;
 }

+ 204 - 204
wechat/pages/cash/cash.js

xqd
@@ -1,205 +1,205 @@
-// pages/cash/cash.js
-var api = require('../../api.js');
-var app = getApp();
-
-function min(var1, var2) {
-    var1 = parseFloat(var1);
-    var2 = parseFloat(var2);
-    return var1 > var2 ? var2 : var1;
-}
-
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        price: 0.00,
-        cash_max_day: -1,
-        selected: -1
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        app.pageOnLoad(this);
-    },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-        var page = this;
-        var share_setting = wx.getStorageSync("share_setting");
-        page.setData({
-            share_setting: share_setting
-        });
-        app.request({
-            url: api.share.get_price,
-            success: function (res) {
-                if (res.code == 0) {
-                    console.log(res.data)
-                    var selected = 0;
-                    var name = '';
-                    var mobile = '';
-                    var cash_last = res.data.cash_last;
-                    var bank = '';
-                    var bank_name = '';
-                    if (res.data.pay_type == 1) {
-                        selected = 1;
-                    }
-                    if (res.data.bank == 1 && res.data.pay_type == 3) {
-                        selected = 3;
-                    }
-
-                    if (cash_last && (res.data.pay_type == 2 || res.data.pay_type == cash_last['type'])) {
-                        selected = cash_last['type'];
-                        name = cash_last['name'];
-                        mobile = cash_last['mobile'];
-                        bank = cash_last['mobile'];
-                        bank_name = cash_last['bank_name'];
-                    }
-                    var a = res.data;
-                    page.setData({
-                        price: res.data.price.price,
-                        cash_max_day: res.data.cash_max_day,
-                        pay_type: res.data.pay_type,
-                        selected: selected,
-                        name: name,
-                        mobile: mobile,
-                        bank: res.data.bank,
-                        bank_name: bank_name,
-                    });
-                }
-            }
-        });
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-
-    formSubmit: function (e) {
-        var page = this;
-        var cash = parseFloat(parseFloat(e.detail.value.cash).toFixed(2));
-        var cash_max = page.data.price;
-        if (page.data.cash_max_day != -1) {
-            cash_max = min(cash_max, page.data.cash_max_day)
-        }
-        if (cash > cash_max) {
-            wx.showToast({
-                title: "提现金额不能超过" + cash_max + "元",
-                image: "/images/icon-warning.png",
-            });
-            return;
-        }
-        if (cash < parseFloat(page.data.share_setting.min_money)) {
-            wx.showToast({
-                title: "提现金额不能低于" + page.data.share_setting.min_money + "元",
-                image: "/images/icon-warning.png",
-            });
-            return;
-        }
-        var name = e.detail.value.name;
-        var mobile = e.detail.value.mobile;
-        if (!name || name == undefined) {
-            wx.showToast({
-                title: '姓名不能为空',
-                image: "/images/icon-warning.png",
-            });
-            return;
-        }
-        if (!mobile || mobile == undefined) {
-            wx.showToast({
-                title: '账号不能为空',
-                image: "/images/icon-warning.png",
-            });
-            return;
-        }
-
-        var selected = page.data.selected;
-        if (selected != 0 && selected != 1 && selected != 3) {
-            wx.showToast({
-                title: '请选择提现方式',
-                image: "/images/icon-warning.png",
-            });
-            return;
-        }
-        var bank_name = e.detail.value.bank_name;
-        if (typeof (bank_name) == "undefined") {
-            var bank_name = '';
-        } else {
-            var bank_name = bank_name;
-        }
-        if (selected == 3) {
-
-            if (!bank_name || bank_name == '') {
-                wx.showToast({
-                    title: '开户行不能为空',
-                    image: "/images/icon-warning.png",
-                });
-                return;
-            }
-        }
-        wx.showLoading({
-            title: "正在提交",
-            mask: true,
-        });
-        app.request({
-            url: api.share.apply,
-            method: 'POST',
-            data: {
-                cash: cash,
-                name: name,
-                mobile: mobile,
-                bank: bank_name,
-                pay_type: selected,
-                scene: 'CASH',
-                form_id: e.detail.formId,
-            },
-            success: function (res) {
-                wx.hideLoading();
-                wx.showModal({
-                    title: "提示",
-                    content: res.msg,
-                    showCancel: false,
-                    success: function (e) {
-                        if (e.confirm) {
-                            if (res.code == 0) {
-                                wx.redirectTo({
-                                    url: '/pages/cash-detail/cash-detail',
-                                })
-                            }
-                        }
-                    }
-                });
-            }
-        });
-    },
-
-    showCashMaxDetail: function () {
-        wx.showModal({
-            title: "提示",
-            content: "今日剩余提现金额=平台每日可提现金额-今日所有用户提现金额"
-        });
-    },
-    select: function (e) {
-        var index = e.currentTarget.dataset.index;
-        this.setData({
-            selected: index
-        });
-    }
-
+// pages/cash/cash.js
+var api = require('../../api.js');
+var app = getApp();
+
+function min(var1, var2) {
+    var1 = parseFloat(var1);
+    var2 = parseFloat(var2);
+    return var1 > var2 ? var2 : var1;
+}
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        price: 0.00,
+        cash_max_day: -1,
+        selected: -1
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        app.pageOnLoad(this);
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+        var page = this;
+        var share_setting = wx.getStorageSync("share_setting");
+        page.setData({
+            share_setting: share_setting
+        });
+        app.request({
+            url: api.share.get_price,
+            success: function (res) {
+                if (res.code == 0) {
+                    console.log(res.data)
+                    var selected = 0;
+                    var name = '';
+                    var mobile = '';
+                    var cash_last = res.data.cash_last;
+                    var bank = '';
+                    var bank_name = '';
+                    if (res.data.pay_type == 1) {
+                        selected = 1;
+                    }
+                    if (res.data.bank == 1 && res.data.pay_type == 3) {
+                        selected = 3;
+                    }
+
+                    if (cash_last && (res.data.pay_type == 2 || res.data.pay_type == cash_last['type'])) {
+                        selected = cash_last['type'];
+                        name = cash_last['name'];
+                        mobile = cash_last['mobile'];
+                        bank = cash_last['mobile'];
+                        bank_name = cash_last['bank_name'];
+                    }
+                    var a = res.data;
+                    page.setData({
+                        price: res.data.price.price,
+                        cash_max_day: res.data.cash_max_day,
+                        pay_type: res.data.pay_type,
+                        selected: selected,
+                        name: name,
+                        mobile: mobile,
+                        bank: res.data.bank,
+                        bank_name: bank_name,
+                    });
+                }
+            }
+        });
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+
+    formSubmit: function (e) {
+        var page = this;
+        var cash = parseFloat(parseFloat(e.detail.value.cash).toFixed(2));
+        var cash_max = page.data.price;
+        if (page.data.cash_max_day != -1) {
+            cash_max = min(cash_max, page.data.cash_max_day)
+        }
+        if (cash > cash_max) {
+            wx.showToast({
+                title: "提现金额不能超过" + cash_max + "元",
+                image: "/images/icon-warning.png",
+            });
+            return;
+        }
+        if (cash < parseFloat(page.data.share_setting.min_money)) {
+            wx.showToast({
+                title: "提现金额不能低于" + page.data.share_setting.min_money + "元",
+                image: "/images/icon-warning.png",
+            });
+            return;
+        }
+        var name = e.detail.value.name;
+        var mobile = e.detail.value.mobile;
+        if (!name || name == undefined) {
+            wx.showToast({
+                title: '姓名不能为空',
+                image: "/images/icon-warning.png",
+            });
+            return;
+        }
+        if (!mobile || mobile == undefined) {
+            wx.showToast({
+                title: '账号不能为空',
+                image: "/images/icon-warning.png",
+            });
+            return;
+        }
+
+        var selected = page.data.selected;
+        if (selected != 0 && selected != 1 && selected != 3) {
+            wx.showToast({
+                title: '请选择提现方式',
+                image: "/images/icon-warning.png",
+            });
+            return;
+        }
+        var bank_name = e.detail.value.bank_name;
+        if (typeof (bank_name) == "undefined") {
+            var bank_name = '';
+        } else {
+            var bank_name = bank_name;
+        }
+        if (selected == 3) {
+
+            if (!bank_name || bank_name == '') {
+                wx.showToast({
+                    title: '开户行不能为空',
+                    image: "/images/icon-warning.png",
+                });
+                return;
+            }
+        }
+        wx.showLoading({
+            title: "正在提交",
+            mask: true,
+        });
+        app.request({
+            url: api.share.apply,
+            method: 'POST',
+            data: {
+                cash: cash,
+                name: name,
+                mobile: mobile,
+                bank: bank_name,
+                pay_type: selected,
+                scene: 'CASH',
+                form_id: e.detail.formId,
+            },
+            success: function (res) {
+                wx.hideLoading();
+                wx.showModal({
+                    title: "提示",
+                    content: res.msg,
+                    showCancel: false,
+                    success: function (e) {
+                        if (e.confirm) {
+                            if (res.code == 0) {
+                                wx.redirectTo({
+                                    url: '/pages/cash-detail/cash-detail',
+                                })
+                            }
+                        }
+                    }
+                });
+            }
+        });
+    },
+
+    showCashMaxDetail: function () {
+        wx.showModal({
+            title: "提示",
+            content: "今日剩余提现金额=平台每日可提现金额-今日所有用户提现金额"
+        });
+    },
+    select: function (e) {
+        var index = e.currentTarget.dataset.index;
+        this.setData({
+            selected: index
+        });
+    }
+
 });

+ 2 - 2
wechat/pages/cash/cash.json

xqd
@@ -1,3 +1,3 @@
-{
-  "navigationBarTitleText": "申请提现"
+{
+  "navigationBarTitleText": "申请提现"
   }

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini