Browse Source

first commit

warrior 4 months ago
commit
5d0fe54353
100 changed files with 9073 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 60 0
      README.md
  3. 314 0
      app.js
  4. 61 0
      app.json
  5. 20 0
      app.wxss
  6. 116 0
      common-page/pages/address/index.js
  7. 5 0
      common-page/pages/address/index.json
  8. 31 0
      common-page/pages/address/index.wxml
  9. 218 0
      common-page/pages/address/index.wxss
  10. 260 0
      common-page/pages/cates/article-detail/index.js
  11. 5 0
      common-page/pages/cates/article-detail/index.json
  12. 210 0
      common-page/pages/cates/article-detail/index.less
  13. 54 0
      common-page/pages/cates/article-detail/index.wxml
  14. 0 0
      common-page/pages/cates/article-detail/index.wxss
  15. 107 0
      common-page/pages/cates/article-list/index.js
  16. 5 0
      common-page/pages/cates/article-list/index.json
  17. 32 0
      common-page/pages/cates/article-list/index.less
  18. 19 0
      common-page/pages/cates/article-list/index.wxml
  19. 28 0
      common-page/pages/cates/article-list/index.wxss
  20. 164 0
      common-page/pages/collect/index.js
  21. 9 0
      common-page/pages/collect/index.json
  22. 126 0
      common-page/pages/collect/index.less
  23. 37 0
      common-page/pages/collect/index.wxml
  24. 114 0
      common-page/pages/collect/index.wxss
  25. 451 0
      common-page/pages/daily-check/index.js
  26. 5 0
      common-page/pages/daily-check/index.json
  27. 136 0
      common-page/pages/daily-check/index.less
  28. 69 0
      common-page/pages/daily-check/index.wxml
  29. 131 0
      common-page/pages/daily-check/index.wxss
  30. 184 0
      common-page/pages/footprint/index.js
  31. 3 0
      common-page/pages/footprint/index.json
  32. 55 0
      common-page/pages/footprint/index.less
  33. 25 0
      common-page/pages/footprint/index.wxml
  34. 48 0
      common-page/pages/footprint/index.wxss
  35. 90 0
      common-page/pages/index/index.js
  36. 7 0
      common-page/pages/index/index.json
  37. 9 0
      common-page/pages/index/index.wxml
  38. 5 0
      common-page/pages/index/index.wxss
  39. 184 0
      common-page/pages/info/bindBank/index.js
  40. 7 0
      common-page/pages/info/bindBank/index.json
  41. 112 0
      common-page/pages/info/bindBank/index.less
  42. 50 0
      common-page/pages/info/bindBank/index.wxml
  43. 105 0
      common-page/pages/info/bindBank/index.wxss
  44. 150 0
      common-page/pages/info/bindWechat/index.js
  45. 3 0
      common-page/pages/info/bindWechat/index.json
  46. 90 0
      common-page/pages/info/bindWechat/index.less
  47. 15 0
      common-page/pages/info/bindWechat/index.wxml
  48. 85 0
      common-page/pages/info/bindWechat/index.wxss
  49. 162 0
      common-page/pages/info/browsing/index.js
  50. 9 0
      common-page/pages/info/browsing/index.json
  51. 67 0
      common-page/pages/info/browsing/index.less
  52. 43 0
      common-page/pages/info/browsing/index.wxml
  53. 63 0
      common-page/pages/info/browsing/index.wxss
  54. 192 0
      common-page/pages/info/cauth/cauth.js
  55. 7 0
      common-page/pages/info/cauth/cauth.json
  56. 45 0
      common-page/pages/info/cauth/cauth.less
  57. 30 0
      common-page/pages/info/cauth/cauth.wxml
  58. 43 0
      common-page/pages/info/cauth/cauth.wxss
  59. 66 0
      common-page/pages/info/cauth/index.js
  60. 3 0
      common-page/pages/info/cauth/index.json
  61. 1 0
      common-page/pages/info/cauth/index.wxml
  62. 0 0
      common-page/pages/info/cauth/index.wxss
  63. 272 0
      common-page/pages/info/index.js
  64. 8 0
      common-page/pages/info/index.json
  65. 61 0
      common-page/pages/info/index.less
  66. 29 0
      common-page/pages/info/index.wxml
  67. 56 0
      common-page/pages/info/index.wxss
  68. 518 0
      common-page/pages/info/ucenter/address-detail/index.js
  69. 6 0
      common-page/pages/info/ucenter/address-detail/index.json
  70. 223 0
      common-page/pages/info/ucenter/address-detail/index.wxml
  71. 245 0
      common-page/pages/info/ucenter/address-detail/index.wxss
  72. 104 0
      common-page/pages/info/ucenter/address/index.js
  73. 5 0
      common-page/pages/info/ucenter/address/index.json
  74. 31 0
      common-page/pages/info/ucenter/address/index.wxml
  75. 218 0
      common-page/pages/info/ucenter/address/index.wxss
  76. 66 0
      common-page/pages/info/ucenter/index.js
  77. 3 0
      common-page/pages/info/ucenter/index.json
  78. 2 0
      common-page/pages/info/ucenter/index.wxml
  79. 1 0
      common-page/pages/info/ucenter/index.wxss
  80. 100 0
      common-page/pages/loading/index.js
  81. 3 0
      common-page/pages/loading/index.json
  82. 7 0
      common-page/pages/loading/index.wxml
  83. 8 0
      common-page/pages/loading/index.wxss
  84. 323 0
      common-page/pages/lucky-draw/index.js
  85. 9 0
      common-page/pages/lucky-draw/index.json
  86. 248 0
      common-page/pages/lucky-draw/index.less
  87. 65 0
      common-page/pages/lucky-draw/index.wxml
  88. 209 0
      common-page/pages/lucky-draw/index.wxss
  89. 66 0
      common-page/pages/myOrder/afterSale/index.js
  90. 3 0
      common-page/pages/myOrder/afterSale/index.json
  91. 1 0
      common-page/pages/myOrder/afterSale/index.wxml
  92. 1 0
      common-page/pages/myOrder/afterSale/index.wxss
  93. 442 0
      common-page/pages/myOrder/index.js
  94. 8 0
      common-page/pages/myOrder/index.json
  95. 113 0
      common-page/pages/myOrder/index.less
  96. 114 0
      common-page/pages/myOrder/index.wxml
  97. 1 0
      common-page/pages/myOrder/index.wxss
  98. 168 0
      common-page/pages/myOrder/order-detail/index.js
  99. 3 0
      common-page/pages/myOrder/order-detail/index.json
  100. 587 0
      common-page/pages/myOrder/order-detail/index.less

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+node_modules

+ 60 - 0
README.md

@@ -0,0 +1,60 @@
+# WAPP 微信小程序:小程序页面、样式、MOCK数据规范
+
+- 起步必看
+    - [目录及开发规范](./tutorial-devspec.html)
+    - [新项目小程序配置](./tutorial-startup.html)
+- 全局服务
+    - [全局:程序入口注意事项](./tutorial-app.html)
+    - [全局:变量、方法、服务](./tutorial-global.html)
+- 通用页面
+    - [组件:DiyPage](./tutorial-diypage.html)
+- 常用业务
+    - [用户登录及验证](./tutorial-userauth.html)
+
+# NovaWapp脚手架工具
+## 初始化子项目
+``` sh
+# 安装依赖
+npm i
+# 初始化子项目
+npm run nova init nova-doctor
+# 开发者工具选择 nova-wapp 目录启动项目
+```
+## 项目结构
+- 子项目配置文件目录:/config/\<project\> 目录为
+  - config.js 账套及三方参数配置文件
+  - app.json 小程序项目分包依赖文件
+- 开发者首先需要加载子项目的配置文件才能正常运行子项目
+  - 例如:npm run nova init nova-doctor
+    - 将nova-doctor精英内推项目配置文件,复制到当前项目进行开发
+- 更多目录介绍请查看:[目录及开发规范](./tutorial-devspec.html)
+## 命令帮助
+> npm run nova help
+``` sh
+> node .release-tool.js help
+usage: .release-tool.js <command>
+
+命令:
+  .release-tool.js list            列出所有可用小程序清单
+  .release-tool.js init <appname>  初始化小程序:根据appname
+
+选项:
+  --help     显示帮助信息                                                 [布尔]
+  --version  显示版本号                                                   [布尔]
+```
+
+# NovaWapp技术文档
+
+``` sh
+# 调试打包 完整
+rm -r dist/docs/*
+jsdoc -c .config-jsdoc.json
+cp -r docs/* dist/docs/
+http-server ./dist/docs/
+# 调试打包
+npm run docs
+
+# 发布上线
+rsync -avPW dist/docs/ root@server.fmode.cn:/var/www/ng-fmode/wapp/
+scp -r dist/docs/* root@server.fmode.cn:/var/www/ng-fmode/wapp/
+```

+ 314 - 0
app.js

@@ -0,0 +1,314 @@
+// app.js
+let Nova = require("./utils/nova.js");
+const CONFIG = require("config.js");
+const request = require("./utils/request");
+const plugin = requirePlugin('fm-plugin')
+const { Parse } = plugin
+App({
+  onLaunch() {
+    // 展示本地存储能力
+    const logs = wx.getStorageSync('logs') || []
+    logs.unshift(Date.now())
+    wx.setStorageSync('logs', logs)
+    let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
+    if (extConfig && extConfig.company) {
+      this.globalData.company = extConfig.company
+      this.globalData.appid = extConfig.wxappid
+    }
+    let {
+      model,
+      platform,
+      statusBarHeight,
+      safeArea,
+      screenHeight
+    } = wx.getSystemInfoSync();
+    this.globalData.platform = platform;
+    this.globalData.statusBarHeight = statusBarHeight;
+    this.globalData.safeArea = safeArea;
+    this.globalData.screenHeight = screenHeight;
+    this.globalData.isIpx = model.includes("iPhone X");
+
+    let {
+      system
+    } = wx.getSystemInfoSync();
+    let headHeight;
+    if (/iphone\s{0,}x/i.test(model)) {
+      headHeight = 88;
+    } else if (system.indexOf("Android") !== -1) {
+      headHeight = 68;
+    } else {
+      headHeight = 64;
+    }
+    this.globalData.headerHeight = headHeight;
+  },
+  Nova: Nova,
+  Parse: Parse,
+  JIMData: {
+    convers: [],
+    messages: {},
+  },
+  globalData: {
+    userInfo: null,
+    theme: CONFIG.default.theme,
+    //腾讯地图的key
+    tencentKey: CONFIG.default.tencentKey,
+    // NovaCloud
+    ncloud: request,
+    // JMessage
+    jmessage: CONFIG.default.jmessage,
+    // We7
+    api: CONFIG.default.api,
+    approot: CONFIG.default.approot,
+    // Tabbar
+    defaultTabBar: CONFIG.default.defaultTabBar,
+    // checkAuth
+    appid: CONFIG.default.appid,
+    company: CONFIG.default.company,
+    rootPage: CONFIG.default.rootPage,
+    appType: CONFIG.default.appType,
+    //获取相关tabs的name
+    moduleTab:CONFIG.default.moduleTab,
+  },
+  checkAuth: plugin.checkAuth,
+  parseLogin(token){
+    return Parse.User.become(token).then(async currentUser => {
+      console.log(currentUser)
+      resolve(currentUser)
+    }).catch(err => {
+      wx.setStorageSync("sessionToken", null);
+      wx.showModal({
+        title: '提示',
+        content: '登录信息过期,请退出重新进入小程序',
+        showCancel: false,
+        cancelText: '取消',
+        cancelColor: '#000000',
+        confirmText: '确定',
+        confirmColor: '#3CC51F',
+        success: (result) => {
+          if (result.confirm) {
+            wx.exitMiniProgram()
+          }
+        },
+      });
+      rej(err)
+    })
+  },
+  // checkAuth: async function (force = true) {
+  //   return new Promise(async (resolve,rej)=>{
+  //     let that = this;
+  //     // 0.检测是否开启各页面强制登陆
+  //     let enabledOptions = wx.getStorageSync("enabledOptions");
+  //     if (force || (enabledOptions && enabledOptions["check-auth"])) {
+  //       let invite = wx.getStorageSync('invite')
+  //       let token = wx.getStorageSync('sessionToken')
+  //       if(!token){
+  //         token = await this.getParseToken()
+  //         let userInfo = wx.getStorageSync("userInfo");
+  //         that.globalData.userInfo = userInfo
+  //         if(!token){
+  //           wx.showModal({
+  //             title: '提示',
+  //             content: '获取登录信息失败,请删除小程序重新进入',
+  //             showCancel: true,
+  //             cancelText: '取消',
+  //             cancelColor: '#000000',
+  //             confirmText: '确定',
+  //             confirmColor: '#3CC51F',
+  //             success: (result) => {
+  //               if(result.confirm){
+  //                 wx.exitMiniProgram()
+  //               }
+  //             },
+  //           });
+  //           resolve(false)
+  //           return
+  //         }
+  //       }
+  //       Parse.User.become(token).then(async currentUser => {
+  //         console.log(currentUser)
+  //         if (invite && !currentUser.get('invite') && currentUser.id != invite && !currentUser.get('agentLevel')) {
+  //           //查询邀请人user,邀请人不能是自己的下级
+  //           let query = new Parse.Query("_User")
+  //           query.equalTo('objectId',invite)
+  //           query.select('invite')
+  //           let result = await query.first()
+  //           if (!(result && result.id && result.get("invite")?.id == currentUser.id)) {
+  //             console.log('上下级绑定成功');
+  //             currentUser.set('invite', {
+  //               __type: "Pointer",
+  //               className: "_User",
+  //               objectId: invite
+  //             })
+  //             currentUser.set('agent', {
+  //               __type: "Pointer",
+  //               className: "_User",
+  //               objectId: invite
+  //             })
+  //             await currentUser.save()
+  //           }
+  //         }
+  //         currentUser.get('mobile') ? wx.setStorageSync("userLogin", currentUser.id) : wx.removeStorageSync("userLogin");
+  //         resolve(currentUser)
+  //         return true
+  //       }).catch(err => {
+  //         wx.setStorageSync("sessionToken", null);
+  //         wx.showModal({
+  //           title: '提示',
+  //           content: '登录信息过期,请退出重新进入小程序',
+  //           showCancel: false,
+  //           cancelText: '取消',
+  //           cancelColor: '#000000',
+  //           confirmText: '确定',
+  //           confirmColor: '#3CC51F',
+  //           success: (result) => {
+  //             if(result.confirm){
+  //               wx.exitMiniProgram()
+  //             }
+  //           },
+  //         });
+  //         rej(err)
+  //       })
+  //     } else {
+  //       resolve(false) 
+  //     }
+  //   })
+  // },
+
+  // async getParseToken(){
+  //   return new Promise((resolve, reject) => {
+  //     wx.login({
+  //       success: function (res) {
+  //         if (res.code) {
+  //           let url = 'https://server.fmode.cn/api/wxapp/login'
+  //           wx.request({
+  //             url: url,
+  //             data: {
+  //               companyId: getApp().globalData.company,
+  //               code: res.code,
+  //               appType: getApp().globalData.appType ? getApp().globalData.appType : ''
+  //             },
+  //             async success(res) {
+  //               console.log(res);
+  //               let data = res.data
+  //               if(data.code == 200){
+  //                 wx.setStorageSync("sessionToken", data.data.token);
+  //                 wx.setStorageSync("userInfo", data.data?.userInfo);
+  //                 resolve(data.data.token)
+  //               }else{
+  //                 resolve()
+  //               }
+  //             },
+  //           });
+  //         }
+  //       },
+  //       fail: function (err) {
+  //         console.warn('小程序wx.login失败');
+  //         resolve()
+  //       }
+  //     });
+  //   })
+  // },
+
+
+  //获取全局定位信息
+  // async getLocationInfo(refrensh = false) {
+  //     let that = this;
+  //     let locationInfo = that.globalData.locationInfo;
+  //     if (locationInfo && !refrensh) {
+  //         return locationInfo;
+  //     } else {
+  //         let locationInfo = await util.getLocation();
+  //         that.globalData.locationInfo = locationInfo;
+  //         return locationInfo;
+  //     }
+  // },
+  onShow: function (options) {
+    this.autoUpdate()
+    let { referrerInfo } = options
+    if(referrerInfo?.extraData?.status && referrerInfo.extraData.status == 'success'){
+      getApp().globalData.merchant_trade_no = referrerInfo.extraData.req_extradata.merchant_trade_no
+    }
+  },
+  autoUpdate() {
+    let self = this
+    if (wx.canIUse('getUpdateManager')) {
+      const updateManager = wx.getUpdateManager()
+      //1. 检查小程序是否有新版本发布
+      updateManager.onCheckForUpdate(function (res) {
+        // 请求完新版本信息的回调
+        if (res.hasUpdate) {
+          wx.showModal({
+            title: '更新提示',
+            content: '检测到新版本,是否下载新版本并重启小程序?',
+            success: function (res) {
+              if (res.confirm) {
+                //2. 用户确定下载更新小程序,小程序下载及更新静默进行
+                self.downLoadAndUpdate(updateManager)
+              } else if (res.cancel) {
+                //用户点击取消按钮的处理,强制更新
+                wx.showModal({
+                  title: '温馨提示~',
+                  content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',
+                  showCancel: false,
+                  confirmText: "确定更新",
+                  success: function (res) {
+                    if (res.confirm) {
+                      //下载新版本,并重新应用
+                      self.downLoadAndUpdate(updateManager)
+                    }
+                  }
+                })
+              }
+            }
+          })
+        }
+      })
+    } else {
+      wx.showModal({
+        title: '提示',
+        content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
+      })
+    }
+  },
+  /**
+   * 下载小程序新版本并重启应用
+   */
+  downLoadAndUpdate(updateManager) {
+    wx.showLoading();
+    //静默下载更新小程序新版本
+    updateManager.onUpdateReady(function () {
+      wx.hideLoading()
+      //新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+      updateManager.applyUpdate()
+    })
+    updateManager.onUpdateFailed(function () {
+      // 新的版本下载失败
+      wx.showModal({
+        title: '已经有新版本了哟~',
+        content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
+      })
+    })
+  },
+  onHide: function () {
+    let pages = getCurrentPages()
+    if (pages.length > 0) {
+      let prevPage = pages[pages.length - 1]
+      if (prevPage.route === 'nova-exam/pages/live-pusher/index') {
+        prevPage.data.client.leave()
+        prevPage.stop()
+        prevPage.data.timer && clearInterval(prevPage.data.timer)
+        wx.showModal({
+          title: '提示',
+          content: '考生将应用切换至后台,请重新进入',
+          showCancel: false,
+          success: (res) => {
+            wx.navigateBack({
+              delta: 1,
+            })
+          }
+        });
+      }
+    }
+  }
+
+})

+ 61 - 0
app.json

@@ -0,0 +1,61 @@
+{
+  "pages": [
+    "index"
+  ],
+  "subpackages": [
+    {
+      "root": "nova-werun",
+      "name": "werun",
+      "pages": [
+        "pages/index/index"
+      ]
+    },
+    {
+      "root": "nova-diypage",
+      "name": "DIYPAGE",
+      "pages": [
+        "pages/index/index"
+      ]
+    }
+  ],
+  "window": {
+    "navigationStyle": "custom",
+    "navigationBarTitleText": "",
+    "navigationBarTextStyle": "black",
+    "navigationBarBackgroundColor": "#f6f5fa",
+    "backgroundColor": "#f6f5fa",
+    "enablePullDownRefresh": false
+  },
+  "permission": {
+    "scope.userLocation": {
+      "desc": "你的位置信息将用于小程序位置接口的效果展示"
+    }
+  },
+  "usingComponents": {
+    "nav": "plugin://fm-plugin/fm-nav",
+    "get-phone-number-btn": "components/getPhone/index",
+    "search": "/components/search/search",
+    "payment": "/components/nova-payment/payment",
+    "address": "/components/address/index",
+    "upload": "/components/upload/index",
+    "van-icon": "@vant/weapp/icon/index",
+    "van-button": "@vant/weapp/button/index",
+    "van-tabbar": "@vant/weapp/tabbar/index",
+    "van-tabbar-item": "@vant/weapp/tabbar-item/index",
+    "van-empty": "@vant/weapp/empty/index",
+    "van-loading": "@vant/weapp/loading/index"
+  },
+  "sitemapLocation": "sitemap.json",
+  "plugins": {
+    "fm-plugin": {
+      "version": "0.1.1",
+      "provider": "wx56d559d35ae6e502",
+      "export": "exportToPlugin.js",
+      "genericsImplementation": {
+        "fm-auth": {
+          "get-phone-number-btn": "components/getPhone/index"
+        }
+      }
+    }
+  }
+}

+ 20 - 0
app.wxss

@@ -0,0 +1,20 @@
+/**app.wxss**/
+
+.container {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: space-between;
+  padding: 200rpx 0;
+  box-sizing: border-box;
+}
+view{
+    box-sizing: border-box;
+}
+button{
+  border: none !important;
+}
+button::after{
+  border: none !important;
+}

+ 116 - 0
common-page/pages/address/index.js

@@ -0,0 +1,116 @@
+// var util = require('../../../../../utils/util.js');
+// var api = require('../../../../../utils/api.js');
+// const pay = require('../../../../../services/pay.js');
+// const app = getApp()
+var Parse = getApp().Parse;
+const activeColor = getApp().globalData.activeColor
+// 触底上拉刷新 TODO 这里要将page传给服务器,作者没写
+Page({
+  data: {
+    addresses: [],
+    nowAddress: 0,
+    activeColor: null,
+    titleColor:'#ffffff'
+  },
+  goAddressDetail: function (e) {
+    let { titleColor, activeColor } = this.data
+    let id = e.currentTarget.dataset.addressid;
+    wx.navigateTo({
+      url: `/common-page/pages/info/ucenter/address-detail/index?id=${id}&activeColor=${activeColor || '#ffffff'}&titleColor=${titleColor}`,
+    })
+  },
+  async getAddresses() {
+    let that = this;
+    let addList = []
+    let user = Parse.User.current();
+    let query = new Parse.Query("ShopAddress");
+    query.equalTo("user", user.id);
+    let address = await query.find()
+    if (address) {
+      address.map(item => {
+        addList.push({
+          id: item.id,
+          name: item.get("name"),
+          province_name: item.get("province_name"),
+          city_name: item.get("city_name"),
+          district_name: item.get("district_name"),
+          full_region: item.get("full_region"),
+          address: item.get("address"),
+          mobile: item.get("mobile")
+        })
+      })
+    }
+    that.setData({
+      addresses: addList
+    })
+
+    // util.request(api.GetAddresses).then(function(res) {
+    //     if (res.errno === 0) {
+    //         that.setData({
+    //             addresses: res.data
+    //         })
+    //     }
+    // });
+  },
+  selectAddress: function (e) {
+    let {
+      typeAddress
+    } = this.data
+    let addressId = e.currentTarget.dataset.addressid
+    let address = e.currentTarget.dataset.address
+    wx.setStorageSync('addressId', addressId);
+    let pages = getCurrentPages()
+    // 获取上一界面的页面内容
+    let perPage = pages[pages.length - 2]
+    perPage.setData({
+      address: address
+    })
+    if (typeAddress) {
+      perPage.setData({
+        [typeAddress]: address
+      })
+    }
+    wx.navigateBack();
+  },
+  onLoad: function (options) {
+    let {
+      type,
+      activeColor,
+      titleColor,
+      typeAddress
+    } = options;
+    this.setData({
+      type: type,
+      activeColor: activeColor,
+      titleColor:titleColor,
+      typeAddress: typeAddress
+    })
+  },
+  onUnload: function () {},
+  onShow: function () {
+    this.getAddresses();
+    let addressId = wx.getStorageSync('addressId');
+    if (addressId) {
+      this.setData({
+        nowAddress: wx.getStorageSync('addressId')
+      });
+    } else {
+      this.setData({
+        nowAddress: 0
+      });
+    }
+  },
+  // 新增地址
+  addAddress: function () {
+    let {activeColor}=this.data
+    wx.navigateTo({
+      url: '/common-page/pages/info/ucenter/address-detail/index?activeColor='+activeColor+'&titleColor=#ffffff',
+    })
+  },
+  onPullDownRefresh: function () {
+    wx.showNavigationBarLoading()
+    this.getAddresses();
+    wx.hideNavigationBarLoading() //完成停止加载
+    wx.stopPullDownRefresh() //停止下拉刷新
+  }
+})

+ 5 - 0
common-page/pages/address/index.json

@@ -0,0 +1,5 @@
+{
+    "navigationBarTitleText": "收货地址",
+    "usingComponents": {
+    }
+}

+ 31 - 0
common-page/pages/address/index.wxml

@@ -0,0 +1,31 @@
+<nav type="back" title="选择地址" background-color="{{activeColor ? activeColor : '#00b26a'}}" front-color="{{titleColor ? titleColor : '#ffffff'}}"></nav>
+<view class="containers">
+    <view class='has-info' wx:if="{{addresses.length > 0}}">
+        <view bindtap="{{type == 0?'goAddressDetail':'selectAddress'}}" class='info-item' data-address="{{item}}" data-addressid="{{item.id}}" wx:for="{{addresses}}" wx:key="id">
+            <view class="selected" wx:if="{{type == 1}}">
+                <image wx:if="{{item.id == nowAddress}}" class="img" src="https://file-cloud.fmode.cn/gou-red.png"></image>
+                <image wx:else class="img" src="https://file-cloud.fmode.cn/gou-gray.png"></image>
+            </view>
+            <view class="info-wrap">
+                <view class="addr">
+                    <view class="top">{{item.address}}</view>
+                    <view class="text">{{item.full_region}}</view>
+                </view>
+                <view class="name">
+                    <view class="text">{{item.name}} {{item.mobile}}</view>
+                    <view class="default" wx:if="{{item.is_default}}">默认</view>
+                </view>
+            </view>
+            <view class="edit-wrap" data-addressid="{{item.id}}" catchtap='goAddressDetail'>
+                <image class="img" src="https://file-cloud.fmode.cn/edit.png"></image>
+            </view>
+        </view>
+    </view>
+    <view class="no-info" wx:else>
+        <image src="https://file-cloud.fmode.cn/position-deny.png" class="img"></image>
+        <view class="text">没有地址信息</view>
+    </view>
+    <view class="btn-wrap" bindtap="addAddress">
+        <view class="btn" style="background:{{activeColor ? activeColor : 'linear-gradient(to right, #00b26a, #e6c006)'}};color: {{titleColor ? titleColor : '#ffffff'}}">新增收货地址</view>
+    </view>
+</view>

+ 218 - 0
common-page/pages/address/index.wxss

