Browse Source

闪店盒子init

zhengwentao 3 years ago
commit
a6eed11221
100 changed files with 3904 additions and 0 deletions
  1. 215 0
      fastshop/app.js
  2. 157 0
      fastshop/app.json
  3. 71 0
      fastshop/app.wxss
  4. 103 0
      fastshop/component/goodpay/index.js
  5. 6 0
      fastshop/component/goodpay/index.json
  6. 5 0
      fastshop/component/goodpay/index.wxml
  7. 6 0
      fastshop/component/goodpay/index.wxss
  8. 3 0
      fastshop/component/loading.wxml
  9. 4 0
      fastshop/component/null.wxml
  10. 28 0
      fastshop/component/skeleton/index.js
  11. 3 0
      fastshop/component/skeleton/index.json
  12. 22 0
      fastshop/component/skeleton/index.wxml
  13. 15 0
      fastshop/component/skeleton/index.wxss
  14. 7 0
      fastshop/config.js
  15. 21 0
      fastshop/ext.json
  16. 794 0
      fastshop/huo/huosdk-1.0.2.js
  17. BIN
      fastshop/img/bbs.png
  18. BIN
      fastshop/img/bill.png
  19. BIN
      fastshop/img/card-face.png
  20. BIN
      fastshop/img/cart-hover.png
  21. BIN
      fastshop/img/cart.png
  22. BIN
      fastshop/img/home-hover.png
  23. BIN
      fastshop/img/home.png
  24. BIN
      fastshop/img/icon_fail.png
  25. BIN
      fastshop/img/icon_success.png
  26. BIN
      fastshop/img/me-hover.png
  27. BIN
      fastshop/img/me.png
  28. BIN
      fastshop/img/null.png
  29. BIN
      fastshop/img/nullcart.png
  30. BIN
      fastshop/img/page.jpg
  31. BIN
      fastshop/img/qrcode.jpg
  32. BIN
      fastshop/img/sale-hover.png
  33. BIN
      fastshop/img/sale.png
  34. 228 0
      fastshop/pages/group/dopay.js
  35. 8 0
      fastshop/pages/group/dopay.json
  36. 40 0
      fastshop/pages/group/dopay.wxml
  37. 19 0
      fastshop/pages/group/dopay.wxss
  38. 42 0
      fastshop/pages/group/index.js
  39. 7 0
      fastshop/pages/group/index.json
  40. 16 0
      fastshop/pages/group/index.wxml
  41. 12 0
      fastshop/pages/group/index.wxss
  42. 46 0
      fastshop/pages/group/item.js
  43. 5 0
      fastshop/pages/group/item.json
  44. 35 0
      fastshop/pages/group/item.wxml
  45. 24 0
      fastshop/pages/group/item.wxss
  46. 25 0
      fastshop/pages/helper/bind.js
  47. 5 0
      fastshop/pages/helper/bind.json
  48. 21 0
      fastshop/pages/helper/bind.wxml
  49. 1 0
      fastshop/pages/helper/bind.wxss
  50. 54 0
      fastshop/pages/helper/bindphone.js
  51. 5 0
      fastshop/pages/helper/bindphone.json
  52. 8 0
      fastshop/pages/helper/bindphone.wxml
  53. 1 0
      fastshop/pages/helper/bindphone.wxss
  54. 36 0
      fastshop/pages/helper/error.js
  55. 5 0
      fastshop/pages/helper/error.json
  56. 19 0
      fastshop/pages/helper/error.wxml
  57. 1 0
      fastshop/pages/helper/error.wxss
  58. 80 0
      fastshop/pages/helper/login.js
  59. 6 0
      fastshop/pages/helper/login.json
  60. 30 0
      fastshop/pages/helper/login.wxml
  61. 14 0
      fastshop/pages/helper/login.wxss
  62. 189 0
      fastshop/pages/helper/safepasspord.js
  63. 5 0
      fastshop/pages/helper/safepasspord.json
  64. 30 0
      fastshop/pages/helper/safepasspord.wxml
  65. 7 0
      fastshop/pages/helper/safepasspord.wxss
  66. 63 0
      fastshop/pages/helper/setting.js
  67. 5 0
      fastshop/pages/helper/setting.json
  68. 14 0
      fastshop/pages/helper/setting.wxml
  69. 4 0
      fastshop/pages/helper/setting.wxss
  70. 24 0
      fastshop/pages/helper/startup.js
  71. 6 0
      fastshop/pages/helper/startup.json
  72. 1 0
      fastshop/pages/helper/startup.wxml
  73. 0 0
      fastshop/pages/helper/startup.wxss
  74. 64 0
      fastshop/pages/helper/webview.js
  75. 6 0
      fastshop/pages/helper/webview.json
  76. 1 0
      fastshop/pages/helper/webview.wxml
  77. 1 0
      fastshop/pages/helper/webview.wxss
  78. 54 0
      fastshop/pages/index/component/index.wxml
  79. 17 0
      fastshop/pages/index/component/item.wxml
  80. 165 0
      fastshop/pages/index/index.js
  81. 4 0
      fastshop/pages/index/index.json
  82. 18 0
      fastshop/pages/index/index.wxml
  83. 38 0
      fastshop/pages/index/index.wxss
  84. 259 0
      fastshop/pages/market/dopay.js
  85. 8 0
      fastshop/pages/market/dopay.json
  86. 37 0
      fastshop/pages/market/dopay.wxml
  87. 13 0
      fastshop/pages/market/dopay.wxss
  88. 141 0
      fastshop/pages/market/index.js
  89. 6 0
      fastshop/pages/market/index.json
  90. 54 0
      fastshop/pages/market/index.wxml
  91. 14 0
      fastshop/pages/market/index.wxss
  92. 95 0
      fastshop/pages/market/item.js
  93. 6 0
      fastshop/pages/market/item.json
  94. 40 0
      fastshop/pages/market/item.wxml
  95. 11 0
      fastshop/pages/market/item.wxss
  96. 95 0
      fastshop/pages/money/cash.js
  97. 5 0
      fastshop/pages/money/cash.json
  98. 19 0
      fastshop/pages/money/cash.wxml
  99. 6 0
      fastshop/pages/money/cash.wxss
  100. 126 0
      fastshop/pages/money/index.js

+ 215 - 0
fastshop/app.js

@@ -0,0 +1,215 @@
+var api = require('./utils/request');
+var util = require('./utils/util');
+var siteInfo = require('config.js');
+App({
+  globalData: {
+    loginuser: [],
+    wechat_config:[],
+    config:[],
+    official_uid: null,
+    ucode: null
+  },
+  /**
+   * 生命周期函数--监听小程序初始化
+   */
+  onLaunch: function (options) {
+    this.api_root = siteInfo.siteroot; //设置api地址
+    this.appname = siteInfo.name; //设置应用名称
+    this.updateMiniapp();  //小程序更新
+    this.setNavigation();  //工具栏
+    this.setConfig();   //设置小程序配置
+  },
+  /**
+   * 生命周期函数--监听小程序显示
+   */
+  onShow: function () {
+    let that = this;
+    //登录用户信息
+    var loginuser = wx.getStorageSync('loginuser');
+    if (!util.isNull(loginuser)) {
+      that.globalData.loginuser = loginuser;
+    }
+  },
+  //设置小程序配置
+  setConfig: function () {
+    let that = this;
+    //微信配置
+    return new Promise((resolve, reject) => {
+      that.getConfig(function (data) {
+        wx.setStorageSync('wechat_config', data);
+        that.globalData.wechat_config = data;
+        resolve(that.globalData.wechat_config);
+      });
+    })
+  },
+  //读取小程序配置
+  getConfig: function (callback) {
+    api.Get('openapi/v1/config', function (result) {
+      callback && callback(result.data);
+    })
+  },
+  //用全局变量保存邀请码
+  setUcode: function (options) {
+    let that = this;
+    if (options.scene) {
+      var scene = util.strToArray(decodeURIComponent(options.scene));
+      if (!util.isNull(scene.ucode)) {
+        that.globalData.ucode = scene.ucode;
+      }
+    } else {
+      if (!util.isNull(options.ucode)) {
+        that.globalData.ucode = options.ucode;
+      }
+    }
+  },
+  //当前用户id
+  getUserId: function () {
+    return this.globalData.loginuser.uid;
+  },
+  //判断是否登录
+  isLogin: function (callback) {
+    let session_id = wx.getStorageSync('session_id'),
+      loginuser = wx.getStorageSync('loginuser'),
+      token = wx.getStorageSync('token')
+    wx.checkSession({
+      success(rel) {
+        if (util.isNull(session_id) || util.isNull(token) || util.isNull(loginuser)) {
+          wx.navigateTo({
+            url: '/pages/helper/login'
+          })
+        } else {
+          callback && callback(true);
+        }
+      },
+      fail(rel) {
+        wx.navigateTo({
+          url: '/pages/helper/login'
+        })
+      }
+    })
+  },
+  /**
+    * 微信小程序登录
+    */
+  doLogin: function (options, callback) {
+    let that = this;
+    wx.login({
+      success: function (res) {
+        api.Post('openapi/v1/login', {
+          code: res.code,
+          user_info: options.detail.rawData,
+          encrypted_data: options.detail.encryptedData,
+          iv: options.detail.iv,
+          signature: options.detail.signature,
+          official_uid: wx.getStorageSync('official_uid'),
+          invite_code: that.globalData.ucode
+        }, function (result) {
+          wx.setStorageSync('token', result.data.token);
+          wx.setStorageSync('session_id', result.data.session_id);
+          wx.setStorageSync('loginuser', result.data);
+          that.globalData.loginuser = result.data;
+          callback && callback(true);
+        })
+      },
+      fail: function () {
+        callback && callback(false);
+      }
+    });
+  },
+  /**
+  * 调用微信支付
+  */
+  doWechatPay: function (data, successCallback, failCallback) {
+    var dataMap = {
+      timeStamp: data.timestamp,
+      nonceStr: data.nonceStr,
+      package: data.package,
+      signType: data.signType,
+      paySign: data.paySign,
+      success: successCallback,
+      fail: failCallback
+    }
+    wx.requestPayment(dataMap);
+  },
+  /**
+   * 更新小程序
+   */
+  updateMiniapp: function () {
+    if (wx.canIUse('getUpdateManager')) {
+      const updateManager = wx.getUpdateManager()
+      //判断是否有新的小程序
+      updateManager.onCheckForUpdate(function (res) {
+        if (res.hasUpdate) {
+          updateManager.onUpdateReady(function () {
+            wx.clearStorage()   //清理缓存
+            wx.showModal({
+              showCancel: false,
+              title: '更新提示',
+              content: '新版本已经升级完成,请重启应用!',
+              success: function (res) {
+                updateManager.applyUpdate()
+              }
+            })
+          })
+          //新的版本下载失败
+          updateManager.onUpdateFailed(function () {
+            wx.showModal({
+              showCancel: false,
+              title: '已经有新版本了哟~',
+              content: '新版本自动升级失败了~请您删除当前小程序,重新搜索打开哟~',
+              success: function (res) {
+                updateManager.applyUpdate()
+              }
+            })
+          })
+        }
+      })
+    } else {
+      wx.showModal({
+        title: '提示',
+        content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
+      })
+    }
+  },
+  /**
+* Navgation导航的高度
+*/
+  setNavigation() {
+    let that = this
+    wx.getSystemInfo({
+      success: function (e) {
+        that.globalData.startBarHeight = e.statusBarHeight;
+        if (e.platform == 'android') {
+          that.globalData.navgationHeight = 50;
+        } else {
+          that.globalData.navgationHeight = 45;
+        };
+      }
+    })
+  },
+  /**
+   * 调用购物车图标
+   */
+  setTabBarCartNumber: function () {
+    var cartItemNumber = wx.getStorageSync('shopping_num')
+    if (cartItemNumber > 0 && !this.util().isNull(cartItemNumber)) {
+      wx.setTabBarBadge({
+        index: 2,
+        text: cartItemNumber.toString()
+      })
+    } else {
+      wx.removeTabBarBadge({
+        index: 2,
+      })
+    }
+  },
+  /**
+   * 调用API
+   */
+  api: function () {
+    return api;
+  },
+  util: function () {
+    return util;
+  }
+});

+ 157 - 0
fastshop/app.json

@@ -0,0 +1,157 @@
+{
+  "pages": [
+    "pages/index/index",
+    "pages/shop/item",
+    "pages/shop/list",
+    "pages/shop/cart",
+    "pages/shop/cate",
+    "pages/shop/search",
+    "pages/shop/top",
+    "pages/market/index",
+    "pages/market/item",
+    "pages/market/dopay",
+    "pages/user/index",
+    "pages/user/gift",
+    "pages/user/giftview",
+    "pages/user/customer",
+    "pages/user/vip",
+    "pages/user/qrcode",
+    "pages/store/index",
+    "pages/order/index",
+    "pages/order/review",
+    "pages/pay/index"
+  ],
+  "subpackages": [
+    {
+      "root": "pages/helper/",
+      "pages": [
+        "setting",
+        "error",
+        "login",
+        "startup",
+        "webview",
+        "bindphone",
+        "safepasspord",
+        "bind"
+      ]
+    },
+    {
+      "root": "pages/group/",
+      "pages": [
+        "index",
+        "item",
+        "dopay"
+      ]
+    },
+    {
+      "root": "pages/money/",
+      "pages": [
+        "transfer",
+        "recharge",
+        "cash",
+        "index"
+      ]
+    }
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#000000",
+    "navigationBarTitleText": "仙乐欢娱",
+    "navigationBarTextStyle": "white"
+  },
+  "debug": false,
+  "tabBar": {
+    "color": "#6e6d6b",
+    "selectedColor": "#FF6347",
+    "borderStyle": "black",
+    "backgroundColor": "#fff",
+    "list": [
+      {
+        "pagePath": "pages/index/index",
+        "iconPath": "img/home.png",
+        "selectedIconPath": "img/home-hover.png",
+        "text": "首页"
+      },
+      {
+        "pagePath": "pages/market/index",
+        "iconPath": "img/sale.png",
+        "selectedIconPath": "img/sale-hover.png",
+        "text": "抢购"
+      },
+      {
+        "pagePath": "pages/shop/cart",
+        "iconPath": "img/cart.png",
+        "selectedIconPath": "img/cart-hover.png",
+        "text": "购物车"
+      },
+      {
+        "pagePath": "pages/user/index",
+        "iconPath": "img/me.png",
+        "selectedIconPath": "img/me-hover.png",
+        "text": "我的"
+      }
+    ],
+    "position": "bottom"
+  },
+  "usingComponents": {
+    "skeleton": "/component/skeleton/index",
+    "van-action-sheet": "./vant/action-sheet/index",
+    "van-count-down": "./vant/count-down/index",
+    "van-area": "./vant/area/index",
+    "van-button": "./vant/button/index",
+    "van-card": "./vant/card/index",
+    "van-cell": "./vant/cell/index",
+    "van-cell-group": "./vant/cell-group/index",
+    "van-checkbox": "./vant/checkbox/index",
+    "van-checkbox-group": "./vant/checkbox-group/index",
+    "van-col": "./vant/col/index",
+    "van-dialog": "./vant/dialog/index",
+    "van-divider": "./vant/divider/index",
+    "van-field": "./vant/field/index",
+    "van-goods-action": "./vant/goods-action/index",
+    "van-goods-action-icon": "./vant/goods-action-icon/index",
+    "van-goods-action-button": "./vant/goods-action-button/index",
+    "van-icon": "./vant/icon/index",
+    "van-loading": "./vant/loading/index",
+    "van-nav-bar": "./vant/nav-bar/index",
+    "van-notice-bar": "./vant/notice-bar/index",
+    "van-notify": "./vant/notify/index",
+    "van-panel": "./vant/panel/index",
+    "van-popup": "./vant/popup/index",
+    "van-progress": "./vant/progress/index",
+    "van-radio": "./vant/radio/index",
+    "van-radio-group": "./vant/radio-group/index",
+    "van-row": "./vant/row/index",
+    "van-search": "./vant/search/index",
+    "van-sidebar": "./vant/sidebar/index",
+    "van-sidebar-item": "./vant/sidebar-item/index",
+    "van-slider": "./vant/slider/index",
+    "van-stepper": "./vant/stepper/index",
+    "van-steps": "./vant/steps/index",
+    "van-sticky": "./vant/sticky/index",
+    "van-submit-bar": "./vant/submit-bar/index",
+    "van-swipe-cell": "./vant/swipe-cell/index",
+    "van-switch": "./vant/switch/index",
+    "van-tab": "./vant/tab/index",
+    "van-tabs": "./vant/tabs/index",
+    "van-tabbar": "./vant/tabbar/index",
+    "van-tabbar-item": "./vant/tabbar-item/index",
+    "van-tag": "./vant/tag/index",
+    "van-toast": "./vant/toast/index",
+    "van-transition": "./vant/transition/index",
+    "van-tree-select": "./vant/tree-select/index",
+    "van-datetime-picker": "./vant/datetime-picker/index",
+    "van-rate": "./vant/rate/index",
+    "van-collapse": "./vant/collapse/index",
+    "van-collapse-item": "./vant/collapse-item/index",
+    "van-picker": "./vant/picker/index",
+    "van-overlay": "./vant/overlay/index",
+    "van-circle": "./vant/circle/index",
+    "van-grid": "./vant/grid/index",
+    "van-image": "./vant/image/index",
+    "van-dropdown-item": "./vant/dropdown-item/index",
+    "van-dropdown-menu": "./vant/dropdown-menu/index",
+    "van-grid-item": "./vant/grid-item/index"
+  },
+  "sitemapLocation": "sitemap.json"
+}