@@ -0,0 +1,218 @@
+.containers {
+  display: flex;
+  align-items: stretch;
+  overflow-x: hidden;
+}
+
+.has-info {
+  display: flex;
+  flex-direction: column;
+  padding: 30rpx;
+  width: 100%;
+}
+
+.has-info .info-item {
+  padding: 30rpx 0;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  background: #fff;
+  border-radius: 10rpx;
+  box-shadow: 2rpx 8rpx 18rpx #f1f1f1;
+  margin-bottom: 24rpx;
+  position: relative;
+}
+
+.has-info .info-item .edit-wrap {
+  padding: 30rpx;
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.has-info .info-item .edit-wrap .img {
+  width: 42rpx;
+  height: 42rpx;
+}
+
+.has-info .info-item .selected {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 30rpx 0 30rpx 30rpx;
+}
+
+.has-info .info-item .selected .img {
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.has-info .info-item .info-wrap {
+  display: flex;
+  flex-direction: column;
+  padding-left: 30rpx;
+}
+
+.has-info .info-item .info-wrap .addr {
+  display: flex;
+  flex-direction: column;
+  margin-bottom: 10rpx;
+}
+
+.has-info .info-item .info-wrap .addr .top {
+  font-size: 30rpx;
+  font-weight: 500;
+  margin-bottom: 4rpx;
+}
+
+.has-info .info-item .info-wrap .addr .text {
+  font-size: 24rpx;
+  color: #777;
+}
+
+.has-info .info-item .info-wrap .addr .img-wrap {
+  width: 44rpx;
+  height: 44rpx;
+  margin-right: 10rpx;
+}
+
+.has-info .info-item .info-wrap .name {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+
+.has-info .info-item .info-wrap .name .img-wrap {
+  width: 44rpx;
+  height: 44rpx;
+  margin-right: 10rpx;
+}
+
+.has-info .info-item .info-wrap .name .img {
+  width: 42rpx;
+  height: 42rpx;
+}
+
+.has-info .info-item .info-wrap .name .default {
+  font-size: 22rpx;
+  color: #ff3456;
+  background: #faedef;
+  text-align: center;
+  padding: 2rpx 10rpx;
+  border-radius: 4rpx;
+}
+
+.has-info .info-item .info-wrap .name .text {
+  font-size: 26rpx;
+  margin-right: 10rpx;
+}
+
+.has-info .info-item .id-wrap {
+  display: flex;
+  flex-direction: column;
+}
+
+.has-info .info-item .id-wrap .ids {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-size: 26rpx;
+  color: #5d6777;
+  margin-bottom: 8rpx;
+}
+
+.has-info .info-item .id-wrap .ids .id-name {
+  margin-right: 20rpx;
+}
+
+.has-info .info-item .id-wrap .no-ids {
+  font-size: 26rpx;
+  color: #ffbb12;
+}
+
+.has-info .add-btn {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background: #fff;
+  border-radius: 10rpx;
+  box-shadow: 2rpx 8rpx 18rpx #f1f1f1;
+  margin-bottom: 24rpx;
+  padding: 30rpx 0;
+}
+
+.has-info .add-btn .icon-wrap {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 40rpx;
+  height: 40rpx;
+  margin-right: 8rpx;
+}
+
+.has-info .add-btn .icon-wrap .img {
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.has-info .add-btn .text {
+  font-size: 28rpx;
+  color: #ffc310;
+}
+
+.no-info {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  margin-top: 300rpx;
+  width: 100%;
+}
+
+.no-info .img {
+  width: 100rpx;
+  height: 100rpx;
+  margin-bottom: 30rpx;
+}
+
+.no-info .text {
+  font-size: 30rpx;
+  color: #999;
+  text-align: center;
+  margin-bottom: 30rpx;
+}
+
+.no-info .add-btn {
+  color: #192841;
+  /* background: #ff3456; */
+  background: linear-gradient(to right, #f8dd66, #fae277);
+  border-radius: 100px;
+  width: 400rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  font-size: 28rpx;
+  margin: 0 auto;
+}
+
+.btn-wrap {
+  position: fixed;
+  bottom: 0;
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn-wrap .btn {
+  width: 100%;
+  background: linear-gradient(to right, #00b26a, #e6c006);
+  color: #fff;
+  font-size: 28rpx;
+  text-align: center;
+  height: 110rpx;
+  line-height: 100rpx;
+}

+ 260 - 0
common-page/pages/cates/article-detail/index.js

@@ -0,0 +1,260 @@
+const Parse = getApp().Parse
+const company = getApp().globalData.company
+const dateF = require('../../../../utils/date')
+const rechText = require('../../../../utils/rech-text')
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        twoModal: false,
+        tives: 1,
+        region: ['江西省', '南昌市', '东湖区'], // 初始值
+        showheader: true,
+        showfoot: false,
+        type: '',
+        title: "",
+        show: false,
+        nextShow: false,
+        name: '',
+        mobile: '',
+        company: '',
+        product: ''
+
+    },
+    bindRegionChange: function(e) { // picker值发生改变都会触发该方法
+        console.log('picker发送选择改变,携带值为', e.detail.value)
+        this.setData({
+            region: e.detail.value
+        })
+    },
+    hideRule: function() {
+        this.setData({
+            twoModal: false
+        })
+    },
+    nextstep(e) {
+        let {
+            tives
+        } = e.currentTarget.dataset
+        let name = this.data.name
+        let mobile = this.data.mobile
+        if (!name || !mobile) {
+            wx.showToast({
+                title: '请将信息填写完整',
+                icon: 'none'
+            })
+            return
+        }
+        let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
+        if (!myreg.test(mobile)) {
+            wx.showToast({
+                title: '请填写正确手机号',
+                icon: 'none'
+            })
+            return
+        }
+        this.setData({
+            tives
+        })
+    },
+
+    prostep() {
+        let {
+            tives
+        } = e.currentTarget.dataset
+        this.setData({
+            tives
+        })
+    },
+    shopsubmit: function() {
+        this.setData({
+            twoModal: true
+        })
+    },
+
+    submit() {
+        let company = this.data.company
+        let product = this.data.product
+        if (!company || product) {
+            wx.showToast({
+                title: '请将信息填写完整',
+                icon: 'none'
+            })
+            return
+        }
+
+        wx.showToast({
+            title: '提交成功',
+            icon: 'success'
+        })
+    },
+    shoppreventTouchMove: function() {
+        this.setData({
+            twoModal: false
+        })
+    },
+    cancenlClicknext: function() {
+        this.setData({
+            twoModal: false
+        })
+    },
+
+    confirmClick1: function() {
+        console.log('确认收货了')
+        this.setData({
+            twoModal: false
+        })
+    },
+    go1: function() {
+        this.setData({
+            twoModal: false
+        })
+    },
+
+    showPopup() {
+        this.setData({
+            show: true
+        });
+    },
+    nextPopup() {
+        this.setData({
+            nextShow: true
+        });
+    },
+
+    onClose() {
+        this.setData({
+            show: false
+        });
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function(options) {
+        let title = options.title
+        let aid = options.aid
+        let showheader = true
+        console.log(options)
+        let article = await this.getArticle(aid)
+            // let user = article.getUser
+
+        if (options.showheader) {
+            showheader = true
+            this.setData({
+                showheader: true
+            })
+        }
+        let showfoot = false
+        let type = ''
+        if (title == '链商城') {
+            showfoot = true
+            type = 'open-shop'
+        }
+        console.log(article)
+        if (article && article.objectId) {
+            this.setData({
+                title: title,
+                article: article,
+                showfoot: showfoot,
+                type: type
+            })
+        }
+
+    },
+    async getArticle(aid) {
+        let Article = new Parse.Query('Article')
+        Article.include('author')
+        let article = await Article.get(aid)
+
+        if (article && article.id) {
+            console.log(article)
+            let articleJSON = article.toJSON()
+            articleJSON.date = articleJSON.publishDate ? dateF.formatTime("YYYY-mm-dd", articleJSON.publishDate.iso) : dateF.formatTime("YYYY-mm-dd", articleJSON.createdAt)
+
+            if (articleJSON.content) {
+                articleJSON.content = rechText.formatRichText(articleJSON.content)
+            }
+            return articleJSON
+        }
+    },
+
+    blur(e) {
+        let name = e.currentTarget.dataset.name
+        this.setData({
+            [name]: e.detail.value
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function() {
+        let user = Parse.User.current()
+        let title = this.data.article.title
+        let aid = this.data.article.objectId
+        let image = this.data.article.image
+        let query
+        if (user) {
+            query = `invite=${user.id}&aid=${aid}`
+        } else {
+            query = `aid=${aid}`
+        }
+
+        return {
+            title: title,
+            query: query,
+            imageUrl: image,
+            success: function(res) {
+                // 转发成功
+            },
+            fail: function(res) {
+                // 转发失败
+            },
+        };
+    }
+})

+ 5 - 0
common-page/pages/cates/article-detail/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "van-popup": "@vant/weapp/popup/index"
+  }
+} 

+ 210 - 0
common-page/pages/cates/article-detail/index.less

@@ -0,0 +1,210 @@
+.title{
+    font-size: 50rpx;
+    font-weight: 500;
+    width: 92%;
+    margin: 0 auto;
+}
+.date{ 
+    font-size: 30rpx;
+    padding: 6rpx 30rpx;
+    .date_text{
+        font-size: 28rpx;
+        color: #999;
+    }
+}
+
+.article_info {
+    height: 100%;
+    margin-top: 20rpx;
+    .article_info_title {
+        font-size: 34rpx;
+        color: red;
+        font-weight: 600;
+        padding: 20rpx;
+    }
+    .article_info_content {
+        width: 92%;
+        height: 100%;
+        background-color: #fff;
+        margin: 0 auto;
+    }
+
+    .article_info .article_no_content {
+        margin-top: 20rpx;
+        padding-left: 20rpx;
+    }
+    .hred_cont{
+        display: flex;
+        flex-wrap: wrap;
+        align-items: center;
+        justify-content: center;
+        .cont{
+            width: 700rpx;
+            height: 340rpx;
+            margin: 20rpx auto;
+        }
+    }
+}
+
+
+.open_button {
+    width: 690rpx;
+    height: 72rpx;
+    background: #41B1FF;
+    border-radius: 12rpx;
+    font-size: 30rpx;
+    color: #fff;
+    margin: 147rpx auto 20rpx;
+}
+
+.popup_info .popup_title {
+    font-size: 30rpx;
+    color: #222222;
+    padding: 36rpx 181rpx;
+    font-weight: 600;
+}
+
+.popup_info .input_info {
+    display: flex;
+    width: 690rpx;
+    height: 100rpx;
+    border: 2rpx solid #DDDDDD;
+    padding: 25rpx;
+    margin: 30rpx;
+}
+
+.popup_info .popup_button {
+    width: 690rpx;
+    height: 80rpx;
+    background: #41B1FF;
+    color: #fff;
+    font-weight: 500;
+    margin-top: 80rpx;
+}
+
+.shop-mask {
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    z-index: 9000;
+    background-color: rgba(0, 0, 0, 0.6);
+}
+
+.shop-button {
+    width: 690rpx !important;
+    height: 88rpx !important;
+    background: #41B1FF;
+    border-radius: 44px;
+    margin: 30rpx 20rpx 70rpx 30rpx !important;
+    color: #ffffff !important;
+    font-size: 32rpx;
+    font-family: PingFang SC;
+    font-weight: 500;
+    line-height: 40rpx;
+    padding: 20rpx !important;
+}
+
+.shop-modalDlg {
+    width: 750rpx;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    z-index: 9999;
+    background-color: #faf4f4;
+    border-radius: 30rpx 30rpx 0rpx 0rpx;
+    display: flex;
+    flex-direction: column;
+
+    .modalDlg-txtt {
+        font-size: 32rpx;
+        font-family: PingFang SC;
+        font-weight: 500;
+        color: #333333;
+        margin-top: 33rpx;
+        text-align: center;
+    }
+
+    .input-txt {
+        text-align: left;
+        margin: 20rpx 20rpx 0rpx 30rpx;
+    }
+
+    .input {
+        float: right;
+        flex: 1;
+        width: 660rpx;
+        height: 88rpx;
+        border-style: solid;
+        border: 2rpx solid #DDDDDD;
+        margin: 20rpx 0rpx 0rpx 30rpx;
+        padding-left: 30rpx;
+    }
+
+    .confirm-next {
+        width: 690rpx !important;
+        height: 100rpx !important;
+        border-radius: 44rpx !important;
+        margin: 30rpx 20rpx 30rpx 30rpx !important;
+        background: #CCCCCC;
+        color: #ffffff !important;
+        font-size: 36rpx !important;
+        font-family: Source Han Sans CN !important;
+        font-weight: 400 !important;
+
+        text-align: center;
+    }
+
+    .input-address {
+        float: right;
+        flex: 1;
+        width: 660rpx !important;
+        height: 88rpx !important;
+        border-style: solid;
+        border: 2rpx solid #DDDDDD;
+        border-radius: 10rpx;
+        margin: 20rpx 0rpx 0rpx 30rpx;
+        padding-left: 30rpx;
+
+        .shop-inputs {
+            font-size: 30rpx;
+            font-family: PingFang SC;
+            font-weight: 500;
+            color: black;
+            line-height: 40rpx;
+            margin: 30rpx 0rpx 30rpx 0rpx;
+        }
+    }
+
+    .ruleHide {
+        height: 30rpx !important;
+        width: 30rpx !important;
+        position: absolute;
+        top: 40rpx;
+        right: 20rpx;
+        margin-right: 10rpx;
+    }
+
+    .return {
+        height: 50rpx !important;
+        width: 50rpx !important;
+        position: absolute;
+        top: 30rpx;
+        left: 20rpx;
+        font-size: 30rpx;
+        font-family: Source Han Sans CN;
+        font-weight: 400;
+        color: #999999;
+        line-height: 40rpx;
+        text-align: left;
+    }
+}
+.desc{
+    padding: 20rpx;
+    font-size: 26rpx;
+    color: #676767;
+}
+
+
+

+ 54 - 0
common-page/pages/cates/article-detail/index.wxml

@@ -0,0 +1,54 @@
+<!-- nova-shop/pages/cates/article-detail/index.wxml -->
+<nav type="back" background-color="#ffffff" title="{{title}}" />
+<block wx:if="{{showheader}}">
+    <view class="title">{{article.title}}</view>
+    <view class="date">
+        {{article.author.nickname}}
+        <span class="date_text">| {{article.date}}| {{article.pageView}}阅读</span>
+    </view>
+</block>
+<view class="article_info">
+    <!--<view class="hred_cont" wx:if="{{article.image || article.video}}">
+        <video wx:if="{{article.video}}" class="cont" src="{{article.video}}" />
+        <image wx:if="{{article.image}}" class="cont" src="{{article.image}}" />
+    </view>-->
+    <view class="desc" wx:if="{{article.desc}}">{{article.desc}}</view>
+    <block wx:if="{{article && article.content}}">
+        <view class="article_info_content">
+            <rich-text nodes="{{article.content}}" style="width: 92%;height: 100%; margin: 0 auto;"></rich-text>
+        </view>
+    </block>
+    <block wx:if="{{!article.content}}">
+        <view class="article_no_content">暂无内容</view>
+    </block>
+</view>
+<button wx:if="{{showfoot && type == 'open-shop'}}" class="open_button" bindtap="shopsubmit">
+    立即开店
+</button>
+<view class="shop-mask" catchtouchmove="shoppreventTouchMove" wx:if="{{twoModal}}">
+    <view class="shop-modalDlg" wx:if="{{twoModal}}">
+        <block wx:if="{{tives == 1}}">
+            <text class='modalDlg-txtt'>填写信息,我们会马上联系你</text>
+            <view class="input-txt">姓名</view>
+            <input value="{{name}}" data-name="name" class="input" placeholder-class="shop-input" placeholder="请输入您的姓名" bindblur="blur" />
+            <view class="input-txt">手机号</view>
+            <input value="{{mobile}}" class="input" data-name="mobile" placeholder-class="shop-input" placeholder="请输入您的手机号" bindblur="blur" />
+            <image src="https://file-cloud.fmode.cn/lb486SzXLP/20211104/i717lg055104.png" class="ruleHide" bindtap="hideRule" />
+            <button class="confirm-next" data-tives="2" bindtap="nextstep">下一步</button>
+        </block>
+        <block wx:if="{{tives == 2}}">
+            <text class='modalDlg-txtt'>填写信息,我们会马上联系你</text>
+            <view class="input-txt">公司名字</view>
+            <input value="{{company}}" class="input" data-name="company" placeholder-class="shop-input" placeholder="请输入公司名称" bindinput="userNameInput" />
+            <view class="input-txt">所在地区</view>
+            <picker class="input-address" mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
+                <view class="shop-inputs">{{region[0]}} {{region[1]}} {{region[2]}}</view>
+            </picker>
+            <view class="input-txt">意向产品</view>
+            <input value="{{product}}" data-name="product" class="input" placeholder-class="shop-input" placeholder="请选择" bindinput="userNameInput" />
+            <image src="https://file-cloud.fmode.cn/lb486SzXLP/20211104/i717lg055104.png" class="ruleHide" bindtap="hideRule" />
+            <image src="https://file-cloud.fmode.cn/lb486SzXLP/20211115/3oofva031047.png" class="return" data-tives="1" bindtap="prostep" />
+            <button class="confirm-next" bindtap="submit">立即提交</button>
+        </block>
+    </view>
+</view>

File diff suppressed because it is too large
+ 0 - 0
common-page/pages/cates/article-detail/index.wxss


+ 107 - 0
common-page/pages/cates/article-list/index.js

@@ -0,0 +1,107 @@
+// nova-shop/pages/cates/article-list/index.js
+const Parse = getApp().Parse
+const company = getApp().globalData.company
+const dateF = require('../../../../utils/date.js')
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        title: "热门资讯",
+        articleList: [],
+        titles: [],
+        id: []
+    },
+
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    // category
+    onLoad: function(options) {
+        console.log(options)
+        this.setData({
+            title: options.title
+        })
+        let cid = options.cid
+        this.getArticle(cid)
+    },
+    textClick(e) {
+        let that = this;
+        console.log(e)
+        let item = e.currentTarget.dataset.item
+        wx.navigateTo({
+            url: `/common-page/pages/cates/article-detail/index?title=${item.title}&aid=${item.objectId}`
+        });
+
+    },
+    async getArticle(cid) {
+        let Article = new Parse.Query('Article')
+        Article.equalTo('category', cid);
+        Article.equalTo('company', company);
+        Article.equalTo('isEnabled', true);
+        Article.select('image', 'title', 'createdAt', 'objectId', 'publishDate')
+        let res = await Article.find();
+        let articleList = [];
+        res.forEach(log => {
+            let logs = log.toJSON();
+            logs.date = logs.publishDate ? dateF.formatTime("YYYY-mm-dd", logs.publishDate.iso) : dateF.formatTime("YYYY-mm-dd", logs.createdAt)
+            articleList.push(logs);
+        });
+        console.log(articleList, )
+        this.setData({
+            articleList: articleList
+        })
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function() {
+
+    }
+})

+ 5 - 0
common-page/pages/cates/article-list/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "van-empty": "@vant/weapp/empty/index"
+  }
+}

+ 32 - 0
common-page/pages/cates/article-list/index.less

@@ -0,0 +1,32 @@
+.hot_info{
+        .hot_tab{
+            width: 690rpx;
+            height: 190rpx;
+            margin-left: 30rpx;
+            border-bottom: 1rpx solid #e2e2e2;
+            display: flex;
+            .hot_left{
+                .title{
+                font-size: 30rpx;
+                width: 470rpx;
+                margin: 23rpx 0;
+                display: -webkit-box;
+                word-break: break-all;
+                -webkit-box-orient:vertical;
+                -webkit-line-clamp:2;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                }
+                .date{
+                    font-size: 24rpx;
+                    color: #999;
+                }
+            }
+            .image{
+                width: 200rpx;
+                height: 150rpx;
+                border-radius: 12rpx;
+                margin: 20rpx 0 0 30rpx;
+            }
+        }
+    }

+ 19 - 0
common-page/pages/cates/article-list/index.wxml

@@ -0,0 +1,19 @@
+<!--nova-shop/pages/cates/article-list/index.wxml-->
+<nav type="back" background-color="#ffffff" title="{{title}}" />
+
+<block wx:if="{{articleList.length > 0}}">
+    <view class="hot_info">
+        <block wx:for="{{articleList}}" wx:key="index">
+            <view class="hot_tab" data-item="{{item}}" bindtap="textClick">
+                <view class="hot_left">
+                    <view class="title">{{item.title}}</view>
+                    <span class="date">{{item.date}}</span>
+                </view>
+                <image class="image" src="{{item.image}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />
+            </view>
+        </block>
+    </view>
+</block>
+<block wx:else>
+    暂无数据
+</block>

+ 28 - 0
common-page/pages/cates/article-list/index.wxss

@@ -0,0 +1,28 @@
+.hot_info .hot_tab {
+  width: 690rpx;
+  height: 190rpx;
+  margin-left: 30rpx;
+  border-bottom: 1rpx solid #e2e2e2;
+  display: flex;
+}
+.hot_info .hot_tab .hot_left .title {
+  font-size: 30rpx;
+  width: 470rpx;
+  margin: 23rpx 0;
+  display: -webkit-box;
+  word-break: break-all;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+.hot_info .hot_tab .hot_left .date {
+  font-size: 24rpx;
+  color: #999;
+}
+.hot_info .hot_tab .image {
+  width: 200rpx;
+  height: 150rpx;
+  border-radius: 12rpx;
+  margin: 20rpx 0 0 30rpx;
+}

+ 164 - 0
common-page/pages/collect/index.js

@@ -0,0 +1,164 @@
+const Parse = getApp().Parse;
+const company = getApp().globalData.company;
+const activeColor = getApp().globalData.activeColor
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        collectList: [],
+        activeColor: null,
+        titleColor:null
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function(options) {
+        await this.getCollect()
+        console.log(getApp().globalData.activeColor);
+        this.setData({ activeColor: getApp().globalData.activeColor,
+            titleColor:getApp().globalData.titleColor
+         })
+    },
+    async getCollect() {
+        let userid = Parse.User.current().id
+        let Collect = new Parse.Query('Collect')
+        Collect.equalTo('user', userid)
+        Collect.equalTo('company', company)
+        Collect.include('collectTarget')
+        let collect = await Collect.find()
+        if (collect && collect.length > 0) {
+            let collectJSON = []
+            collect.forEach(c => {
+                collectJSON.push(c.toJSON())
+            })
+            this.setData({
+                collectList: collectJSON
+            })
+        }
+        console.log(this.data.collectList)
+    },
+
+    onClose(event) {
+        console.log(event);
+        let that = this
+        let id = event.currentTarget.dataset.id
+        let index = event.currentTarget.dataset.index
+        console.log(id, index)
+        const {
+            position,
+            instance
+        } = event.detail;
+        switch (position) {
+            case 'right':
+                instance.close();
+                break;
+        }
+        wx.showModal({
+            title: '确认删除',
+            content: '确定删除收藏物品?',
+            success: function(res) {
+                if (res.confirm) {
+                    that.deleteCollect(id, index)
+                }
+            }
+        })
+    },
+
+    lesson(e) {
+        let id = e.currentTarget.dataset.item.collectTarget[0].objectId
+        console.log(id);
+        wx.navigateTo({
+            url: '/nova-lesson/pages/lesson-detail/lesson-detail?id=' + id
+        })
+
+    },
+    async deleteCollect(id, index) {
+        let that = this
+        let Collect = new Parse.Query('Collect')
+        let collect = await Collect.get(id)
+        if (collect && collect.id)(
+            collect.destroy().then(res => {
+                console.log(res)
+                if (res && res.id) {
+                    console.log(id, index)
+                    let collectList = that.data.collectList
+                    collectList.splice(index, 1)
+                    that.setData({
+                        collectList: collectList
+                    })
+                }
+            })
+        )
+    },
+    toDetail(e) {
+        console.log(e)
+        let item = e.currentTarget.dataset.item
+        if (item.type == 'goods') {
+            wx.navigateTo({
+                url: '/nova-shop/pages/shop-goods/goods-detail/index?id=' + item.collectId
+            })
+        }
+        if (item.type == 'article') {
+            wx.navigateTo({
+                url: '/common-page/pages/cates/article-detail/index?aid=' + item.collectId + "&title=" + item.name
+            })
+        }
+        if (item.type == 'lesson') {
+            wx.navigateTo({
+                url: '/nova-lesson/pages/lesson-detail/index?id=' + item.collectId
+            })
+        }
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function() {
+
+    }
+})

+ 9 - 0
common-page/pages/collect/index.json

@@ -0,0 +1,9 @@
+{
+  "usingComponents": {
+    "van-stepper": "@vant/weapp/stepper/index",
+    "van-icon": "@vant/weapp/icon/index",
+    "van-swipe-cell": "@vant/weapp/swipe-cell/index",
+    "van-cell": "@vant/weapp/cell/index",
+    "van-cell-group": "@vant/weapp/cell-group/index"
+  }
+}

+ 126 - 0
common-page/pages/collect/index.less

@@ -0,0 +1,126 @@
+/* nova-shop/pages/shopping-cart/index.wxss */
+page {
+    background: #f6f6f6;
+}
+.collect {
+    .collect_info {
+        width: 93%;
+        background: #ffffff;
+        border-radius: 12rpx;
+        margin: 20rpx auto;
+        display: flex;
+        .left_info {
+            width: 38%;
+            display: flex;
+            align-items: center;
+            .image {
+                width: 240rpx;
+                height: 240rpx;
+                border-radius: 16rpx;
+            }
+        }
+        .right_info {
+            width: 58%;
+            .title {
+                font-size: 28rpx;
+                margin: 20rpx 0;
+                font-weight: 700;
+                overflow: hidden;
+                display: -webkit-box;
+                -webkit-box-orient: vertical;
+                -webkit-line-clamp: 1;
+            }
+            .desc {
+                font-size: 24rpx;
+                margin-bottom: 20rpx;
+                color: #c2c2c2;
+                overflow: hidden;
+                display: -webkit-box;
+                -webkit-box-orient: vertical;
+                -webkit-line-clamp: 2;
+            }
+            .down_info {
+                padding: 16rpx 0;
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+
+                .price {
+                    font-size: 34rpx;
+                    color: #fd3030;
+                    font-weight: 700;
+                }
+            }
+            
+        }
+    }
+    .delete {
+        background: #e42929;
+        color: #fff;
+        height: 100%;
+        padding: 100rpx 34rpx;
+    }
+    .bottom {
+        width: 100%;
+        height: 100rpx;
+    }
+    .box {
+        width: 93%;
+        margin: 20rpx auto;
+        background: #ffffff;
+        display: flex;
+        border-radius: 20rpx;
+       
+        position: relative;
+        .image {
+            width: 240rpx;
+            height: 240rpx;
+            margin-right: 20rpx;
+            border-radius: 20rpx;
+        }
+    
+        .right {
+           
+         width: 65%;
+            .title {
+                margin-top: 20rpx;
+                overflow: hidden; //一定要写
+                text-overflow: ellipsis; //超出省略号
+                display: -webkit-box; //一定要写
+                -webkit-line-clamp: 1; //控制行数
+                -webkit-box-orient: vertical; //一定要写
+            
+            }
+            .price {
+                color: red;
+                margin-top: 20rpx;
+            }
+    
+            .time {
+                color: #c1bcbc;
+                margin-top: 10rpx;
+                overflow: hidden; //一定要写
+                text-overflow: ellipsis; //超出省略号
+                display: -webkit-box; //一定要写
+                -webkit-line-clamp: 2; //控制行数
+                -webkit-box-orient: vertical; //一定要写
+            
+            }
+    
+            .lecturer {
+                font-size: 28rpx;
+                margin-top: 20rpx;
+            }
+            .collection {
+                position: absolute;
+                right: 30rpx;
+                top: 160rpx;
+                padding: 10rpx 20rpx;
+                background: red;
+                color: #ffffff;
+                border-radius: 20rpx;
+            }
+        }
+    
+    }
+}

+ 37 - 0
common-page/pages/collect/index.wxml

@@ -0,0 +1,37 @@
+<nav type="back" background-color="{{activeColor ? activeColor : '#ffffff'}}" title="我的收藏" frontColor="{{titleColor ? titleColor : '#000000'}}" />
+<view class="collect" wx:if="{{collectList && collectList.length > 0}}">
+    <block wx:for="{{collectList}}" wx:key="index">
+        <block wx:if="{{item.schemaName=='ShopGoods'}}">
+            <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" data-id="{{item.objectId}}" async-close bind:close="onClose">
+                <view bindtap="toDetail" data-item="{{item}}" class="collect_info">
+                    <view class="left_info">
+                        <image class="image" src="{{item.image}}" mode="aspectFill" lazy-load="false" />
+                    </view>
+                    <view class="right_info">
+                        <view class="title">{{item.name}}</view>
+                        <view class="desc">{{item.collectTarget[0].desc}}</view>
+                        <view class="down_info">
+                            <view class="price">¥{{item.collectTarget[0].price}}</view>
+                        </view>
+                    </view>
+                </view>
+                <view slot="right" class="delete">删除</view>
+            </van-swipe-cell>
+        </block>
+        <block wx:if="{{item.schemaName=='Lesson'}}">
+         
+            <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" data-id="{{item.objectId}}" async-close bind:close="onClose">
+                <view bindtap="lesson" data-item="{{item}}" class="box">
+                    <image class="image" src="{{item.image}}" mode="aspectFill" lazy-load="false" />
+                    <view class="right">
+                        <view class="title">{{item.name}}</view>
+                        <view class="time">{{item.collectTarget[0].desc}}</view>
+                        <view class="lecturer">{{item.collectTarget[0].teacher}}</view>
+                    </view>
+                </view>
+                <view slot="right" class="delete">删除</view>
+            </van-swipe-cell>
+        </block>
+    </block>
+</view>
+<van-empty image="https://file-cloud.fmode.cn/null_order.png" description="暂无收藏" wx:else />

+ 114 - 0
common-page/pages/collect/index.wxss

@@ -0,0 +1,114 @@
+/* nova-shop/pages/shopping-cart/index.wxss */
+page {
+  background: #f6f6f6;
+}
+.collect .collect_info {
+  width: 93%;
+  background: #ffffff;
+  border-radius: 12rpx;
+  margin: 20rpx auto;
+  display: flex;
+}
+.collect .collect_info .left_info {
+  width: 38%;
+  display: flex;
+  align-items: center;
+}
+.collect .collect_info .left_info .image {
+  width: 240rpx;
+  height: 240rpx;
+  border-radius: 16rpx;
+}
+.collect .collect_info .right_info {
+  width: 58%;
+}
+.collect .collect_info .right_info .title {
+  font-size: 28rpx;
+  margin: 20rpx 0;
+  font-weight: 700;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 1;
+}
+.collect .collect_info .right_info .desc {
+  font-size: 24rpx;
+  margin-bottom: 20rpx;
+  color: #c2c2c2;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+}
+.collect .collect_info .right_info .down_info {
+  padding: 16rpx 0;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.collect .collect_info .right_info .down_info .price {
+  font-size: 34rpx;
+  color: #fd3030;
+  font-weight: 700;
+}
+.collect .delete {
+  background: #e42929;
+  color: #fff;
+  height: 100%;
+  padding: 100rpx 34rpx;
+}
+.collect .bottom {
+  width: 100%;
+  height: 100rpx;
+}
+.collect .box {
+  width: 93%;
+  margin: 20rpx auto;
+  background: #ffffff;
+  display: flex;
+  border-radius: 20rpx;
+  position: relative;
+}
+.collect .box .image {
+  width: 240rpx;
+  height: 240rpx;
+  margin-right: 20rpx;
+  border-radius: 20rpx;
+}
+.collect .box .right {
+  width: 65%;
+}
+.collect .box .right .title {
+  margin-top: 20rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+}
+.collect .box .right .price {
+  color: red;
+  margin-top: 20rpx;
+}
+.collect .box .right .time {
+  color: #c1bcbc;
+  margin-top: 10rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+}
+.collect .box .right .lecturer {
+  font-size: 28rpx;
+  margin-top: 20rpx;
+}
+.collect .box .right .collection {
+  position: absolute;
+  right: 30rpx;
+  top: 160rpx;
+  padding: 10rpx 20rpx;
+  background: red;
+  color: #ffffff;
+  border-radius: 20rpx;
+}

+ 451 - 0
common-page/pages/daily-check/index.js

@@ -0,0 +1,451 @@
+//打卡日历页面
+const Parse = getApp().Parse;
+const dateF = require('../../../utils/date.js')
+const company = getApp().globalData.company;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        days: [], //存放一个月的天数数组
+        signUp: [], //用户判断当天是否已打卡  可废除下方模拟打卡数组直接采用此数组
+        //用于判断
+        cur_year: 0, //年
+        cur_month: 0, //月
+        count: 0, //累计打卡的数量
+        continuous_daka_count: 0, //连续打卡次数
+        task: null
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function (options) {
+        //获取当前年月  
+        const date = new Date();
+        let _cur_year = date.getFullYear();
+        let _cur_month = date.getMonth() + 1;
+        let _weeks_ch = ['日', '一', '二', '三', '四', '五', '六'];
+        this.setData({
+            cur_year: _cur_year,
+            cur_month: _cur_month,
+            weeks_ch: _weeks_ch,
+        })
+        await this.getTask(),//查询积分表赋值给credit
+            await this.calculateEmptyGrids(this.data.cur_year, this.data.cur_month); // 计算当月1号前空了几个格子,把它填充在days数组的前面
+        await this.calculateDays(this.data.cur_year, this.data.cur_month); // 绘制当月天数占的格子,并把它放到days数组中
+        await this.onGetSignUp();//获取当前用户当前任务的人签到状态
+    },
+    //查询积分表赋值给credit
+    async getTask() {
+        let Task = new Parse.Query('Task');
+        Task.equalTo('company', company);
+        Task.equalTo('isOpen', true);
+        Task.equalTo('taskType', 'daily-check');
+        let task = await Task.first();
+        if (task && task.id) {
+            let taskJSON = task.toJSON();
+            this.setData({
+                task: taskJSON
+            });
+            await this.setSignUp()
+        } else {
+            wx.showToast({
+                title: '未设置签到规则',
+                icon: 'none',
+
+            })
+            setTimeout(() => {
+                wx.navigateBack({
+                    delta: 1
+                });
+            }, 1500)
+
+        }
+    },
+
+    ///查询数据库签到了多少天 并复制给signUp数组
+    async setSignUp() {
+        let uid = Parse.User.current().id;
+        let TaskLog = new Parse.Query("TaskLog");
+        TaskLog.equalTo('company', company);
+        TaskLog.equalTo('user', uid);
+        TaskLog.equalTo('task', this.data.task.objectId);
+        let taskLog = await TaskLog.find();
+        let parsetsJSON = [];
+        if (taskLog && taskLog.length > 0) {
+            taskLog.forEach(parse => {
+                let b = parse.toJSON();
+                parsetsJSON.push(b);
+            })
+        }
+        console.log(parsetsJSON)
+        //这个用来装数据库的时间
+        let count = new Array();
+        for (let i = 0; i < taskLog.length; i++) {
+            let sum = "";
+            let dateSubString = "";
+            sum = parsetsJSON[i].updatedAt;
+            dateSubString = sum.substring(0, 10);
+            count.push(dateSubString)
+        }
+        this.setData({
+            signUp: count
+        })
+        this.onGetSignUp();
+    },
+
+    //获取当前用户该任务的签到数组
+    onGetSignUp: function () {
+        let that = this;
+        let _arr = [];
+        that.data.signUp.map(item => {
+            _arr.push(item);
+        })
+        that.setData({
+            count: _arr.length
+        });
+        //获取后就判断签到情况
+        that.onJudgeSign();//匹配判断当月与当月哪些日子签到打卡
+    },
+
+    //匹配判断当月与当月哪些日子签到打卡
+    onJudgeSign() {
+        let that = this;
+        let signs = that.data.signUp;
+        let daysArr = that.data.days;
+        for (let i = 0; i < signs.length; i++) {
+            let current = new Date(signs[i].replace(/-/g, "/"));
+            let year = current.getFullYear();
+            let month = current.getMonth() + 1;
+            let day = current.getDate();
+            day = parseInt(day);
+            for (let j = 0; j < daysArr.length; j++) {
+                //年月日相同并且已打卡
+                if (year == that.data.cur_year && month == that.data.cur_month && daysArr[j].date == day) {
+                    daysArr[j].isSign = true;
+                }
+            }
+        }
+        that.setData({
+            days: daysArr
+        });
+        that.onJudgeContinuousClock();
+    },
+
+    //判断连续打卡次数
+    onJudgeContinuousClock() {
+        let that = this;
+        let _count = 0;
+        let arr = that.data.signUp
+        // 再实际数据中,dateList 是不需要咱们手动排序的,我这边主要是用于测试,所以一些校验并未完善
+        arr = arr.sort((a, b) => {
+            return Date.parse(`${a.year}/${a.month}/${a.date}`) - Date.parse(`${b.year}/${b.month}/${b.date}`)
+        })
+        for (let i = 0; i < arr.length; i++) {
+            //把时间转换为时间戳
+            if (i != 0) {
+                var newDate_ = Date.parse(arr[i]); //当天
+                var theOriginalTime_ = Date.parse(arr[i - 1]);
+                //计算天
+                let _day = parseInt(newDate_ - theOriginalTime_) / (1000 * 60 * 60);
+                if (_day <= 24) {
+                    _count += 1;
+                } else {
+                    _count = 0;
+                }
+            }
+        }
+        that.setData({
+            continuous_daka_count: _count != 0 ? _count + 1 : 0,
+        })
+    },
+
+    //查询有没有签到
+    async onBindTap() {
+        //获取今天零点时间
+        let beforeDawn = new Date(new Date().toLocaleDateString()).getTime(); //获取当天凌晨的时间
+        let date = new Date(beforeDawn);
+        let uid = Parse.User.current().id;
+        let TaskLog = new Parse.Query('TaskLog');
+        TaskLog.equalTo('company', company);
+        TaskLog.equalTo('user', uid);
+        TaskLog.equalTo('task', this.data.task.objectId);
+        TaskLog.greaterThan('createdAt', date);
+        let taskLog = await TaskLog.first();
+        if (taskLog && taskLog.id) {
+            wx.showToast({
+                title: '今日已签到',
+                icon: 'none'
+            })
+            return
+        } else {
+            let DailyCheck = Parse.Object.extend('DailyCheck')
+            let dailyCheck = new DailyCheck()
+            dailyCheck.set("user", {
+                __type: "Pointer",
+                className: "_User",
+                objectId: uid
+            })
+            dailyCheck.set("company", {
+                __type: "Pointer",
+                className: "Company",
+                objectId: company
+            })
+            let check = await dailyCheck.save();
+            if (check && check.id) {
+                wx.showToast({
+                    title: '签到成功',
+                    icon: 'success'
+                })
+                this.setSignUp();
+                this.inCredit();
+            }
+        }
+    },
+
+    async check() {
+        let userid = Parse.User.current().id
+        let start = new Date(new Date(new Date().toLocaleDateString()).getTime())
+        let TaskLog = new Parse.Query('TaskLog')
+        TaskLog.equalTo('user', userid)
+        TaskLog.equalTo('task', this.data.task.objectId)
+        TaskLog.equalTo('company', company)
+        TaskLog.greaterThan('createdAt', start)
+        let log = await TaskLog.first()
+        if (log && log.id) {
+            return
+        } else {
+            let credit = this.data.task.credit ? this.data.task.credit : 1
+            let maxLength = this.data.task.increLength - 1
+            let increasing = this.data.task.increasing
+            if (increasing && !maxLength) {
+                credit = credit + (increasing * this.data.continuous_daka_count)
+            }
+            if (increasing && maxLength) {
+                if (this.data.continuous_daka_count < maxLength) {
+                    credit = credit + (increasing * this.data.continuous_daka_count)
+                } else {
+                    credit = credit + (increasing * maxLength)
+                }
+            }
+            this.createdLog(userid, this.data.task.objectId, credit)
+        }
+    },
+
+    async createdLog(uid, tid, credit) {
+        let TaskLog = Parse.Object.extend('TaskLog')
+        let tasklog = new TaskLog()
+        tasklog.set('user', {
+            __type: "Pointer",
+            className: '_User',
+            objectId: uid
+        })
+        tasklog.set('task', {
+            __type: "Pointer",
+            className: 'Task',
+            objectId: tid
+        })
+        tasklog.set('company', {
+            __type: "Pointer",
+            className: 'Company',
+            objectId: company
+        })
+        tasklog.set('isReceive', false)
+        tasklog.set('credit', credit)
+        await tasklog.save()
+        wx.showToast({
+            title: '签到成功',
+            icon: 'success'
+        })
+        await this.setSignUp()
+        await this.inCredit(credit)
+    },
+
+    //签到给用户添加5积分
+    async inCredit(credit) {
+        let uid = Parse.User.current().id
+        let Profile = new Parse.Query('Profile')
+        Profile.equalTo('user', uid)
+        Profile.equalTo('company', company)
+        let profile = await Profile.first()
+        let profileJSON = profile.toJSON()
+
+        let Account = new Parse.Query('Account')
+        Account.equalTo('company', company)
+        Account.equalTo('user', uid)
+        let account = await Account.first()
+        let accountJSON = account.toJSON()
+        let targetAccount = accountJSON.objectId
+
+        let AccountLog = Parse.Object.extend('AccountLog')
+        let accountLog = new AccountLog()
+        accountLog.set('assetCount', credit)
+        accountLog.set('targetAccount', { __type: 'Pointer', 'className': 'Account', objectId: targetAccount })
+        accountLog.set('company', { __type: 'Pointer', className: 'Company', objectId: company })
+        accountLog.set('fromAccountName', '南昌水业工会')
+        accountLog.set('assetType', 'credit')
+        if (credit == 1) {
+            accountLog.set('desc', '签到获得积分')
+        }
+        if (credit == 2) {
+            accountLog.set('desc', '连续签到2天获得积分')
+        }
+        if (credit >= 3) {
+            accountLog.set('desc', '连续签到3天获得积分')
+        }
+        accountLog.set('profile', { __type: 'Pointer', className: 'Profile', objectId: profileJSON.objectId })
+        accountLog.set('isVerified', false)
+        accountLog.save().then((res) => {
+            res.set('isVerified', true)
+            res.save()
+        })
+    },
+
+
+    // 获取当月共多少天
+    getThisMonthDays: function (year, month) {
+        return new Date(year, month, 0).getDate()
+    },
+
+    // 获取当月第一天星期几
+    getFirstDayOfWeek: function (year, month) {
+        return new Date(Date.UTC(year, month - 1, 1)).getDay();
+    },
+
+    // 计算当月1号前空了几个格子,把它填充在days数组的前面
+    calculateEmptyGrids: function (year, month) {
+        let that = this;
+        //计算每个月时要清零
+        that.setData({
+            days: [],
+        });
+        const firstDayOfWeek = this.getFirstDayOfWeek(year, month);
+        if (firstDayOfWeek > 0) {
+            for (let i = 0; i < firstDayOfWeek; i++) {
+                let obj = {
+                    date: null,
+                    isSign: false //拒绝
+                }
+                that.data.days.push(obj);
+            }
+            this.setData({
+                days: that.data.days,
+            });
+            //清空
+        } else {
+            this.setData({
+                days: []
+            });
+        }
+    },
+
+
+    // 绘制当月天数占的格子,并把它放到days数组中
+    calculateDays: function (year, month) {
+        let that = this;
+        const thisMonthDays = this.getThisMonthDays(year, month);
+        for (let i = 1; i <= thisMonthDays; i++) {
+            let obj = {
+                date: i,
+                isSign: false
+            }
+            that.data.days.push(obj);
+        }
+        this.setData({
+            days: that.data.days
+        });
+
+    },
+
+    // 切换控制年月,上一个月,下一个月
+    handleCalendar: function (e) {
+        let that = this;
+        const handle = e.currentTarget.dataset.handle;
+        const cur_year = that.data.cur_year;
+        const cur_month = that.data.cur_month;
+
+        if (handle === 'prev') {
+            let newMonth = cur_month - 1;
+            let newYear = cur_year;
+            if (newMonth < 1) {
+                newYear = cur_year - 1;
+                newMonth = 12;
+            }
+            this.setData({
+                cur_year: newYear,
+                cur_month: newMonth
+            })
+            this.calculateEmptyGrids(newYear, newMonth);
+            this.calculateDays(newYear, newMonth);
+            this.onGetSignUp();
+        } else {
+
+            let newMonth = cur_month + 1;
+            let newYear = cur_year;
+            if (newMonth > 12) {
+                newYear = cur_year + 1;
+                newMonth = 1;
+            }
+            this.setData({
+                cur_year: newYear,
+                cur_month: newMonth
+            })
+
+            this.calculateEmptyGrids(newYear, newMonth);
+            this.calculateDays(newYear, newMonth);
+            this.onGetSignUp();
+        }
+    },
+
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function (options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+})

+ 5 - 0
common-page/pages/daily-check/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+      "van-button": "@vant/weapp/button/index"
+  }
+}

+ 136 - 0
common-page/pages/daily-check/index.less

@@ -0,0 +1,136 @@
+page{
+  background-color: #F4F4F4;
+}
+.continuouspunching_style::before{
+  content: "";
+  display: block;
+  padding-top: 100%;
+}
+.continuouspunching_style{
+    background-image: url('https://i.loli.net/2019/10/18/C9cPfSnrMUmqxz8.png');
+    width: 100%;
+    background-size: 100% auto;
+    margin-top: -130rpx;
+    .clockfrequency_view_style{
+        padding-top: 100rpx;
+        width: 77%;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        text-align: center;
+        position: absolute;
+        top: 30rpx;
+        left: 95rpx;
+        .daka_info {
+            color: white;
+            line-height: 65rpx;
+            letter-spacing: 5rpx;
+            .daka_tiansu {
+                .daka_number_style{
+                    font-size: 60rpx;
+                }
+            }
+            .daka_jiesao {
+                opacity: 0.8;
+                font-size: 30rpx;
+            }
+        }
+    }
+
+    .all{
+        position: absolute;
+        top: 280rpx;
+        left: 30rpx;
+        width: 92%;
+        box-shadow:0 5px 8px -1px rgba(175, 171, 171, 0.2);
+        padding-top: 20rpx;
+        border-radius: 20rpx;
+        background-color: white;
+        .bar {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            padding: 10rpx;
+            .date {
+                display: flex;
+                justify-content: flex-start;
+                align-items: center;
+                font-size: 38rpx;
+                font-weight: 500;
+                color:rgba(51,51,51,1);
+                margin: 0px auto;
+                .sanjiao {
+                    width: 0;
+                    height: 0;
+                    border-top: 9px solid transparent;
+                    border-right:  12px solid #2681FF;
+                    border-bottom:  9px solid transparent;
+                    margin-right: 20rpx;
+                }
+                .you_sanjiao {
+                    width: 0;
+                    height: 0;
+                    border-top: 9px solid transparent;
+                    border-left:  12px solid #ccc;
+                    border-bottom:  9px solid transparent;
+                    margin-left: 20rpx;
+                }
+            }
+        }
+        .week {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            padding: 20rpx;
+            padding-left: 40rpx;
+            padding-right: 40rpx;
+            border-radius: 10px;
+            color: #2681FF;
+            margin: 20rpx;
+            font-size: 30rpx;
+        }
+        .days {
+            margin: 20rpx;
+            padding: 10rpx;
+            border-radius: 10px;
+            font-size: 30rpx;
+            .columns {
+                display: flex;
+                flex-direction: column;
+                justify-content: space-between; 
+                .rows {
+                    display: flex;
+                    flex-direction: row;
+                    justify-content: space-between;
+                    .cell {
+                        width: 84rpx;
+                        height: 88rpx;
+                        margin: 3rpx;
+                        text-align: center;
+                        border-radius: 50%;
+                        display: flex;
+                        flex-direction: column;
+                        justify-content: center;
+                    }
+                }
+            }
+        }
+    }
+    .credit {
+        width: 100%;
+        display: flex;
+        justify-content: center;
+        position: absolute;
+        top: 84%;
+        font-weight: 700;
+    }
+    .mxc2-1 {
+        position: absolute;
+        top: 89%;
+        left: 50%;
+        margin-left: -315rpx;
+        width: 80%;
+    }
+}
+
+

+ 69 - 0
common-page/pages/daily-check/index.wxml

@@ -0,0 +1,69 @@
+<!-- 打卡日历页面 -->
+<nav title="签到中心" type="back" background-color="#2681ff"></nav>
+<view class="continuouspunching_style">
+    <!-- 累计打卡次数 -->
+    <view class="clockfrequency_view_style">
+        <view class="daka_info">
+            <view class="daka_tiansu">
+                <text class="daka_number_style">{{count}}</text>
+                天
+            </view>
+            <view class="daka_jiesao">累计打卡</view>
+        </view>
+        <view class="daka_info">
+            <view class="daka_tiansu">
+                <text class="daka_number_style">{{continuous_daka_count}}</text>
+                天
+            </view>
+            <view class="daka_jiesao">连续打卡</view>
+        </view>
+    </view>
+
+
+    <!-- 累计打卡次数end -->
+    <!-- 日历 -->
+    <view class='all'>
+        <view class="bar">
+            <!-- 显示年月 -->
+            <view class="date">
+                <view class="sanjiao" bindtap="handleCalendar" data-handle="prev"></view>
+                {{cur_year || "--"}} 年 {{cur_month || "--"}} 月
+                <view class="you_sanjiao" bindtap="handleCalendar" data-handle="next"></view>
+            </view>
+        </view>
+        <!-- 显示星期 -->
+        <view class="week">
+            <view wx:for="{{weeks_ch}}" wx:key="index" data-idx="{{index}}">{{item}}</view>
+        </view>
+        <view class='days'>
+            <!-- 列 -->
+            <view class="columns" wx:for="{{days.length/7}}" wx:for-index="i" wx:key="i">
+                <view wx:for="{{days}}" wx:for-index="j" wx:key="j">
+                    <!-- 行 -->
+                    <view class="rows" wx:if="{{j/7 == i}}">
+                        <view class="rows" wx:for="{{7}}" wx:for-index="k" wx:key="k">
+                            <!-- 每个月份的空的单元格 -->
+                            <view class='cell' wx:if="{{days[j+k].date == null}}">
+                                <text decode="{{true}}">&nbsp;&nbsp;</text>
+                            </view>
+                            <!-- 每个月份的有数字的单元格 -->
+                            <view class='cell' wx:else>
+                                <!-- 当前日期已签到 -->
+                                <view wx:if="{{days[j+k].isSign == true}}" style='background-color:#2681FF;  color: white;' class='cell'>
+                                    <text>{{days[j+k].date}}</text>
+                                </view>
+                                <!-- 当前日期未签到 -->
+                                <view wx:else>
+                                    <text>{{days[j+k].date}}</text>
+                                </view>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+            </view>
+        </view>
+    </view>
+    <view class="credit">{{task.desc}}</view>
+    <van-button  custom-class="mxc2-1"  color="#2681ff"  round type="primary" size="large"  bind:click="check">每日签到</van-button>
+</view>
+

+ 131 - 0
common-page/pages/daily-check/index.wxss

@@ -0,0 +1,131 @@
+page {
+  background-color: #F4F4F4;
+}
+.continuouspunching_style::before {
+  content: "";
+  display: block;
+  padding-top: 100%;
+}
+.continuouspunching_style {
+  background-image: url('https://i.loli.net/2019/10/18/C9cPfSnrMUmqxz8.png');
+  width: 100%;
+  background-size: 100% auto;
+  margin-top: -130rpx;
+}
+.continuouspunching_style .clockfrequency_view_style {
+  padding-top: 100rpx;
+  width: 77%;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  text-align: center;
+  position: absolute;
+  top: 30rpx;
+  left: 95rpx;
+}
+.continuouspunching_style .clockfrequency_view_style .daka_info {
+  color: white;
+  line-height: 65rpx;
+  letter-spacing: 5rpx;
+}
+.continuouspunching_style .clockfrequency_view_style .daka_info .daka_tiansu .daka_number_style {
+  font-size: 60rpx;
+}
+.continuouspunching_style .clockfrequency_view_style .daka_info .daka_jiesao {
+  opacity: 0.8;
+  font-size: 30rpx;
+}
+.continuouspunching_style .all {
+  position: absolute;
+  top: 280rpx;
+  left: 30rpx;
+  width: 92%;
+  box-shadow: 0 5px 8px -1px rgba(175, 171, 171, 0.2);
+  padding-top: 20rpx;
+  border-radius: 20rpx;
+  background-color: white;
+}
+.continuouspunching_style .all .bar {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  padding: 10rpx;
+}
+.continuouspunching_style .all .bar .date {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-size: 38rpx;
+  font-weight: 500;
+  color: #333333;
+  margin: 0px auto;
+}
+.continuouspunching_style .all .bar .date .sanjiao {
+  width: 0;
+  height: 0;
+  border-top: 9px solid transparent;
+  border-right: 12px solid #2681FF;
+  border-bottom: 9px solid transparent;
+  margin-right: 20rpx;
+}
+.continuouspunching_style .all .bar .date .you_sanjiao {
+  width: 0;
+  height: 0;
+  border-top: 9px solid transparent;
+  border-left: 12px solid #ccc;
+  border-bottom: 9px solid transparent;
+  margin-left: 20rpx;
+}
+.continuouspunching_style .all .week {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  padding: 20rpx;
+  padding-left: 40rpx;
+  padding-right: 40rpx;
+  border-radius: 10px;
+  color: #2681FF;
+  margin: 20rpx;
+  font-size: 30rpx;
+}
+.continuouspunching_style .all .days {
+  margin: 20rpx;
+  padding: 10rpx;
+  border-radius: 10px;
+  font-size: 30rpx;
+}
+.continuouspunching_style .all .days .columns {
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+}
+.continuouspunching_style .all .days .columns .rows {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+}
+.continuouspunching_style .all .days .columns .rows .cell {
+  width: 84rpx;
+  height: 88rpx;
+  margin: 3rpx;
+  text-align: center;
+  border-radius: 50%;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+.continuouspunching_style .credit {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  position: absolute;
+  top: 84%;
+  font-weight: 700;
+}
+.continuouspunching_style .mxc2-1 {
+  position: absolute;
+  top: 89%;
+  left: 50%;
+  margin-left: -315rpx;
+  width: 80%;
+}

+ 184 - 0
common-page/pages/footprint/index.js

@@ -0,0 +1,184 @@
+const Parse = getApp().Parse;
+const company = getApp().globalData.company
+const dateF = require('../../../utils/date')
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        list: null
+    },
+    async getBehaviorLog(id) {
+        let BehaviorLog = new Parse.Query('BehaviorLog')
+        BehaviorLog.equalTo('company', company)
+        BehaviorLog.equalTo('user', id)
+        BehaviorLog.descending('createdAt')
+        BehaviorLog.include('targetObject')
+        let behaviorLog = await BehaviorLog.find()
+        let listJSON = []
+        if (behaviorLog && behaviorLog.length > 0) {
+            behaviorLog.forEach(behaviorLog => {
+                let b = behaviorLog.toJSON()
+                b.joinTime = dateF.formatTime("YYYY-mm-dd HH:MM:SS", b.createdAt)
+                listJSON.push(b)
+            })
+            this.setData({ list: listJSON })
+        }
+        console.log(this.data.list);
+    },
+    lesson(e) {
+        let id = e.currentTarget.dataset.item.targetObject[0].objectId
+        console.log(id);
+        wx.navigateTo({
+            url: '/nova-lesson/pages/lesson-detail/lesson-detail?id=' + id
+        })
+
+    },
+
+    goods(e) {
+        let id = e.currentTarget.dataset.item.targetObject[0].objectId
+        console.log(id);
+        wx.navigateTo({
+
+            url: '/nova-shop/pages/shop-goods/goods-detail/index?id=' + id
+        })
+
+    },
+    async collection(e) {
+        console.log(e.currentTarget.dataset.item);
+        // if (schemaName == "ShopGoods") {
+        //     let name = e.currentTarget.dataset.item.targetObject[0].name
+        // }
+        // if (schemaName == "Lesson") {
+        //     let name = e.currentTarget.dataset.item.targetObject[0].title
+        // }
+        let collectId = e.currentTarget.dataset.item.targetObject[0].objectId
+        let schemaName = e.currentTarget.dataset.item.targetClassName
+        let image = e.currentTarget.dataset.item.targetObject[0].image
+        console.log(collectId, schemaName, image);
+        let Collecti = new Parse.Query('Collect')
+        Collecti.equalTo('company', company)
+        Collecti.equalTo('user', Parse.User.current().id)
+        Collecti.equalTo('collectId', collectId)
+        let res = await Collecti.first()
+        if (res && res.id) {
+            wx.showToast({
+                title: '您已收藏该课程',
+                icon: 'none'
+            })
+            return
+        }
+        let collect
+        let Collect = Parse.Object.extend("Collect")
+        collect = new Collect()
+        collect.set("company", {
+            __type: "Pointer",
+            className: "Company",
+            objectId: company
+        })
+        collect.set("user", {
+            __type: "Pointer",
+            className: "_User",
+            objectId: Parse.User.current().id
+        })
+        if (schemaName == "ShopGoods") {
+            collect.set("collectTarget", [{
+                __type: "Pointer",
+                className: "ShopGoods",
+                objectId: collectId
+            }])
+            collect.set("name", e.currentTarget.dataset.item.targetObject[0].name)
+            collect.set("type", "goods")
+        }
+        if (schemaName == "Lesson") {
+            collect.set("collectTarget", [{
+                __type: "Pointer",
+                className: "Lesson",
+                objectId: collectId
+            }])
+            collect.set("name", e.currentTarget.dataset.item.targetObject[0].title)
+            collect.set("type", "lesson")
+        }
+        // if (schemaName == "Lesson") {
+        //     collect.set("collectTarget", [{
+        //         __type: "Pointer",
+        //         className: "Lesson",
+        //         objectId: collectId
+        //     }])
+        // }
+        collect.set("collectId", collectId)
+        collect.set("schemaName", schemaName)
+        collect.set("image", image)
+
+        collect.save().then(a => {
+            console.log(a)
+
+            wx.showToast({
+
+                title: '收藏成功',
+                icon: 'none'
+            })
+
+
+        })
+
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function(options) {
+        let id = Parse.User.current().id
+        console.log(id);
+        this.getBehaviorLog(id)
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function() {
+
+    }
+})

+ 3 - 0
common-page/pages/footprint/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 55 - 0
common-page/pages/footprint/index.less

@@ -0,0 +1,55 @@
+page {
+    background: #f6f6f6;
+}
+
+.box {
+    margin: 20rpx;
+    background: #ffffff;
+    display: flex;
+    border-radius: 20rpx;
+    padding: 20rpx;
+
+    .image {
+        width: 150rpx;
+        height: 150rpx;
+        margin-right: 20rpx;
+        border-radius: 20rpx;
+    }
+
+    .right {
+        width: 75%;
+        position: relative;
+        .title {
+            overflow: hidden; //一定要写
+            text-overflow: ellipsis; //超出省略号
+            display: -webkit-box; //一定要写
+            -webkit-line-clamp: 1; //控制行数
+            -webkit-box-orient: vertical; //一定要写
+        
+        }
+        .price {
+            color: red;
+            margin-top: 20rpx;
+        }
+
+        .time {
+            color: #c1bcbc;
+            margin-top: 10rpx;
+        }
+
+        .lecturer {
+            font-size: 28rpx;
+            margin-top: 20rpx;
+        }
+        .collection {
+            position: absolute;
+            right: 20rpx;
+            top: 40rpx;
+            padding: 10rpx 20rpx;
+            background: #309b9e;
+            color: #ffffff;
+            border-radius: 20rpx;
+        }
+    }
+
+}

+ 25 - 0
common-page/pages/footprint/index.wxml

@@ -0,0 +1,25 @@
+<nav type="back" background-color="#ffffff" frontColor="{{titleColor ? titleColor : '#ffffff'}}" backgroundColor="{{activeColor ? activeColor : '#279a9e'}}" title="我的足迹"></nav>
+<block wx:for="{{list}}" wx:key="index">
+    <block wx:if="{{item.targetClassName=='ShopGoods'}}">
+        <view class="box" bindtap="goods" data-item="{{item}}">
+            <image class="image" src="{{item.targetObject[0].image}}" />
+            <view class="right">
+                <view class="title">{{item.targetObject[0].name}}</view>
+                <view class="price">¥{{item.targetObject[0].price}}</view>
+                <view class="time">{{item.joinTime}}</view>
+                <view class="collection" catchtap="collection" data-item="{{item}}">收藏</view>
+            </view>
+        </view>
+    </block>
+    <block wx:if="{{item.targetClassName=='Lesson'}}">
+        <view class="box" bindtap="lesson" data-item="{{item}}">
+            <image class="image" src="{{item.targetObject[0].image}}" />
+            <view class="right">
+                <view class="title">{{item.targetObject[0].title}}</view>
+                <view class="lecturer">{{item.targetObject[0].teacher}}</view>
+                <view class="time">{{item.joinTime}}</view>
+                <view class="collection" catchtap="collection" data-item="{{item}}">收藏</view>
+            </view>
+        </view>
+    </block>
+</block>

+ 48 - 0
common-page/pages/footprint/index.wxss

@@ -0,0 +1,48 @@
+page {
+  background: #f6f6f6;
+}
+.box {
+  margin: 20rpx;
+  background: #ffffff;
+  display: flex;
+  border-radius: 20rpx;
+  padding: 20rpx;
+}
+.box .image {
+  width: 150rpx;
+  height: 150rpx;
+  margin-right: 20rpx;
+  border-radius: 20rpx;
+}
+.box .right {
+  width: 75%;
+  position: relative;
+}
+.box .right .title {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+}
+.box .right .price {
+  color: red;
+  margin-top: 20rpx;
+}
+.box .right .time {
+  color: #c1bcbc;
+  margin-top: 10rpx;
+}
+.box .right .lecturer {
+  font-size: 28rpx;
+  margin-top: 20rpx;
+}
+.box .right .collection {
+  position: absolute;
+  right: 20rpx;
+  top: 40rpx;
+  padding: 10rpx 20rpx;
+  background: #309b9e;
+  color: #ffffff;
+  border-radius: 20rpx;
+}

+ 90 - 0
common-page/pages/index/index.js

@@ -0,0 +1,90 @@
+// nova-shop/pages/home/home.js
+const Parse = getApp().Parse;
+var util = require("../../../utils/util");
+Page({
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        tabbarList: [],
+        activeTab: 0,
+        page: null,
+        options: null
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function (options) {
+        console.log(options)
+        await this.getDiyPage(options.id);
+        this.setData({
+            options: options
+        })
+        
+    },
+
+    // 加载页面数据
+    async getDiyPage(id) {
+        let query = new Parse.Query("DiyPage");
+        let page = await query.get(id);
+        console.log(page);
+        this.setData({ page: page.toJSON() })
+    },
+
+    
+
+
+
+
+
+    
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 7 - 0
common-page/pages/index/index.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+    "van-tabbar": "@vant/weapp/tabbar/index",
+    "van-tabbar-item": "@vant/weapp/tabbar-item/index",
+    "nova-diypage" : "../../../components/diypage/diypage"
+  }
+}

+ 9 - 0
common-page/pages/index/index.wxml

@@ -0,0 +1,9 @@
+<nav type="back" frontColor="#fff" background-color="#009de1"></nav>
+  <view>
+    <block wx:if="{{options}}">
+      <nova-diypage  options="{{options}}" activeColor="{{activeColor ? activeColor : '#009de1'}}"></nova-diypage>
+    </block>
+  </view>
+
+
+

+ 5 - 0
common-page/pages/index/index.wxss

@@ -0,0 +1,5 @@
+/* nova-shop/pages/home/home.wxss */
+.indexPage {
+    padding: 0 0 180rpx 0;
+}
+ 

+ 184 - 0
common-page/pages/info/bindBank/index.js

@@ -0,0 +1,184 @@
+
+const Parse = getApp().Parse;
+const company = getApp().globalData.company
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    show: false,
+    cardList:[],
+    name:'',
+    cardId:'',
+    bankName:'',
+    objectId:'',
+    activeColor: getApp().globalData.activeColor,
+    titleColor: getApp().globalData.titleColor
+  },
+
+  onClickShow() {
+    this.setData({ show: true });
+  },
+
+  onClickHide() {
+    this.setData({ show: false });
+  },
+  delete(e){
+    let cardList = this.data.cardList
+    cardList.splice(e.currentTarget.dataset.index,1)
+    
+    let Account = Parse.Object.extend("Account")
+    let account = new Account()
+    account.id = this.data.objectId
+    if((cardList && cardList.length == 0) || !cardList) {
+      account.set("bank",null)
+    }else {
+      account.set("bank",cardList)
+    }
+    account.save().then(res=>{
+      wx.showToast({
+        title: '删除银行卡成功',
+        icon: 'succee',
+        duration: 2000
+      })
+      this.getCardList()
+    })
+  },
+  submit(){
+    const _this = this
+    let reg = /[\u4e00-\u9fa5]/
+    let name = this.data.name
+    let bankName = this.data.bankName
+    let cardId = this.data.cardId
+    if(!this.data.name || !this.data.cardId || !this.data.bankName){
+      wx.showToast({
+        title: '请填写完整信息',
+        icon: 'none',
+        duration: 2000
+      })
+      return
+    }
+    if(!reg.test(name)){
+      wx.showToast({
+        title: '请输入您的真实姓名',
+        icon: 'none',
+        duration: 2000
+      })
+      return
+    }
+   
+    let regExp = /^([1-9]{1})(\d{15}|\d{16}|\d{18})$/;
+    if(!regExp.test(cardId)){
+      wx.showToast({
+        title: '请输入正确的银行卡号',
+        icon: 'none',
+        duration: 2000
+      })
+      return
+    }
+    if(!reg.test(bankName)){
+      wx.showToast({
+        title: '请输入正确的开卡行',
+        icon: 'none',
+        duration: 2000
+      })
+      return
+    }
+    let Account = Parse.Object.extend("Account")
+    let account = new Account()
+    account.id = this.data.objectId
+    account.addUnique("bank",{
+      name,
+      cardId,
+      bankName
+    })
+    account.save().then(res=>{
+      console.log(res)
+      wx.showToast({
+        title: '添加银行卡成功',
+        icon: 'succee',
+        duration: 2000
+      })
+      this.onClickHide()
+      this.getCardList()
+      this.setData({
+        name:null,
+        cardId: null,
+        bankName:null
+      })
+    })
+  },
+  getCardList(){
+    let Account = new Parse.Query("Account")
+    Account.equalTo("user",Parse.User.current().id)
+    Account.equalTo("company",company)
+    Account.first().then(res=>{
+      let account = res.toJSON()
+      this.setData({
+        cardList:account.bank ? account.bank : [] ,
+        objectId:account.objectId
+      })
+      
+    })
+  },
+  bindKeyInput(e){
+      this.setData({
+        [e.currentTarget.dataset.prop]: e.detail.value
+      })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.getCardList()
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 7 - 0
common-page/pages/info/bindBank/index.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+    "van-picker": "@vant/weapp/picker/index",
+    "van-icon": "@vant/weapp/icon/index",
+    "van-overlay": "@vant/weapp/overlay/index"
+  }
+}

+ 112 - 0
common-page/pages/info/bindBank/index.less

@@ -0,0 +1,112 @@
+/* nova-travel/page/vip-info/real-name/real-name.wxss */
+.real_name_wrap{
+    
+    .card{
+        width: 100%;
+        background-color: #fff;
+        // margin-top: 50rpx;
+        .title{
+            width: 100%;
+            height: 90rpx;
+            padding-left: 20rpx;
+            font-size: 36rpx;
+            font-weight: 600;
+            display: flex;
+            align-items: center;
+        }
+        .real_name{
+            width: 90%;
+            height: 250rpx;
+            background-color: #4079d3;
+            padding: 20rpx;
+            border-radius: 20rpx;
+            margin: 30rpx auto;
+            position: relative;
+            .name{
+                height: 100rpx;
+                font-size: 34rpx;
+                font-weight: 800;
+                color: #fff;
+                display: flex;
+                align-items: center;
+            }
+            .number{
+                font-size: 46rpx;
+                font-weight: 800;
+                color: #fff;
+                display: flex;
+                align-items: center;
+                letter-spacing: 6rpx;
+                // justify-content: flex-end;
+            }
+        }
+        .add{
+            width: 90%;
+            height: 90rpx;
+            line-height: 90rpx;
+            background-color: #3476fe;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            margin: 20rpx auto;
+            border-radius: 15rpx;
+            text{
+                color: #fff;
+                font-size: 32rpx;
+                font-weight: 600;
+                padding-left: 15rpx;
+            }
+        }
+    }
+}
+
+.wrapper {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    height: 100%;
+  }
+  
+  .block {
+    width: 600rpx;
+    height: 700rpx;
+    background-color: #fff;
+    border-radius: 30rpx;
+    .bank{
+        width: 100%;
+        .title{
+            width: 100%;
+            height: 90rpx;
+            font-size: 32rpx;
+            font-weight: 600;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+        }
+        .box{
+            width: 95%;
+            height: 90rpx;
+            display: flex;
+            align-items: center;
+            background-color: #fff;
+            padding:0 20rpx;
+            border: 1px solid #b3dbec;
+            margin-top: 20rpx;
+            margin: 20rpx auto;
+            text{
+                font-size: 28rpx;
+                font-weight: 600;
+                padding-right: 20rpx;
+            }
+        }
+        button{
+            width: 95%;
+            height: 80rpx;
+            line-height: 80rpx;
+            background-color: #3476fe;
+            color: #fff;
+            font-weight: 28rpx;
+            margin-top: 30rpx;
+        }
+    }
+  }