+ 71 - 0
fastshop/app.wxss

@@ -0,0 +1,71 @@
+/**
+ * 第三方库样式
+ */
+@import 'style/weui.wxss';
+@import "vant/common/index.wxss";
+/**
+ * 全局样式表
+ */
+::-webkit-scrollbar{width: 0;height: 0;color: transparent;}
+page{font-size: 28rpx;color: #333;background-color: #f2f3f5;-webkit-font-smoothing: antialiased;font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;}
+page,.page{height: 100%}
+.weui-panel:before{border-top:0rpx}
+.weui-panel:after{border-bottom:0rpx}
+.weui-footer{padding: 10px 0px}
+button{border-radius: 2px;}
+button[type=primary]{color: #FFF;background-color: #07C160;border-color: #07C160;}
+.button-hover[type=primary] {color: #FFF;background-color: #06AD56;}
+/*辅助项*/
+.left{float: left}.right{float: right}
+.tac{text-align: center}.tar{text-align: right}
+.loading{margin:auto}
+.title{margin: 0;font-weight: 400;font-size: 14px;color: rgba(69,90,100,.6);padding:20px 15px 15px;}
+.red{color: #E91E63}
+.f12{font-size: 12px}.f16{font-size: 16px}.f18{font-size: 18px}
+.gray{color: #F3F3F3}
+.mt5{margin-top: 5px!important}
+.hide{display: none}
+/*底部*/
+.weui-loadmore__tips_in-line{background:#f2f3f5}
+.weui-loadmore__tips_in-line image{width:40rpx;margin:0px 5px}
+.weui-loadmore_line {margin-top:2em;}
+.weui-loadmore{margin-bottom: 0px;}
+/*友情提示*/
+.error{margin: 130rpx 100rpx;}
+.error .img{width: 220rpx;margin: auto;text-align: center}
+.error .img image {width: 80%;}
+.error .msg{display: block;text-align: center;font-size:25rpx;color: #999;margin-top: 10rpx;}
+/*导航推荐*/
+.icon_row{overflow: hidden;font-size: 28rpx;text-align: center;flex-wrap: wrap;
+flex-direction: row;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
+.icon_row .icon_col{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;float: left;width:20%;min-width:20%; max-width:20%;box-sizing:border-box;padding:10px 0px}
+.icon_row image{width: 100%;min-width: 80rpx;min-height:80rpx;max-height: 100rpx;max-width: 100rpx}
+.icon_row .icon_title {color: #7d7e80;display: block;text-align: center;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;}
+/* 虚拟系统栏 */
+#navigation{z-index:666;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;color:#ffffff;position:fixed;top: 0px;right: 0px;left: 0px;}
+#navigation .appname{font-size:36rpx;font-weight:500;padding-left: 20px}
+/**弹幕*/
+.barrage-fly{z-index:200;height:20px;position: absolute;top: 0;display:flex;background: #464c5b;border-radius: 10px;line-height: 20px;font-size: 12px;opacity:0.80;max-width:300px;min-width: 50px;white-space:nowrap;color:#FFF}
+.barrage-fly .face{width: 20px;height: 20px;border-radius: 10px}
+.barrage-fly .face image{width: 20px;height: 20px;border-radius: 10px}
+.barrage-fly .text{padding:0px 5px;}
+@keyframes first{from{left: 100%;}to{left: -100%;}}
+/* 抢购推荐 */
+.cardbg {margin:5px 5px 0;background: #fff;border-top-left-radius: 6px;border-top-right-radius: 6px;padding:2px;}
+.card{position: relative;display: inline-block;box-sizing: border-box;border-radius: 10px;background-color: #FFFFFF;white-space: normal;width: 100%;padding:0 10px 10px 10px;}
+.card .item-title{height:30px;padding:10px 5px 5px 5px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;line-height:30px;}
+.card .item-title .item-name{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-overflow: ellipsis;overflow: hidden;font-weight:600}
+.card .item-title .item-price{color:#f23030;text-align: right;padding-left:10px}
+.card .item-title .item-price .number{font-size:40rpx;}
+.card .item-img{margin-top:5px;display: -webkit-box;display: -webkit-flex;display: flex;}
+.card .item-img .item-grid{-webkit-box-flex: 1;-webkit-flex: 1;flex: 1;width: 33.33333333%;box-sizing: border-box;padding-left:10px;}
+.card .item-img .item-grid:first-child{padding-left:0px;}
+.card .item-img .item-grid image{width: 100%;vertical-align:middle;border-radius:9.936px;}
+.card .item-img .item-grid .grid-name{text-overflow: ellipsis;overflow: hidden;font-size: 26rpx;line-height: 35rpx;max-height:70rpx;margin-top: 5px}
+.card .item-img .item-grid .price{font-size:12px;color:#999;margin-top: 5px}
+.card .item-img .item-grid .number{font-size:28rpx;text-decoration:line-through;}
+.card .item-info {height:30px;line-height:30px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
+.card .item-info .item_state{-webkit-box-flex: 1;-webkit-flex: 1;flex: 1;}
+.card .item-info .van-tag{border-radius: 10px!important;margin: 0px 3px!important}
+.card .item-info .more{float: right;}
+.card .progress{width:200rpx;margin-top:15px}

+ 103 - 0
fastshop/component/goodpay/index.js

@@ -0,0 +1,103 @@
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    params: {
+      type: Object,
+      value: null
+    },
+    envVersion: {
+      type: String,
+      value: "release"
+    }
+  },
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    appid:'wx13e5a2a68ae503c0',
+    showPayModal:false,
+    chickOnPay: false   //标记是否支付中状态
+  },
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    //设置支付点击了打开云小程序
+    setPaying(paystatus) {
+      this.setData({
+        chickOnPay: paystatus
+      })
+      this.triggerEvent('Change',{chickOnPay:paystatus})
+    },
+    //[跳转到【收银台】小程序失败-用户点击了支付组件外的地方(灰色地方)
+    onTapCancel () {
+      this.triggerEvent('Fail',{navigateSuccess:false})
+      this.triggerEvent('Complete')
+    },
+    //跳转到【收银台】小程序成功
+    navigateSuccess () {
+      this.setPaying(true)
+    },
+    /**
+     * 跳转失败
+     * 如果下单成功但是用户取消支付则可在
+     * 调用组件用 res.detail.event 查看原因
+     */
+    navigateFail (event) {
+      this.triggerEvent('Fail',{navigateSuccess: false,event:event})
+      this.triggerEvent('Complete')
+    }
+  },
+  /** 
+   * 组件生命周期
+   */
+  lifetimes: {
+    attached() {
+      this.setPaying(false)
+      if (!this.data.params) {
+        console.error('跳转到【收银台】小程序失败 - 没有传递跳转参数')
+        this.triggerEvent('Fail',{error: true,navigateSuccess: false})
+        this.triggerEvent('Complete')
+      }
+      //监听app.onShow事件
+      wx.onAppShow(appOptions => {
+        if (!this.data.chickOnPay){
+          return;
+        }
+        this.setPaying(false)
+        if (appOptions.scene === 1038 && appOptions.referrerInfo.appId === 'wx13e5a2a68ae503c0') {
+          console.log('确认来源于【收银台】回调返回')
+          let extraData = appOptions.referrerInfo.extraData
+          if (extraData.return_code =='SUCCESS') {
+            this.triggerEvent('Success',extraData)
+            this.triggerEvent('Complete')
+          } else {
+            this.triggerEvent('Fail',{navigateSuccess:true,event:extraData})
+            this.triggerEvent('Complete')
+          }
+        }
+      })
+      var params = this.data.params;
+      //尝试打开
+      wx.navigateToMiniProgram({
+        appId: this.data.appid,
+        path: 'pages/dopay/index',
+        extraData: params,
+        envVersion: this.data.envVersion,
+        success:yes => {
+          console.log('跳转到【收银台】小程序成功')
+          this.setPaying(true)
+        },
+        fail:no => {
+          console.log('跳转到【收银台】小程序失败-弹窗提醒')
+          this.setData({
+            showPayModal: true,
+            appid: this.data.appid
+          })
+        },
+      })
+    }
+  }
+})

+ 6 - 0
fastshop/component/goodpay/index.json

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

+ 5 - 0
fastshop/component/goodpay/index.wxml

@@ -0,0 +1,5 @@
+<view class="fulllayer" catchtap="onTapCancel"></view>
+<view wx:if="{{showPayModal}}" class="modal">
+  <view class="content">需要跳转到【云收银台】进行付款</view>
+  <navigator class="button" target="miniProgram" app-id="{{appid}}" path="pages/dopay/index" extra-data="{{ params }}" version="{{ envVersion }}" bindsuccess="navigateSuccess" bindfail="navigateFail">立即去付款</navigator>
+</view>

+ 6 - 0
fastshop/component/goodpay/index.wxss

@@ -0,0 +1,6 @@
+.fulllayer{position: fixed;top: 0;left: 0;width: 100vw;height: 100vh;background-color: #000;opacity: 0.4;z-index:100000}
+.button {background: none;}
+.button::after {border: none;}
+.modal {position: fixed;left: 10vw;top: 30vh;width: 80vw;height:20vh;background-color: #fff;border-radius:10rpx;text-align: center;line-height: 10vh;z-index:100001}
+.modal .content {height: 13vh;color: #000;font-size:28rpx;line-height:12vh;}
+.modal .button {height:7vh;color: #333;font-size:30rpx;font-weight:600;line-height:7vh;border-top:1px #f3f3f3 solid;}

+ 3 - 0
fastshop/component/loading.wxml

@@ -0,0 +1,3 @@
+<van-divider content-position="center">
+  <block wx:if="{{loading}}"><van-loading /></block><block wx:else>到底了</block>
+</van-divider>

+ 4 - 0
fastshop/component/null.wxml

@@ -0,0 +1,4 @@
+<view class="error">
+  <view class='img'><image mode="widthFix" src="/img/null.png" /></view>
+  <text class="msg">暂无内容</text>
+</view>

+ 28 - 0
fastshop/component/skeleton/index.js

@@ -0,0 +1,28 @@
+Component({
+  data: {
+    visible: true,
+  },
+  attached: function () {
+    const systemInfo = wx.getSystemInfoSync();
+    this.setData({
+      systemInfo: {
+        width: systemInfo.windowWidth,
+        height: systemInfo.windowHeight
+      },
+    })
+  },
+  ready: function () {
+    const that = this;
+    setTimeout(() => {
+      that.setData({
+        visible: false
+      })
+    }, 1000)
+  },
+  methods: {
+    //锁屏
+    touchmove: function () {
+
+    }
+  },
+})

+ 3 - 0
fastshop/component/skeleton/index.json

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

+ 22 - 0
fastshop/component/skeleton/index.wxml

@@ -0,0 +1,22 @@
+<view class="skeleton" catchtouchmove="touchmove" style="width: {{systemInfo.width}}px; height: {{systemInfo.height}}px;" wx:if="{{visible}}">
+  <view class="skeleton-head"></view>
+  <view class="skeleton-body">
+    <view class="skeleton-100"></view>
+    <view class="skeleton-80 skeleton-mt"></view>
+  </view>
+  <view class="skeleton-head"></view>
+  <view class="skeleton-body">
+    <view class="skeleton-80"></view>
+    <view class="skeleton-100 skeleton-mt"></view>
+  </view>
+  <view class="skeleton-head"></view>
+  <view class="skeleton-body">
+    <view class="skeleton-100"></view>
+    <view class="skeleton-80 skeleton-mt"></view>
+  </view>
+  <view class='skeleton-text'>
+    <view class='line lineA'></view>
+    <view class='line lineB'></view>
+    <view class='line lineC'></view>
+  </view>
+</view>

+ 15 - 0
fastshop/component/skeleton/index.wxss

@@ -0,0 +1,15 @@
+/*加载骨架*/
+.skeleton{position:fixed;z-index: 9999;height: 100%;width: 100%;bottom:0px;top:0px;background:#fff;box-sizing: border-box;padding:10px}
+.skeleton .skeleton-head,.skeleton .skeleton-100,.skeleton .skeleton-80,.skeleton .skeleton-60{background:#F3F3F3;float:left;}
+.skeleton-head {width:20%;height:80px;margin-bottom:10px;}
+.skeleton-body {margin-left:22%;height: 80px;margin-bottom:10px;}
+.skeleton-100 {width:100%;height: 40px;}
+.skeleton-80 {width:80%;height: 30px;}
+.skeleton-60 {width:60%;height: 30px;}
+.skeleton-mt{margin-top:10px;}
+.skeleton-text{color: #FF0000;text-align: center;line-height:30px;font-size:28rpx;}
+.line{display: inline-block;width:5px;height:5px;border-radius: 15px;margin:0px 5px;background:#ccc}
+@keyframes loading{50%{width: 30px}100%{width:5px}}
+.lineA{animation: loading 1.5s 0s infinite}
+.lineB{animation: loading 1.5s 0.3s infinite}
+.lineC{animation: loading 1.5s 0.6s infinite}

+ 7 - 0
fastshop/config.js

@@ -0,0 +1,7 @@
+//当前配置文件不需要修改(参数在ext.json中)
+// let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
+module.exports = {
+  name: '仙乐欢娱 ',
+  siteroot: 'https://shop.yueyouhudong.com',
+  miniapp: 'e99caacd6c455906bd9fb79e62f25963',
+};

+ 21 - 0
fastshop/ext.json

@@ -0,0 +1,21 @@
+{
+  "extEnable": false,
+  "directCommit": false,
+  "extAppid": "appid",
+  "ext": {
+    "name": "",
+    "attr": {
+      "host": "",
+      "miniapp": ""
+    }
+  },
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#ffffff",
+    "navigationBarTextStyle": "black"
+  },
+  "networkTimeout": {
+    "request": 10000,
+    "downloadFile": 10000
+  }
+}

File diff suppressed because it is too large
+ 794 - 0
fastshop/huo/huosdk-1.0.2.js


BIN
fastshop/img/bbs.png


BIN
fastshop/img/bill.png


BIN
fastshop/img/card-face.png


BIN
fastshop/img/cart-hover.png


BIN
fastshop/img/cart.png


BIN
fastshop/img/home-hover.png


BIN
fastshop/img/home.png


BIN
fastshop/img/icon_fail.png


BIN
fastshop/img/icon_success.png


BIN
fastshop/img/me-hover.png


BIN
fastshop/img/me.png


BIN
fastshop/img/null.png


BIN
fastshop/img/nullcart.png


BIN
fastshop/img/page.jpg


BIN
fastshop/img/qrcode.jpg


BIN
fastshop/img/sale-hover.png


BIN
fastshop/img/sale.png


+ 228 - 0
fastshop/pages/group/dopay.js

@@ -0,0 +1,228 @@
+const app = getApp();
+Page({
+  data: {
+    loading: false,
+    item: [],
+    amount: [],
+    address: [],
+    address_isnull: 0,
+    actions: [],
+    orderParams: {},    // 支付参数
+    chickPayBtn: false, //点击了支付按钮(订单信息交由古德云组件)
+    chickOnPay: false, // 用户是否已经点击了「支付」并成功跳转到 古德云收银台 小程序
+  },
+  /*
+   生命周期函数--监听页面初次载入
+  */
+  onLoad: function () {
+    this.getAddress();
+    this.getCart();
+  },
+  /**
+   * 获取购物车中的订单
+   */
+  getCart: function () {
+    let that = this;
+    var cart = wx.getStorageSync('group');
+    app.api().Post('api/v3/fastshop/group/cartItem', {
+      cart: cart
+    }, function (result) {
+      if (result.code == 200) {
+        that.setData({
+          item: result.data.item,
+          amount: result.data.amount
+        })
+      } else {
+        wx.removeStorageSync('store')
+        wx.navigateBack()
+      }
+    })
+  },
+  /**
+    * 唤起微信支付
+    */
+  wchatPayment: function (buytype) {
+    let that = this;
+    var ids = app.util().clearArray(wx.getStorageSync('group'));
+    var param = {
+      ids: ids,
+      address: that.data.address.id,
+      buytype: buytype,
+      ucode: app.globalData.loginuser.ucode
+    }
+    app.api().Post("api/v3/fastshop/group/doPay", param, function (rel) {
+      if (200 == rel.code) {
+        wx.removeStorageSync('group')
+        if (rel.data.type == 1) {
+          that.setData({
+            chickPayBtn: true,
+            orderParams: rel.data.order
+          })
+        } else {
+          app.doWechatPay(rel.data.order, function (res) {
+            wx.navigateTo({
+              url: '../order/index'
+            })
+          }, function (res) {
+            wx.showModal({
+              content: '支付失败或取消', showCancel: false, complete: function () {
+                wx.navigateTo({
+                  url: '../order/index'
+                });
+              }
+            })
+          })
+        }
+      }
+    })
+  },
+  /**
+   * 读取微信地址
+   */
+  getAddress: function () {
+    let that = this;
+    app.api().Get("openapi/v1/user/getaddress", { 'signkey': 'dopay' }, function (rel) {
+      if (rel.code == 200) {
+        that.setData({
+          address: rel.data,
+          address_isnull: Object.keys(rel.data).length,
+        })
+      }
+    })
+  },
+  /**
+   * 读取微信地址
+   */
+  address: function () {
+    let that = this;
+    wx.getSetting({
+      success(res) {
+        if (res.authSetting['scope.address'] == false) {
+          wx.openSetting({
+            success: (res) => {
+              res.authSetting = {
+                "scope.address": true,
+              }
+            }
+          })
+        } else {
+          wx.chooseAddress({
+            success: function (res) {
+              var name = res.userName;
+              var telNumber = res.telNumber;
+              var city = res.provinceName + res.cityName + res.countyName;
+              var address = res.detailInfo;
+              app.api().Post("openapi/v1/user/createaddress", {
+                name: name,
+                telphone: telNumber,
+                city: city,
+                address: address
+              }, function (rel) {
+                that.setData({
+                  address: rel.data,
+                  address_isnull: Object.keys(rel.data).length,
+                })
+              });
+            }
+          })
+        }
+      }
+    })
+  },
+  /**
+   * 支付方式
+   */
+  payTypes: function () {
+    let that = this;
+    var actions = that.data.actions;
+    var address_isnull = that.data.address_isnull
+    if (address_isnull == 0) {
+      wx.showModal({
+        content: '必须选择收货地址',
+      })
+    } else {
+      this.setData({
+        show: true
+      });
+    }
+    if (that.data.show) {
+      app.api().Get('api/v3/fastshop/index/shopBuyTypes', { 'signkey': 'shopBuyTypes' }, function (result) {
+        that.setData({
+          actions: result.data
+        });
+      })
+    }
+  },
+  /**
+   * 是否弹出支付菜单
+  */
+  onClose() {
+    this.setData({
+      show: false
+    });
+  },
+  onSelect(event) {
+    let that = this;
+    var address_isnull = that.data.address_isnull
+    var addressId = that.data.address.id;
+    var payTypes = event.detail.types;
+    wx.showLoading({ title: '支付中' })
+    switch (payTypes) {
+      case 1:
+        that.wchatPayment("wepay");
+        break;
+      case 2:
+        that.wchatPayment("point");
+        break;
+      default:
+        that.onClose();
+    }
+  },
+  /**
+   * 支付成功的事件处理函数
+   * res.detail 为 payjs 小程序返回的订单信息
+   * 可通过 res.detail.payjsOrderId 拿到 payjs 订单号
+   * 可通过 res.detail.responseData 拿到详细支付信息
+   */
+  goodPaySuccess: function (res) {
+    if (res.detail.return_code = "SUCCESS") {
+      wx.navigateTo({
+        url: '/pages/order/index'
+      })
+    }
+  },
+  /**
+  * 支付失败的事件处理函数
+  * res.detail.error 为 true 代表传入小组件的参数存在问题
+  * res.detail.navigateSuccess 代表了是否成功跳转到 PAYJS 小程序
+  * res.detail.event 可能存有失败的原因
+  * 如果下单成功但是用户取消支付则 res.detail.event.return_code == FAIL
+  */
+  goodPayFail: function (res) {
+    this.setData({
+      chickPayBtn: false,
+      cart_number: 0
+    })
+  },
+  /**
+   * 支付完毕的事件处理函数
+   * 无论支付成功或失败均会执行
+   */
+  goodPayComplete: function () {
+    this.setData({
+      chickPayBtn: false,
+      cart_number: 0
+    })
+  },
+  /**
+   * 组件内部数据被修改时的事件
+   * 当用户跳转到 云收银台 小程序并等待返回的过程中 chickOnPay 值为 true
+   */
+  goodPayChange(res) {
+    if (res.detail.chickOnPay) {
+      this.setData({
+        chickOnPay: res.detail.chickOnPay
+      })
+    }
+  }
+})

+ 8 - 0
fastshop/pages/group/dopay.json

@@ -0,0 +1,8 @@
+{
+  "navigationBarTitleText": "拼团支付",
+  "navigationBarBackgroundColor": "#FFF",
+  "navigationBarTextStyle": "black",
+  "usingComponents": {
+    "goodpay": "/component/goodpay/index"
+  }
+}

+ 40 - 0
fastshop/pages/group/dopay.wxml

@@ -0,0 +1,40 @@
+<skeleton />
+<!-- 收获地址 -->
+<block wx:if="{{address_isnull >= 1}}">
+  <view bindtap="address" class="address">
+    <view class="address_icon"><van-icon name="contact" size="30px" color="#FF6C6C" /></view>
+    <view class="address_value">
+      <view>姓名:{{address.name}} / 电话:{{address.telphone}}</view>
+      <view>地址:{{address.address}}</view>
+    </view>
+    <view class="address_ight"><van-icon name="arrow" size="16px" color="#969799" /></view>
+</view>
+</block>
+<block wx:else>
+  <view bindtap="address" class="address">
+      <view class="address_icon"><van-icon name="add-square" size="30px" color="#1989FA" /></view>
+      <view class="address_value">选择收货地址</view>
+      <view class="address_ight"><van-icon name="arrow" size="16px" color="#969799" /></view>
+  </view>
+</block>
+<view class='block__title'>已选宝贝</view>
+<view class="card">
+  <view class="img"><image src="{{ item.img }}" /></view>
+  <view class="info">
+    <view class="name">{{ item.name }}</view>
+    <view class="price">¥<text class="amount">{{ item.sale_price }}</text></view>
+  </view>
+</view>
+<view class='block__title'>订单信息</view>
+<van-cell icon="free-postage" title="配送方式" value="{{amount.real_freight == 0 ?' 免运费 / ':''}}普通快递" />
+<van-cell icon="gold-coin" title="商品金额" value="¥{{amount.real_amount}}" />
+<van-cell icon="logistics" title="运费" value="¥{{amount.real_freight}}" />
+<view class="weui-loadmore weui-loadmore_line">
+    <view class="weui-loadmore__tips weui-loadmore__tips_in-line">到底了</view>
+  </view>
+  <van-submit-bar price="{{amount.order_amount*100}}" button-text="立即拼团" bindtap="payTypes" button-type="primary">
+    <view class='margin-left'>含运费</view>
+  </van-submit-bar>
+  <van-action-sheet title="请选择支付方式 " show="{{ show }}" actions="{{ actions }}" bind:close="onClose" bind:select="onSelect" cancel-text="取消" bind:cancel="onClose" data-address-id="{{address.id}}" />
+<!-- 古德云支付组件 -->
+<goodpay wx:if="{{ chickPayBtn }}" params="{{ orderParams }}" bindSuccess="goodPaySuccess" bindFail="goodPayFail" bindComplete="goodPayComplete" bind:Change="goodPayChange"/>

+ 19 - 0
fastshop/pages/group/dopay.wxss

@@ -0,0 +1,19 @@
+.margin-left{padding-left:10px}
+.block__title {margin: 0;font-weight: 400;font-size: 14px;color: rgba(69,90,100,.6);padding:10px;}
+button.address::after{border:none;background: none;}
+.left{float: left}
+/* 收货地址 */
+.address {padding: 16px;align-items: center;position: relative;display: flex;box-sizing: border-box;width: 100%;overflow: hidden;color: #323233;font-size: 14px;background-color: #fff;}
+.address::before{position: absolute;right: 0;bottom: 0;left: 0;height: 2px;background: -webkit-repeating-linear-gradient(135deg, #ff6c6c 0, #ff6c6c 20%, transparent 0, transparent 25%, #1989fa 0, #1989fa 45%, transparent 0, transparent 50%);
+background: repeating-linear-gradient(-45deg, #ff6c6c 0, #ff6c6c 20%, transparent 0, transparent 25%, #1989fa 0, #1989fa 45%, transparent 0, transparent 50%);background-size: 80px;content: '';}
+.address .address_icon{width: 30px;height:30px;}
+.address .address_value{line-height:20px;margin-left: 5px;vertical-align: middle;-webkit-box-flex: 1;-webkit-flex: 1;flex: 1;}
+.address .address_ight-icon{width: 30px;height:30px;}
+/* 产品预览 */
+.card{background: #fff;clear: both;margin:3px 5px;padding:5px;display: flex}
+.card .img{margin-right: 10px;}
+.card .img image{width:100px;height: 100px;vertical-align: middle}
+.card .info{flex: 1;}
+.card .info .name{font-size:28rpx;color: #323233;line-height:35rpx;}
+.card .info .price{line-height:30px;font-size:28rpx;}
+.card .info .amount{color:#f23030;font-size:38rpx;}

+ 42 - 0
fastshop/pages/group/index.js

@@ -0,0 +1,42 @@
+const app = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    loading: true,
+    page: 0,
+    item: [],
+  },
+  //生命周期函数--监听页面加载
+  onLoad: function () {
+    this.getApi();
+  },
+  //上拉加载
+  onReachBottom: function () {
+    var that = this;
+    that.setData({
+      loading: true,
+    });
+    that.getApi();
+  },  
+  //读取团购数据
+  getApi: function () {
+    let that = this;
+    if (that.data.loading) {
+      var page = that.data.page + 1;
+      app.api().Get('api/v3/fastshop/group/index', {page: page}, function (result) {
+        var item = that.data.item;
+        for (let i in result.data) {
+          item.push(result.data[i]);
+        }
+        that.setData({
+          item: item,
+          page: page,
+          loading: false,
+        });
+      })
+    }
+  },
+})

+ 7 - 0
fastshop/pages/group/index.json

@@ -0,0 +1,7 @@
+{
+  "navigationBarTitleText": "一起拼团",
+  "enablePullDownRefresh": false,
+  "backgroundTextStyle": "dark",
+  "navigationBarBackgroundColor": "#FFF",
+  "navigationBarTextStyle": "black"
+}

+ 16 - 0
fastshop/pages/group/index.wxml

@@ -0,0 +1,16 @@
+<skeleton />
+<navigator hover-class="none" class="box" wx:for="{{item}}" wx:key="this" url="item?id={{item.id}}">
+  <view class="box-img"><image src="{{item.img}}"></image></view>
+  <view class="box-flex">
+    <view class="g_title">{{item.name}}</view>
+    <view class="g_disc">{{item.uids}}人参团</view>
+    <view class="g_bar">
+      <view class="amout">¥{{item.amount}}元</view>
+      <view class="btn">
+        <view class="btnleft">{{item.hao_people}}人团</view>
+        <view class="btnright">去拼团</view>
+      </view>
+    </view>
+  </view>
+</navigator>
+<include src="/component/loading.wxml" />

+ 12 - 0
fastshop/pages/group/index.wxss

@@ -0,0 +1,12 @@
+
+.box{height: 100px;display: flex;padding: 10px;background: #fff;margin-bottom:5px;}
+.box .box-img{width:105px;}
+.box .box-img image{width: 100px;height: 100px;vertical-align: middle;border-radius: 5px;}
+.box .box-flex{flex: 1;padding:0px 5px;}
+.box .box-flex .g_title{line-height: 22px;font-size: 14px;height: 45px;}
+.box .g_disc{color: #777;font-size: 12px;line-height:20px;}
+.box .g_bar{margin-top:5px;display: flex;}
+.box .g_bar .amout{flex: 1;color: #fe3939;font-size: 18px;}
+.box .g_bar .btn{flex: 1;display: flex;height: 30px;font-size: 14px;}
+.box .g_bar .btn .btnleft{flex: 1;display: block;border: 1px solid #fe3939;text-align: center;line-height:30px;border-radius: 0.3rem 0 0 0.3rem;}
+.box .g_bar .btn .btnright{flex: 1;display: block;border: 1px solid #fe3939;text-align: center;line-height:30px;background: #fe3939;color: #fff;    border-radius: 0 0.3rem 0.3rem 0;}

+ 46 - 0
fastshop/pages/group/item.js

@@ -0,0 +1,46 @@
+var api = require('../../utils/request');
+var util = require('../../utils/util');
+var WxParse = require('../../wxParse/wxParse.js');
+const app = getApp()
+Page({
+  data: {
+    tip: false,     // 轮播图指针
+    group_id: 0,
+    items: [],
+  },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onLoad: function (options) {
+    this.setData({
+      group_id: parseInt(options.id)
+    });
+    this.getItem();
+  },
+  /**
+   * 获取商品信息
+   */
+  getItem: function (e) {
+    let that = this;
+    var group_id = that.data.group_id;
+    api.Get('api/v3/fastshop/group/item', { 'id': group_id}, function (result) {
+      that.setData({
+        items: result.data,
+        tip: result.data.face.length >= 1 ? true : false
+      });
+      WxParse.wxParse('content', 'html', result.data.content, that, 0);
+    })
+  },
+  //立即购买
+  buy_now: function () {
+    let that = this;
+    var group_id = that.data.group_id;
+    wx.showLoading({ title: '下单中' })
+    wx.setStorageSync('group',group_id)
+    setTimeout(function () {
+      wx.navigateTo({
+        url: 'dopay'
+      })
+    },600)
+  }
+})

+ 5 - 0
fastshop/pages/group/item.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "产品详情",
+  "navigationBarBackgroundColor": "#FFF",
+  "navigationBarTextStyle": "black"
+}

+ 35 - 0
fastshop/pages/group/item.wxml

@@ -0,0 +1,35 @@
+<skeleton />
+<swiper autoplay="true" indicator-dots="true" class='swiper-box'>
+  <swiper-item wx:for="{{items.imgs}}" wx:key="this">
+    <image class="slide-image" mode="widthFix" src="{{item}}" />
+  </swiper-item>
+</swiper>
+<view class="weui-panel">
+  <view class="weui-media-box weui-media-box_text">
+    <view class="weui-media-box__title weui-media-box__title_in-text">{{items.name}}</view>
+    <view class="weui-media-box__info">
+        <view class="weui-media-box__info__meta price">团购价:¥<text class="number">{{items.group_price}}</text></view>
+        <view class="weui-media-box__info__meta weui-media-box__info__meta_extra">
+            零售价:¥{{items.sale_price}}
+        </view>
+    </view>
+  </view>
+</view>
+<view class="article-title">产品详情</view>
+<view class="weui-article">
+  <import src="../../wxParse/wxParse.wxml" />
+  <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
+</view>
+<van-submit-bar price="{{items.sale_price*100}}" button-text="立即购买" bind:submit="buy_now" tip="{{ tip }}">
+  <view class="goods-fixed-icon">
+    <text class='red f16'>{{items.hao_people}}</text>人成团
+  </view>
+  <view slot='tip'>
+    <view class="left">已参团:</view>
+    <view class="face" >
+        <block wx:for="{{items.face}}" wx:for-item="rs" wx:key="this">
+          <image src="{{rs.face}}" style="z-index:{{index}};left:{{index*20}}px"></image>
+        </block>
+    </view>
+  </view>
+</van-submit-bar>

+ 24 - 0
fastshop/pages/group/item.wxss

@@ -0,0 +1,24 @@
+@import "/wxParse/wxParse.wxss";
+.swiper-box{height:750rpx;}
+.slide-image {width: 100%;height: 100%;margin: 0 auto;display: block;background: #F3F3F3;}
+.weui-panel{margin-top: 0px;margin-bottom: 10px;border-bottom: 1px #EEE solid;}
+.weui-panel .price{color: #F5203E}
+.weui-panel .price .number{font-size:35rpx;} 
+.weui-media-box__title{white-space:normal;}
+.weui-media-box__info {line-height:2em;}
+.weui-media-box{padding:10px}
+.article-title{margin:5px 5px 0px 5px;padding:10px;font-size: 14px;border-bottom: 1px #EEE solid;color:#999;}
+.weui-article{margin:0px 5px 95px;padding:10px;background: #FFF}
+.weui-article image{width: 100%}
+.gift{background: #f0f0f0;padding:2px;}
+.box{margin:2px;background: #fff;padding: 5px;position:relative;overflow: hidden}
+.box image{min-height:100px;min-width:100px;max-height:120px;width: 100%;vertical-align:middle}
+.box .gift-name{font-size: 14px;padding:0px 5px 5px 5px;height:40px;overflow: hidden}
+.box .giftname{color: #333;background: #fff;padding:5px;line-height:20px;font-size: 14px;position:relative;bottom:0px;}
+.box .tip{position:absolute;bottom:7px;right:5px;}
+.van-tag {margin-left:5px;}
+/*底部按钮*/
+.goods-fixed-icon {width:140rpx;background: #fff;border-right: 1rpx solid #eee;position: relative;text-align: center;}
+.goods-fixed-icon  .fixed-icon{font-size:40rpx;}
+.face{position: relative;height: 20px;left:50px;}
+.face image{width:20px;height:20px;border-radius:10px;border:1px #eee solid;vertical-align: middle;position:absolute;box-shadow: 0 2px 10px 0 rgba(0,0,0,0.1);}

+ 25 - 0
fastshop/pages/helper/bind.js

@@ -0,0 +1,25 @@
+const app = getApp()
+import Toast from '../..//vant/toast/toast';
+Page({
+  /**
+   * 用户登录
+   */
+  authorLogin: function (e) {
+    let that = this;
+    if (e.detail.errMsg !== 'getUserInfo:ok') {
+      return false;
+    }
+    Toast.loading({
+      mask: true,
+      message: '帐号正在授权'
+    });
+    //登录返回上一页
+    app.doLogin(e,function (isLogin) {
+      if (isLogin) {
+        wx.switchTab({
+          url: '/pages/user/index'
+        })
+      }
+    });
+  }
+})

+ 5 - 0
fastshop/pages/helper/bind.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "会员登录",
+  "navigationBarBackgroundColor": "#FFFFFF",
+  "navigationBarTextStyle": "black"
+}

+ 21 - 0
fastshop/pages/helper/bind.wxml

@@ -0,0 +1,21 @@
+<view class="page">
+  <view class="weui-msg">
+    <view class="weui-msg__icon-area wechatapp">
+        <view class="header"><open-data type="userAvatarUrl"></open-data>
+    </view>
+    </view>
+    <view class="weui-msg__text-area">
+        <view class="weui-msg__title">申请以下权限</view>
+        <view class="weui-msg__desc">获得你的公开信息(昵称、头像等)</view>
+    </view>
+    <view class="weui-msg__opr-area">
+        <view class="weui-btn-area">
+            <button open-type="getUserInfo" plain lang="zh_CN" bindgetuserinfo="authorLogin" class="weui-btn" type="primary">授权登录</button>
+        </view>
+    </view>
+    <view class="weui-msg__tips-area">
+        <view class="weui-msg__tips">仅获取您的公开信息头像和昵称,用于帐号的验证。</view>
+    </view>
+  </view>
+</view>
+<van-toast id="van-toast" />

+ 1 - 0
fastshop/pages/helper/bind.wxss

@@ -0,0 +1 @@
+@import 'login.wxss';

+ 54 - 0
fastshop/pages/helper/bindphone.js

@@ -0,0 +1,54 @@
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    loading: false,
+    phone_uid: '',
+  },
+  onShow:function(){
+    let that = this;
+    app.isLogin(function(rel){
+      that.isUsrInfo();      
+    });
+  },
+  /**
+   * 获取用户信息检测是否绑定手机号
+   */
+  isUsrInfo: function () {
+    let that = this;
+    app.api().Get('openapi/v1/user/getUserInfo', function (res) {
+      if (res.code == 200) {
+        that.setData({
+          phone_uid: res.data.phone_uid
+        })
+      }
+    })
+  },
+  /**
+  * 设置输入手机号
+  */
+  getPhoneNumber: function (e) {
+    let that = this;
+    var detail = e.detail;
+    if (detail.errMsg == 'getPhoneNumber:ok'){
+      var parms = {
+        encryptedData: detail.encryptedData,
+        errMsg: detail.errMsg,
+        iv: detail.iv
+      }
+      app.api().Post('openapi/v1/bindWechatPhone', parms, function (rel) {
+        if (rel.code == 200) {
+          wx.showModal({
+            content: rel.msg, showCancel: false,
+          })
+          that.setData({
+            phone_uid: rel.data.phone_uid
+          })
+        }
+      })
+    }
+  }
+})

+ 5 - 0
fastshop/pages/helper/bindphone.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "手机绑定",
+  "navigationBarBackgroundColor": "#FFFFFF",
+  "navigationBarTextStyle": "black"
+}

+ 8 - 0
fastshop/pages/helper/bindphone.wxml

@@ -0,0 +1,8 @@
+<view class="header-info">
+  <view class="phone"><van-icon name="{{phone_uid ? 'checked':'warning'}}" size="40px" color="#06ad56"/></view>
+  <view class="phone_num">{{phone_uid?'绑定的手机号:'+phone_uid:'未绑定手机号'}}</view>
+  <view class="phone_tip">手机号仅用户帐号安全验证或关键信息的通知</view>
+</view>
+<view class="van-button">
+  <van-button open-type="getPhoneNumber" bind:getphonenumber="getPhoneNumber" type="primary" block  plain="{{phone_uid ? true : false}}">{{phone_uid ? '更换手机号':'绑定手机号'}}</van-button>
+</view>

File diff suppressed because it is too large
+ 1 - 0
fastshop/pages/helper/bindphone.wxss


+ 36 - 0
fastshop/pages/helper/error.js

@@ -0,0 +1,36 @@
+var util = require('../../utils/util');
+const app = getApp()
+Page({
+
+  data: {
+    message: '请求失败, 请稍后再试',
+    url: '/pages/index/index'
+  },
+  //错误提示文本
+  onLoad: function (options) {
+    this.setData({
+      appname: app.appname
+    })
+    //提示内容
+    var msg = options.msg;
+    if (!util.isNull(msg)) {
+      this.setData({
+        message: msg
+      })
+    }
+    //网址
+    var url = options.url;
+    if (!util.isNull(url)) {
+      this.setData({
+        url: url
+      })
+    }
+  },
+  //重试
+  postRests: function () {
+    var url = this.data.url;
+    wx.reLaunch({
+      url: url,
+    })
+  }
+})

+ 5 - 0
fastshop/pages/helper/error.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "友情提示",
+  "navigationBarBackgroundColor": "#f8f8f8",
+  "navigationBarTextStyle": "black"
+}

+ 19 - 0
fastshop/pages/helper/error.wxml

@@ -0,0 +1,19 @@
+<view class="weui-msg">
+    <view class="weui-msg__icon-area">
+        <van-icon name="info-o" size="93px" color='#F44336'/>
+    </view>
+    <view class="weui-msg__text-area">
+        <view class="weui-msg__title">友情提示</view>
+        <view class="weui-msg__desc">{{message}}</view>
+    </view>
+    <view class="weui-msg__opr-area">
+        <view class="weui-btn-area">
+            <button bindtap="postRests" class="weui-btn" type="default">点击重试</button>
+        </view>
+    </view>
+    <view class="weui-msg__extra-area">
+        <view class="weui-footer">
+            <view ontip class="weui-footer__text">Copyright © {{appname}}</view>
+        </view>
+    </view>
+</view>

+ 1 - 0
fastshop/pages/helper/error.wxss

@@ -0,0 +1 @@
+page{background: #FFF}

+ 80 - 0
fastshop/pages/helper/login.js

@@ -0,0 +1,80 @@
+const app = getApp()
+Page({
+  /**
+    * 页面的初始数据
+    */
+  data: {
+    show: false,
+  },
+  //页面创建时执行
+  onLoad: function (options) {
+    app.setUcode(options);
+  },
+  //每次打开都获取要确人
+  onShow: function () {
+    this.getUcode();
+  },
+  /**
+ * 获取邀请用户
+ */
+  getUcode: function () {
+    if (!app.util().isNull(app.globalData.ucode)) {
+      app.api().Get('openapi/v1/getCodeUser',{'ucode':app.globalData.ucode},(rel) => {
+        if (rel.code == 200) {
+          this.setData({
+            ucode: app.globalData.ucode,
+            ucode_user: rel.data,
+            show:true,
+          })
+        }else{
+          
+        }
+      })
+    }
+  },
+  //输入邀请码
+  inputCode: function (event) {
+    var that = this;
+    var cursor = event.detail.cursor, code = event.detail.value;
+    if (cursor >= 4) {
+      app.globalData.ucode = code;
+      that.getUcode();
+    } else {
+      var user = {
+        face: '/img/me.png'
+      }
+      that.setData({
+        ucode_user: user
+      })
+    }
+  },
+  /**
+   * 关闭弹出窗口
+   */
+  onClose: function () {
+    this.setData({
+      show:!this.data.show
+    })
+  },
+  /**
+   * 用户登录
+   */
+  authorLogin: function (e) {
+    let that = this;
+    if (e.detail.errMsg !== 'getUserInfo:ok') {
+      return false;
+    }
+    wx.showLoading({
+      title: '正在授权',
+    })
+    //登录返回上一页
+    app.doLogin(e,function (isLogin){
+      if (isLogin){
+        app.globalData.ucode = '';
+        wx.navigateBack({
+          delta:1
+        })
+      }
+    });
+  }
+})

+ 6 - 0
fastshop/pages/helper/login.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "会员登录",
+  "backgroundColor": "#FFFFFF",
+  "navigationBarBackgroundColor": "#FFFFFF",
+  "navigationBarTextStyle": "black"
+}

+ 30 - 0
fastshop/pages/helper/login.wxml

@@ -0,0 +1,30 @@
+<view class="page">
+  <view class="weui-msg">
+    <view class="weui-msg__icon-area wechatapp">
+      <view class="header"><open-data type="userAvatarUrl"></open-data></view>
+      <view class="nickname"><open-data type="userNickName"></open-data></view>
+    </view>
+    <view class="weui-msg__text-area">
+      <view class="weui-msg__title">申请以下权限</view>
+      <view class="weui-msg__desc">获得你的公开信息(昵称、头像等)</view>
+    </view>
+    <view class="weui-msg__opr-area">
+      <view class="weui-btn-area">
+        <button open-type="getUserInfo" bindgetuserinfo="authorLogin" class="weui-btn" type="primary">授权登录</button>
+        <button plain class="weui-btn" type="default" bindtap="onClose">邀请码</button>
+      </view>
+    </view>
+    <view class="weui-msg__tips-area">
+      <view class="weui-msg__tips">首次授权用户如有邀请码,建议填写</view>
+    </view>
+  </view>
+</view>
+<van-dialog title="邀请人" use-slot show="{{ show }}" confirm-button-open-type="getUserInfo"  bind:getuserinfo="authorLogin" show-cancel-button confirm-button-text="确认" bind:close="onClose">
+  <view class="user">
+    <view class="faceimg"><image mode="widthFix" src="{{ucode_user.face}}"></image></view>
+    <view class="nackname">{{ucode_user.nickname}}</view> 
+  </view>
+  <view class='inputucode'>
+    <input name="ucode" class="input" value="{{ucode}}" placeholder="邀请码,没有可不填写" bindinput="inputCode" />
+  </view>
+</van-dialog>

+ 14 - 0
fastshop/pages/helper/login.wxss

@@ -0,0 +1,14 @@
+page{background: #FFF}
+.wechatapp {padding: 80rpx 0 48rpx;margin-bottom: 72rpx;text-align: center;border-bottom: 1px #f8f8f8 solid}
+.wechatapp .header {width: 190rpx;height: 190rpx;border: 2px solid #fff;margin: 0rpx auto 0;border-radius: 50%;overflow: hidden;box-shadow: 1px 0px 5px #CCC;}
+.wechatapp .nickname{font-size: 35rpx;font-weight: 600;margin-top: 10px}
+.weui-msg__title {font-size:35rpx;}
+.weui-msg__desc {font-size:28rpx;}
+/* 邀请码输入 */
+.user{margin:10px;}
+.user .faceimg{width:100rpx;height:100rpx;overflow:hidden;margin: auto;padding:2px;border-radius:100%;border: 2px #F3F3F3 solid;}
+.user .faceimg image{width: 100%;height: auto;border-radius:100%;}
+.user .nackname{font-size:32rpx;margin: 5px;text-align: center}
+.inputucode{text-align: center;margin:5px;}
+.inputucode .input{width:80%;border:1px #F3F3F3 solid;margin: auto;height:25px;padding: 5px;}
+.weui-msg__opr-area .weui-btn-area {margin: 0 50px;}

+ 189 - 0
fastshop/pages/helper/safepasspord.js

@@ -0,0 +1,189 @@
+const app = getApp()
+var api = require('../../utils/request');
+var util = require('../../utils/util');
+var common = require('../../utils/common');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    disabled: false,
+    countdown: 60,
+    isPassword:false,
+    sms: '',
+    showType: 'number',//如果是密码换成'password'
+    isFocus: true,
+    dataSource: [{initValue:''},{initValue:''}, {initValue:''},{initValue:''},{initValue:''},{initValue:''}]
+  },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    let that = this;
+    app.isLogin(function (rel) {
+      that.isPassword();
+    });
+  },
+  /**
+   * 用户tap假的Input,focus到隐藏的input
+   */
+  onTapFocus: function () {
+    this.setData({
+      isFocus:true
+    });
+  },
+  /**
+   * 移动端键入
+   * 注意:在pc端无法显示键盘,移动端下编译、预览正常
+   */
+  mobileInput: function (e) {
+    let dataSource = this.data.dataSource;
+    let curInpArr = e.detail.value.split('');
+    let curInpArrLength = curInpArr.length;
+    if (curInpArr.length != this.data.dataSource.length)
+      for (let i = 0; i < dataSource.length - curInpArrLength; i++)
+        curInpArr.push('');
+    for (let i = 0; i < this.data.dataSource.length; i++) {
+      let initValue = 'dataSource[' + i + '].initValue';
+      this.setData({
+        [initValue]: curInpArr[i]
+      });
+    }
+    if (6 == curInpArrLength){
+      var checkPassword = curInpArr.join("");
+      this.checkPassword(checkPassword);
+    }
+  },
+  /**
+   * 第一次近期检测是否设置了密码
+   */
+  isPassword: function () {
+    let that = this;
+    api.Get('openapi/v1/user/isSafePassword',{types:1},function (res) {
+      if (res.code == 204) {
+        that.setData({
+          isPassword: true
+        })
+      }
+    })
+  },
+  /**
+   * 读取手机验证码
+   */
+  getSms: function (e) {
+    let that = this;
+    var detail = e.detail;
+    if (detail.errMsg == 'getPhoneNumber:ok') {
+      var parms = {
+        encryptedData: detail.encryptedData,
+        errMsg: detail.errMsg,
+        iv: detail.iv
+      }
+      app.api().Post('openapi/v1/getBindWechatPhoneSms',parms,function (rel) {
+        if (rel.code == 200) {
+          wx.setStorageSync('session_id', rel.data.session_id);
+          common.settime(that);
+          that.setData({
+            disabled: true,
+            sms: rel.data.sms
+          })
+        }
+      })
+    }
+  },
+  /**
+   * 验证密码是否正确
+   */
+  checkPassword: function (safepassword) {
+    let that = this;
+    if (safepassword.length == 6){
+      wx.showLoading({
+        title: '密码验证中',
+      })
+      var parms = {
+        safepassword:safepassword,
+      }
+      api.Post('openapi/v1/user/checksafepassword',parms,function (res) {
+        wx.hideLoading();
+        if (res.code == 200) {
+          that.setData({
+            isPassword:true
+          })
+        }
+        wx.hideLoading();
+      })
+    }
+  },
+  /**
+    * 修改密码
+    */
+  formSubmit: function (e) {
+    let that = this;
+    var data = e.detail.value;
+    var isPost = true;
+    if (util.isNull(data.code)) {
+      wx.showModal({
+        content: '验证码必须输入'
+      })
+      isPost = false;
+    } else {
+      if (!(/^\d{6}$/.test(data.code))) {
+        wx.showModal({
+          content: '验证码输入错误'
+        })
+        isPost = false;
+      }
+    }
+    if (data.safepassword != data.resafepassword) {
+      wx.showModal({
+        content: '两次密码必须一致'
+      })
+      isPost = false;
+    }
+    if (util.isNull(data.resafepassword)) {
+      wx.showModal({
+        content: '确认密码必须输入'
+      })
+      isPost = false;
+    }
+    if (util.isNull(data.safepassword)) {
+      wx.showModal({
+        content: '密码必须输入'
+      })
+      isPost = false;
+    } else {
+      if (!(/^\d{6}$/.test(data.safepassword))) {
+        wx.showModal({
+          content: '密码只能是6位数字'
+        })
+        isPost = false;
+      }
+    }
+    //提交数据
+    if (isPost == true) {
+      wx.showLoading({
+        title: '提交申请中',
+        mask: true
+      })
+      var parms = {
+        safepassword: data.safepassword,
+        resafepassword: data.resafepassword,
+        code: data.code,
+      }
+      api.Post('openapi/v1/user/setSafePassword', parms, function (res) {
+        wx.showModal({
+          showCancel: false,
+          title: '友情提示',
+          content: res.msg,
+          complete: function () {
+            wx.navigateBack({
+              delta: 1
+            })
+          }
+        })
+      })
+      wx.hideLoading();
+    }
+  }
+})

+ 5 - 0
fastshop/pages/helper/safepasspord.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "安全密码",
+  "navigationBarBackgroundColor": "#FFFFFF",
+  "navigationBarTextStyle": "black"
+}

+ 30 - 0
fastshop/pages/helper/safepasspord.wxml

@@ -0,0 +1,30 @@
+<block wx:if="{{isPassword == false}}">
+  <view class="title">验证密码</view>
+  <view class="tip">请验证安全密码确认是本人操作</view>
+<view class="container">
+  <view class="render-wrap">
+    <block wx:for="{{dataSource}}" wx:key="this">
+      <input type="number" class="render-input" bindtap="onTapFocus" type="password" disabled value="{{item.initValue}}"></input>
+    </block>
+    <input type="number" maxlength="6" focus="{{isFocus}}" class="hidden-input" bindinput="mobileInput" ></input>
+  </view>
+</view>
+</block>
+<block wx:else>
+  <view class="title">设置安全密码</view>
+<form bindsubmit="formSubmit">
+  <van-cell-group>
+    <van-field placeholder="6位数字密码" type="password" maxlength="6" name="safepassword" />
+    <van-field placeholder="请确认密码" type="password" maxlength="6" name="resafepassword" />
+    <van-field value="{{sms}}"  center clearable label="验证码" placeholder="验证码" name="code" use-button-slot maxlength="6">
+      <van-button open-type="getPhoneNumber" bind:getphonenumber="getSms" disabled="{{disabled}}" slot="button" size="small" type="primary" >
+          <text wx:if="{{disabled}}">获取验证码({{countdown}})</text>
+          <text wx:else>获取验证码</text>
+      </van-button>
+    </van-field>
+  </van-cell-group>
+  <view class="button">
+     <button formType="submit" type="primary" block plain>设置密码</button>
+  </view>
+</form>
+</block>

+ 7 - 0
fastshop/pages/helper/safepasspord.wxss

@@ -0,0 +1,7 @@
+.title{text-align: center;font-size:38rpx;padding:120rpx 0rpx 20rpx 0rpx;color: #333;}
+.tip{text-align: center;font-size:26rpx;padding-bottom:50px;color: #333}
+.button{padding: 10px}
+.render-wrap{display: flex;flex-direction: row;margin: auto;width: 600rpx}
+.render-input{width: 100rpx;height: 100rpx;border:1rpx solid #eee;border-left: none;box-sizing: border-box;text-align: center;background: #FFF;}
+.render-input:first-child{border-left: 1rpx solid #eee;}
+.hidden-input{width: 0;height: 0;}

+ 63 - 0
fastshop/pages/helper/setting.js

@@ -0,0 +1,63 @@
+const app = getApp()
+Page({
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    app.isLogin()
+  },
+
+  //清空缓存
+  clearStorage: function () {
+    wx.showModal({
+      content: '请确认要退出登录?',
+      success: function (res) {
+        if (res.confirm) {
+          wx.clearStorage({
+            success: function () {
+              wx.switchTab({
+                url: '../index/index',
+              })
+            },
+          })
+        }
+      }
+    })
+  },
+  /**
+   * 绑定公众号帐号
+   */
+  pubOffice: function () {
+    wx.showModal({
+      content: '确定要绑定同主体公众号帐号吗?',
+      success: function (res) {
+        if (res.confirm) {
+          wx.navigateTo({ url: 'startup' })
+        }
+      }
+    })
+  },
+  /**
+   *地址 
+   */
+  address: function () {
+    let that = this;
+    //获取用户权限
+    wx.getSetting({
+      success(res) {
+        if (res.authSetting['scope.address'] == false) {
+          wx.openSetting({
+            success: (res) => {
+              res.authSetting = {
+                "scope.address": true,
+              }
+            }
+          })
+        } else {
+          wx.chooseAddress({})
+        }
+      }
+    })
+  },
+})

+ 5 - 0
fastshop/pages/helper/setting.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "应用设置",
+  "navigationBarBackgroundColor": "#ffffff",
+  "navigationBarTextStyle": "black"
+}

+ 14 - 0
fastshop/pages/helper/setting.wxml

@@ -0,0 +1,14 @@
+<van-cell-group>
+  <van-cell title="安全密码" icon="eye-o" url="safepasspord"  is-link/>
+  <van-cell title="绑定手机" icon="phone" url="bindphone"  is-link/>
+  <van-cell title="联系地址" icon="location" bindtap="address" is-link/>
+  <van-cell title="绑定帐号" value="绑定公众号" icon="exchange" bindtap="pubOffice" is-link/>
+</van-cell-group>
+<van-cell-group>
+  <button class='openSetting' open-type="openSetting"><van-cell title="微信权限" icon="info-o" is-link url="../helper/setting" /></button>
+  <button class='openSetting' open-type="contact"><van-cell title="客服中心" icon="service-o" is-link url="../helper/setting" /></button>
+  <button class='openSetting' open-type="feedback"><van-cell title="意见反馈" icon="chat-o" is-link url="../helper/setting" /></button>
+</van-cell-group>
+<view class="button">
+  <van-button type="primary" bind:click="clearStorage" plain block>退出登录</van-button>
+</view>

+ 4 - 0
fastshop/pages/helper/setting.wxss

@@ -0,0 +1,4 @@
+.openSetting{padding: 0px;background: none;text-align: left;border-radius: 0px}
+button.openSetting::after{border:none;background: none;}
+.van-cell-group{margin-bottom:20rpx;}
+.button{margin:20rpx}

+ 24 - 0
fastshop/pages/helper/startup.js

@@ -0,0 +1,24 @@
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    url: app.apiroot + '/openapi-' + app.globalData.wechat_config.app_id + '/v1/bindOfficial'
+  },
+  
+  onShow:function(){
+    wx.showModal({
+      content: this.data.url,
+    })
+  },
+  /**
+   * 接受参数
+  */
+  getMessage: function (e) {
+    var that = this;
+    var options = e.detail.data[0];
+    wx.setStorageSync('official_uid',options.official_uid);
+  },
+})

+ 6 - 0
fastshop/pages/helper/startup.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "正在载入中",
+  "backgroundColor": "#f8f8f8",
+  "navigationBarBackgroundColor": "#fff",
+  "navigationBarTextStyle": "black"
+}

+ 1 - 0
fastshop/pages/helper/startup.wxml

@@ -0,0 +1 @@
+<web-view src="{{url}}#wechat_redirect" bindmessage="getMessage"></web-view>

+ 0 - 0
fastshop/pages/helper/startup.wxss


+ 64 - 0
fastshop/pages/helper/webview.js

@@ -0,0 +1,64 @@
+var api = require('../../utils/request');
+var util = require('../../utils/util');
+
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    src: ''
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    var src = options.src;
+    var ids = options.ids;
+    var token = wx.getStorageSync('token');
+    if (util.isNull(src)) {
+      wx.redirectTo({url: 'error?msg=访问页面路径错误' })
+    } else {
+      src = decodeURIComponent(options.src);
+    }
+    if (!util.isNull(ids)) {
+      ids = '?ids=' + decodeURIComponent(options.ids);
+    } else {
+      ids = '';
+    }
+    var pages = getCurrentPages();
+    var currentPage = pages[pages.length - 1];
+    var src = decodeURIComponent(currentPage.options.src || this.data.src)
+    this.setData({
+      src: src + ids
+    });
+  },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    wx.showLoading({title:'正在加载'})
+    setTimeout(function () {
+      wx.hideLoading();
+    }, 2000);
+  },
+  /**
+   * 接受参数
+  */
+  getMessage: function (e) {
+    var that = this;
+    var options = e.detail.data[0];
+  },
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function (options) {
+    return {
+      path: options.webViewUrl,
+      success(e) {
+        wx.showShareMenu({withShareTicket: true});
+      }
+    }
+  },
+})

+ 6 - 0
fastshop/pages/helper/webview.json

@@ -0,0 +1,6 @@
+{
+  "enablePullDownRefresh": true,
+  "backgroundTextStyle": "dark",
+  "navigationBarBackgroundColor": "#FFFFFF",
+  "navigationBarTextStyle": "black"
+}

+ 1 - 0
fastshop/pages/helper/webview.wxml

@@ -0,0 +1 @@
+<web-view src="{{src}}#wechat_redirect" bindmessage="getMessage"></web-view>

+ 1 - 0
fastshop/pages/helper/webview.wxss

@@ -0,0 +1 @@
+page{background: #FFF}

+ 54 - 0
fastshop/pages/index/component/index.wxml

@@ -0,0 +1,54 @@
+<!-- Banner广告 -->
+<view class="banner" wx:if="{{adwords[2].length > 0}}">
+ <swiper autoplay="true" circular="true" interval="3000" duration="300" indicator-dots="true" style='height:{{imgheights[0]}}px;'> 
+    <navigator wx:for="{{adwords[2]}}" wx:key="this" hover-class="none" url="{{item.link}}" open-type="{{item.open_type}}">
+      <swiper-item><image bindload="imageLoad" src="{{item.picture}}" class="slide-image" style="height:{{imgheights[i]}}px;" mode="widthFix" lazy-load="true"/></swiper-item>
+    </navigator>
+</swiper>
+</view>
+<!-- 图标导航 -->
+<view class="icon_row" wx:if="{{adwords[3].length > 0}}">
+  <navigator wx:for="{{adwords[3]}}" wx:key="this" url="{{item.link}}" open-type='{{item.open_type}}' class="icon_col" hover-class="none">
+    <image src="{{item.picture}}" mode="widthFix" lazy-load="true"/><view class="icon_title">{{item.title}}</view>
+  </navigator>
+</view>
+<!-- 公共 -->
+<van-notice-bar left-icon="/img/bbs.png" mode="link" backgroundColor="#ffffff" color="#333333" bind:click="onNotice"  data-id="{{notice.id}}" text="{{notice.title}}" wx:if="{{notice.id > 0}}" >
+  <text slot="left-icon">[公告]</text>
+</van-notice-bar>
+<!-- 中间图片广告 -->
+<navigator class="bannerimg" wx:if="{{adwords[4].length > 0}}" url="{{adwords[4][0].link}}" open-type="{{adwords[4][0].open_type}}"><image src="{{adwords[4][0].picture}}" mode="widthFix" lazy-load="true"/></navigator>
+<!-- 抢购的商品 -->
+<view class="cardbg" wx:if="{{sale.length > 0 && swiper_height > 0}}">
+  <swiper autoplay="true" circular="true" style='height:{{swiper_height}}'> 
+      <swiper-item wx:for="{{sale}}" wx:key="this">
+      <navigator class="card" hover-class="none" url="../market/item?id={{item.id}}">
+        <view class="item-title">
+          <view class="item-name">{{item.title}}</view>
+          <view class="item-price">¥<text class="number">{{item.sale_price}}</text></view>
+        </view>
+        <view class="item-img">
+          <view class="item-grid">
+            <image src="{{item.item.img}}" mode="widthFix"></image>
+            <view class="grid-name">{{item.item.name}}</view>
+            <view class="price">单价¥<text class="number">{{item.item.sell_price}}</text></view>
+          </view>
+          <view class="item-grid" wx:for="{{item.gift}}" wx:for-item="gift" wx:key="this">
+            <image src="{{gift.img}}" mode="widthFix"></image>
+            <view class="grid-name">{{gift.name}}</view>
+            <view class="price">单价¥<text class="number">{{gift.sell_price}}</text></view>
+          </view>
+        </view>
+      </navigator>
+      </swiper-item>
+  </swiper>
+</view>
+<!-- 首页产品列表 -->
+<block wx:if="{{item.length > 0}}">
+<view class="van-title">精选推荐<text>优质宝贝 百姓之选</text></view>
+  <block wx:for="{{item}}" wx:key="this">
+    <van-card price="{{item.sell_price}}" title="{{item.name}}" thumb="{{item.img}}" lazy-load="{{ true }}" ontap="onItem" data-id="{{item.id}}">
+    </van-card>
+  </block>
+  <include src="/component/loading.wxml" />
+</block>

+ 17 - 0
fastshop/pages/index/component/item.wxml

@@ -0,0 +1,17 @@
+<block wx:if="{{item.length > 0}}">
+<view class="item">
+  <view class="item_box" wx:for="{{item}}" wx:key="this">
+    <navigator hover-class="none" url="../shop/item?id={{item.id}}">
+      <view class="product-img"><image lazy-load="true" src="{{item.img}}" mode='widthFix'></image></view>
+      <view class='product-info'>
+        <view class="product-title">{{item.name}}</view>
+        <view class="product-price"><text class='sell'>¥{{item.sell_price}}</text><text class='market'>¥{{item.market_price}}</text></view>
+      </view>
+    </navigator>
+  </view>
+</view>
+<include src="/component/loading.wxml" />
+</block>
+<block wx:else>
+  <include src="/component/null.wxml" />
+</block>

+ 165 - 0
fastshop/pages/index/index.js

@@ -0,0 +1,165 @@
+const app = getApp()
+var common = require('../../utils/common');
+Page({
+  data: {
+    loading:true,
+    page: 0,
+    index: 0,
+    swiper_height:0,
+    imgheights: [],
+    adwords:[],
+    notice: {id: 0,title:''},
+    tabs:[],
+    item: [],
+    sale:[]
+  },
+  //页面创建时执行
+  onLoad: function (options) {
+    app.setUcode(options);
+    this.getApi();
+    this.getItem(0);
+  },
+  //页面出现在前台时执行
+  onShow: function () {
+    app.setTabBarCartNumber();
+  },
+  //获取首页接口
+  getApi: function () {
+    let that = this;
+    //获取广告
+    var param = {
+      apis: JSON.stringify([2,3,4])
+    }
+    app.api().Get('api/v3/fastshop/adwords/all', param, function (result) {
+      if (200 == result.code) {
+        that.setData({
+          adwords: result.data,
+        });
+      }
+    })
+    //获取公告
+    app.api().Get('api/v3/fastshop/index/notice',{'signkey':'notice'},function (result) {
+      if (200 == result.code) {
+        that.setData({
+          notice: result.data,
+        });
+      }
+    })
+    //获取导航
+    app.api().Get('api/v3/fastshop/shop/tabs', function (result) {
+      if (result.code == 200) {
+        that.setData({
+          catetab: result.data
+        });
+      }
+    })
+    //获取套装
+    app.api().Get('api/v3/fastshop/sale/index', {'signkey':'index'}, function (result) {
+      if (200 == result.code) {
+        that.setData({
+          sale: result.data,
+        });
+        setTimeout(() => {
+          that.autoHeight();
+        },1000)
+      }
+    })
+  },
+  /**
+   * 点击Tab栏目切换
+   */
+  onClickTab: function (event) {
+    let id = parseInt(event.detail.name);
+    this.setData({
+      index: id,
+      loading: true,
+      page: 0,
+      item: [],
+    });
+    this.getItem(id);
+  },
+  /**
+   * 活动指定分类商品(所有子类)
+   */
+  getItem: function (id) {
+    let that = this;
+    if (that.data.loading) {
+      var parms = {
+        cate_id: id,
+        types: 1,
+        page: that.data.page + 1
+      }
+      app.api().Get('api/v3/fastshop/shop/cateitem', parms, function (result) {
+        if (result.code == 200) {
+          var item = that.data.item;
+          for (let i in result.data) {
+            item.push(result.data[i]);
+          }
+          that.setData({
+            item: item,
+            page: parms.page,
+          });
+        }
+        that.setData({
+          loading: false,
+        });
+      })
+    }
+  },
+  //图片高度
+  imageLoad: function (event) {
+    this.setData({
+      imgheights: common.autoimg(event)
+    })
+  },
+  //点击公告栏
+  onNotice: function (event) {
+    let id = event.currentTarget.dataset.id, config = app.globalData.wechat_config;
+    wx.navigateTo({
+      url: '/pages/helper/webview?src=' + app.api_root + '/api-' + config.app_id + '/v3/fastshop/webview/index/' + id
+    })
+  },
+  //点击访问某个商品
+  onItem: function (event) {
+    wx.navigateTo({
+      url: '../shop/item?id=' + event.currentTarget.dataset.id,
+    })
+  },
+  /**
+   * 分享按钮
+   */
+  onShareAppMessage: function () {
+    return {
+      path: '/pages/index/index?ucode=' + app.globalData.loginuser.ucode
+    }
+  },
+  //推荐二维码
+  qrcode: function () {
+    wx.navigateTo({
+      url: '../user/qrcode',
+    })
+  },
+  //搜索
+  onSearch: function (event) {
+    wx.navigateTo({
+      url: '../shop/search?keyword=',
+    })
+  },
+  //判断活动的高度
+  autoHeight() {
+    wx.createSelectorQuery().select('.card').boundingClientRect().exec(rect => {
+      if (!app.util().isNull(rect[0])) {
+        this.setData({
+          swiper_height: rect[0].height
+        });
+      }
+    })
+  },
+  //滚动
+  onPageScroll(res) {
+    let scrollTop = res.scrollTop;
+    if (scrollTop <= 10 && scrollTop <= 15) {
+      this.autoHeight();
+    }
+  }
+})

+ 4 - 0
fastshop/pages/index/index.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarBackgroundColor": "#FFFFFF",
+  "navigationBarTextStyle": "black"
+}

+ 18 - 0
fastshop/pages/index/index.wxml

@@ -0,0 +1,18 @@
+<skeleton />
+<block wx:if="{{catetab.length > 0}}">
+  <!-- 搜索框 -->
+  <van-search bind:focus="onSearch" class="searchbar" placeholder="请输入搜索关键词" shape="round" use-action-slot>
+    <view slot="action" bind:tap="qrcode" class="qrcode"><van-icon name="qr" size="30px" /></view>
+  </van-search>
+  <!-- 导航 -->
+  <van-tabs bind:click="onClickTab" border="{{ false }}" sticky>
+    <van-tab name="0" title="热门产品" />
+    <van-tab wx:for="{{catetab}}" wx:key="this" name="{{item.id}}" title="{{item.title}}"/>
+  </van-tabs>
+</block>
+<block wx:if="{{index == 0}}">
+  <include src="component/index.wxml" />
+</block>
+<block wx:else>
+  <include src="component/item.wxml" />
+</block>

+ 38 - 0
fastshop/pages/index/index.wxss

@@ -0,0 +1,38 @@
+.isfixed{position: fixed;top: 0px;left: 0px;right:0px;z-index:1;}
+/*搜索*/
+.searchbar {position:relative;}
+.searchbar .qrcode{width: 30px;height:30px;vertical-align:middle}
+.searchbar .van-search{padding:5px 10px!important}
+.searchbar .van-search__action--hover{background-color:#fff!important}
+/* 广告 */
+.banner{position: relative;margin-top:1px}
+.banner image{vertical-align:middle;width:100%;}
+.banner .wx-swiper-dots.wx-swiper-dots-horizontal{margin-bottom:10rpx;}
+.banner .wx-swiper-dot{width:20rpx;display: inline-flex;height:5rpx;margin-left:5rpx;justify-content:space-between;}
+.banner .wx-switem-titleiper-dot::before{content: '';flex-grow: 1;background: #FFF;border-radius:5rpx}
+.banner .wx-swiper-dot-active::before{background:#bbd000;}
+.bannerimg{background:#FFF;box-sizing:border-box;margin-top: 5px}
+.bannerimg image{width: 100%;vertical-align:middle}
+/* 快捷图标 */
+.icon_row{background: #FFF;position: relative;}
+/* 产品列表 */
+.van-title{margin-top:5px;background:#FFF;color: #FF0036;font-weight: 700;padding:10px 10px 0px;line-height:30px}
+.van-title text{margin-left: 8px;font-weight: 400;color: #aaa;font-size: 12px;}
+.van-card {padding: 10px!important;margin-bottom:1px}
+.van-card .van-card__title {font-weight:400!important;font-size:28rpx!important;line-height:35rpx!important;}
+.van-card .van-card__thumb .van-card__img{border-radius:3px}
+.van-card .van-card__price{font-size: 35rpx!important;}
+.van-card__bottom,.van-card__desc {line-height: 30px!important;}
+/* 左右大图 */
+.item{display: flex;flex-flow: row wrap;width: 100%;margin-top: 6px}
+.item .item_box{margin-bottom:6px;display: block;width:50%;position: relative;}
+.item .item_box navigator{background: #FFF;}
+.item .item_box:nth-child(2n) navigator{margin-left:3px;margin-right:6px;}
+.item .item_box:nth-child(odd) navigator{margin-right:3px;margin-left:6px;}
+.item .product-img image{width: 100%;vertical-align:top;border-radius:3px;}
+.item .product-info{padding:8rpx;line-height: 20px;}
+.item .product-title{max-height:40px;font-size: 28rpx;overflow: hidden;word-break: break-word;text-overflow:ellipsis;color: #333;}
+.item .product-price {height:25px;line-height:25px;}
+.item .product-price .sell{color:#f23030;font-size: 16px;}
+.item .product-price .market{color:#999;font-size: 12px;text-decoration:line-through;padding-left: 10px}
+.item .product-tip{max-height:20px;font-size: 12px;overflow: hidden;word-break: break-word;text-overflow: ellipsis;color:#999;}

+ 259 - 0
fastshop/pages/market/dopay.js

@@ -0,0 +1,259 @@
+var api = require('../../utils/request');
+const app = getApp();
+Page({
+  data: {
+    item: [],
+    amount: [],
+    address: {},
+    address_isnull: 0,
+    actions: [],
+    disabled:false,
+    orderParams: {},    // 支付参数
+    chickPayBtn: false, //点击了支付按钮(订单信息交由古德云组件)
+    chickOnPay: false, // 用户是否已经点击了「支付」并成功跳转到 古德云收银台 小程序
+  },
+  /*
+   生命周期函数--监听页面初次载入
+  */
+  onLoad: function () {
+    this.getAddress();
+    this.getCart();
+  },
+  /**
+   * 唤起微信支付
+   */
+  wchatPayment: function (buytype) {
+    let that = this;
+    var param = {
+      address: that.data.address.id,
+      ids: wx.getStorageSync('cart'),
+      ucode: app.globalData.loginuser.ucode,
+      buytype: buytype,
+    }
+    app.api().Post('api/v3/fastshop/order/doPay',param,function (rel) {
+      if (200 == rel.code) {
+        if (rel.data.type == 1) {
+          that.setData({
+            chickPayBtn: true,
+            orderParams: rel.data.order
+          })
+        } else {
+          wx.removeStorageSync('cart');
+          app.doWechatPay(rel.data.order, function () {
+            wx.navigateTo({ url: '../user/gift' });
+          }, function () {
+            wx.showModal({
+              content: '支付失败或取消', showCancel: false, complete: function () {
+                wx.switchTab({ url: '../market/index' })
+              }
+            })
+          })
+        }
+      }
+      wx.hideLoading();
+    })
+  },
+  /**
+  * 读取微信地址
+  */
+  getAddress: function () {
+    let that = this;
+    app.api().Get("openapi/v1/user/getaddress", {'signkey':'dopay' }, function (rel) {
+      if (rel.code == 200) {
+        that.setData({
+          address: rel.data,
+          address_isnull: Object.keys(rel.data).length,
+        })
+      }
+    })
+  },
+  /**
+   * 读取微信地址
+   */
+  address: function () {
+    let that = this;
+    //获取用户权限
+    wx.getSetting({
+      success(res) {
+        if (res.authSetting['scope.address'] == false) {
+          wx.openSetting({
+            success: (res) => {
+              res.authSetting = {
+                "scope.address": true,
+              }
+            }
+          })
+        } else {
+          wx.chooseAddress({
+            success: function (res) {
+              var name = res.userName;
+              var telNumber = res.telNumber;
+              var city = res.provinceName + res.cityName + res.countyName;
+              var address = res.detailInfo;
+              app.api().Post("openapi/v1/user/createAddress", {
+                name: name,
+                telphone: telNumber,
+                city: city,
+                address: address
+              }, function (rel) {
+                that.setData({
+                  address: rel.data,
+                  address_isnull: Object.keys(rel.data).length,
+                })
+              });
+            }
+          })
+        }
+      }
+    })
+  },
+  /**
+   * 获取购物车中的订单
+   */
+  getCart: function () {
+    let that = this;
+    wx.showLoading({
+      title: '正在加载',
+      mask: true
+    })
+    var cart = wx.getStorageSync('cart');
+    app.api().Post('api/v3/fastshop/order/cartItem', {
+      cart: cart
+    }, function (result) {
+      if (result.code == 200) {
+        that.setData({
+          item: result.data.item,
+          amount: result.data.amount
+        })
+      } else {
+        wx.setStorageSync('cart', 0)
+        wx.switchTab({
+          url: result.url
+        })
+      }
+      wx.hideLoading();
+    })
+  },
+  /**
+  * 支付方式
+  */
+  payTypes: function () {
+    let that = this;
+    var actions = that.data.actions;
+    var address_isnull = that.data.address_isnull
+    if (address_isnull == 0) {
+      wx.showModal({
+        content: '必须选择收货地址',
+      })
+    } else {
+      this.setData({
+        show: true
+      });
+    }
+    if (that.data.show) {
+      app.api().Get('api/v3/fastshop/index/saleBuyTypes',{'signkey': 'saleBuyTypes' }, function (result) {
+        that.setData({
+          actions: result.data
+        });
+      })
+    }
+  },
+  /**
+   * 是否弹出支付菜单
+  */
+  onClose() {
+    this.setData({
+      show: false,
+      disabled: false
+    });
+  },
+  /**
+   * 支付方式
+   */
+  payTypes: function () {
+    let that = this;
+    var actions = that.data.actions;
+    var address_isnull = that.data.address_isnull
+    if (address_isnull == 0) {
+      wx.showModal({
+        content: '必须选择收货地址',
+      })
+    } else {
+      that.setData({
+        show: true,
+        disabled: true
+      });
+    }
+    if (that.data.show) {
+      app.api().Get('api/v3/fastshop/index/saleBuyTypes', { 'signkey': 'saleBuyTypes' }, function (result) {
+        that.setData({
+          actions: result.data
+        });
+      })
+    }
+  },
+  /**
+   * 选择支付方式
+   */
+  onSelect(event) {
+    var address_isnull = this.data.address_isnull
+    var addressId = this.data.address.id;
+    var payTypes = event.detail.types;
+    switch (payTypes) {
+      case 1:
+        this.wchatPayment("wepay");
+        break;
+      case 2:
+        this.wchatPayment("point");
+        break;
+      default:
+        this.onClose();
+    }
+  },
+  /**
+   * 支付成功的事件处理函数
+   * res.detail 为 payjs 小程序返回的订单信息
+   * 可通过 res.detail.payjsOrderId 拿到 payjs 订单号
+   * 可通过 res.detail.responseData 拿到详细支付信息
+   */
+  goodPaySuccess: function (res) {
+    if (res.detail.return_code = "SUCCESS") {
+      wx.removeStorageSync('cart');
+      wx.navigateTo({
+        url: '/pages/user/gift'
+      })
+    }
+  },
+  /**
+  * 支付失败的事件处理函数
+  * res.detail.error 为 true 代表传入小组件的参数存在问题
+  * res.detail.navigateSuccess 代表了是否成功跳转到 PAYJS 小程序
+  * res.detail.event 可能存有失败的原因
+  * 如果下单成功但是用户取消支付则 res.detail.event.return_code == FAIL
+  */
+  goodPayFail: function (res) {
+    this.setData({
+      chickPayBtn: false,
+    })
+  },
+  /**
+   * 支付完毕的事件处理函数
+   * 无论支付成功或失败均会执行
+   */
+  goodPayComplete: function (res) {
+    this.setData({
+      chickPayBtn: false,
+    })
+  },
+  /**
+   * 组件内部数据被修改时的事件
+   * 当用户跳转到 云收银台 小程序并等待返回的过程中 chickOnPay 值为 true
+   */
+  goodPayChange(res) {
+    if (res.detail.chickOnPay) {
+      this.setData({
+        chickOnPay: res.detail.chickOnPay
+      })
+    }
+  }
+})

+ 8 - 0
fastshop/pages/market/dopay.json

@@ -0,0 +1,8 @@
+{
+  "navigationBarTitleText": "抢购",
+  "navigationBarBackgroundColor": "#FFFFFF",
+  "navigationBarTextStyle": "black",
+  "usingComponents": {
+    "goodpay": "/component/goodpay/index"
+  }
+}

+ 37 - 0
fastshop/pages/market/dopay.wxml

@@ -0,0 +1,37 @@
+<skeleton />
+<!-- 收获地址 -->
+<block wx:if="{{address_isnull >= 1}}">
+  <view bindtap="address" class="address">
+    <view class="address_icon"><van-icon name="contact" size="30px" color="#FF6C6C" /></view>
+    <view class="address_value">
+      <view>姓名:{{address.name}} / 电话:{{address.telphone}}</view>
+      <view>地址:{{address.address}}</view>
+    </view>
+    <view class="address_ight"><van-icon name="arrow" size="16px" color="#969799" /></view>
+</view>
+</block>
+<block wx:else>
+  <view bindtap="address" class="address">
+      <view class="address_icon"><van-icon name="add-square" size="30px" color="#1989FA" /></view>
+      <view class="address_value">选择收货地址</view>
+      <view class="address_ight"><van-icon name="arrow" size="16px" color="#969799" /></view>
+  </view>
+</block>
+<view class='block__title'>已选宝贝</view>
+<view class="van-item">
+  <van-card title="{{item.item.name}}" thumb="{{item.item.img}}" num="1" lazy-load="{{ true }}" ontap="onItem" />
+  <block wx:for="{{item.gift}}" wx:key="this">
+    <van-card title="{{item.name}}" desc="{{item.note}}" thumb="{{item.img}}" lazy-load="{{ true }}"  num="1" />
+  </block>
+</view>
+<view class='block__title'>订单信息</view>
+<van-cell icon="free-postage" title="配送方式" value="{{amount.real_freight == 0 ?' 免运费 / ':''}}普通快递" />
+<van-cell icon="gold-coin" title="商品金额" value="¥{{amount.real_amount}}" />
+<van-cell icon="logistics" title="运费" value="¥{{amount.real_freight}}" />
+<view class="weui-loadmore weui-loadmore_line">
+    <view class="weui-loadmore__tips weui-loadmore__tips_in-line">到底了</view>
+</view>
+<van-submit-bar disabled="{{disabled}}" price="{{amount.order_amount*100}}" button-text="立即付款" bindtap="payTypes" button-type="primary" />
+<van-action-sheet title="请选择支付方式 " show="{{ show }}" actions="{{ actions }}" bind:close="onClose" bind:select="onSelect" cancel-text="取消" bind:cancel="onClose" data-address-id="{{address.id}}" />
+<!-- 古德云支付组件 -->
+<goodpay wx:if="{{ chickPayBtn }}" params="{{ orderParams }}" bindSuccess="goodPaySuccess" bindFail="goodPayFail" bindComplete="goodPayComplete" bind:Change="goodPayChange"/>

+ 13 - 0
fastshop/pages/market/dopay.wxss

@@ -0,0 +1,13 @@
+.block__title {margin: 0;font-weight: 400;font-size: 14px;color: rgba(69,90,100,.6);padding:10px;}
+/* 收货地址 */
+.address {padding: 16px;align-items: center;position: relative;display: flex;box-sizing: border-box;width: 100%;overflow: hidden;color: #323233;font-size: 14px;background-color: #fff;}
+.address::before{position: absolute;right: 0;bottom: 0;left: 0;height: 2px;background: -webkit-repeating-linear-gradient(135deg, #ff6c6c 0, #ff6c6c 20%, transparent 0, transparent 25%, #1989fa 0, #1989fa 45%, transparent 0, transparent 50%);
+background: repeating-linear-gradient(-45deg, #ff6c6c 0, #ff6c6c 20%, transparent 0, transparent 25%, #1989fa 0, #1989fa 45%, transparent 0, transparent 50%);background-size: 80px;content: '';}
+.address .address_icon{width: 30px;height:30px;}
+.address .address_value{line-height:20px;margin-left: 5px;vertical-align: middle;-webkit-box-flex: 1;-webkit-flex: 1;flex: 1;}
+.address .address_ight-icon{width: 30px;height:30px;}
+/* 产品预览 */
+.van-card {padding:5px!important;background-color: #fff!important;}
+.van-card .van-card__content{border-bottom: 1px #f2f3f5 solid}
+.van-card .van-card__title {font-weight:400!important;font-size:28rpx!important;line-height:35rpx!important;}
+.van-card .van-card__desc{font-size: 12px;}

+ 141 - 0
fastshop/pages/market/index.js

@@ -0,0 +1,141 @@
+const app = getApp()
+Page({
+  data: {
+    loading: true,
+    startBarHeight: app.globalData.startBarHeight,
+    navgationHeight: app.globalData.navgationHeight,
+    windowHeight: '',
+    windowWidth: '',
+    page: 0,
+    activeIndex: 0,
+    sliderLeft: 0,
+    menuIndex: 0,
+    times:[],
+    time_id: 0,
+    market:[],
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onLoad: function (options) {
+    app.setUcode(options);
+  },
+  /**
+   * 每次载入
+   */
+  onShow:function () {
+    this.setData({
+      page: 0,
+      loading: true,
+      market: []
+    });
+    this.getExtend();
+  },
+  //下拉
+  onReachBottom: function () {
+    var that = this;
+    that.setData({
+      loading: true,
+    });
+    this.getApi();
+  },
+  //获取首页接口
+  getExtend: function () {
+    let that = this;
+    let time_id = that.data.time_id, index = that.data.activeIndex;
+    let param = {
+      time_id: time_id,
+      index: index
+    }
+    app.api().Get('api/v3/fastshop/times/index',param,function (result) {
+      if (result.code == 200){
+        //计算我的tab索引
+        for (let i in result.data) {
+          if (result.data[i].state == 1) {
+            index = i;
+            time_id = result.data[i].id;
+          }
+        }
+        that.setData({
+          times: result.data,
+          time_id: time_id,
+          activeIndex: index,
+          timeHeight:45
+        });
+        //开始计算滚动条位移
+        wx.getSystemInfo({
+          success: function (res) {
+            var tabWidth = res.windowWidth / 5;
+            that.setData({
+              windowHeight: res.windowHeight,
+              windowWidth: res.windowWidth,
+              sliderLeft: (index - 2) * tabWidth
+            });
+          }
+        });
+      }else{
+        that.setData({
+          time_id:0,
+          timeHeight:0
+        });
+      }
+    })
+    this.getApi();
+  },
+  //点击Tab切换
+  selecttab: function (e) {
+    var id         = parseInt(e.currentTarget.dataset.id);
+    var sliderLeft = e.currentTarget.offsetLeft;
+    var index      = e.currentTarget.dataset.index;
+    var tabWidth = this.data.windowWidth/5;
+    this.setData({
+      page: 0,
+      loading: true,
+      time_id: id,
+      sliderLeft: (index - 2) * tabWidth,
+      market: []
+    });
+    this.getApi();
+  },
+  /**
+ * 添加商品
+ */
+  getApi: function () {
+    let that = this;
+    if (that.data.loading) {
+      var param = {
+        page: that.data.page + 1,
+        time_id: that.data.time_id
+      }
+      app.api().Get('api/v3/fastshop/sale/lists',param,function (result) {
+        if (result.code == 200) {
+          var market = that.data.market;
+          for (let i in result.data) {
+            market.push(result.data[i]);
+          }
+          that.setData({
+            market: market,
+            page: param.page,
+          });
+        }
+        that.setData({
+          loading: false,
+        });
+      })
+    }
+  },
+  //分享按钮
+  onShareAppMessage: function () {
+    return {
+      desc: app.appname,
+      path: '/pages/index/index?ucode=' + app.globalData.loginuser.ucode
+    }
+  },
+  //滚动
+  onPageScroll(res) {
+    let scrollTop = res.scrollTop;
+    this.setData({
+      'barbolor': 10 <= scrollTop ? '#FF3B35' : 'none'
+    })
+  }
+})

+ 6 - 0
fastshop/pages/market/index.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "活动套装",
+  "navigationBarBackgroundColor": "#FF3B35",
+  "navigationBarTextStyle": "white",
+  "navigationStyle": "custom"
+}

+ 54 - 0
fastshop/pages/market/index.wxml

@@ -0,0 +1,54 @@
+<view id="navigation" style="padding-top:{{startBarHeight}}px;height:{{navgationHeight}}px;line-height:{{navgationHeight}}px;background-color:{{barbolor}}">
+    <view class="appname">活动套装</view>
+</view>
+<view id="header"><image src="../../img/page.jpg" mode="scaleToFill"></image></view>
+<scroll-view class="tab" scroll-x scroll-left="{{sliderLeft}}" scroll-with-animation="true" style="top:{{startBarHeight+navgationHeight}}px;background-color:{{barbolor}}" wx:if="{{times.length > 0}}">
+  <view class="tabs" wx:for="{{times}}" wx:key="this" data-index="{{index}}" data-id="{{item.id}}" bindtap="selecttab" bindtap="selecttab" style="">
+    <view class="times{{time_id == item.id?' action':''}}">
+      <view class="house">{{item.name}}</view>
+      <view class="state">{{item.state_text}}</view>
+    </view>
+  </view>
+</scroll-view>
+<view class="body" style="top:{{startBarHeight+navgationHeight+timeHeight}}px;">
+  <block wx:if="{{market.length > 0}}">
+    <navigator wx:for="{{ market }}" wx:key="this" class="card" hover-class="none" url="item?id={{item.id}}">
+      <view class="item-title">
+        <view class="item-name">{{item.title}}</view>
+        <view class="item-price">¥<text class="number">{{item.sale_price}}</text></view>
+      </view>
+      <view class="item-info">
+        <view class="item_state">
+          <block wx:if="{{item.state == 2}}">
+              <van-tag type="warning" wx:if="{{item.is_vip == 1}}">限会员</van-tag>
+              <van-tag type="primary" wx:if="{{item.is_newuser == 1}}">新用户</van-tag>
+              <view class="progress" wx:if="{{item.is_vip == 0 && item.is_newuser == 0}}">
+                <van-progress percentage="50" color="#f2826a"/>
+              </view>
+          </block>
+          <block wx:else><van-tag>已经结束</van-tag></block>
+        </view>
+        <view wx:if="{{item.state == 2}}">
+            <van-tag wx:if="{{item.types == 1}}" plain mark round type="danger" size="medium">{{item.end_time}}</van-tag>
+            <van-tag wx:elif="{{item.types == 2}}" plain mark round type="success" size="medium">{{item.start_time}}</van-tag>
+        </view>
+      </view>
+      <view class="item-img">
+        <view class="item-grid">
+          <image src="{{item.item.img}}" mode="widthFix" lazy-load />
+          <view class="grid-name">{{item.item.name}}</view>
+          <view class="price">单价¥<text class="number">{{item.item.sell_price}}</text></view>
+        </view>
+        <view class="item-grid" wx:for="{{item.gift}}" wx:for-item="gift" wx:key="this">
+          <image src="{{gift.img}}" mode="widthFix"  lazy-load />
+          <view class="grid-name">{{gift.name}}</view>
+          <view class="price">单价¥<text class="number">{{gift.sell_price}}</text></view>
+        </view>
+      </view>
+    </navigator>
+  <include src="/component/loading.wxml" />
+  </block>
+  <block wx:else>
+    <include src="/component/null.wxml" />
+  </block>
+</view>

+ 14 - 0
fastshop/pages/market/index.wxss

@@ -0,0 +1,14 @@
+#header{position: fixed;top:0;left: 0;right: 0;bottom: 0;z-index: 1;height: 100%;background-repeat:no-repeat;}
+#header image{width: 100%;}
+.error {margin: 50% 0px;}
+/*栏目Tab*/
+.tab{height:45px;position: fixed;top: 0px;left: 0px;z-index:200;white-space: nowrap;box-sizing: border-box;overflow: hidden;}
+.tab .tabs{display: inline-block;width: 20%;text-align: center;font-size: 30rpx;line-height:40rpx;color: #FFF}
+.tab .times{opacity:0.6;}
+.tab .times.action{opacity:1;}
+.tab .times.action .house{font-size:45rpx;color: #FFF;font-weight:500}
+.tab .times .house{font-size: 35rpx;}
+.tab .times .state{font-size: 26rpx;}
+/* 正文呢日 */
+.body{position:absolute;left:0;right:0;z-index:2;padding:10px;box-sizing: border-box;}
+.card{margin-bottom:10px;}

+ 95 - 0
fastshop/pages/market/item.js

@@ -0,0 +1,95 @@
+var WxParse = require('../../wxParse/wxParse.js');
+const app = getApp()
+Page({
+  data: {
+    loading: false,
+    disabled: true,    
+    item_id: 0,
+    items: [],
+  },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onLoad: function (options) {
+    app.setUcode(options);  //读取邀请码
+    if (options.scene) {
+      var scene = app.util().strToArray(decodeURIComponent(options.scene));
+      var item_id = parseInt(scene.id);
+    } else {
+      var item_id = parseInt(options.id);
+    }
+    //获取当前页面点击ID
+    this.setData({ item_id: item_id });
+  },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    this.getItem();
+  },
+  /**
+   * 获取商品信息
+   */
+  getItem: function (e) {
+    let that = this;
+    var item_id = that.data.item_id;
+    app.api().Get('api/v3/fastshop/sale/item', {
+      'id': item_id
+    }, function (result) {
+      if (result.data.types == 1 && result.data.state == 1){
+        that.setData({
+          disabled:false,
+        });
+      }
+      that.setData({
+        items: result.data,
+      });
+      WxParse.wxParse('content','html',result.data.item.content,that,0);
+    })
+  },
+  //立即购买
+  buy_now: function () {
+    let that = this;
+    var item_id = that.data.item_id;
+    //下单前查询是否有库存和购买
+    wx.showLoading({title: '抢购中'})
+    app.api().Post('api/v3/fastshop/order/isOrder',{'id': item_id}, function (result) {
+        wx.setStorageSync('cart',item_id)
+        setTimeout(function () {
+          wx.navigateTo({ url: 'dopay' })
+        }, 600)
+    })
+  },
+  /**
+   * 分享按钮
+   */
+  onShareAppMessage: function (res) {
+    let that = this;
+    var item_id = that.data.item_id,ucode = app.globalData.loginuser.ucode;
+    return {
+      path: '/pages/market/item?id=' + item_id + '&ucode=' + ucode,
+    }
+  },
+  //返回首页
+  toRedirect: function () {
+    wx.switchTab({
+      url: '/pages/index/index',
+    });
+  },
+  //滚动
+  onPageScroll(res) {
+    wx.createSelectorQuery().select('.weui-panel').boundingClientRect().exec(rect => {
+      if (rect[0].top - 100 <= 0){
+        this.setData({
+          'barbolor':'#FFFFFF',
+          'appname': '产品详情'
+        })
+      }else{
+        this.setData({
+          'barbolor': 'none',
+          'appname': ''
+        })
+      }
+    })
+  }
+})

+ 6 - 0
fastshop/pages/market/item.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "套装详情",
+  "navigationBarBackgroundColor": "#FFFFFF",
+  "navigationBarTextStyle": "black"
+}
+

+ 40 - 0
fastshop/pages/market/item.wxml

@@ -0,0 +1,40 @@
+<skeleton />
+<swiper autoplay="true" indicator-dots="true" class='swiper-box'>
+  <swiper-item wx:for="{{items.item.imgs}}" wx:key="this">
+    <image class="slide-image" mode="widthFix" src="{{item}}" />
+  </swiper-item>
+</swiper>
+<view class="weui-panel">
+  <view class="weui-media-box weui-media-box_text">
+    <view class="weui-media-box__title weui-media-box__title_in-text">{{items.item.name}}</view>
+    <view class="weui-media-box__desc">{{items.item.name}}</view>
+  </view>
+  <view class="card" hover-class="none" url="../shop/item?id={{item.id}}">
+    <view class="item-title">
+      <view class="item-name">活动套装</view>
+      <view class="item-price">活动价¥
+        <text class="number">{{items.sale_price}}</text>
+      </view>
+    </view>
+    <view class="item-img">
+      <navigator class="item-grid" wx:for="{{items.gift}}" wx:for-item="gift" wx:key="this" hover-class="none" url="../shop/item?id={{gift.id}}">
+        <image src="{{gift.img}}" mode="widthFix" lazy-load />
+        <view class="grid-name">{{gift.name}}</view>
+        <view class="price">单价¥
+          <text class="number">{{gift.sell_price}}</text>
+        </view>
+      </navigator>
+    </view>
+  </view>
+</view>
+<view class="article-title">产品详情</view>
+<view class="weui-article">
+  <import src="../../wxParse/wxParse.wxml" />
+  <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
+  <include src="/component/loading.wxml" />
+</view>
+<van-submit-bar disabled="{{ disabled }}" price="{{items.sale_price*100}}" button-text="{{items.state_text}}" bind:submit="buy_now" tip="{{ true }}">
+  <view class="goods-fixed-icon" bindtap="toRedirect">
+      <van-icon name="home-o" class='fixed-icon' /><view>首页</view>
+  </view>
+</van-submit-bar>

+ 11 - 0
fastshop/pages/market/item.wxss

@@ -0,0 +1,11 @@
+@import "/wxParse/wxParse.wxss";
+.swiper-box{height:750rpx;}
+.slide-image {width: 100%;height: 100%;margin: 0 auto;display: block;}
+.weui-panel{margin-top: 0px;}
+
+.article-title{padding:10px;font-size: 14px;color:#999;}
+.weui-article{margin-bottom:50px;padding:5px;}
+.weui-article image{width: 100%}
+/*底部按钮*/
+.goods-fixed-icon {width:140rpx;background: #fff;margin:auto;line-height:15px;border-right: 1rpx solid #eee;position: relative;text-align: center;}
+.goods-fixed-icon  .fixed-icon{font-size:40rpx;}

+ 95 - 0
fastshop/pages/money/cash.js

@@ -0,0 +1,95 @@
+const app = getApp()
+var api = require('../../utils/request');
+var util = require('../../utils/util');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    loading: false,
+    bank: {
+      money: 0,
+      due_money: 0,
+      lack_money: 0,
+      income_monney: 0,
+      shop_money: 0
+    },
+  },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    this.getBank();
+  },
+  /**
+   * 读取我的账单
+   */
+  getBank: function () {
+    let that = this;
+    api.Get("api/v3/fastshop/bank/index", function (result) {
+      if (result.code == 200) {
+        that.setData({ bank: result.data });
+      }
+    })
+  },
+  /**
+   * 申请提现
+   */
+  onSubmit: function (e) {
+    let that = this;
+    var data = e.detail.value;
+    var isPost = true;
+    //安全密码
+    if (util.isNull(data.safepassword)) {
+      wx.showModal({
+        content: '安全密码必须填写'
+      })
+      isPost = false;
+    }
+    if (util.isNull(data.money)) {
+      wx.showModal({
+        content: '提现金额必须填写'
+      })
+      isPost = false;
+    } else {
+      if (!(/^\d+$/.test(data.money))) {
+        wx.showModal({
+          content: '提现金额只能输入整数'
+        })
+        isPost = false;
+      } else {
+        var money = parseInt(data.money);
+        var bank = this.data.bank;
+        if (money > bank.due_money || money == 0) {
+          wx.showModal({
+            content: '超出允许提现金额'
+          })
+          isPost = false;
+        }
+      }
+    }
+    //提交数据
+    if (isPost == true) {
+      wx.showLoading({
+        title: '提交申请中',
+        mask: true
+      })
+      var parms = {
+        money: data.money,
+        safepassword: data.safepassword,
+      }
+      api.Post('api/v3/fastshop/bank/cash', parms, function (res) {
+        wx.hideLoading();
+        if (res.code == 200) {
+          wx.showModal({
+            showCancel: false,title: '友情提示',content: res.msg,
+            complete: function () {
+              wx.navigateBack({delta:1})
+            }
+          })
+        }
+      })
+    }
+  }
+})

+ 5 - 0
fastshop/pages/money/cash.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "余额转出",
+  "navigationBarBackgroundColor": "#FB4248",
+  "navigationBarTextStyle": "white"
+}

+ 19 - 0
fastshop/pages/money/cash.wxml

@@ -0,0 +1,19 @@
+<view class="header-bg">
+  <navigator class="header-info" hover-class='none'>
+    <view class="title">账户余额</view>
+    <view class="monay">{{bank.due_money}}</view>
+  </navigator>
+</view>
+<form bindsubmit="onSubmit" report-submit="true">
+  <view class="title">转出金额</view>
+  <van-cell-group>
+    <van-field label="转出金额:" placeholder="¥" type="number" name="money" />
+  </van-cell-group>
+  <view class="title">安全密码<text>没有请先返回设置</text></view>
+  <van-cell-group>
+    <van-field label="安全密码:" type="number" maxlength="6" name="safepassword" password/>
+  </van-cell-group>
+  <view class="button">
+      <button type="warn" block plain formType="submit">确定转出</button>
+  </view>
+</form>

+ 6 - 0
fastshop/pages/money/cash.wxss

@@ -0,0 +1,6 @@
+.header-bg{background: #FB4248;box-shadow: 0 1px 6px rgba(0,0,0,.15);}
+.header-info{text-align: center;line-height:30px;padding:10px 0px 20px;}
+.header-info .title{font-size: 12px;color: #f3f3f3;padding:0px;}
+.header-info .monay{line-height:25px;font-size:22px;color: #fff;}
+.title text{font-size: 12px;color: #888;padding-left: 5px}
+.button{padding: 10px}

+ 126 - 0
fastshop/pages/money/index.js

@@ -0,0 +1,126 @@
+var api = require('../../utils/request');
+const app = getApp();
+Page({
+  data: {
+    loading: true,
+    shopping_name:'购物积分',
+    bank: {
+      money: 0,
+      due_money: 0,
+      lack_money: 0,
+      income_monney: 0,
+      shop_money: 0
+    },
+    list: [],
+    today: 0,
+    page: 0,
+    loading: true,
+    types:0
+  },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    var that = this;
+    app.isLogin(function () {
+      that.getBank();
+    });
+  },
+  /**
+  * 生命周期函数--监听页面初次渲染完成
+  */
+  onReady: function () {
+    this.setData({
+      shopping_name: app.globalData.config.shopping_name
+    })
+  },
+  // 下拉刷新
+  onPullDownRefresh: function () {
+    var that = this;
+    that.setData({
+      page: 0,
+      loading: true,
+      list: [],
+      bank: {
+        money: 0,
+        due_money: 0,
+        lack_money: 0,
+        income_monney: 0,
+        shop_money: 0
+      },
+    });
+    wx.showNavigationBarLoading();
+    this.getBank();
+    this.getList();
+    setTimeout(function () {
+      wx.hideNavigationBarLoading();
+      wx.stopPullDownRefresh();
+    }, 1500);
+  },
+  //下拉
+  onReachBottom: function () {
+    var that = this;
+    that.setData({
+      loading: true,
+    }); 
+    this.getList();
+  },
+  /**
+   * 点击切换
+   */
+  onChange(event) {
+    this.setData({
+      page: 0,
+      loading: true,
+      list: [],
+      types: event.detail.name
+    });
+    this.getList();
+  },
+  /**
+    * 读取我的账单
+    */
+  getBank: function () {
+    let that = this;
+    api.Get("api/v3/fastshop/bank/index", function (result) {
+      if (result.code == 200){
+        that.setData({ bank: result.data });
+        that.getList();
+      }
+    })
+  },
+  /**
+   * 获取帐号明细
+   */
+  getList: function () {
+    let that = this;
+    if (that.data.loading) {
+      wx.showLoading({ title: '正在加载' });
+      var page = that.data.page + 1;
+      var types = that.data.types;
+      api.Get("api/v3/fastshop/bank/bill", { today: types, page: page }, function (result) {
+        if (result.code == 200) {
+          var list = that.data.list;
+          for (let i in result.data) {
+            list.push(result.data[i]);
+          }
+          that.setData({
+            list: list,
+            page: page,
+          });
+        }
+      })
+      that.setData({
+        loading: false,
+      });
+      wx.hideLoading();
+    }
+  },
+  //点击底部菜单
+  ontabbar(event) {
+    var url = event.detail;
+    wx.navigateTo({
+      url: url,
+    })
+  }
+})

Some files were not shown because too many files changed in this diff