+ 50 - 0
common-page/pages/info/bindBank/index.wxml

@@ -0,0 +1,50 @@
+<!--nova-travel/page/vip-info/real-name/real-name.wxml-->
+<nav type="back" title="银行卡" background-color="{{activeColor ? activeColor : '#ffffff'}}"  frontColor="{{titleColor ? titleColor : 'black'}}"></nav>
+<view class="real_name_wrap">
+  <view class="card">
+    <view class="title">我的卡</view>
+    <block wx:for="{{cardList}}" wx:key="index">
+      <!-- 银行卡 -->
+      <view class="real_name">
+        <view class="name">{{item.bankName}}</view>
+        <view class="number" wx:if="{{item.cardId.length == 16}}">**** **** **** {{item.cardId[12]}}{{item.cardId[13]}}{{item.cardId[14]}}{{item.cardId[15]}}</view>
+        <view class="number" wx:if="{{item.cardId.length == 17}}">**** **** **** {{item.cardId[13]}}{{item.cardId[14]}}{{item.cardId[15]}}{{item.cardId[16]}}</view>
+        <view class="number" wx:if="{{item.cardId.length == 18}}">**** **** **** {{item.cardId[14]}}{{item.cardId[15]}}{{item.cardId[16]}}{{item.cardId[17]}}</view>
+        <view class="number" wx:if="{{item.cardId.length == 19}}">**** **** **** {{item.cardId[15]}}{{item.cardId[16]}}{{item.cardId[17]}}{{item.cardId[18]}}</view>
+        <van-icon bind:tap="delete" data-index="{{index}}" name="delete" size="40rpx" color="#fbf9f8" style="position:absolute;right:30rpx;top:30rpx;"/>
+      </view>
+    </block>
+    <view class="add" bindtap="onClickShow"style="background-color: {{activeColor ? activeColor : '#00c2cb'}};color:{{titleColor?titleColor:'ffffff'}}">
+      <van-icon name="add-o" color="{{titleColor?titleColor:'ffffff'}}" size="40rpx"/>
+      <text style="background-color: {{activeColor ? activeColor : '#00c2cb'}};color:{{titleColor?titleColor:'ffffff'}}">添加银行卡</text>
+    </view>
+  </view>
+</view>
+
+<!-- 遮罩层 -->
+<van-overlay show="{{ show }}" bind:click="onClickHide">
+  <view class="wrapper" >
+    <view class="block">
+       <!-- 添加银行卡 -->
+      <view class="bank" catch:tap="noop">
+        <view class="title">添加银行卡</view>
+        <!-- 姓名 -->
+        <view class="box">
+          <text>持卡人</text>
+          <input class="weui-input" bindinput="bindKeyInput" data-prop="name" value="{{name}}" placeholder="持卡人姓名"/>
+        </view>
+        <!-- 卡号 -->
+        <view class="box">
+          <text>卡 号</text>
+          <input class="weui-input" bindinput="bindKeyInput" data-prop="cardId" value="{{cardId}}" type="number" placeholder="持卡人姓名"/>
+        </view>
+        <!-- 开户行 -->
+        <view class="box">
+          <text>开卡行</text>
+          <input class="weui-input" bindinput="bindKeyInput" data-prop="bankName" value="{{bankName}}" placeholder="例 中国银行"/>
+        </view>
+        <button bind:tap="submit" style="background-color: {{activeColor ? activeColor : '#00c2cb'}};color:{{titleColor?titleColor:'ffffff'}}">提 交</button>
+      </view>
+    </view>
+  </view>
+</van-overlay>

+ 105 - 0
common-page/pages/info/bindBank/index.wxss

@@ -0,0 +1,105 @@
+/* nova-travel/page/vip-info/real-name/real-name.wxss */
+.real_name_wrap .card {
+  width: 100%;
+  background-color: #fff;
+}
+.real_name_wrap .card .title {
+  width: 100%;
+  height: 90rpx;
+  padding-left: 20rpx;
+  font-size: 36rpx;
+  font-weight: 600;
+  display: flex;
+  align-items: center;
+}
+.real_name_wrap .card .real_name {
+  width: 90%;
+  height: 250rpx;
+  background-color: #4079d3;
+  padding: 20rpx;
+  border-radius: 20rpx;
+  margin: 30rpx auto;
+  position: relative;
+}
+.real_name_wrap .card .real_name .name {
+  height: 100rpx;
+  font-size: 34rpx;
+  font-weight: 800;
+  color: #fff;
+  display: flex;
+  align-items: center;
+}
+.real_name_wrap .card .real_name .number {
+  font-size: 46rpx;
+  font-weight: 800;
+  color: #fff;
+  display: flex;
+  align-items: center;
+  letter-spacing: 6rpx;
+}
+.real_name_wrap .card .add {
+  width: 90%;
+  height: 90rpx;
+  line-height: 90rpx;
+  background-color: #3476fe;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin: 20rpx auto;
+  border-radius: 15rpx;
+}
+.real_name_wrap .card .add text {
+  color: #fff;
+  font-size: 32rpx;
+  font-weight: 600;
+  padding-left: 15rpx;
+}
+.wrapper {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 100%;
+}
+.block {
+  width: 600rpx;
+  height: 700rpx;
+  background-color: #fff;
+  border-radius: 30rpx;
+}
+.block .bank {
+  width: 100%;
+}
+.block .bank .title {
+  width: 100%;
+  height: 90rpx;
+  font-size: 32rpx;
+  font-weight: 600;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.block .bank .box {
+  width: 95%;
+  height: 90rpx;
+  display: flex;
+  align-items: center;
+  background-color: #fff;
+  padding: 0 20rpx;
+  border: 1px solid #b3dbec;
+  margin-top: 20rpx;
+  margin: 20rpx auto;
+}
+.block .bank .box text {
+  font-size: 28rpx;
+  font-weight: 600;
+  padding-right: 20rpx;
+}
+.block .bank button {
+  width: 95%;
+  height: 80rpx;
+  line-height: 80rpx;
+  background-color: #3476fe;
+  color: #fff;
+  font-weight: 28rpx;
+  margin-top: 30rpx;
+}

+ 150 - 0
common-page/pages/info/bindWechat/index.js

@@ -0,0 +1,150 @@
+const Parse = getApp().Parse;
+const company = getApp().globalData.company
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        hasInfo: false,
+        name: '',
+        accountId: ''
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        console.log(options)
+        this.setData({
+            way: options.way
+        })
+        this.getAuthInfo(options.way)
+    },
+    bindKeyInput(e) {
+        this.setData({
+            [e.currentTarget.dataset.prop]: e.detail.value
+        })
+    },
+    getAuthInfo(type) {
+        const _this = this
+        let account = new Parse.Query("Account")
+        account.equalTo("user", Parse.User.current().id)
+        account.first().then(res => {
+            console.log(res)
+            let info = res.toJSON()
+            console.log(type, info)
+            if (type == 'alipay' && info.ali) {
+                console.log(222)
+                _this.setData({
+                    name: info.ali.name,
+                    accountId: info.ali.accountId,
+                    hasInfo: true
+                })
+            }
+            if (type == 'wechat' && info.wechat) {
+                _this.setData({
+                    name: info.wechat.name,
+                    accountId: info.wechat.accountId,
+                    hasInfo: true
+                })
+            }
+            _this.setData({
+                account: res.id
+            })
+        })
+    },
+    submit() {
+        const _this = this
+        if (!this.data.name || !this.data.accountId) {
+            wx.showToast({
+                icon: 'none',
+                title: '请填写完整信息',
+                duration: 2000
+            })
+            return
+        }
+        try {
+            let Account = Parse.Object.extend("Account")
+            let account = new Account()
+            account.id = this.data.account
+            this.data.way == 'alipay' ? account.set('ali', {
+                name: _this.data.name,
+                accountId: _this.data.accountId
+            }) : account.set('wechat', {
+                name: _this.data.name,
+                accountId: _this.data.accountId
+            })
+            account.save().then(res => {
+                wx.showToast({
+                    icon: 'none',
+                    title: '保存成功',
+                    duration: 2000
+                })
+                _this.setData({
+                    hasInfo: true
+                })
+            })
+        } catch (error) {
+            console.log(error)
+            wx.showToast({
+                icon: 'none',
+                title: '保存失败',
+                duration: 2000
+            })
+        }
+    },
+    change() {
+        this.setData({
+            hasInfo: false
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
common-page/pages/info/bindWechat/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 90 - 0
common-page/pages/info/bindWechat/index.less

@@ -0,0 +1,90 @@
+.navbar {
+    width: 100vw;
+    background-color: #f6f5fa;
+    position: fixed;
+    top: 0px;
+    z-index: 991;
+  }
+  
+  .title-container {
+    height: 44px;
+    display: flex;
+    align-items: center;
+    position: relative;
+  }
+  .capsule {
+    margin-left: 10px;
+    width: auto;
+    height: 32px;
+    overflow: hidden;
+  }
+  .capsule .icon-image {
+    width: 18rpx;
+    height: 33rpx;
+    margin: 0rpx auto;
+  }
+  
+  .flex-center{
+    display:flex;
+    align-items:center; 
+  }
+  
+  .title {
+    color: #222222;
+    position: absolute;
+    left: 100px;
+    right: 100px;
+    font-size: 15px;
+    text-align: center;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  .navBar-home{
+    width: 180rpx;
+    height: 64rpx;
+    background: white;
+    border-radius: 32rpx;
+    font-size: 24rpx;
+    color: #222222;
+    border: 1rpx solid #dcdcdc;
+    font-weight: bold;
+    line-height: 1;
+  }
+  .home-img{
+    width: 29rpx;
+    height: 29rpx;
+    margin:0rpx 12rpx 6rpx 22rpx;
+  }
+  .wrap{
+    width: 100%;
+    background-color: #fff;
+    margin-top: 10rpx;
+    padding: 30rpx;
+    padding-top:15rpx ;
+    .item{
+        display: flex;
+        width: 100%;
+        align-items: center;
+        justify-content: space-between;
+        border-bottom: 1px solid #fafafa;
+        padding: 20rpx 0;
+        font-size: 28rpx;
+        .value{
+            color: #969799;
+        }
+    }
+  }
+  .button{
+    width: 50%;
+    height: 80rpx;
+    border-radius: 80rpx;
+    background-color: #ffd744;
+    // margin-top: 120rpx;
+    margin: 80rpx auto 0 auto;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    color: #fff;
+
+}

+ 15 - 0
common-page/pages/info/bindWechat/index.wxml

@@ -0,0 +1,15 @@
+<nav type="back" title="微信绑定" background-color="#fff"></nav>
+<view class="wrap">
+    <view class="item">
+        <view class="key">姓名</view>
+        <view class="value" wx:if="{{hasInfo}}">{{name}}</view>
+        <input class="value" wx:if="{{!hasInfo}}" type="text" style="width:70%" bindinput="bindKeyInput" data-prop="name" value="{{name}}" placeholder="请输入姓名"/>
+    </view>
+    <view class="item">
+        <view class="key">微信账号</view>
+        <view class="value" wx:if="{{hasInfo}}">{{accountId}}</view>
+        <input class="value" wx:if="{{!hasInfo}}" type="text" style="width:70%" bindinput="bindKeyInput" data-prop="accountId" value="{{accountId}}" placeholder="{{way == 'alipay' ? '请输入支付宝账号':'请输入微信账号'}}"/>
+    </view>
+</view>
+<view class="button" wx:if="{{!hasInfo}}" bind:tap="submit">保存</view>
+<view class="button"wx:if="{{hasInfo}}" bind:tap="change">修改</view>

+ 85 - 0
common-page/pages/info/bindWechat/index.wxss

@@ -0,0 +1,85 @@
+.navbar {
+  width: 100vw;
+  background-color: #f6f5fa;
+  position: fixed;
+  top: 0px;
+  z-index: 991;
+}
+.title-container {
+  height: 44px;
+  display: flex;
+  align-items: center;
+  position: relative;
+}
+.capsule {
+  margin-left: 10px;
+  width: auto;
+  height: 32px;
+  overflow: hidden;
+}
+.capsule .icon-image {
+  width: 18rpx;
+  height: 33rpx;
+  margin: 0rpx auto;
+}
+.flex-center {
+  display: flex;
+  align-items: center;
+}
+.title {
+  color: #222222;
+  position: absolute;
+  left: 100px;
+  right: 100px;
+  font-size: 15px;
+  text-align: center;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.navBar-home {
+  width: 180rpx;
+  height: 64rpx;
+  background: white;
+  border-radius: 32rpx;
+  font-size: 24rpx;
+  color: #222222;
+  border: 1rpx solid #dcdcdc;
+  font-weight: bold;
+  line-height: 1;
+}
+.home-img {
+  width: 29rpx;
+  height: 29rpx;
+  margin: 0rpx 12rpx 6rpx 22rpx;
+}
+.wrap {
+  width: 100%;
+  background-color: #fff;
+  margin-top: 10rpx;
+  padding: 30rpx;
+  padding-top: 15rpx ;
+}
+.wrap .item {
+  display: flex;
+  width: 100%;
+  align-items: center;
+  justify-content: space-between;
+  border-bottom: 1px solid #fafafa;
+  padding: 20rpx 0;
+  font-size: 28rpx;
+}
+.wrap .item .value {
+  color: #969799;
+}
+.button {
+  width: 50%;
+  height: 80rpx;
+  border-radius: 80rpx;
+  background-color: #ffd744;
+  margin: 80rpx auto 0 auto;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color: #fff;
+}

+ 162 - 0
common-page/pages/info/browsing/index.js

@@ -0,0 +1,162 @@
+const Parse = getApp().Parse
+const company = getApp().globalData.company
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        pageIndex: 0,
+        loadLen: 10,
+        logs: []
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function(options) {
+        await this.getLog()
+    },
+    async getLog() {
+        let uid = Parse.User.current().id
+        let BehaviorLog = new Parse.Query('BehaviorLog')
+        BehaviorLog.equalTo('company', company)
+        BehaviorLog.equalTo('user', uid)
+        BehaviorLog.include('targetObject')
+        BehaviorLog.limit(this.data.loadLen)
+        BehaviorLog.descending('createdAt')
+        BehaviorLog.skip(this.data.pageIndex * this.data.loadLen)
+        let logs = await BehaviorLog.find()
+        console.log(logs)
+        if (logs && logs.length > 0) {
+            let logsJSON = []
+            logs.forEach(log => {
+                logsJSON.push(log.toJSON())
+            })
+            let newLogs = this.data.logs.concat(logsJSON)
+            this.setData({
+                logs: newLogs
+            })
+        }
+
+    },
+
+    toDetail(e) {
+        console.log(e)
+        let item = e.currentTarget.dataset.item
+        if (item.targetClassName == 'ShopGoods') {
+            wx.navigateTo({
+                url: '/nova-shop/pages/shop-goods/goods-detail/index?id=' + item.targetId
+            })
+        } else if (item.targetClassName == 'Article') {
+            wx.navigateTo({
+                url: '/common-page/pages/cates/article-detail/index?aid=' + item.targetId + "&title=" + item.name
+            })
+        } else if (item.targetClassName == 'Lesson') {
+            wx.navigateTo({
+                url: '/nova-lesson/pages/lesson-detail/index?id=' + item.collectId
+            })
+        } else if (item.targetClassName == 'Activity') {
+            wx.navigateTo({
+                url: '/nova-activity/pages/activity-detail/index?aid=' + item.targetId
+            })
+        }
+    },
+
+    onClose(event) {
+        console.log(event);
+        let that = this
+        let id = event.currentTarget.dataset.id
+        let index = event.currentTarget.dataset.index
+        console.log(id, index)
+        const {
+            position,
+            instance
+        } = event.detail;
+        switch (position) {
+            case 'right':
+                instance.close();
+                break;
+        }
+        wx.showModal({
+            title: '确认删除',
+            content: '确定删除该记录?',
+            success: function(res) {
+                if (res.confirm) {
+                    that.deleteCollect(id, index)
+                }
+            }
+        })
+    },
+    async deleteCollect(id, index) {
+        let that = this
+        let BehaviorLog = new Parse.Query('BehaviorLog')
+        let behaviorLog = await BehaviorLog.get(id)
+        if (behaviorLog && behaviorLog.id)(
+            behaviorLog.destroy().then(res => {
+                console.log(res)
+                if (res && res.id) {
+                    console.log(id, index)
+                    let logs = that.data.logs
+                    collectList.splice(index, 1)
+                    that.setData({
+                        logs: logs
+                    })
+                }
+            })
+        )
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: async function() {
+        this.setData({
+            pageIndex: this.data.pageIndex + 1
+        })
+        await this.getLog()
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function() {
+
+    }
+})

+ 9 - 0
common-page/pages/info/browsing/index.json

@@ -0,0 +1,9 @@
+{
+  "usingComponents": {
+    "van-stepper": "@vant/weapp/stepper/index",
+    "van-icon": "@vant/weapp/icon/index",
+    "van-swipe-cell": "@vant/weapp/swipe-cell/index",
+    "van-cell": "@vant/weapp/cell/index",
+    "van-cell-group": "@vant/weapp/cell-group/index"
+  }
+}

+ 67 - 0
common-page/pages/info/browsing/index.less

@@ -0,0 +1,67 @@
+/* nova-shop/pages/shopping-cart/index.wxss */
+page {
+    background: #f6f6f6;
+}
+.browsing {
+    .browsing_info {
+        width: 93%;
+        background: #ffffff;
+        border-radius: 12rpx;
+        margin: 20rpx auto;
+        display: flex;
+        .left_info {
+            width: 38%;
+            display: flex;
+            align-items: center;
+            .image {
+                width: 240rpx;
+                height: 240rpx;
+                border-radius: 16rpx;
+            }
+        }
+        .right_info {
+            width: 58%;
+            .title {
+                font-size: 28rpx;
+                margin: 20rpx 0;
+                font-weight: 700;
+                overflow: hidden;
+                display: -webkit-box;
+                -webkit-box-orient: vertical;
+                -webkit-line-clamp: 1;
+            }
+            .desc {
+                font-size: 24rpx;
+                margin-bottom: 20rpx;
+                color: #c2c2c2;
+                overflow: hidden;
+                display: -webkit-box;
+                -webkit-box-orient: vertical;
+                -webkit-line-clamp: 2;
+            }
+            .down_info {
+                padding: 16rpx 0;
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+
+                .price {
+                    font-size: 34rpx;
+                    color: #fd3030;
+                    font-weight: 700;
+                }
+            }
+            
+        }
+    }
+    .delete {
+        background: #e42929;
+        color: #fff;
+        height: 100%;
+        padding: 100rpx 34rpx;
+    }
+    .bottom {
+        width: 100%;
+        height: 100rpx;
+    }
+}

+ 43 - 0
common-page/pages/info/browsing/index.wxml

@@ -0,0 +1,43 @@
+<nav type="back" background-color="#ffffff" title="浏览记录" />
+
+<view class="browsing">
+    <block wx:for="{{logs}}" wx:key="index">
+        <block wx:if="{{item.targetClassName == 'ShopGoods'}}">
+            <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" data-id="{{item.objectId}}" async-close bind:close="onClose">
+                <view bindtap = "toDetail" data-item="{{item}}" class="browsing_info">
+                    <view class="left_info">
+                        <image class="image" src="{{item.targetObject[0].image}}" mode="aspectFill" lazy-load="false" />
+                    </view>
+                    <view class="right_info">
+                        <view class="title">{{item.targetObject[0].name}}</view>
+                        <view class="desc">{{item.targetObject[0].desc}}</view>
+                        <view class="down_info">
+                            <view class="price">¥{{item.targetObject[0].price ? item.targetObject[0].price : '暂无'}}</view>
+                        </view>
+                    </view>
+                </view>
+                <view slot="right" class="delete">删除</view>
+            </van-swipe-cell>
+        </block>
+        <block wx:if="{{item.targetClassName == 'Activity'}}">
+            <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" data-id="{{item.objectId}}" async-close bind:close="onClose">
+                <view bindtap = "toDetail" data-item="{{item}}" class="browsing_info">
+                    <view class="left_info">
+                        <image class="image" src="{{item.targetObject[0].cover}}" mode="aspectFill" lazy-load="false" />
+                    </view>
+                    <view class="right_info">
+                        <view class="title">{{item.targetObject[0].title}}</view>
+                        <view class="desc">{{item.targetObject[0].desc}}</view>
+                        <view class="down_info">
+                            <view class="price">¥{{item.targetObject[0].price ? item.targetObject[0].price : '暂无'}}</view>
+                        </view>
+                    </view>
+                </view>
+                <view slot="right" class="delete">删除</view>
+            </van-swipe-cell>
+        </block>
+    </block>
+      
+    
+</view>
+  

+ 63 - 0
common-page/pages/info/browsing/index.wxss

@@ -0,0 +1,63 @@
+/* nova-shop/pages/shopping-cart/index.wxss */
+page {
+  background: #f6f6f6;
+}
+.browsing .browsing_info {
+  width: 93%;
+  background: #ffffff;
+  border-radius: 12rpx;
+  margin: 20rpx auto;
+  display: flex;
+}
+.browsing .browsing_info .left_info {
+  width: 38%;
+  display: flex;
+  align-items: center;
+}
+.browsing .browsing_info .left_info .image {
+  width: 240rpx;
+  height: 240rpx;
+  border-radius: 16rpx;
+}
+.browsing .browsing_info .right_info {
+  width: 58%;
+}
+.browsing .browsing_info .right_info .title {
+  font-size: 28rpx;
+  margin: 20rpx 0;
+  font-weight: 700;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 1;
+}
+.browsing .browsing_info .right_info .desc {
+  font-size: 24rpx;
+  margin-bottom: 20rpx;
+  color: #c2c2c2;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+}
+.browsing .browsing_info .right_info .down_info {
+  padding: 16rpx 0;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.browsing .browsing_info .right_info .down_info .price {
+  font-size: 34rpx;
+  color: #fd3030;
+  font-weight: 700;
+}
+.browsing .delete {
+  background: #e42929;
+  color: #fff;
+  height: 100%;
+  padding: 100rpx 34rpx;
+}
+.browsing .bottom {
+  width: 100%;
+  height: 100rpx;
+}

+ 192 - 0
common-page/pages/info/cauth/cauth.js

@@ -0,0 +1,192 @@
+// nova-travel/page/cauth/cauth.js
+var qiniuUploader = require("../../../../utils/qiniuUploader");
+var Parse = getApp().Parse;
+var company = getApp().globalData.company
+
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        focus: false,
+        fileList: [],
+        fileList_1: [],
+        uploadURL: "", //七牛参数
+        domain: "", //七牛参数
+        uptokenURL: "", //七牛参数
+        optionId: "",
+        auth: true,
+        activeColor:getApp().globalData.activeColor,
+        titleColor:getApp().globalData.titleColor
+    },
+    bindKeyInput(e) {
+        this.setData({
+            [e.currentTarget.dataset.prop]: e.detail.value
+        })
+    },
+    submit() {
+        const _this = this
+        if (!this.data.name || !this.data.mobile || !this.data.id) {
+            wx.showToast({
+                title: '请填写完整信息',
+                icon: 'none',
+                duration: 2000
+            })
+            return
+        }
+        let name = /[\u4e00-\u9fa5]/,
+            text = this.data.name;
+        if (!name.test(text)) {
+            wx.showToast({
+                title: '请输入您的真实姓名',
+                icon: 'none',
+                duration: 2000
+            })
+            return
+        }
+        let str = this.data.mobile;
+        let exist = /^1[34578]\d{9}$/.test(str);
+        if (exist == false) {
+            wx.showToast({
+                title: '手机号码格式有误',
+                icon: 'none',
+                duration: 2000
+            })
+            return
+        }
+        let idReg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/gi
+        let id = this.data.id
+        if (!idReg.test(id)) {
+            wx.showToast({
+                title: '请输入正确的身份证号',
+                icon: 'none',
+                duration: 2000
+            })
+            return
+        }
+        wx.request({
+            url: "https://server.fmode.cn/api/apig/idcard", //请求接口的url
+            method: "POST", //请求方式
+            data: {
+                company: company,
+                cardNo: id,
+                realName: text
+            }, //请求参数
+            header: {
+                "content-type": "application/json", // 默认值
+            },
+            success: (res) => {
+                console.log(res.data);
+                console.log(res.data.data.result);
+                if (res.data.data.result.isok) {
+                    let User = Parse.Object.extend("_User")
+                    let user = new User()
+                    user.id = Parse.User.current().id
+                    user.set("authentication", {
+                        "id": _this.data.id,
+                        "name": _this.data.name,
+                        "mobile": _this.data.mobile
+                    })
+                    user.set('realname',_this.data.name)
+                    user.set('idcard',_this.data.id)
+                    user.save().then(res => {
+                        // 弹窗
+                        wx.showToast({
+                            title: '提交成功',
+                            icon: 'none',
+                            duration: 2000
+                        })
+                        // 重新拉取数据
+                        _this.getUserInfo()
+                    })
+                } else {
+                    wx.showToast({
+                        title: '请输入正确的身份证号和姓名',
+                        icon: 'none',
+                        duration: 2000
+                    })
+                }
+            },
+        })
+    },
+    getUserInfo() {
+        const _this = this
+        let User = new Parse.Query("_User")
+        User.equalTo("objectId", Parse.User.current().id)
+        User.first().then(res => {
+            let user = res.toJSON()
+            console.log(user)
+            if (user.authentication && user.authentication.id) {
+                console.log(user.authentication)
+                user.authentication.id = user.authentication.id.replace(/^(.{3})(?:\d+)(.{4})$/, "$1***********$2")
+                user.authentication.mobile = user.authentication.mobile.replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+                _this.setData({
+                    userInfo: user.authentication,
+                    auth: true
+                })
+            } else {
+                _this.setData({
+                    auth: false
+                })
+            }
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        this.getUserInfo()
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 7 - 0
common-page/pages/info/cauth/cauth.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+    "van-uploader": "@vant/weapp/uploader/index",
+    "van-cell": "@vant/weapp/cell/index",
+    "van-cell-group": "@vant/weapp/cell-group/index"
+  }
+}

+ 45 - 0
common-page/pages/info/cauth/cauth.less

@@ -0,0 +1,45 @@
+/* nova-travel/page/cauth/cauth.wxss */
+.cauh_wrap{
+    .text{
+        width: 100%;
+        height: 100rpx;
+        background-color: #fff;
+        display: flex;
+        align-items: center;
+        padding:0 20rpx;
+        border-bottom: 1px solid rgb(240, 237, 237);
+        text{
+            font-size: 30rpx;
+            font-weight: 600;
+            padding-right: 20rpx;
+        }
+    }
+    .upload{
+        background-color: #fff;
+        margin: 30rpx 0;
+        .title{
+            width: 100%;
+            height: 100rpx;
+            font-size: 30rpx;
+            font-weight: 600;
+            padding:0 20rpx;
+            display: flex;
+            align-items: center;
+        }
+        .uploader{
+            padding:10rpx 30rpx;
+        }
+    }
+    .submit{
+        width: 90%;
+        color: #fff;
+        line-height: 50rpx;
+        margin-top: 50rpx;
+        border-radius: 40rpx;
+        padding: 20rpx 0rpx;
+    }
+}
+.warp{
+    margin-top: 20rpx;
+    border-radius: 20rpx;
+}

+ 30 - 0
common-page/pages/info/cauth/cauth.wxml

@@ -0,0 +1,30 @@
+<nav type="back" title="{{auth ? '个人信息' : '实名认证'}}" background-color="{{activeColor ? activeColor : '#ffffff'}}"
+	frontColor="{{titleColor ? titleColor : '#000000'}}"></nav>
+<view class="cauh_wrap" wx:if="{{!auth}}">
+	<!-- 姓名 -->
+	<view class="text">
+		<text>真实姓名</text>
+		<input class="weui-input" placeholder="请输入本人姓名" type="text" bindinput="bindKeyInput" data-prop="name"
+			value="{{name}}" />
+	</view>
+	<!-- 手机号码 -->
+	<view class="text">
+		<text>手机号码</text>
+		<input class="weui-input" placeholder="请输入手机号码" type="number" bindinput="bindKeyInput" data-prop="mobile"
+			value="{{mobile}}" />
+	</view>
+	<!-- 身份证号 -->
+	<view class="text">
+		<text>身份证号</text>
+		<input class="weui-input" type="idcard" placeholder="请输入本人身份证号" bindinput="bindKeyInput" data-prop="id"
+			value="{{id}}" />
+	</view>
+	<button class="submit" bind:tap="submit" style="background-color: {{activeColor ? activeColor : '#1aad19'}}">提 交</button>
+</view>
+<view class="warp" wx:if="{{auth}}">
+	<van-cell-group>
+		<van-cell title="姓名" value="{{userInfo.name&&userInfo.name}}" />
+		<van-cell title="手机号" value="{{userInfo.mobile&&userInfo.mobile}}" />
+		<van-cell title="身份证号" value="{{userInfo.id&&userInfo.id}}"></van-cell>
+	</van-cell-group>
+</view>

+ 43 - 0
common-page/pages/info/cauth/cauth.wxss

@@ -0,0 +1,43 @@
+/* nova-travel/page/cauth/cauth.wxss */
+.cauh_wrap .text {
+  width: 100%;
+  height: 100rpx;
+  background-color: #fff;
+  display: flex;
+  align-items: center;
+  padding: 0 20rpx;
+  border-bottom: 1px solid #f0eded;
+}
+.cauh_wrap .text text {
+  font-size: 30rpx;
+  font-weight: 600;
+  padding-right: 20rpx;
+}
+.cauh_wrap .upload {
+  background-color: #fff;
+  margin: 30rpx 0;
+}
+.cauh_wrap .upload .title {
+  width: 100%;
+  height: 100rpx;
+  font-size: 30rpx;
+  font-weight: 600;
+  padding: 0 20rpx;
+  display: flex;
+  align-items: center;
+}
+.cauh_wrap .upload .uploader {
+  padding: 10rpx 30rpx;
+}
+.cauh_wrap .submit {
+  width: 90%;
+  color: #fff;
+  line-height: 50rpx;
+  margin-top: 50rpx;
+  border-radius: 40rpx;
+  padding: 20rpx 0rpx;
+}
+.warp {
+  margin-top: 20rpx;
+  border-radius: 20rpx;
+}

+ 66 - 0
common-page/pages/info/cauth/index.js

@@ -0,0 +1,66 @@
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
common-page/pages/info/cauth/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 1 - 0
common-page/pages/info/cauth/index.wxml

@@ -0,0 +1 @@
+

+ 0 - 0
common-page/pages/info/cauth/index.wxss


+ 272 - 0
common-page/pages/info/index.js

@@ -0,0 +1,272 @@
+const Parse = getApp().Parse
+    // const company = getApp().globalData.company
+const dateF = require('../../../utils/date')
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        consume: 0,
+        activeColor: "",
+        titleColor: "",
+        currentDate: new Date().getTime(),
+        minDate: (new Date().getTime() - 70 * 12 * 30 * 24 * 60 * 60 * 1000),
+        account: null,
+        mobile: null,
+        nickname: null,
+        actions: [{
+                name: '男',
+            },
+            {
+                name: '女',
+            },
+        ],
+        images: []
+    },
+    onSelect(event) {
+        console.log(event.detail);
+        let {
+            name
+        } = event.detail
+        let {
+            user
+        } = this.data
+        user.sex = name
+        this.setData({
+            user,
+            show2: false
+        })
+    },
+    async getUser() {
+        let id = Parse.User.current() ? Parse.User.current().id : ""
+        if (!id) {
+            wx.showToast({
+                title: '您还未登录请先登录',
+                icon: 'error'
+            })
+            setTimeout(() => {
+                wx.navigateBack({
+                    delta: 1
+                });
+            }, 1000)
+            return
+        }
+        let new_user = new Parse.Query('_User')
+        new_user.include('invite')
+        new_user.include('agentLevel')
+        new_user.select('objectId', 'avatar', 'authentication', 'nickname', 'mobile', 'invite.nickname',
+            'agentLevel.name')
+        let res = await new_user.get(id)
+        let user = res.toJSON()
+        user.joinTime = dateF.formatTime("YYYY-mm-dd", user.createdAt)
+        if (user.authentication && user.authentication != {}) {
+            user.auth = { isAuth: true, label: "已认证" }
+        } else {
+            user.auth = { isAuth: false, label: "未认证" }
+        }
+        console.log(user.avatar)
+        this.setData({
+            user: user,
+            images: [user.avatar]
+        })
+    },
+    // 会员头像,会员昵称,手机号,会员性别,实名认证,会员等级,会员ID, 邀请人,
+    async getAccount() {
+        let Account = new Parse.Query('Account')
+        Account.equalTo('user', Parse.User.current().id)
+        Account.select('bank', 'wechat')
+        let account = await Account.first()
+        let a = account.toJSON()
+        if (a.bank && a.bank.length > 0) {
+            a.isBank = { isBank: true, label: "已绑定" }
+        } else {
+            a.isBank = { isBank: false, label: "未绑定" }
+        }
+        if (a.wechat) {
+            a.isWechat = { isWechat: true, label: "已绑定" }
+        } else {
+            a.isWechat = { isWechat: false, label: "未绑定" }
+        }
+        if (account && account.id) {
+            this.setData({
+                account: a
+            })
+        }
+    },
+
+    editMobile(e) {
+        let mobile = e.detail.value
+        let a = /^1[3456789]\d{9}$/;
+        if (!mobile.match(a)) {
+            wx.showToast({
+                icon: "none",
+                title: "请填写正确的手机记号格式",
+            });
+            return;
+        } else {
+            this.setData({
+                mobile: mobile
+            })
+        }
+    },
+    changeImage(e) {
+        if (e.detail && e.detail.length > 0) {
+            this.setData({
+                image: [e.detail[0].url]
+            })
+        } else {
+            this.setData({
+                image: []
+            })
+        }
+    },
+    editNickname(e) {
+        let nickname = e.detail
+        this.setData({
+            nickname: nickname
+        })
+    },
+    onInput(event) {
+        this.setData({
+            currentDate: event.detail,
+        });
+    },
+    showPicker() {
+        this.setData({
+            show: true
+        })
+    },
+    //取消日期选择
+    onClose() {
+        this.setData({
+            show: false,
+            show2: false
+        })
+    },
+    showSelect() {
+        this.setData({
+            show2: true
+        })
+    },
+    async submit() {
+        let {
+            sex
+        } = this.data.user
+        console.log(this.data.user)
+        let id = Parse.User.current().id
+        let new_user = new Parse.Query('_User')
+        let res = await new_user.get(id)
+        if (sex) {
+            res.set("sex", sex)
+        }
+        if (this.data.mobile) {
+            res.set("mobile", this.data.mobile)
+        }
+        if (this.data.nickname) {
+            res.set("nickname", this.data.nickname)
+        }
+        let updateuser = await res.save()
+        if (updateuser) {
+            console.log(updateuser)
+            wx.showToast({
+                title: '修改成功',
+                icon: 'success',
+                image: '',
+                duration: 1000,
+                mask: false,
+                success: (result) => {
+                    setTimeout(() => {
+                        wx.navigateBack({
+                            delta: 1
+                        });
+                    }, 1000);
+                },
+                fail: () => {},
+                complete: () => {}
+            });
+        }
+
+    },
+
+    toAuth() {
+        wx.navigateTo({
+            url: '/common-page/pages/info/cauth/cauth'
+        })
+    },
+
+    bindWechat(e) {
+        wx.navigateTo({
+            url: `/common-page/pages/info/bindWechat/index?way='wechat'`,
+        })
+    },
+    bindBank() {
+        wx.navigateTo({
+            url: `/common-page/pages/info/bindBank/index`,
+        })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function(options) {
+        this.getUser()
+        this.getAccount()
+
+        console.log(getApp().globalData.activeColor, 'getApp().globalData.activeColor')
+        this.setData({
+            activeColor: getApp().globalData.activeColor,
+            titleColor: getApp().globalData.titleColor
+        })
+        console.log(this.data.activeColor);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function() {
+        this.getUser()
+        this.getAccount()
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function() {
+
+    }
+})

+ 8 - 0
common-page/pages/info/index.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+    "van-field": "@vant/weapp/field/index",
+    "van-datetime-picker": "@vant/weapp/datetime-picker/index",
+    "van-popup": "@vant/weapp/popup/index",
+    "van-action-sheet": "@vant/weapp/action-sheet/index"
+  }
+}

+ 61 - 0
common-page/pages/info/index.less

@@ -0,0 +1,61 @@
+.top{
+  background: #0abf58;
+  width: 100%;
+  color: white;
+  padding: 20rpx;
+  .avatar{
+    display: flex;
+    align-items: center;
+    image{
+      width: 120rpx;
+      height: 120rpx;
+      border-radius: 50%;
+    }
+    .tag{
+      border-radius: 44rpx;
+      padding: 10rpx 30rpx;
+      background: #186138;
+      margin-left: 20rpx;
+    }
+  }
+}
+.cont{
+  .h3{
+    color: #646566;
+    padding: 10rpx 28rpx;
+    font-size: 28rpx;
+  }
+  .group {
+      .field {
+          font-size: 30rpx;
+          font-weight: 600;
+      }
+      .avatar {
+          display: flex;
+          height: 80rpx;
+          align-items: center;
+          padding: 0 32rpx;
+          justify-content: space-between;
+          .image {
+              width: 120rpx;
+              height: 120rpx;
+              
+          }
+      }
+  }
+}
+.footer{
+  width: 100%;
+  position: fixed;
+  bottom: 60rpx;
+  z-index: 9;
+  display: flex;
+  justify-content: center;
+  .sbmit{
+    width: 92%;
+    background: #0abf58;
+    padding: 20rpx 0;
+    text-align: center;
+    border-radius: 10rpx;
+  }
+}

+ 29 - 0
common-page/pages/info/index.wxml

@@ -0,0 +1,29 @@
+<nav type="back" background-color="{{activeColor ? activeColor : '#ffffff'}}" title="会员信息" frontColor="{{titleColor ? titleColor : 'black'}}" />
+
+<view class="cont">
+    <van-cell-group class="group">
+        <view class="avatar">
+            <view class="label">
+                会员头像
+            </view>
+            <image class="image" src="{{user.avatar}}" lazy-load="false" binderror="" bindload="" />
+        </view>
+        <van-field class="field" model:value="{{ user.nickname }}" label="会员昵称" input-align="right" is-link />
+        <van-field class="field" model:value="{{ user.mobile }}" type="number" maxlength="11" label="联系电话" is-link input-align="right" bind:blur="editMobile" />
+        <van-field class="field" model:value="{{ user.sex }}" readonly maxlength="1" label="会员性别" is-link input-align="right" bind:tap="showSelect" />
+        <van-field class="field" model:value="{{ user.objectId }}" label="会员ID" readonly is-link input-align="right" />
+        <van-field class="field" model:value="{{ user.invite ? user.invite.nickname : '暂无' }}" readonly label="邀请人" is-link input-align="right" />
+        <van-field class="field" model:value="{{ user.agentLevel ? user.agentLevel.name : '暂无' }}" readonly label="会员等级" is-link input-align="right" />
+        <van-field class="field" model:value="{{ user.auth.label }}" readonly label="实名认证" input-align="right" is-link bind:tap="toAuth" />
+        <van-field class="field" model:value="{{ user.joinTime }}" readonly label="加入时间" input-align="right" is-link />
+        <!-- <van-field class="field" model:value="{{ account.isWechat.label }}" readonly label="绑定微信" input-align="right" bind:tap="bindWechat" is-link /> -->
+        <van-field class="field" model:value="{{ account.isBank.label }}" readonly label="绑定银行卡" input-align="right" bind:tap="bindBank" is-link />
+    </van-cell-group>
+</view>
+<view class="footer">
+    <view class="sbmit" style="background-color: {{activeColor ? activeColor : '#00c2cb'}};color:{{titleColor?titleColor:'ffffff'}}" bind:tap="submit">确认</view>
+</view>
+<van-popup show="{{ show }}" position="bottom" custom-style="height: 40%;">
+    <van-datetime-picker type="year-month" value="{{ currentDate }}" min-date="{{ minDate }}" bind:input="onInput" bind:cancel="onClose" bind:confirm="confirm" />
+</van-popup>
+<van-action-sheet show="{{ show2 }}" actions="{{ actions }}" bind:select="onSelect" />

+ 56 - 0
common-page/pages/info/index.wxss

@@ -0,0 +1,56 @@
+.top {
+  background: #0abf58;
+  width: 100%;
+  color: white;
+  padding: 20rpx;
+}
+.top .avatar {
+  display: flex;
+  align-items: center;
+}
+.top .avatar image {
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 50%;
+}
+.top .avatar .tag {
+  border-radius: 44rpx;
+  padding: 10rpx 30rpx;
+  background: #186138;
+  margin-left: 20rpx;
+}
+.cont .h3 {
+  color: #646566;
+  padding: 10rpx 28rpx;
+  font-size: 28rpx;
+}
+.cont .group .field {
+  font-size: 30rpx;
+  font-weight: 600;
+}
+.cont .group .avatar {
+  display: flex;
+  height: 80rpx;
+  align-items: center;
+  padding: 0 32rpx;
+  justify-content: space-between;
+}
+.cont .group .avatar .image {
+  width: 120rpx;
+  height: 120rpx;
+}
+.footer {
+  width: 100%;
+  position: fixed;
+  bottom: 60rpx;
+  z-index: 9;
+  display: flex;
+  justify-content: center;
+}
+.footer .sbmit {
+  width: 92%;
+  background: #0abf58;
+  padding: 20rpx 0;
+  text-align: center;
+  border-radius: 10rpx;
+}

+ 518 - 0
common-page/pages/info/ucenter/address-detail/index.js

@@ -0,0 +1,518 @@
+var util = require('../../../../../utils/util.js');
+var api = require('../../../../../utils/api');
+var Parse = getApp().Parse;
+import placeArrays from "../../../../../utils/citysearch"
+const placeArray=placeArrays.placeArray
+Page({
+    data: {
+        type:1,
+        address: {
+            id: 0,
+            province_id: 0,
+            city_id: 0,
+            district_id: 0,
+            address: '',
+            full_region: '',
+            name: '',
+            mobile: '',
+            is_default: 0
+        },
+        addressId: 0,
+        openSelectRegion: false,
+        selectRegionList: [{
+                id: 0,
+                name: '省份',
+                parent_id: 1,
+                type: 1
+            },
+            {
+                id: 0,
+                name: '城市',
+                parent_id: 1,
+                type: 2
+            },
+            {
+                id: 0,
+                name: '区县',
+                parent_id: 1,
+                type: 3
+            }
+        ],
+        regionType: 1,
+        regionList: [],
+        selectRegionDone: false,
+        placeArray: placeArray,
+        province: placeArray[0].name, //- 省
+        pIndex: 0,
+        city: placeArray[0].city[0].name, //- 市
+        cIndex: 0,
+        area: placeArray[0].city[0].area[0], //- 区
+        aIndex: 0,
+        isAddress:false,
+        fullName:""
+        },
+    onClose(){
+        this.setData({
+            isAddress:false
+        })
+    },
+    confirm(){
+        let full_region = this.data.province+this.data.city+this.data.area
+        this.setData({
+            ['address.full_region']:full_region,
+            isAddress:false
+        })
+    },
+    showAddress(){
+        this.setData({
+            isAddress:true
+        })
+    },
+    changeProvince: function(e){
+        const val = e.detail.value   //这些val都是数组形式的了
+        this.setData({
+          pIndex: val,
+          cIndex: 0,
+          aIndex: 0,
+          province: placeArray[val].name,
+          city: placeArray[val].city[0].name,
+          area: placeArray[val].city[0].area[0]
+        })
+      },
+      changeCity: function(e){
+        const val = e.detail.value
+        this.setData({
+          cIndex: val,
+          aIndex: 0,
+          city: placeArray[this.data.pIndex].city[val].name,
+          area: placeArray[this.data.pIndex].city[val].area[0]
+        })
+      },
+      changeArea: function(e){
+        const val = e.detail.value
+        this.setData({
+          aIndex: val,
+          area: placeArray[this.data.pIndex].city[this.data.cIndex].area[val]
+        })
+      },
+    mobilechange(e) {
+        let mobile = e.detail.value;
+        let address = this.data.address;
+        if (util.testMobile(mobile)) {
+            address.mobile = mobile;
+            this.setData({
+                address: address
+            });
+        }
+    },
+    bindinputName(event) {
+        let address = this.data.address;
+        address.name = event.detail.value;
+        this.setData({
+            address: address
+        });
+    },
+    bindinputAddress(event) {
+        let address = this.data.address;
+        address.address = event.detail.value;
+        this.setData({
+            address: address
+        });
+    },
+    switchChange(e) {
+        let status = e.detail.value;
+        let is_default = 0;
+        if (status == true) {
+            is_default = 1;
+        }
+        let address = 'address.is_default';
+        this.setData({
+            [address]: is_default
+        });
+    },
+    async getAddressDetail() {
+        let that = this;
+        let checkedAddress = {}
+        let query = new Parse.Query("ShopAddress");
+        query.equalTo("objectId", that.data.addressId);
+        let address = await query.first()
+        if(address)
+        {
+          checkedAddress.name = address.get("name")
+          checkedAddress.country_id = address.get("country_id")
+          checkedAddress.province_id = address.get("province_id")
+          checkedAddress.city_id = address.get("city_id")
+          checkedAddress.district_id = address.get("district_id")
+          checkedAddress.address = address.get("address")
+          checkedAddress.mobile = address.get("mobile")
+          checkedAddress.is_default = address.get("is_default")
+          checkedAddress.province_name = address.get("province_name")
+          checkedAddress.city_name = address.get("city_name")
+          checkedAddress.district_name = address.get("district_name")
+          checkedAddress.full_region = address.get("full_region")
+          that.setData({
+            address:checkedAddress
+          })
+        }
+        // util.request(api.AddressDetail, {
+        //     id: that.data.addressId
+        // }).then(function(res) {
+        //     if (res.errno === 0) {
+        //         that.setData({
+        //             address: res.data
+        //         });
+        //     }
+        // });
+    },
+    deleteAddress: function() {
+        let id = this.data.addressId;
+        wx.showModal({
+            title: '提示',
+            content: '您确定要删除么?',
+            success: function(res) {
+                if (res.confirm) {
+                    util.request(api.DeleteAddress, {
+                        id: id
+                    }, 'POST').then(function(res) {
+                        if (res.errno === 0) {
+                            wx.removeStorageSync('addressId');
+                            util.showErrorToast('删除成功');
+                            wx.navigateBack();
+                        } else {
+                            util.showErrorToast(res.errmsg);
+                        }
+                    });
+                }
+            }
+        })
+    },
+    setRegionDoneStatus() {
+        let that = this;
+        let doneStatus = that.data.selectRegionList.every(item => {
+            return item.id != 0;
+        });
+
+        that.setData({
+            selectRegionDone: doneStatus
+        })
+
+    },
+    chooseRegion() {
+        let that = this;
+        this.setData({
+            openSelectRegion: !this.data.openSelectRegion
+        });
+
+        //设置区域选择数据
+        let address = this.data.address;
+        if (address.province_id > 0 && address.city_id > 0 && address.district_id > 0) {
+            let selectRegionList = this.data.selectRegionList;
+            selectRegionList[0].id = address.province_id;
+            selectRegionList[0].name = address.province_name;
+            selectRegionList[0].parent_id = 1;
+
+            selectRegionList[1].id = address.city_id;
+            selectRegionList[1].name = address.city_name;
+            selectRegionList[1].parent_id = address.province_id;
+
+            selectRegionList[2].id = address.district_id;
+            selectRegionList[2].name = address.district_name;
+            selectRegionList[2].parent_id = address.city_id;
+
+            this.setData({
+                selectRegionList: selectRegionList,
+                regionType: 3
+            });
+
+            this.getRegionList(address.city_id);
+        } else {
+            this.setData({
+                selectRegionList: [{
+                        id: 0,
+                        name: '省份',
+                        parent_id: 1,
+                        type: 1
+                    },
+                    {
+                        id: 0,
+                        name: '城市',
+                        parent_id: 1,
+                        type: 2
+                    },
+                    {
+                        id: 0,
+                        name: '区县',
+                        parent_id: 1,
+                        type: 3
+                    }
+                ],
+                regionType: 1
+            })
+            this.getRegionList(1);
+        }
+
+        this.setRegionDoneStatus();
+
+    },
+    onLoad: function(options) {
+        let {activeColor,titleColor}=options
+        this.setData({activeColor,titleColor})
+        // 页面初始化 options为页面跳转所带来的参数
+        if (options.id) {
+            this.setData({
+                addressId: options.id,
+                type:2
+            });
+            this.getAddressDetail();
+        }
+        // this.getRegionList(1);
+    },
+    onReady: function() {
+
+    },
+    async saveEditAddress(){
+        let that = this
+        let query = new Parse.Query("ShopAddress");
+        query.equalTo("objectId", that.data.addressId);
+        let shopAddress = await query.first()
+        shopAddress.set("name",that.data.address.name)
+        shopAddress.set("mobile",that.data.address.mobile)
+        shopAddress.set("province_id",that.data.address.province_id)
+        shopAddress.set("city_id",that.data.address.city_id)
+        shopAddress.set("district_id",that.data.address.district_id)
+        shopAddress.set("address",that.data.address.address)
+        shopAddress.set("province_name",that.data.province)
+        shopAddress.set("city_name",that.data.city)
+        shopAddress.set("district_name",that.data.area)
+        shopAddress.set("full_region",that.data.address.full_region)
+        shopAddress.set("is_default",that.data.address.is_default)
+        if(that.data.address.is_default == 1){
+            that.setDefault()
+        }
+        await shopAddress.save().then(data=>{
+            wx.navigateBack()
+        })
+    },
+    selectRegionType(event) {
+        let that = this;
+        let regionTypeIndex = event.target.dataset.regionTypeIndex;
+        let selectRegionList = that.data.selectRegionList;
+
+        //判断是否可点击
+        if (regionTypeIndex + 1 == this.data.regionType || (regionTypeIndex - 1 >= 0 && selectRegionList[regionTypeIndex - 1].id <= 0)) {
+            return false;
+        }
+
+        this.setData({
+            regionType: regionTypeIndex + 1
+        })
+
+        let selectRegionItem = selectRegionList[regionTypeIndex];
+
+        this.getRegionList(selectRegionItem.parent_id);
+
+        this.setRegionDoneStatus();
+
+    },
+    selectRegion(event) {
+        let that = this;
+        let regionIndex = event.target.dataset.regionIndex;
+        let regionItem = this.data.regionList[regionIndex];
+        let regionType = regionItem.type;
+        let selectRegionList = this.data.selectRegionList;
+        selectRegionList[regionType - 1] = regionItem;
+
+
+        if (regionType != 3) {
+            this.setData({
+                selectRegionList: selectRegionList,
+                regionType: regionType + 1
+            })
+            this.getRegionList(regionItem.id);
+        } else {
+            this.setData({
+                selectRegionList: selectRegionList
+            })
+        }
+
+        //重置下级区域为空
+        selectRegionList.map((item, index) => {
+            if (index > regionType - 1) {
+                item.id = 0;
+                item.name = index == 1 ? '城市' : '区县';
+                item.parent_id = 0;
+            }
+            return item;
+        });
+
+        this.setData({
+            selectRegionList: selectRegionList
+        })
+
+
+        that.setData({
+            regionList: that.data.regionList.map(item => {
+
+                //标记已选择的
+                if (that.data.regionType == item.type && that.data.selectRegionList[that.data.regionType - 1].id == item.id) {
+                    item.selected = true;
+                } else {
+                    item.selected = false;
+                }
+
+                return item;
+            })
+        });
+
+        this.setRegionDoneStatus();
+
+    },
+    doneSelectRegion() {
+        if (this.data.selectRegionDone === false) {
+            return false;
+        }
+
+        let address = this.data.address;
+        let selectRegionList = this.data.selectRegionList;
+        address.province_id = selectRegionList[0].id;
+        address.city_id = selectRegionList[1].id;
+        address.district_id = selectRegionList[2].id;
+        address.province_name = selectRegionList[0].name;
+        address.city_name = selectRegionList[1].name;
+        address.district_name = selectRegionList[2].name;
+        address.full_region = selectRegionList.map(item => {
+            return item.name;
+        }).join('');
+
+        this.setData({
+            address: address,
+            openSelectRegion: false
+        });
+
+    },
+    cancelSelectRegion() {
+        this.setData({
+            openSelectRegion: false,
+            regionType: this.data.regionDoneStatus ? 3 : 1
+        });
+    },
+    getRegionList(regionId) {
+        let that = this;
+        let regionType = that.data.regionType;
+        util.request(api.RegionList, {
+            parentId: regionId
+        }).then(function(res) {
+            if (res.errno === 0) {
+                that.setData({
+                    regionList: res.data.map(item => {
+
+                        //标记已选择的
+                        if (regionType == item.type && that.data.selectRegionList[regionType - 1].id == item.id) {
+                            item.selected = true;
+                        } else {
+                            item.selected = false;
+                        }
+
+                        return item;
+                    })
+                });
+            }
+        });
+    },
+    async saveAddress() {
+        let address = this.data.address;
+        let company = getApp().globalData.company
+        let user = Parse.User.current();
+        if (address.name == '' || address.name == undefined) {
+            util.showErrorToast('请输入姓名');
+            return false;
+        }
+        if (address.mobile == '' || address.mobile == undefined) {
+            util.showErrorToast('请输入手机号码');
+            return false;
+        }
+        if (address.province == "" || address.city == "") {
+            util.showErrorToast('请输入省市区');
+            return false;
+        }
+        if (address.address == '' || address.address == undefined) {
+            util.showErrorToast('请输入详细地址');
+            return false;
+        }
+        let that = this;
+        let ShopAddress = Parse.Object.extend("ShopAddress");
+        let shopAddress = new ShopAddress();
+        shopAddress.set("user",{
+            "__type": "Pointer",
+            "className": "_User",
+            "objectId": user.id
+          })
+          shopAddress.set("company",{
+            "__type": "Pointer",
+            "className": "Company",
+            "objectId": company
+          })
+        shopAddress.set("name",that.data.address.name)
+        shopAddress.set("mobile",that.data.address.mobile)
+        shopAddress.set("province_id",that.data.address.province_id)
+        shopAddress.set("city_id",that.data.address.city_id)
+        shopAddress.set("district_id",that.data.address.district_id)
+        shopAddress.set("address",that.data.address.address)
+        shopAddress.set("province_name",that.data.province)
+        shopAddress.set("city_name",that.data.city)
+        shopAddress.set("district_name",that.data.area)
+        shopAddress.set("full_region",that.data.address.full_region)
+        shopAddress.set("is_default",that.data.address.is_default)
+        if(that.data.address.is_default == 1){
+            that.setDefault()
+        }
+        await shopAddress.save().then(data=>{
+            wx.navigateBack()
+        })
+        // util.request(api.SaveAddress, {
+        //     id: address.id,
+        //     name: address.name,
+        //     mobile: address.mobile,
+        //     province_id: address.province_id,
+        //     city_id: address.city_id,
+        //     district_id: address.district_id,
+        //     address: address.address,
+        //     is_default: address.is_default,
+        // }, 'POST').then(function(res) {
+        //     if (res.errno === 0) {
+        //         
+        //     }
+        // });
+    },
+    setDefault(){
+        let ShopAddress = new Parse.Query("ShopAddress")
+        ShopAddress.equalTo("user",Parse.User.current().id)
+        ShopAddress.equalTo("is_default",1)
+        ShopAddress.first().then(res=>{
+           if(res){
+            res.set("is_default",0)
+            res.save()
+           }
+        })
+    },
+    onShow: function() {
+        let id = this.data.addressId;
+        if (id > 0) {
+            wx.setNavigationBarTitle({
+                title: '编辑地址',
+            })
+        } else {
+            wx.setNavigationBarTitle({
+                title: '新增地址',
+            })
+        }
+    },
+    onHide: function() {
+        // 页面隐藏
+
+    },
+    onUnload: function() {
+        // 页面关闭
+
+    }
+})

+ 6 - 0
common-page/pages/info/ucenter/address-detail/index.json

@@ -0,0 +1,6 @@
+{
+    "navigationBarTitleText": "",
+    "usingComponents": {
+      "van-popup":"@vant/weapp/popup/index"
+    }
+}

+ 223 - 0
common-page/pages/info/ucenter/address-detail/index.wxml

@@ -0,0 +1,223 @@
+<nav
+ type="back"
+ title="添加地址"
+ backgroundColor="{{activeColor ? activeColor : '#ffffff'}}"
+ frontColor="{{titleColor?titleColor:'#000000'}}"
+></nav>
+<view class="container">
+	<view class='edit-container'>
+		<view class="a-item">
+			<view class="icon">
+				<image class="img" src="https://file-cloud.fmode.cn/receiver.png"></image>
+			</view>
+			<view class="input-wrap">
+				<input
+				 cursor-spacing='100'
+				 class='a-input'
+				 bindinput="bindinputName"
+				 placeholder='姓名'
+				 value="{{address.name}}"
+				></input>
+			</view>
+		</view>
+		<view class="a-item">
+			<view class="icon">
+				<image class="img" src="https://file-cloud.fmode.cn/mobile.png"></image>
+			</view>
+			<view class="input-wrap">
+				<input
+				 cursor-spacing='100'
+				 class='a-input'
+				 type='number'
+				 bindblur="mobilechange"
+				 value="{{address.mobile}}"
+				 placeholder='手机号码'
+				 maxlength='12'
+				></input>
+			</view>
+		</view>
+		<!--
+        
+        <view class="a-item">
+			<view class="icon">
+				<image class="img" src="/nova-shop/images/icon/position.png"></image>
+			</view>
+			<view class="input-wrap" bindtap="chooseRegion">
+				<input
+				 cursor-spacing='100'
+				 class="a-input"
+				 value="{{address.full_region}}"
+				 disabled="true"
+				 placeholder="选择省份、城市、区县"
+				/>
+				<view class="arrow"></view>
+			</view>
+		</view>
+
+        -->
+		<view class="a-item">
+			<view class="icon">
+				<image class="img" src="https://file-cloud.fmode.cn/address.png"></image>
+			</view>
+			<view class="input-wrap" bindtap="showAddress">
+				<input
+				 cursor-spacing='100'
+				 class="a-input"
+				 value="{{address.full_region}}"
+				 disabled="true"
+				 placeholder="选择省份、城市、区县"
+				/>
+				<view class="arrow"></view>
+			</view>
+		</view>
+
+		<view class="a-item">
+			<view class="icon">
+				<image class="img" src="https://file-cloud.fmode.cn/address.png"></image>
+			</view>
+			<view class="input-wrap">
+				<input
+				 cursor-spacing='100'
+				 class="a-input"
+				 bindinput="bindinputAddress"
+				 value="{{address.address}}"
+				 placeholder="详细地址, 如街道、小区或写字楼等"
+				/>
+			</view>
+		</view>
+
+		<!-- <view class="a-item">
+            <view class="default-input {{address.is_default == 1 ? 'checked' : 'unchecked'}}" bindtap="bindIsDefault" >点击设为默认地址</view>
+        </view> -->
+	</view>
+	<view class="default-wrap">
+		<view class="text">设为默认地址</view>
+		<switch
+		 class="switch"
+		 checked="{{address.is_default}}"
+		 bindchange="switchChange"
+		></switch>
+	</view>
+	<view
+	 wx:if="{{type==1}}"
+	 class='btn-wrap'
+	 bindtap="saveAddress"
+	>
+		<view class="btn active">新增</view>
+	</view>
+	<view
+	 wx:if="{{type==2}}"
+	 class='btn-wrap'
+	 bindtap="saveEditAddress"
+	>
+		<view class="btn active">保存</view>
+	</view>
+	<view
+	 class='delete-wrap'
+	 wx:if="{{addressId > 0}}"
+	 bindtap='deleteAddress'
+	>
+		<view class='btn'>删除</view>
+	</view>
+	<view class="region-select" wx:if="{{openSelectRegion}}">
+		<view class="hd">
+			<view class="region-selected">
+				<view
+				 class="item {{item.id == 0 ? 'disabled' : ''}} {{(regionType -1) === index ? 'selected' : ''}}"
+				 bindtap="selectRegionType"
+				 data-region-type-index="{{index}}"
+				 wx:for="{{selectRegionList}}"
+				 wx:key="id"
+				>{{item.name}}
+				</view>
+			</view>
+			<view class="done {{selectRegionDone ? '' : 'disabled'}}" bindtap="doneSelectRegion">确定</view>
+		</view>
+		<view class="bd">
+			<scroll-view scroll-y class="region-list">
+				<view
+				 class="item {{item.selected ? 'selected' : ''}}"
+				 bindtap="selectRegion"
+				 data-region-index="{{index}}"
+				 wx:for="{{regionList}}"
+				 wx:key="id"
+				>{{item.name}}
+				</view>
+			</scroll-view>
+		</view>
+	</view>
+</view>
+<view
+ class="bg-mask"
+ bindtap="cancelSelectRegion"
+ wx:if="{{openSelectRegion}}"
+></view>
+
+<van-popup
+ show="{{ isAddress }}"
+ closeable
+ position="bottom"
+ custom-style="height: 20%"
+ bind:close="onClose"
+>
+
+	<view style="width:100%;position:fixed;bottom:0;left:0;z-index:10000;height:500rpx;background-color:white">
+		<!-- 仿原生picker的“确定”和“取消”按钮 -->
+		<view style="display:flex;width:100%;height:100%">
+			<view style="position: absolute;top:0;width:100%;height:100rpx;z-index:1000000;display:flex;justify-content:space-between;align-items:center;">
+				<view style="width:calc(100% / 3);text-align:center;color:rgba(0,0,0,.6);font-size:28rpx" bindtap="onClose">取消
+				</view>
+				<view style="width:calc(100% / 3);text-align:center;color:#ff3456;font-size:28rpx" bindtap="confirm">确定
+				</view>
+			</view>
+
+			<picker-view
+			 indicator-style="height: 200rpx;"
+			 style="width: 100%;height: 300rpx;text-align: center;margin-top:150rpx"
+			 value="{{pIndex}}"
+			 bindchange="changeProvince"
+			>
+				<picker-view-column>
+					<view
+					 wx:for="{{placeArray}}"
+					 wx:key="name"
+					 style="line-height: 77rpx"
+					>{{item.name}}
+					</view>
+				</picker-view-column>
+			</picker-view>
+			<picker-view
+			 indicator-style="height: 200rpx;"
+			 style="width: 100%;height: 300rpx;text-align: center;margin-top:150rpx"
+			 value="{{cIndex}}"
+			 bindchange="changeCity"
+			>
+				<picker-view-column>
+					<view
+					 wx:for="{{placeArray[pIndex].city}}"
+					 wx:key="name"
+					 style="line-height: 77rpx"
+					>{{item.name}}
+					</view>
+				</picker-view-column>
+			</picker-view>
+			<picker-view
+			 indicator-style="height: 200rpx;"
+			 style="width: 100%;height: 300rpx;text-align: center;margin-top:150rpx"
+			 value="{{aIndex}}"
+			 bindchange="changeArea"
+			>
+				<picker-view-column>
+					<view
+					 wx:for="{{placeArray[pIndex].city[cIndex].area}}"
+					 wx:key="*this"
+					 style="line-height: 77rpx"
+					>{{item}}
+					</view>
+				</picker-view-column>
+			</picker-view>
+
+		</view>
+	</view>
+</van-popup>
+

+ 245 - 0
common-page/pages/info/ucenter/address-detail/index.wxss

@@ -0,0 +1,245 @@
+page {
+    min-height: 100%;
+    background-color: #f8f8f8;
+}
+
+.container {
+    min-height: 100%;
+    /* align-items: stretch; */
+    background: #f8f8f8;
+    overflow-x: hidden;
+    padding: 30rpx;
+}
+
+.edit-container {
+    background: #fff;
+    width: 100%;
+    margin-bottom: 30rpx;
+    border-radius: 10rpx;
+    box-shadow: 2rpx 8rpx 18rpx #f1f1f1;
+}
+
+.a-item {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    padding-left: 30rpx;
+}
+
+.a-item .icon {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    margin-right: 20rpx;
+}
+
+.a-item .icon .img {
+    width: 36rpx;
+    height: 36rpx;
+}
+
+.a-item .input-wrap {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+    padding: 30rpx 30rpx 30rpx 0;
+    border-bottom: 1rpx solid #f1f1f1;
+}
+
+.a-item:last-child .input-wrap {
+    border-bottom: none;
+}
+
+.a-item .input-wrap .a-input {
+    font-size: 28rpx;
+    width: 100%;
+}
+
+.a-item .input-wrap .arrow {
+    width: 10rpx;
+    height: 10rpx;
+    border-top: 4rpx solid #aaa;
+    border-right: 4rpx solid #aaa;
+    transform: rotate(45deg);
+}
+
+.a-input {
+    font-size: 28rpx;
+    width: 100%;
+}
+
+.confirm-box {
+    width: 100%;
+    height: 100rpx;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    /* border-top:1px solid #eee;  */
+    background: linear-gradient(to right, #ff116a, #fe5b46);
+    text-align: center;
+    line-height: 100rpx;
+    color: #fff;
+    font-size: 32rpx;
+}
+
+.default-input {
+    font-size: 28rpx;
+    color: #233445;
+    line-height: 60rpx;
+    margin: 0 auto;
+    width: 300rpx;
+}
+
+.region-select {
+    width: 100%;
+    height: 600rpx;
+    background: #fff;
+    position: fixed;
+    z-index: 1000;
+    left: 0;
+    bottom: 0;
+}
+
+.region-select .hd {
+    height: 108rpx;
+    width: 100%;
+    border-bottom: 1px solid #f4f4f4;
+    padding: 46rpx 30rpx 0 30rpx;
+    box-sizing: border-box;
+}
+
+.region-select .region-selected {
+    float: left;
+    height: 60rpx;
+    display: flex;
+}
+
+.region-select .region-selected .item {
+    max-width: 140rpx;
+    margin-right: 30rpx;
+    text-align: left;
+    line-height: 60rpx;
+    height: 100%;
+    color: #333;
+    font-size: 28rpx;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+
+.region-select .region-selected .item.disabled {
+    color: #999;
+}
+
+.region-select .region-selected .item.selected {
+    color: #ff3456;
+}
+
+.region-select .done {
+    float: right;
+    height: 60rpx;
+    width: 60rpx;
+    border: none;
+    background: #fff;
+    line-height: 60rpx;
+    text-align: center;
+    color: #ff3456;
+    font-size: 28rpx;
+}
+
+.region-select .done.disabled {
+    color: #999;
+}
+
+.region-select .bd {
+    height: 492rpx;
+    width: 100%;
+    padding: 0 30rpx;
+}
+
+.region-select .region-list {
+    height: 492rpx;
+}
+
+.region-select .region-list .item {
+    width: 100%;
+    height: 104rpx;
+    line-height: 104rpx;
+    text-align: left;
+    color: #333;
+    font-size: 28rpx;
+}
+
+.region-select .region-list .item.selected {
+    color: #ff3456;
+}
+
+.bg-mask {
+    height: 100%;
+    width: 100%;
+    background: rgba(0, 0, 0, 0.4);
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: 8;
+}
+
+.default-wrap{
+    background: #fff;
+    width: 100%;
+    margin-bottom: 30rpx;
+    border-radius: 10rpx;
+    box-shadow: 2rpx 8rpx 18rpx #f1f1f1;
+    padding: 30rpx;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    box-sizing: border-box;
+}
+
+.default-wrap .text{
+    font-size: 28rpx;
+}
+
+.btn-wrap {
+    width: 100%;
+    padding: 24rpx 0;
+    /* position: fixed;
+    bottom: 0;
+    left: 0; */
+    box-sizing: border-box;
+}
+
+.btn-wrap .btn {
+    font-size: 28rpx;
+    height: 100rpx;
+    line-height: 100rpx;
+    text-align: center;
+    border-radius: 10rpx;
+    width: 100%;
+    color: #fff;
+    background: #bbb;
+    box-shadow: 0rpx 10rpx 20rpx #ccc;
+}
+
+.btn-wrap .btn.active {
+    background: linear-gradient(to right, #3472ff, #3498ff);
+    box-shadow: 0rpx 10rpx 20rpx #f1f1f1;
+    color: #fff;
+}
+
+.delete-wrap {
+    width: 100%;
+    padding: 24rpx;
+    /* position: fixed;
+    bottom: 0;
+    left: 0; */
+    box-sizing: border-box;
+}
+
+.delete-wrap .btn {
+    font-size: 28rpx;
+    color: #5d6777;
+    text-align: center;
+}

+ 104 - 0
common-page/pages/info/ucenter/address/index.js

@@ -0,0 +1,104 @@
+// var util = require('../../../../../utils/util.js');
+// var api = require('../../../../../utils/api.js');
+// const pay = require('../../../../../services/pay.js');
+// const app = getApp()
+var Parse = getApp().Parse;
+
+// 触底上拉刷新 TODO 这里要将page传给服务器,作者没写
+Page({
+    data: {
+        addresses: [],
+        nowAddress: 0,
+        activeColor: getApp().globalData.activeColor,
+        titleColor: getApp().globalData.titleColor
+    },
+    goAddressDetail: function(e) {
+        let id = e.currentTarget.dataset.addressid;
+        wx.navigateTo({
+            url: '/common-page/pages/info/ucenter/address-detail/index?id=' + id,
+        })
+    },
+
+    async getAddresses() {
+        let that = this;
+        let addList = []
+        let user = Parse.User.current();
+        let query = new Parse.Query("ShopAddress");
+        query.equalTo("user", user.id);
+        let address = await query.find()
+        if(address)
+        {
+            address.map(item=>{
+                addList.push({
+                    id:item.id,
+                    name:item.get("name"),
+                    province_name:item.get("province_name"),
+                    city_name:item.get("city_name"),
+                    district_name:item.get("district_name"),
+                    full_region:item.get("full_region"),
+                    address:item.get("address")
+                })
+            })
+        }
+        that.setData({
+               addresses:  addList
+          })
+        
+        // util.request(api.GetAddresses).then(function(res) {
+        //     if (res.errno === 0) {
+        //         that.setData({
+        //             addresses: res.data
+        //         })
+        //     }
+        // });
+    },
+
+    selectAddress:function(e) {
+        let addressId = e.currentTarget.dataset.addressid
+        let address = e.currentTarget.dataset.address
+        wx.setStorageSync('addressId', addressId);
+        let pages = getCurrentPages()
+        // 获取上一界面的页面内容
+        let perPage = pages[pages.length-2]
+        perPage.setData({
+            address: address
+        })
+
+        wx.navigateBack();
+    },
+
+    onLoad: function(options) {
+        let type = options.type;
+        this.setData({
+            type: type
+        })
+    },
+    
+    onUnload: function() {},
+    onShow: function() {
+        this.getAddresses();
+        let addressId = wx.getStorageSync('addressId');
+        if (addressId) {
+            this.setData({
+                nowAddress: wx.getStorageSync('addressId')
+            });
+        }
+        else {
+            this.setData({
+                nowAddress: 0
+            });
+        }
+    },
+    // 新增地址
+    addAddress: function() {
+        wx.navigateTo({
+            url: '/nova-zhiliang/pages/my/ucenter/address-detail/index',
+        })
+    },
+    onPullDownRefresh: function () {
+        wx.showNavigationBarLoading()
+        this.getAddresses();
+        wx.hideNavigationBarLoading() //完成停止加载
+        wx.stopPullDownRefresh() //停止下拉刷新
+    }
+})

+ 5 - 0
common-page/pages/info/ucenter/address/index.json

@@ -0,0 +1,5 @@
+{
+    "navigationBarTitleText": "收货地址",
+    "usingComponents": {
+    }
+}

+ 31 - 0
common-page/pages/info/ucenter/address/index.wxml

@@ -0,0 +1,31 @@
+<nav type="back" title="选择地址" background-color="{{activeColor?activeColor:'#00b26a'}}" front-color="{{titleColor?titleColor:'#ffffff'}}"></nav>
+<view class="containers">
+    <view class='has-info' wx:if="{{addresses.length > 0}}">
+        <view bindtap="{{type == 0?'goAddressDetail':'selectAddress'}}" class='info-item' data-address="{{item}}" data-addressid="{{item.id}}" wx:for="{{addresses}}" wx:key="id">
+            <view class="selected" wx:if="{{type == 1}}">
+                <image wx:if="{{item.id == nowAddress}}" class="img" src="https://file-cloud.fmode.cn/gou-red.png"></image>
+                <image wx:else class="img" src="https://file-cloud.fmode.cn/gou-gray.png"></image>
+            </view>
+            <view class="info-wrap">
+                <view class="addr">
+                    <view class="top">{{item.address}}</view>
+                    <view class="text">{{item.full_region}}</view>
+                </view>
+                <view class="name">
+                    <view class="text">{{item.name}} {{item.mobile}}</view>
+                    <view class="default" wx:if="{{item.is_default}}">默认</view>
+                </view>
+            </view>
+            <view class="edit-wrap" data-addressid="{{item.id}}" catchtap='goAddressDetail'>
+                <image class="img" src="https://file-cloud.fmode.cn/edit.png"></image>
+            </view>
+        </view>
+    </view>
+    <view class="no-info" wx:else>
+        <image src="https://file-cloud.fmode.cn/position-deny.png" class="img"></image>
+        <view class="text">没有地址信息</view>
+    </view>
+    <view class="btn-wrap"  bindtap="addAddress">
+        <view class="btn" style="color: {{titleColor ? titleColor : ''}}; background: {{activeColor ? activeColor : ''}};">新增收货地址</view>
+    </view>
+</view>

+ 218 - 0
common-page/pages/info/ucenter/address/index.wxss

@@ -0,0 +1,218 @@
+.containers {
+  display: flex;
+  align-items: stretch;
+  overflow-x: hidden;
+}
+
+.has-info {
+  display: flex;
+  flex-direction: column;
+  padding: 30rpx;
+  width: 100%;
+}
+
+.has-info .info-item {
+  padding: 30rpx 0;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  background: #fff;
+  border-radius: 10rpx;
+  box-shadow: 2rpx 8rpx 18rpx #f1f1f1;
+  margin-bottom: 24rpx;
+  position: relative;
+}
+
+.has-info .info-item .edit-wrap {
+  padding: 30rpx;
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.has-info .info-item .edit-wrap .img {
+  width: 42rpx;
+  height: 42rpx;
+}
+
+.has-info .info-item .selected {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 30rpx 0 30rpx 30rpx;
+}
+
+.has-info .info-item .selected .img {
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.has-info .info-item .info-wrap {
+  display: flex;
+  flex-direction: column;
+  padding-left: 30rpx;
+}
+
+.has-info .info-item .info-wrap .addr {
+  display: flex;
+  flex-direction: column;
+  margin-bottom: 10rpx;
+}
+
+.has-info .info-item .info-wrap .addr .top {
+  font-size: 30rpx;
+  font-weight: 500;
+  margin-bottom: 4rpx;
+}
+
+.has-info .info-item .info-wrap .addr .text {
+  font-size: 24rpx;
+  color: #777;
+}
+
+.has-info .info-item .info-wrap .addr .img-wrap {
+  width: 44rpx;
+  height: 44rpx;
+  margin-right: 10rpx;
+}
+
+.has-info .info-item .info-wrap .name {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+
+.has-info .info-item .info-wrap .name .img-wrap {
+  width: 44rpx;
+  height: 44rpx;
+  margin-right: 10rpx;
+}
+
+.has-info .info-item .info-wrap .name .img {
+  width: 42rpx;
+  height: 42rpx;
+}
+
+.has-info .info-item .info-wrap .name .default {
+  font-size: 22rpx;
+  color: #ff3456;
+  background: #faedef;
+  text-align: center;
+  padding: 2rpx 10rpx;
+  border-radius: 4rpx;
+}
+
+.has-info .info-item .info-wrap .name .text {
+  font-size: 26rpx;
+  margin-right: 10rpx;
+}
+
+.has-info .info-item .id-wrap {
+  display: flex;
+  flex-direction: column;
+}
+
+.has-info .info-item .id-wrap .ids {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-size: 26rpx;
+  color: #5d6777;
+  margin-bottom: 8rpx;
+}
+
+.has-info .info-item .id-wrap .ids .id-name {
+  margin-right: 20rpx;
+}
+
+.has-info .info-item .id-wrap .no-ids {
+  font-size: 26rpx;
+  color: #ffbb12;
+}
+
+.has-info .add-btn {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background: #fff;
+  border-radius: 10rpx;
+  box-shadow: 2rpx 8rpx 18rpx #f1f1f1;
+  margin-bottom: 24rpx;
+  padding: 30rpx 0;
+}
+
+.has-info .add-btn .icon-wrap {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 40rpx;
+  height: 40rpx;
+  margin-right: 8rpx;
+}
+
+.has-info .add-btn .icon-wrap .img {
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.has-info .add-btn .text {
+  font-size: 28rpx;
+  color: #ffc310;
+}
+
+.no-info {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  margin-top: 300rpx;
+  width: 100%;
+}
+
+.no-info .img {
+  width: 100rpx;
+  height: 100rpx;
+  margin-bottom: 30rpx;
+}
+
+.no-info .text {
+  font-size: 30rpx;
+  color: #999;
+  text-align: center;
+  margin-bottom: 30rpx;
+}
+
+.no-info .add-btn {
+  color: #192841;
+  /* background: #ff3456; */
+  background: linear-gradient(to right, #f8dd66, #fae277);
+  border-radius: 100px;
+  width: 400rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  font-size: 28rpx;
+  margin: 0 auto;
+}
+
+.btn-wrap {
+  position: fixed;
+  bottom: 0;
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.btn-wrap .btn {
+  width: 100%;
+  background: linear-gradient(to right, #00b26a, #e6c006);
+  color: #fff;
+  font-size: 28rpx;
+  text-align: center;
+  height: 110rpx;
+  line-height: 100rpx;
+}

+ 66 - 0
common-page/pages/info/ucenter/index.js

@@ -0,0 +1,66 @@
+// common-page/pages/info/ucenter/index.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
common-page/pages/info/ucenter/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 2 - 0
common-page/pages/info/ucenter/index.wxml

@@ -0,0 +1,2 @@
+<!--common-page/pages/info/ucenter/index.wxml-->
+<text>common-page/pages/info/ucenter/index.wxml</text>

+ 1 - 0
common-page/pages/info/ucenter/index.wxss

@@ -0,0 +1 @@
+/* common-page/pages/info/ucenter/index.wxss */

+ 100 - 0
common-page/pages/loading/index.js

@@ -0,0 +1,100 @@
+const Parse = getApp().Parse;
+const company = getApp().globalData.company;
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    isChack:false,
+    title:'服务器已到期,等待店主开通中'
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad:async function (options) {
+    let { url } = options
+    this.setData({
+      url
+    })
+    let query = new Parse.Query("Company")
+    query.select('website','expireMap')
+    query.equalTo('objectId',company)
+    let c = await query.first()
+    if(c?.id && c?.get('expireMap')){
+      //website配置且renew(续费)存在
+      if(c.get('expireMap')?.renew && c.get('website')){
+        this.setData({
+          title:c.get('website')
+        })
+      }
+    }
+  },
+  onCheck(){
+    this.setData({
+      isChack:true
+    })
+  },
+  onTour(){
+    if(this.data.isChack){
+      wx.showLoading({
+        title: '正在跳转',
+      });
+      let url = this.data.url
+      wx.redirectTo({
+        url: url,
+      });
+      wx.hideLoading();
+    }
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
common-page/pages/loading/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 7 - 0
common-page/pages/loading/index.wxml

@@ -0,0 +1,7 @@
+<view style="padding: 200rpx 0;display: flex;flex-direction: column;align-items: center;">
+  <!-- <van-empty style="width: 100%;" image='https://file-cloud.fmode.cn/668rM7MPii/20230808/1lcd16094625153.png' description="服务器已到期,等待店主开通中" /> -->
+  <image style="width: 600rpx;" mode="aspectFit" src="https://file-cloud.fmode.cn/668rM7MPii/20230808/1lcd16094625153.png"
+   bindtap="onTour" />
+  <view style="margin-top: 100rpx;color: #8c8c8c;padding: 0 50rpx;text-align: center;">{{title}}</view>
+</view>
+<view class="hide-btn" bindtap="onCheck"></view>

+ 8 - 0
common-page/pages/loading/index.wxss

@@ -0,0 +1,8 @@
+.hide-btn{
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100rpx;
+  background: white;
+}

+ 323 - 0
common-page/pages/lucky-draw/index.js

@@ -0,0 +1,323 @@
+// pages/Lucky-draw/index.js
+const Parse = getApp().Parse
+const company = getApp().globalData.company
+const rechText = require('../../../utils/rech-text')
+const dateF = require('../../../utils/date.js')
+const login = require("../../../utils/login");
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        prizeId: '', // 抽中结果id,通过属性方式传入组件
+        config: { // 转盘配置,通过属性方式传入组件
+            nameLength: 7
+        },
+        luckyDrawRules: null,
+        giftModules: [],
+        account: null,
+        gifts: [],
+        user: "",
+        module: "",
+        giftsList: [],
+        twoModal: false,
+        region: ['江西省', '南昌市', '东湖区'],
+        name: "",
+        address: "",
+        mobile: "",
+        area: "",
+        value: '',
+        enable: true
+
+    },
+    // 奖品表
+    async getgiftModule() {
+        let GiftModule = new Parse.Query("GiftModule");
+        GiftModule.equalTo("company", company);
+        let giftModules = await GiftModule.find();
+        let giftModuleJSON = []
+        if (giftModules && giftModules.length > 0) {
+            giftModules.forEach(giftModule => {
+                let b = giftModule.toJSON()
+                giftModuleJSON.push(b)
+            })
+            this.setData({
+                giftModules: giftModuleJSON
+
+            })
+        }
+
+    },
+    //积分表
+    async getAccount() {
+        let uid = Parse.User.current().id
+        let queryAccount = new Parse.Query("Account");
+        queryAccount.equalTo("user", uid);
+        let account = await queryAccount.first();
+        console.log(account)
+        if (account && account.id) {
+            this.setData({
+                account: account.toJSON()
+            });
+        }
+    },
+
+    // 数据增减
+    async subtractIntegral() {
+        let Account = new Parse.Query('Account')
+        let updateAccount = await Account.get(this.data.account.objectId)
+        updateAccount.increment('credit', -this.data.luckyDrawRules.credit)
+        let res = await updateAccount.save()
+        console.log(res)
+        if (res && res.id) {
+            this.setData({
+                account: res.toJSON()
+            })
+        }
+    },
+
+    onNotEnoughHandle(e) {
+        wx.showToast({
+            icon: 'none',
+            title: e.detail
+        })
+    },
+    // 点击函数
+    onLuckDrawHandle() {
+        console.log(this.data.luckyDrawRules.credit, this.data.account.credit)
+        if(!this.data.account.credit || (this.data.luckyDrawRules.credit > this.data.account.credit))
+        {
+            wx.showToast({
+                title: '积分不足!',
+                icon: 'none'
+            });
+            this.setData({
+                enable: true
+            })
+            return;
+        }
+        this.subtractIntegral() //修改数据库
+        this.setData({
+            prizeId: this.data.giftModules[Math.floor(Math.random() * 10 % this.data.giftModules.length)].objectId,
+        });
+
+    },
+
+    /**
+     * 动画旋转完成回调
+     */
+    async onLuckDrawFinishHandle() {
+        let giftModules = this.data.giftModules;
+        let data = giftModules.find((item) => {
+            return item.objectId === this.data.prizeId;
+        });
+        wx.showToast({
+            icon: 'none',
+            title: `恭喜你抽中 ${data.name}`
+        })
+        await this.saveGift(this.data.prizeId)
+        this.setData({
+            prizeId: ''
+        });
+
+    },
+    //添加数据
+    async saveGift(prizeId) {
+        let Gift = Parse.Object.extend('Gift')
+        let gift = new Gift()
+        let uid = Parse.User.current().id
+        gift.set('user', {
+            __type: 'Pointer',
+            className: "_User",
+            objectId: uid
+        })
+        gift.set('module', {
+            __type: 'Pointer',
+            className: "GiftModule",
+            objectId: prizeId
+        })
+        gift.set('company', {
+            __type: 'Pointer',
+            className: "Company",
+            objectId: company
+        })
+        
+        let res = await gift.save()
+        if (res && res.id) {
+            await this.getGift()
+        }
+    },
+    async getGift() {
+        let uid = Parse.User.current().id
+        let Gift = new Parse.Query("Gift");
+        Gift.equalTo("company", company);
+        Gift.descending("createdAt")
+        Gift.include('module')
+        Gift.equalTo("user", uid);
+        let gifts = await Gift.find();
+        let giftJSON = []
+        if (gifts && gifts.length > 0) {
+            gifts.forEach(gift => {
+                let b = gift.toJSON()
+                b.joinTime = dateF.formatTime("YYYY-mm-dd HH:MM:SS", b.createdAt)
+                giftJSON.push(b)
+            })
+            this.setData({
+                giftList: giftJSON
+            })
+        }
+    },
+    async getLuckyDrawRules() {
+        let LuckyDrawRule = new Parse.Query("LuckyDrawRules");
+        LuckyDrawRule.equalTo("company", company);
+        LuckyDrawRule.equalTo("isOpen", true);
+        let luckyDrawRules = await LuckyDrawRule.first();
+
+        if (luckyDrawRules) {
+            let rules = luckyDrawRules.toJSON()
+            rules.content = rechText.formatRichText(rules.detail)
+            this.setData({
+                luckyDrawRules: rules,
+
+            })
+        }
+        console.log(this.data.luckyDrawRules)
+    },
+    shopsubmit: function(e) {
+        let item = e.currentTarget.dataset.item
+        console.log(item)
+        this.setData({
+            twoModal: true,
+            receiveId: item.objectId
+        })
+    },
+    shoppreventTouchMove: function() {
+        this.setData({
+            twoModal: false
+        })
+    },
+    bindRegionChange: function(e) { // picker值发生改变都会触发该方法
+        console.log('picker发送选择改变,携带值为', e.detail.value)
+        this.setData({
+            region: e.detail.value
+        })
+    },
+    hideRule: function() {
+        this.setData({
+            twoModal: false
+        })
+    },
+    //提交按纽// 修改数据
+    async submit() {
+        let newGift = new Parse.Query('Gift')
+        if (!this.data.mobile || !this.data.name || !this.data.address || this.data.region.length == 0) {
+            wx.showToast({
+                title: '请将信息填写完整',
+                icon: 'none'
+            })
+            return
+        }
+        let area = ""
+        this.data.region.forEach((item, index) => {
+            if (index == (this.data.region.length - 1)) {
+                area += item
+            } else {
+                area += item + '-'
+            }
+        })
+        let res = await newGift.get(this.data.receiveId)
+        if (res) {
+            res.set("mobile", this.data.mobile)
+            res.set("name", this.data.name)
+            res.set("address", this.data.address)
+            res.set("area", area)
+
+            let updateuser = await res.save()
+            if (updateuser) {
+                console.log(updateuser)
+                wx.showToast({
+                    title: '确认成功',
+                    icon: 'success',
+                    image: '',
+                    duration: 1000,
+                    mask: false,
+                });
+                this.setData({
+                    receiveId: "",
+                    name: "",
+                    mobile: "",
+                    address: "",
+                    twoModal: false
+                })
+            }
+        }
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function(options) {
+        let userLogin = wx.getStorageSync("userLogin");
+        if (userLogin == "") {
+            login.loginNow();
+            return;
+        }
+        await this.getLuckyDrawRules()
+        await this.getgiftModule()
+        await this.getGift()
+        await this.getAccount()
+        
+        
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function(e) {
+
+    },
+
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function() {
+
+    },
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function() {
+
+    }
+})

+ 9 - 0
common-page/pages/lucky-draw/index.json

@@ -0,0 +1,9 @@
+{
+    "usingComponents": {
+        "draw": "/components/draw/index",
+        "van-field": "@vant/weapp/field/index",
+        "van-empty": "@vant/weapp/empty/index"
+
+    },
+    "navigationBarTitleText": "幸运大抽奖"
+}

+ 248 - 0
common-page/pages/lucky-draw/index.less

@@ -0,0 +1,248 @@
+page {
+//    background: #FFB82E;
+}
+
+.box {
+    background-repeat:repeat;
+    background-position: center top;
+    background-size: 100% 60%;
+    .my-integral {
+        color: #CC0000;
+        margin-left: 30rpx;
+    }
+
+    .draw {
+        margin: 66rpx 0rpx 0rpx 110rpx;
+    }
+
+    .prize-box {
+        margin: 20rpx 30rpx 0rpx 30rpx;
+        background: #FFE4B2;
+        border-radius: 50rpx;
+        padding-bottom: 20rpx;
+
+        .prize {
+            padding: 30rpx 0rpx 0rpx 30rpx;
+            font-size: 30rpx;
+            font-family: Source Han Sans CN;
+            font-weight: 400;
+            color: #222222;
+            line-height: 24rpx;
+        }
+
+        .details {
+            margin: 20rpx 30rpx 0rpx 30rpx;
+        }
+    }
+
+    .record {
+        margin: 20rpx 30rpx 0rpx 30rpx;
+        background: #FFD57F;
+        border-radius: 50rpx;
+        padding-bottom: 20rpx;
+        
+
+        .record-top {
+            font-size: 30rpx;
+            font-family: Source Han Sans CN;
+            font-weight: 400;
+            color: #CC0000;
+            line-height: 24rpx;
+            padding: 30rpx 0rpx 0rpx 30rpx;
+            margin-bottom: 20rpx;
+        }
+
+        .record-x {
+            white-space: nowrap;
+            /* box-sizing: border-box; */
+            height: 600rpx;
+            .record-txt {
+                display: flex;
+                background: #FFEECB;
+                border-radius: 20rpx;
+                padding: 20rpx 0rpx 20rpx 0rpx;
+                margin:0rpx 20rpx 20rpx 20rpx;
+                .record-name {
+                    width: 200rpx;
+                    font-size: 30rpx;
+                    font-family: Source Han Sans CN;
+                    font-weight: 400;
+                    color: #CC0000;
+                    line-height: 24rpx;
+                    margin: 25rpx 0rpx 0rpx 30rpx;
+                }
+
+                .record-time {
+                    margin-top: 20rpx;
+                    font-size: 24rpx;
+                    color: #666666;
+                }
+
+                .record-title {
+                    margin-left: 40rpx;
+                    background: #DDDDDD;
+                    border-radius: 20rpx;
+                    padding: 10rpx 0rpx 10rpx 0rpx;
+                    width: 120rpx;
+                    text-align: center;
+                }
+                .record-titles {
+                    margin-left: 40rpx;
+                    background: #FFB82E;
+                    border-radius: 20rpx;
+                    padding: 10rpx 0rpx 10rpx 0rpx;
+                    width: 120rpx;
+                    text-align: center;
+                }
+            }
+
+        }
+
+   
+    }
+
+}
+
+.top {
+    display: flex;
+    justify-content: space-between;
+    padding: 30rpx;
+
+    .rules {
+        font-size: 24rpx;
+    }
+}
+
+
+
+
+.shop-mask {
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    z-index: 9000;
+    background-color: rgba(0, 0, 0, 0.6);
+}
+
+.shop-button {
+    width: 690rpx !important;
+    height: 88rpx !important;
+    background: #41B1FF;
+    border-radius: 44px;
+    margin: 30rpx 20rpx 70rpx 30rpx !important;
+    color: #ffffff !important;
+    font-size: 32rpx;
+    font-family: PingFang SC;
+    font-weight: 500;
+    line-height: 40rpx;
+    padding: 20rpx !important;
+}
+
+.shop-modalDlg {
+    width: 750rpx;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    z-index: 9999;
+    background-color: #ffffff;
+    border-radius: 30rpx 30rpx 0rpx 0rpx;
+    display: flex;
+    flex-direction: column;
+
+    .modalDlg-txtt {
+        font-size: 32rpx;
+        font-family: PingFang SC;
+        font-weight: 500;
+        color: #e61b1b;
+        margin-top: 33rpx;
+        text-align: center;
+    }
+
+    .input-txt {
+        text-align: left;
+        margin: 20rpx 30rpx 0rpx 40rpx;
+        color: #777575;
+
+    }
+
+    .input {
+        float: right;
+        flex: 1;
+        width: 660rpx;
+        height: 88rpx;
+        border-style: solid;
+        border: 2rpx solid #DDDDDD;
+        margin: 20rpx 0rpx 0rpx 30rpx;
+        padding-left: 30rpx;
+    }
+
+    .confirm-next {
+        width: 690rpx !important;
+        height: 100rpx !important;
+        border-radius: 44rpx !important;
+        margin: 30rpx 20rpx 30rpx 30rpx !important;
+        background: #d14545;
+        color: #ffffff !important;
+        font-size: 36rpx !important;
+        font-family: Source Han Sans CN !important;
+        font-weight: 400 !important;
+
+        text-align: center;
+    }
+
+    .input-box {
+        display: flex;
+        width: 670rpx;
+        border-bottom: 2rpx solid #f6f6f6;
+        margin-left: 40rpx;
+
+        .input-txt {
+            text-align: left;
+            margin: 20rpx 30rpx 0rpx 0rpx;
+            color: #777575;
+
+        }
+
+        .input-address {
+            float: left;
+            flex: 1;
+            display: flex;
+            margin: 20rpx 0rpx 0rpx 40rpx;
+            padding-left: 10rpx;
+
+            .shop-inputs {
+                font-size: 30rpx;
+                font-family: PingFang SC;
+                font-weight: 500;
+                color: black;
+                line-height: 40rpx;
+                margin: 10rpx 0rpx 30rpx 0rpx;
+            }
+        }
+    }
+
+    .ruleHide {
+        height: 30rpx !important;
+        width: 30rpx !important;
+        position: absolute;
+        top: 40rpx;
+        right: 20rpx;
+        margin-right: 10rpx;
+    }
+
+    .return {
+        height: 50rpx !important;
+        width: 50rpx !important;
+        position: absolute;
+        top: 30rpx;
+        left: 20rpx;
+        font-size: 30rpx;
+        font-family: Source Han Sans CN;
+        font-weight: 400;
+        color: #999999;
+        line-height: 40rpx;
+        text-align: left;
+    }
+}

+ 65 - 0
common-page/pages/lucky-draw/index.wxml

@@ -0,0 +1,65 @@
+<nav type="back" title="{{luckyDrawRules.name}}" background-color="#FFB82E"></nav>
+<block wx:if="{{ luckyDrawRules && (giftModules && giftModules.length > 0) }}">
+    <view class="box" style="background-image: url('{{luckyDrawRules.bgImg}}')">
+        <view class="my-integral">我的积分:{{account.credit ? account.credit : 0}}</view>
+        <view class="draw">
+            <draw gifts="{{giftModules}}" prize-id="{{prizeId}}" 
+                count="{{account.credit ? account.credit : 0}}" 
+                enable="{{enable}}"
+                config="{{config}}"
+                 bind:LuckDraw="onLuckDrawHandle" 
+                bindNotEnough="onNotEnoughHandle" 
+                bindLuckDrawFinish="onLuckDrawFinishHandle">
+            </draw>
+        </view>
+        <view class="prize-box">
+            <view class="prize">抽奖规则: {{luckyDrawRules.credit ? luckyDrawRules.credit + '积分一次' : "免费抽奖"}} </view>
+            <view class="details">
+                <rich-text nodes="{{luckyDrawRules.content}}" style="width: 92%;height: 100%; margin-right: 0 auto;">
+                </rich-text>
+            </view>
+        </view>
+        <view class="record">
+            <view class="record-top">中奖记录:</view>
+            <scroll-view class="record-x" scroll-y="true">
+                <block wx:for="{{giftList}}" class="item" wx:key="index">
+                    <view class="record-txt">
+                        <view class="record-name">{{item.module.name}}</view>
+                        <view class="record-time">{{item.joinTime}}</view>
+                        <view wx:if="{{item.name}}">
+                            <view class="record-title">已领取</view>
+                        </view>
+                        <view wx:elif="{{!item.name}}">
+                            <view class="record-titles" data-item="{{item}}" bindtap="shopsubmit">领取</view>
+                        </view>
+                    </view>
+                </block>
+            </scroll-view>
+        </view>
+    </view>
+    <view class="shop-mask" catchtouchmove="shoppreventTouchMove" wx:if="{{twoModal}}">
+        <view class="shop-modalDlg" wx:if="{{twoModal}}">
+            <text class='modalDlg-txtt'>请填写收货信息,确认之后无法更改!</text>
+            <van-cell-group>
+                <van-field model:value="{{ name }}" label="收件人姓名" placeholder="请输入收件人姓名" />
+                <van-field model:value="{{ mobile }}" label="手机号" placeholder="请输入收件人手机号" />
+                <view class="input-box">
+                    <view class="input-txt">收货地址</view>
+                    <picker class="input-address" mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
+                        <view class="shop-inputs">
+                            {{region[0]}} {{region[1]}} {{region[2]}}
+                        </view>
+                    </picker>
+                </view>
+                <van-field model:value="{{ address }}" label="详细地址" placeholder="请输入收货地址" />
+            </van-cell-group>
+            <image src="https://file-cloud.fmode.cn/lb486SzXLP/20211104/i717lg055104.png" class="ruleHide" bindtap="hideRule" />
+            <button class="confirm-next" bindtap="submit">确认</button>
+        </view>
+    </view>
+</block>
+<block wx:else>
+    <van-empty description="暂时还未开启抽奖" />
+</block>
+  
+  

+ 209 - 0
common-page/pages/lucky-draw/index.wxss

@@ -0,0 +1,209 @@
+.box {
+  background-repeat: repeat;
+  background-position: center top;
+  background-size: 100% 60%;
+}
+.box .my-integral {
+  color: #CC0000;
+  margin-left: 30rpx;
+}
+.box .draw {
+  margin: 66rpx 0rpx 0rpx 110rpx;
+}
+.box .prize-box {
+  margin: 20rpx 30rpx 0rpx 30rpx;
+  background: #FFE4B2;
+  border-radius: 50rpx;
+  padding-bottom: 20rpx;
+}
+.box .prize-box .prize {
+  padding: 30rpx 0rpx 0rpx 30rpx;
+  font-size: 30rpx;
+  font-family: Source Han Sans CN;
+  font-weight: 400;
+  color: #222222;
+  line-height: 24rpx;
+}
+.box .prize-box .details {
+  margin: 20rpx 30rpx 0rpx 30rpx;
+}
+.box .record {
+  margin: 20rpx 30rpx 0rpx 30rpx;
+  background: #FFD57F;
+  border-radius: 50rpx;
+  padding-bottom: 20rpx;
+}
+.box .record .record-top {
+  font-size: 30rpx;
+  font-family: Source Han Sans CN;
+  font-weight: 400;
+  color: #CC0000;
+  line-height: 24rpx;
+  padding: 30rpx 0rpx 0rpx 30rpx;
+  margin-bottom: 20rpx;
+}
+.box .record .record-x {
+  white-space: nowrap;
+  /* box-sizing: border-box; */
+  height: 600rpx;
+}
+.box .record .record-x .record-txt {
+  display: flex;
+  background: #FFEECB;
+  border-radius: 20rpx;
+  padding: 20rpx 0rpx 20rpx 0rpx;
+  margin: 0rpx 20rpx 20rpx 20rpx;
+}
+.box .record .record-x .record-txt .record-name {
+  width: 200rpx;
+  font-size: 30rpx;
+  font-family: Source Han Sans CN;
+  font-weight: 400;
+  color: #CC0000;
+  line-height: 24rpx;
+  margin: 25rpx 0rpx 0rpx 30rpx;
+}
+.box .record .record-x .record-txt .record-time {
+  margin-top: 20rpx;
+  font-size: 24rpx;
+  color: #666666;
+}
+.box .record .record-x .record-txt .record-title {
+  margin-left: 40rpx;
+  background: #DDDDDD;
+  border-radius: 20rpx;
+  padding: 10rpx 0rpx 10rpx 0rpx;
+  width: 120rpx;
+  text-align: center;
+}
+.box .record .record-x .record-txt .record-titles {
+  margin-left: 40rpx;
+  background: #FFB82E;
+  border-radius: 20rpx;
+  padding: 10rpx 0rpx 10rpx 0rpx;
+  width: 120rpx;
+  text-align: center;
+}
+.top {
+  display: flex;
+  justify-content: space-between;
+  padding: 30rpx;
+}
+.top .rules {
+  font-size: 24rpx;
+}
+.shop-mask {
+  width: 100%;
+  height: 100%;
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 9000;
+  background-color: rgba(0, 0, 0, 0.6);
+}
+.shop-button {
+  width: 690rpx !important;
+  height: 88rpx !important;
+  background: #41B1FF;
+  border-radius: 44px;
+  margin: 30rpx 20rpx 70rpx 30rpx !important;
+  color: #ffffff !important;
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  line-height: 40rpx;
+  padding: 20rpx !important;
+}
+.shop-modalDlg {
+  width: 750rpx;
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 9999;
+  background-color: #ffffff;
+  border-radius: 30rpx 30rpx 0rpx 0rpx;
+  display: flex;
+  flex-direction: column;
+}
+.shop-modalDlg .modalDlg-txtt {
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #e61b1b;
+  margin-top: 33rpx;
+  text-align: center;
+}
+.shop-modalDlg .input-txt {
+  text-align: left;
+  margin: 20rpx 30rpx 0rpx 40rpx;
+  color: #777575;
+}
+.shop-modalDlg .input {
+  float: right;
+  flex: 1;
+  width: 660rpx;
+  height: 88rpx;
+  border-style: solid;
+  border: 2rpx solid #DDDDDD;
+  margin: 20rpx 0rpx 0rpx 30rpx;
+  padding-left: 30rpx;
+}
+.shop-modalDlg .confirm-next {
+  width: 690rpx !important;
+  height: 100rpx !important;
+  border-radius: 44rpx !important;
+  margin: 30rpx 20rpx 30rpx 30rpx !important;
+  background: #d14545;
+  color: #ffffff !important;
+  font-size: 36rpx !important;
+  font-family: Source Han Sans CN !important;
+  font-weight: 400 !important;
+  text-align: center;
+}
+.shop-modalDlg .input-box {
+  display: flex;
+  width: 670rpx;
+  border-bottom: 2rpx solid #f6f6f6;
+  margin-left: 40rpx;
+}
+.shop-modalDlg .input-box .input-txt {
+  text-align: left;
+  margin: 20rpx 30rpx 0rpx 0rpx;
+  color: #777575;
+}
+.shop-modalDlg .input-box .input-address {
+  float: left;
+  flex: 1;
+  display: flex;
+  margin: 20rpx 0rpx 0rpx 40rpx;
+  padding-left: 10rpx;
+}
+.shop-modalDlg .input-box .input-address .shop-inputs {
+  font-size: 30rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: black;
+  line-height: 40rpx;
+  margin: 10rpx 0rpx 30rpx 0rpx;
+}
+.shop-modalDlg .ruleHide {
+  height: 30rpx !important;
+  width: 30rpx !important;
+  position: absolute;
+  top: 40rpx;
+  right: 20rpx;
+  margin-right: 10rpx;
+}
+.shop-modalDlg .return {
+  height: 50rpx !important;
+  width: 50rpx !important;
+  position: absolute;
+  top: 30rpx;
+  left: 20rpx;
+  font-size: 30rpx;
+  font-family: Source Han Sans CN;
+  font-weight: 400;
+  color: #999999;
+  line-height: 40rpx;
+  text-align: left;
+}

+ 66 - 0
common-page/pages/myOrder/afterSale/index.js

@@ -0,0 +1,66 @@
+// nova-shop/pages/myOrder/afterSale/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
common-page/pages/myOrder/afterSale/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 1 - 0
common-page/pages/myOrder/afterSale/index.wxml

@@ -0,0 +1 @@
+<nav type="back" background-color="#ffffff" title="售后" />

+ 1 - 0
common-page/pages/myOrder/afterSale/index.wxss

@@ -0,0 +1 @@
+/* nova-shop/pages/myOrder/afterSale/index.wxss */

+ 442 - 0
common-page/pages/myOrder/index.js

@@ -0,0 +1,442 @@
+const Parse = getApp().Parse
+const company = getApp().globalData.company
+const dateF = require('../../../utils/date')
+const req = require('../../utils/request')
+const colorChange = require("../../utils/color");
+// const activeColor=getApp().globalData.activeColor
+let {
+	statusBarHeight
+} = wx.getSystemInfoSync();
+statusBarHeight = Math.abs(statusBarHeight)
+let custom = wx.getMenuButtonBoundingClientRect();
+let customBarHeight = custom.bottom + custom.top - statusBarHeight;
+customBarHeight = Math.abs(customBarHeight)
+Page({
+	data: {
+		status: 1,
+		active: null,
+		activeColor: null,
+		goodsList: [],
+		currentGoods: null,
+		type: null, // 订单类型
+		themeColor: '',
+		themeRGB: [],
+		customBarHeight,
+	},
+	onChange(e) {
+		console.log(e)
+		console.log(e.detail)
+		let {
+			index
+		} = e.detail
+		this.setData({
+			active: index
+		})
+		console.log(index, e.detail)
+		let switchFn = {
+			'0': 0,
+			'1': 100,
+			'2': 200,
+			'3': 300,
+			'4': 400
+		}
+		this.setData({
+			goodsList:[]
+		})
+		this.queryShopOrder(switchFn[index])
+	},
+
+	//删除
+	delOrder(e) {
+		console.log(e);
+		let {
+			index
+		} = e.currentTarget.dataset
+		let {
+			goodsList
+		} = this.data
+		let _this = this
+		wx.showModal({
+			title: '',
+			content: '你确定删除该订单吗?',
+			showCancel: true,
+			cancelText: '取消',
+			cancelColor: '#000000',
+			confirmText: '确定',
+			confirmColor: '#3CC51F',
+			success: async (result) => {
+				if (result.confirm) {
+					await this.upDel(goodsList[index].objectId)
+					goodsList.splice(index, 1)
+					_this.setData({
+						goodsList
+					})
+					wx.showToast({
+						title: '已取消',
+						icon: 'none',
+						image: '',
+						duration: 1500,
+					});
+				}
+			},
+			fail: () => { },
+			complete: () => { }
+		});
+	},
+	async upDel(id) {
+		let ShopOrder = new Parse.Query('Order')
+		let order = await ShopOrder.get(id)
+		if (order && order.id) {
+			console.log(order);
+			await order.destroy()
+		}
+	},
+	// 查看物流
+	onShowExpress(e) {
+		let { item } = e.currentTarget.dataset
+		console.log(item)
+		if (item?.trackingNumber) {
+			let url = `/common-page/pages/nova-express/index?num=${item.trackingNumber}&com=${item.expressCompany && item.expressCompany.code}`
+			wx.navigateTo({
+				url: url,
+			});
+			return
+		}
+		wx.showToast({
+			title: '暂无物流信息',
+			icon: 'error',
+			image: '',
+			duration: 1500,
+			mask: false,
+		});
+	},
+
+	//确认收货
+	receipt(e) {
+		console.log(e);
+		let {
+			index
+		} = e.currentTarget.dataset
+		let {
+			goodsList
+		} = this.data
+		let _this = this
+		wx.showModal({
+			title: '',
+			content: '是否确认收货',
+			showCancel: true,
+			cancelText: '取消',
+			cancelColor: '#000000',
+			confirmText: '确定',
+			confirmColor: '#3CC51F',
+			success: async (result) => {
+				if (result.confirm) {
+					await _this.upOk(goodsList[index].objectId)
+					wx.showToast({
+						title: '已收货',
+						icon: 'none',
+						image: '',
+						duration: 1500,
+					});
+				}
+			},
+			fail: () => { },
+			complete: () => { }
+		});
+	},
+	async upOk(id) {
+		let {
+			active
+		} = this.data
+		let ShopOrder = new Parse.Query('Order')
+		let order = await ShopOrder.get(id)
+		if (order && order.id) {
+			order.set("status", '400')
+			await order.save()
+			let e = {
+				detail: active
+			}
+			this.onChange(e)
+		}
+	},
+
+
+	toUrl(e) {
+		let {
+			url
+		} = e.currentTarget.dataset
+		wx.navigateTo({
+			url: url,
+		});
+	},
+	/**
+	 * 生命周期函数--监听页面加载
+	 */
+	onLoad:async function (options) {
+		//测试数据
+		console.log(getApp().globalData.activeColor);
+		let status = options.status ? Number(options.status) : 0
+		let type = options.type;
+		let themeColor = options.themeColor || getApp().globalData.activeColor;
+		let titleColor = getApp().globalData.titleColor;
+		console.log(status, 11111)
+		this.setData({
+			status: status,
+			type,
+			themeColor,
+			titleColor
+		})
+		console.log(titleColor);
+		themeColor && this.changeTheme()
+		let switchFn = {
+			'100': 1,
+			'200': 2,
+			'300': 3,
+			'400': 4
+		}
+		
+		let active = switchFn[status] ? switchFn[status] : 0
+		await this.queryShopOrder(status)
+		this.setData({
+			active: active
+		})
+	},
+	async reqSql() {
+		let user = Parse.User.current().id
+		let type = this.data.type;
+
+		let sql = `select sr."objectId",sr.name,sr.price,sr.count,sr."createdAt",sr.status,
+            gd.desc,gd.image
+            from "ShopOrder" as sr
+            join "ShopGoods" as gd
+            on gd."objectId" = sr."goods"
+            where sr.user = '${user}' and sr.type = '${type}'
+            and (sr.status = 400 or sr.status = 800)`
+		let res = await req.customSQL(sql)
+		console.log(res);
+		let goodsList = res.reduce((total, item) => {
+			item.orderTime = dateF.formatTime("YYYY-mm-dd HH:MM:SS", item.createdAt)
+			total.push(item)
+			return total
+		}, [])
+		this.setData({
+			goodsList: goodsList
+		})
+
+	},
+
+	async queryShopOrder(status) {
+		let user = Parse.User.current()
+		let type = this.data.type;
+		let ShopOrder = new Parse.Query('Order')
+		ShopOrder.equalTo('company', company)
+		ShopOrder.equalTo('user', user.id)
+		ShopOrder.equalTo('type', 'goods')
+		ShopOrder.include('targetObject')
+		ShopOrder.descending('createdAt')
+		ShopOrder.limit(6)
+		ShopOrder.skip(this.data.goodsList.length)
+		if (status != 0 && status) {
+			ShopOrder.equalTo('status', String(status))
+		}
+		if (type) {
+			ShopOrder.equalTo('type', type)
+		}
+		let orders = await ShopOrder.find()
+		if (orders && orders.length > 0) {
+			let orderJSON = this.data.goodsList ?  this.data.goodsList : []
+			orders.forEach(order => {
+				let orderObj = order.toJSON()
+				orderObj.orderTime = dateF.formatTime("YYYY-mm-dd HH:MM:SS", orderObj.createdAt)
+				orderJSON.push(orderObj)
+			})
+			this.setData({
+				goodsList: orderJSON
+			})
+			console.log(this.data.goodsList)
+			
+		} else {
+			let orderJSON = this.data.goodsList ?  this.data.goodsList : []
+			this.setData({
+				goodsList: orderJSON
+			})
+		}
+	},
+
+
+	showPay(e) {
+		let item = e.currentTarget.dataset.item
+		let id = item.objectId
+		console.log(id);
+		let specMap = e.currentTarget.dataset.specMap ? e.currentTarget.dataset.specMap : null
+		wx.navigateTo({
+			url: `/nova-shop/pages/shop-goods/pay/index?id=${id}&specMap=${specMap}&count=${item.count}`
+		});
+	},
+	//支付
+	async acceptResult(e) {
+		let that = this
+		let {
+			params,
+			no
+		} = e.detail;
+		that.setData({
+			show: false
+		})
+		try {
+			if (params == "ok") {
+				wx.showLoading({
+					title: "处理中",
+					mask: true
+				});
+				let shopOrder = new Parse.Query("Order")
+				let isOrder = await shopOrder.get(this.data.PayId)
+				if (isOrder && isOrder.id) {
+					isOrder.set('isPay', true)
+					isOrder.set('status', '200')
+					let order = await isOrder.save()
+					if (order && order.id) {
+						wx.hideLoading();
+						wx.showToast({
+							title: "支付成功",
+							icon: "success",
+							duration: 1500,
+						});
+						// 存储云仓
+						if (order.get('giftList') && order.get('giftList').length > 0) {
+							order.get('giftList').forEach(li => {
+								if (li.type == 'stock') {
+									that.creatShopStock(li, order.id)
+								}
+								if (li.type == 'agentlevel') {
+									that.updateUserAgent(li)
+								}
+							})
+						}
+						// 更换经销商等级
+						wx.navigateTo({
+							url: "/nova-zhiliang/pages/my/myOrder/index",
+						});
+					} else {
+						wx.showToast({
+							title: "支付成功, 订单状态修改失败,请联系客服",
+							icon: "error",
+							duration: 1500,
+						});
+					}
+				}
+			} else {
+				wx.hideLoading();
+				this.setData({
+					show: false
+				})
+			}
+		} catch (error) {
+			wx.showToast({
+				title: "支付失败",
+				icon: "error",
+				duration: 1500,
+			});
+			wx.hideLoading()
+		}
+	},
+
+	//修改地址    
+	modify(e) {
+		console.log(e)
+		let id = e.currentTarget.dataset.item.objectId
+		wx.navigateTo({
+			url: "/nova-zhiliang/pages/my/myOrder/order-detail/index?id=" + id
+		})
+	},
+	//催单
+	reminder() {
+		wx.showToast({
+			title: '催单成功',
+			icon: 'success',
+			duration: 2000,
+		});
+	},
+
+	//查看物流
+	logistics(e) {
+		let {
+			item
+		} = e.currentTarget.dataset
+		console.log(item);
+		this.setData({
+			showExpress: true,
+			express: item.express
+		})
+	},
+	/**
+	 * 生命周期函数--监听页面初次渲染完成
+	 */
+	onReady: function () {
+
+	},
+	changeTheme() {
+		let themeColor = this.data.themeColor;
+		console.log(themeColor);
+		let colorRgb = colorChange.hexToRgb(themeColor); // 十六进制转rgb
+		console.log(colorRgb);
+		let {
+			r,
+			g,
+			b
+		} = colorRgb;
+		this.setData({
+			themeRGB: [r, g, b]
+		})
+	},
+	/**
+	 * 生命周期函数--监听页面显示
+	 */
+	onShow: function () {
+
+	},
+
+	/**
+	 * 生命周期函数--监听页面隐藏
+	 */
+	onHide: function () {
+
+	},
+
+	/**
+	 * 生命周期函数--监听页面卸载
+	 */
+	onUnload: function () {
+
+	},
+
+	/**
+	 * 页面相关事件处理函数--监听用户下拉动作
+	 */
+	onPullDownRefresh: function () {
+
+	},
+
+	/**
+	 * 页面上拉触底事件的处理函数
+	 */
+	onReachBottom: function () {
+		let switchFn = {
+			'0': 0,
+			'1': 100,
+			'2': 200,
+			'3': 300,
+			'4': 400
+		}
+		let active = this.data.active
+		console.log(111)
+		this.queryShopOrder(switchFn[active])
+	},
+
+	/**
+	 * 用户点击右上角分享
+	 */
+	onShareAppMessage: function () {
+
+	}
+})

+ 8 - 0
common-page/pages/myOrder/index.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+    "van-tab": "@vant/weapp/tab/index",
+    "van-tabs": "@vant/weapp/tabs/index",
+    "van-empty": "@vant/weapp/empty/index",
+    "van-dialog": "@vant/weapp/dialog/index"
+  }
+}

+ 113 - 0
common-page/pages/myOrder/index.less

@@ -0,0 +1,113 @@
+@themeColor: var(--themeColor);
+@textColor:hsl(0, 0%, calc((var(--perceived-lightness) - var(--threshold)) * -10000000%));
+@backgroundColor:rgb(var(--red), var(--green), var(--blue));
+page {
+  --threshold: 0.5;
+  --border-threshold: 0.8;
+  --r: calc(var(--red) * 0.2126);
+  --g: calc(var(--green) * 0.7152);
+  --b: calc(var(--blue) * 0.0722);
+  --sum: calc(var(--r) + var(--g) + var(--b));
+  --perceived-lightness: calc(var(--sum) / 255);
+}
+.top_scrprell {
+  position: sticky;
+  width: 100%;
+  z-index: 99;
+}
+.list {
+  .li {
+    width: 700rpx;
+    margin: 20rpx auto;
+    padding: 20rpx 10rpx;
+    background: white;
+    border-radius: 20rpx;
+    box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(34, 34, 34, 0.1);
+
+    .li-title {
+      font-size: 32rpx;
+      margin: 20rpx auto;
+    }
+// #e73434
+    .li-cont {
+      display: flex;
+      .li-cont-left {
+        width: 160rpx;
+        margin-right: 20rpx;
+        .goods_image {
+          width: 160rpx;
+          height: 160rpx;
+        }
+
+      }
+
+      .li-cont-rigth {
+        flex: 1;
+        display: flex;
+        // justify-content: space-between;
+        align-items: center;
+        flex-direction: column;
+        .li-row{
+          display: flex;
+          justify-content: space-between;
+          width: 100%;
+          margin-bottom: 10rpx;
+        }
+        .desc {
+          overflow: hidden;
+          display: -webkit-box;
+          -webkit-line-clamp: 2;
+          -webkit-box-orient: vertical;
+        }
+        .li-row-right{
+          display: flex;
+          justify-content: flex-end;
+          width: 100%;
+        }
+      }
+    }
+
+    .date {
+      color: black;
+    }
+
+    .li-footer {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      margin-top: 10rpx;
+
+      .footer-left {
+        color: #949494;
+      }
+
+      .footer-right {
+        flex: 1;
+        display: flex;
+        justify-content: flex-end;
+
+        .btn-ov {
+          padding: 4rpx 20rpx;
+          border: 1rpx solid #949494;
+          border-radius: 30rpx;
+          margin-left: 10rpx;
+        }
+
+        .btn-end {
+          padding: 4rpx 20rpx;
+          border-radius: 30rpx;
+          background:  @backgroundColor;
+          margin-left: 10rpx;
+          // color: white;
+          border: 1rpx solid #949494;
+        }
+      }
+    }
+  }
+}
+
+.logistics {
+  height: 300rpx;
+  overflow-y: auto;
+  padding: 10rpx;
+}

+ 114 - 0
common-page/pages/myOrder/index.wxml

@@ -0,0 +1,114 @@
+<page-meta
+  page-style="--themeColor:{{themeColor}};--red: {{themeRGB[0]}}; --green: {{themeRGB[1]}};--blue: {{themeRGB[2]}}">
+  <nav type="back" background-color="{{themeColor ? themeColor : '#ffffff'}}" title="我的订单"
+    frontColor="{{titleColor ? titleColor : '#000000'}}" />
+  <view class="top_scrprell" style="top:{{2 *customBarHeight}}rpx;">
+    <van-tabs active="{{ active }}" bind:change="onChange" data-change="true" color="{{themeColor}}">
+      <van-tab title="全部"></van-tab>
+      <van-tab title="待付款"></van-tab>
+      <van-tab title="待发货"></van-tab>
+      <van-tab title="待收货"></van-tab>
+      <van-tab title="待评价"></van-tab>
+    </van-tabs>
+  </view>
+  <view class="list" wx:if="{{goodsList}}">
+    <block wx:for="{{goodsList}}" wx:key="index">
+      <view class="li">
+        <view class="li-title">{{item.targetObject[0].name}}</view>
+        <view class="li-cont">
+          <view class="li-cont-left">
+            <image class="goods_image" mode="aspectFit"
+              src="{{item.targetObject[0].image ? item.targetObject[0].image : item.image}}" />
+          </view>
+          <view class="li-cont-rigth">
+            <view class="li-row">
+              <view class="desc">{{item.targetObject[0].name ? item.targetObject[0].name : item.name }}</view>
+              <view style="color:red">¥{{item.price}}</view>
+            </view>
+            <view class="li-row">
+              <view class="desc" style="color:#949494;">{{item.targetObject[0].desc}}</view>
+              <view style="color:#949494; float: right;">x{{item.count}}</view>
+            </view>
+            <view class="li-row-right">
+              <view class="desc" style="color:#949494;">总价</view>
+              <view style="color:red; margin-left:10rpx">¥{{item.totalPrice}}</view>
+            </view>
+          </view>
+        </view>
+        <view class="date">{{item.orderTime}}</view>
+        <view class="li-footer">
+          <block wx:if="{{item.status == 100}}">
+            <view class="footer-left">待付款</view>
+            <view class="footer-right">
+              <view class="btn-ov" data-index="{{index}}" catch:tap="delOrder">取消订单</view>
+              <view class="btn-end" data-price="{{item.price}}" data-code="{{item.orderNum}}"
+                data-id="{{item.objectId}}" data-item="{{item}}" catch:tap="showPay">
+                立即支付
+              </view>
+            </view>
+          </block>
+          <block wx:if="{{item.status == 200}}">
+            <view class="footer-left">待发货</view>
+            <view class="footer-right">
+              <view class="btn-ov" data-url="/common-page/pages/myOrder/order-detail/index?id={{item.objectId}}"
+                catch:tap="toUrl">
+                订单详情
+              </view>
+              <view class="btn-end" catch:tap="reminder">我要催单</view>
+            </view>
+          </block>
+          <block wx:if="{{item.status == 300}}">
+            <view class="footer-left">待收货</view>
+            <view class="footer-right">
+
+              <view class="btn-ov" data-url="/common-page/pages/myOrder/order-detail/index?id={{item.objectId}}"
+                catch:tap="toUrl">
+                订单详情
+              </view>
+              <view class="btn-ov" data-item="{{item}}" catch:tap="onShowExpress">查看物流</view>
+              <view class="btn-end" data-index="{{index}}" catch:tap="receipt">确认收货</view>
+            </view>
+          </block>
+          <block wx:if="{{item.status == 400}}">
+            <view class="footer-left">待评价</view>
+            <view class="footer-right">
+              <view class="btn-ov" data-url="/common-page/pages/myOrder/order-detail/index?id={{item.objectId}}"
+                catch:tap="toUrl">
+                订单详情
+              </view>
+              <view class="btn-ov" data-item="{{item}}" catch:tap="onShowExpress">查看物流</view>
+              <view class="btn-end" data-url="/common-page/pages/myOrder/score/index?id={{item.objectId}}"
+                catch:tap="toUrl">
+                去评价
+              </view>
+            </view>
+          </block>
+          <block wx:if="{{item.status == 500}}">
+            <view class="footer-left">已申请退款</view>
+            <view class="footer-right">
+              <view class="btn-ov">退款详情</view>
+            </view>
+          </block>
+          <block wx:if="{{item.status == 600}}">
+            <view class="footer-left">退款完成</view>
+            <view class="footer-right">
+              <view class="btn-ov">已退款</view>
+            </view>
+          </block>
+          <block wx:if="{{item.status == 800}}">
+            <view class="footer-left">已完成</view>
+            <view class="footer-right">
+              <view class="btn-ov">已评价</view>
+            </view>
+          </block>
+        </view>
+      </view>
+    </block>
+  </view>
+  <van-empty wx:else description="没有相应订单" />
+  <payment style="z-index: 99999;" id='payMent' show="{{show}}" tradeNo="{{tradeNo}}" price="{{PayPrice}}"
+    bind:payResult='acceptResult' />
+  <van-dialog use-slot title="物流信息" show="{{ showExpress }}" bind:close="onClose">
+    <view class="logistics">{{express? express : '暂无物流信息'}}</view>
+  </van-dialog>
+</page-meta>

+ 1 - 0
common-page/pages/myOrder/index.wxss

@@ -0,0 +1 @@
+page{--threshold:.5;--border-threshold:.8;--r:calc(var(--red) * .2126);--g:calc(var(--green) * .7152);--b:calc(var(--blue) * .0722);--sum:calc(var(--r) + var(--g) + var(--b));--perceived-lightness:calc(var(--sum) / 255)}.top_scrprell{position:sticky;width:100%;z-index:99}.list .li{width:700rpx;margin:20rpx auto;padding:20rpx 10rpx;background:white;border-radius:20rpx;box-shadow:0rpx 0rpx 20rpx 0rpx rgba(34,34,34,0.1)}.list .li .li-title{font-size:32rpx;margin:20rpx auto}.list .li .li-cont{display:flex}.list .li .li-cont .li-cont-left{width:160rpx;margin-right:20rpx}.list .li .li-cont .li-cont-left .goods_image{width:160rpx;height:160rpx}.list .li .li-cont .li-cont-rigth{flex:1;display:flex;align-items:center;flex-direction:column}.list .li .li-cont .li-cont-rigth .li-row{display:flex;justify-content:space-between;width:100%;margin-bottom:10rpx}.list .li .li-cont .li-cont-rigth .desc{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.list .li .li-cont .li-cont-rigth .li-row-right{display:flex;justify-content:flex-end;width:100%}.list .li .date{color:black}.list .li .li-footer{display:flex;justify-content:space-between;align-items:center;margin-top:10rpx}.list .li .li-footer .footer-left{color:#949494}.list .li .li-footer .footer-right{flex:1;display:flex;justify-content:flex-end}.list .li .li-footer .footer-right .btn-ov{padding:4rpx 20rpx;margin-left: 10rpx;border:1rpx solid #949494;border-radius:30rpx}.list .li .li-footer .footer-right .btn-end{padding:4rpx 20rpx;border-radius:30rpx;background:rgb(var(--red), var(--green), var(--blue));margin-left:10rpx;border:1rpx solid #949494}.logistics{height:300rpx;overflow-y:auto;padding:10rpx}

+ 168 - 0
common-page/pages/myOrder/order-detail/index.js

@@ -0,0 +1,168 @@
+const Parse = getApp().Parse
+const company = getApp().globalData.company
+const dateF = require('../../../../utils/date')
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        orderId: '',
+        address: null,
+        goods: null,
+        shipper: null,
+        trackingNumber: null,
+        order: null,
+        companyInfo: null
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function(options) {
+        let orderId = options.id
+        console.log(orderId);
+        this.setData({
+            orderId: orderId
+        })
+        this.queryOrder(orderId)
+
+    },
+    async queryOrder(id) {
+        let ShopOrder = new Parse.Query('Order')
+        ShopOrder.include('goods')
+        ShopOrder.include('address')
+        let shopOrder = await ShopOrder.get(id)
+        if (shopOrder && shopOrder.id) {
+            let order = shopOrder.toJSON()
+            order.orderTime = dateF.formatTime("YYYY-mm-dd HH:MM:SS", order.createdAt)
+            this.setData({
+                order: order,
+                goods: order.goods,
+                address: order.address,
+                shipper: order.shipper,
+                trackingNumber: order.trackingNumber
+            })
+            console.log(this.data.order);
+        }
+
+    },
+    async getCompany() {
+        let Company = new Parse.Query('Company')
+        let companyInfo = await Company.get(company)
+        if (companyInfo) {
+            this.setData({
+                companyInfo: companyInfo.toJSON()
+            })
+        }
+        console.log(this.data.companyInfo);
+    },
+
+
+    //更换地址
+    toAddress() {
+        let { order } = this.data
+        if (order.status != 200) {
+            wx.showToast({
+                title: '已发货物件不支持更换地址',
+                icon: 'none',
+                image: '',
+                duration: 1500,
+                mask: false,
+            });
+            return
+        }
+        wx.navigateTo({
+            url: "/common-page/pages/address/index?type=1"
+        })
+    },
+
+    async refund() {
+        let that = this
+        wx.showModal({
+            title: '',
+            content: '你确定要申请退款吗?',
+            showCancel: true,
+            cancelText: '取消',
+            cancelColor: '#000000',
+            confirmText: '确定',
+            confirmColor: '#3CC51F',
+            success: (result) => {
+                if (result.confirm) {
+                    that.upRefund()
+                }
+            },
+            fail: () => {},
+            complete: () => {}
+        });
+    },
+
+    async upRefund() {
+        let { order } = this.data
+        let ShopOrder = new Parse.Query("Order")
+        let res = await ShopOrder.get(order.objectId)
+        if (res && res.id) {
+            res.set("status", '500')
+            await res.save()
+            wx.showToast({
+                title: '已申请退款',
+                icon: 'none',
+                image: '',
+                duration: 1500,
+                mask: false,
+            });
+            order.status = '500'
+            this.setData({
+                order
+            })
+        }
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function() {
+        this.getCompany()
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function() {
+
+    }
+})

+ 3 - 0
common-page/pages/myOrder/order-detail/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 587 - 0
common-page/pages/myOrder/order-detail/index.less

@@ -0,0 +1,587 @@
+.pay_wrap {
+    background-color: #e6e6e6;
+    height: 100%;
+    padding-bottom: 20rpx;
+    .line {
+        width: 100%;
+        height: 20rpx;
+        background-color: #e6e6e6;
+    }
+
+    .address {
+        background-color: #fff;
+        margin: 0 auto;
+        padding: 10rpx;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        width: 94%;
+        height: 240rpx;
+        border-radius: 16rpx;
+
+        .address_info {
+            margin-left: 6rpx;
+
+            .info_top {
+                display: flex;
+                align-items: center;
+                justify-content: start;
+                margin-bottom: 10rpx;
+
+                .name {
+                    font-size: 32rpx;
+                    font-weight: 700;
+                }
+
+                .mobile {
+                    font-size: 28rpx;
+                    color: #B0ADAD;
+                    margin-left: 12rpx;
+                }
+            }
+
+            .info_content {
+                font-size: 30rpx;
+                margin-bottom: 10rpx;
+            }
+
+            .tips {
+                font-size: 30rpx;
+                color: #ee0a24;
+            }
+        }
+
+        .address_select {
+            font-size: 36rpx;
+            font-weight: 700;
+            color: #ffca28;
+        }
+    }
+
+
+    .goods_box {
+
+        background-color: #fff;
+        margin: 20rpx auto;
+        padding: 10rpx;
+        align-items: center;
+        width: 94%;
+        border-radius: 16rpx;
+
+        .title {
+            display: flex;
+            align-items: center;
+            justify-content: start;
+            margin-bottom: 30rpx;
+
+            .logo {
+                margin-right: 10rpx;
+            }
+        }
+
+        .goods_info {
+            display: flex;
+            align-items: flex-start;
+
+            .goods_image {
+                width: 200rpx;
+                height: 200rpx;
+                margin-right: 10rpx;
+            }
+
+            .goods_detail {
+                .goods_name {
+                    font-size: 32rpx;
+                    font-weight: 700;
+                    margin-bottom: 10rpx;
+
+                }
+
+                .goods_desc {
+                    font-size: 30rpx;
+                    color: #ccc;
+                }
+
+                .goods_tips {
+                    font-size: 30rpx;
+                    color: #ffca28;
+                }
+            }
+        }
+
+        .goods_count {
+            display: flex;
+            align-items: center;
+            margin-top: 20rpx;
+            justify-content: space-between;
+            padding: 10rpx;
+        }
+
+        .goods_remark {
+            margin-top: 20rpx;
+            padding: 10rpx;
+        }
+    }
+
+
+
+
+
+    .pay_address {
+        width: 100%;
+        padding: 30rpx;
+        margin-top: 30rpx;
+        height: 90rpx;
+        display: flex;
+        background-color: #fff;
+        align-items: center;
+        border-radius: 10rpx;
+
+        .pay_address_left {
+            // width: 40rpx;
+            // height: 40rpx;
+            background-color: red;
+            color: white;
+            flex: 2;
+            text-align: center;
+            border-radius: 10rpx;
+        }
+
+        .pay_address_right {
+            flex: 8;
+            display: flex;
+            justify-content: space-between;
+        }
+    }
+
+    .pay_goods {
+        margin: 30rpx 0;
+        border: 1px solid rgb(236, 236, 236);
+        border-radius: 15rpx;
+
+        .footer_wrap {
+            display: flex;
+            flex-direction: column;
+
+            // justify-content: center;
+            // align-items: center;
+            .footer_btn {}
+
+            .checkbox {
+                width: 100%;
+                height: 70rpx;
+                display: flex;
+                justify-content: space-between;
+                align-items: center;
+
+                .text {
+                    font-size: 28rpx;
+                    font-weight: 600;
+                    color: red;
+                }
+            }
+        }
+
+    }
+
+    .user_info {
+        background-color: #fff;
+        margin: 20rpx 0;
+        padding: 0 20rpx;
+
+        .user_info_name {
+            height: 90rpx;
+            display: flex;
+            align-items: center;
+        }
+
+        .user_info_num {
+            height: 90rpx;
+            display: flex;
+            align-items: center;
+        }
+    }
+
+    .pay_discount {
+        width: 100%;
+        background-color: #fff;
+
+        .pay_discount_title {
+            padding: 20rpx;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+        }
+
+    }
+}
+
+.van-cell {
+    position: relative;
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: flex;
+    justify-content: space-between;
+    box-sizing: border-box;
+    width: 100%;
+    padding: 10px 16px;
+    overflow: hidden;
+    color: #323233;
+    font-size: 14px;
+    line-height: 24px;
+    background-color: #fff;
+}
+
+// .van-cell::after {
+//     position: absolute;
+//     box-sizing: border-box;
+//     content: ' ';
+//     pointer-events: none;
+//     right: 16px;
+//     bottom: 0;
+//     left: 16px;
+//     border-bottom: 1px solid #ebedf0;
+//     -webkit-transform: scaleY(0.5);
+//     transform: scaleY(0.5);
+// }
+
+.discount {
+    .discount_text {
+        width: 100%;
+        height: 90rpx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+
+        // margin:0 auto;
+        text {
+            font-size: 36rpx;
+            font-weight: 700;
+        }
+    }
+
+}
+
+checkbox .wx-checkbox-input {
+    width: 44rpx;
+    height: 44rpx;
+    border-radius: 50%;
+}
+
+checkbox .wx-checkbox-input.wx-checkbox-input-checked {
+    background: #ee0a24;
+    border-color: #ee0a24;
+    /* color: #ffffff; */
+}
+
+checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
+    width: 30rpx;
+    height: 30rpx;
+    line-height: 30rpx;
+    text-align: center;
+    font-size: 34rpx;
+    color: #fff;
+    background: transparent;
+    transform: translate(-50%, -50%) scale(1);
+    -webkit-transform: translate(-50%, -50%) scale(1);
+}
+
+
+.tabs_title {
+    display: flex;
+}
+
+.tabs_title .title_item {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    flex: 1;
+    padding: 15rpx 0;
+}
+
+.active {
+    color: red;
+    border-bottom: 5rpx solid currentColor;
+}
+
+.tabs_content {
+    // background-color: #f6f5fa;
+    background-color: #fff;
+    padding-top: 40rpx;
+
+    .coupon {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding: 10rpx 20rpx;
+    }
+}
+
+.coupon_img {
+    width: 95%;
+    height: 220rpx;
+    margin: 0 auto;
+    background-color: #ccc;
+}
+
+.coupon_item_wrap {
+    width: 90%;
+    height: 180rpx;
+    margin: 20rpx auto;
+    display: flex;
+    background-image: url('http://cloud.file.futurestack.cn/1AiWpTEDH9/20201207/qf19km053654.png?imageView2');
+    background-size: 100%;
+    background-repeat: no-repeat;
+
+    .coupon_item_left {
+        flex: 7.5;
+        padding: 15rpx;
+        display: flex;
+
+        .coupon_left_price_wrap {
+            flex: 3;
+            display: flex;
+            flex-direction: column;
+            justify-content: center;
+            align-items: center;
+
+            .coupon_left_price {
+                color: #DB432E;
+                font-size: 20rpx;
+
+                .text1 {
+                    color: #DB432E;
+                    font-size: 48rpx;
+                    font-weight: 800;
+                }
+            }
+
+            .coupon_price_text {
+                font-size: 24rpx;
+            }
+        }
+
+        .coupon_left_cnt {
+            flex: 7;
+            display: flex;
+            padding-left: 10rpx;
+            flex-direction: column;
+            justify-content: space-around;
+
+            .left_cnt_title {
+                margin: 15rpx 0;
+
+            }
+
+            .left_cnt_btm {
+                display: flex;
+                flex-direction: column;
+
+                text {
+                    font-size: 22rpx;
+                    color: #B0ADAD;
+
+                }
+            }
+        }
+    }
+
+    .coupon_item_right {
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        align-items: center;
+        flex: 2.5;
+        position: relative;
+        overflow: hidden;
+
+        button {
+            width: 120rpx;
+            background-color: #DB432E;
+            color: #fff;
+            border-radius: 40px;
+            font-size: 20rpx;
+        }
+
+        .active {
+            image {
+                width: 100rpx;
+                height: 100rpx;
+                position: absolute;
+                right: -10rpx;
+                top: -25rpx;
+            }
+
+            button {
+                width: 120rpx;
+                background-color: #f5e054;
+                color: #ed6d69;
+                border-radius: 40px;
+                font-size: 20rpx;
+                margin-top: 40rpx;
+            }
+        }
+    }
+}
+
+.has-info {
+    display: flex;
+    flex-direction: column;
+    // padding: 30rpx;
+    padding: 0;
+    margin: 30rpx 0;
+    width: 100%;
+    background-color: #fff;
+
+    .info-item {
+        // padding: 30rpx 0;
+        display: flex;
+        justify-content: flex-start;
+        align-items: center;
+        // background: #fff;
+        border-radius: 10rpx;
+        box-shadow: 2rpx 8rpx 18rpx #f1f1f1;
+        // margin-bottom: 24rpx;
+        position: relative;
+
+        .edit-wrap {
+            // padding: 30rpx;
+            position: absolute;
+            right: 0;
+            bottom: 0;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+
+            .img {
+                width: 42rpx;
+                height: 42rpx;
+            }
+        }
+
+        .selected {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            // padding: 30rpx 0 30rpx 30rpx;
+
+            .img {
+                width: 40rpx;
+                height: 40rpx;
+            }
+        }
+
+        .info-wrap {
+            display: flex;
+            flex-direction: column;
+            padding-left: 30rpx;
+
+            .addr {
+                display: flex;
+                flex-direction: column;
+                margin-bottom: 10rpx;
+
+                .top {
+                    font-size: 30rpx;
+                    font-weight: 500;
+                    margin-bottom: 4rpx;
+                }
+
+                .text {
+                    font-size: 24rpx;
+                    color: #777;
+                }
+
+                .img-wrap {
+                    width: 44rpx;
+                    height: 44rpx;
+                    margin-right: 10rpx;
+                }
+            }
+
+            .name {
+                display: flex;
+                justify-content: flex-start;
+                align-items: center;
+
+                .img-wrap {
+                    width: 44rpx;
+                    height: 44rpx;
+                    margin-right: 10rpx;
+                }
+
+                .img {
+                    width: 42rpx;
+                    height: 42rpx;
+                }
+
+                .default {
+                    font-size: 22rpx;
+                    color: #ff3456;
+                    background: #faedef;
+                    text-align: center;
+                    padding: 2rpx 10rpx;
+                    border-radius: 4rpx;
+                }
+
+                .text {
+                    font-size: 26rpx;
+                    margin-right: 10rpx;
+                }
+            }
+        }
+
+        // .id-wrap {
+        //     display: flex;
+        //     flex-direction: column;
+
+        //     .ids {
+        //         display: flex;
+        //         justify-content: flex-start;
+        //         align-items: center;
+        //         font-size: 26rpx;
+        //         color: #5d6777;
+        //         margin-bottom: 8rpx;
+
+        //         .id-name {
+        //             margin-right: 20rpx;
+
+        //         }
+        //     }
+
+        //     .no-ids {
+        //         font-size: 26rpx;
+        //         color: #ffbb12;
+        //     }
+        // }
+    }
+
+}
+
+.fetchTime {
+    background-color: #fff;
+    font-size: 26rpx;
+    padding: 30rpx;
+}
+
+.btn {
+    display: flex;
+    justify-content: space-between;
+    margin: 20rpx auto;
+    padding: 0 20rpx;
+    align-items: center;
+    .status {
+        text-align: center;
+        font-size: 34rpx;
+        font-weight: 800;
+        line-height: 1.5;
+        color: #6d6d6d;
+    }
+
+    .refund {
+        padding: 14rpx 60rpx;
+        border: 1rpx solid #fd5f5f;
+        border-radius: 50rpx;
+        color: #fd5f5f;
+    }
+}

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