diff --git a/eaterplanet_ecommerce/components/actionsheet/actionsheet.js b/eaterplanet_ecommerce/components/actionsheet/actionsheet.js
new file mode 100644
index 0000000..25e9fae
--- /dev/null
+++ b/eaterplanet_ecommerce/components/actionsheet/actionsheet.js
@@ -0,0 +1,170 @@
+module.exports =
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 1);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */,
+/* 1 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Component({
+ options: {
+ multipleSlots: true,
+ addGlobalClass: true
+ },
+ properties: {
+ title: {
+ type: String,
+ value: ''
+ },
+ showCancel: {
+ type: Boolean,
+ value: true
+ },
+ cancelText: {
+ type: String,
+ value: '取消'
+ },
+ maskClass: {
+ type: String,
+ value: ''
+ },
+ extClass: {
+ type: String,
+ value: ''
+ },
+ maskClosable: {
+ type: Boolean,
+ value: true
+ },
+ mask: {
+ type: Boolean,
+ value: true
+ },
+ show: {
+ type: Boolean,
+ value: false
+ },
+ actions: {
+ type: Array,
+ value: [],
+ observer: '_groupChange'
+ }
+ },
+ methods: {
+ _groupChange: function _groupChange(e) {
+ if (e.length > 0 && typeof e[0] !== 'string' && !(e[0] instanceof Array)) {
+ this.setData({
+ actions: [this.data.actions]
+ });
+ }
+ },
+ buttonTap: function buttonTap(e) {
+ var _e$currentTarget$data = e.currentTarget.dataset,
+ value = _e$currentTarget$data.value,
+ groupindex = _e$currentTarget$data.groupindex,
+ index = _e$currentTarget$data.index;
+
+ this.triggerEvent('actiontap', { value: value, groupindex: groupindex, index: index });
+ },
+ closeActionSheet: function closeActionSheet(e) {
+ var type = e.currentTarget.dataset.type;
+
+ if (this.data.maskClosable || type) {
+ this.setData({
+ show: false
+ });
+ this.triggerEvent('close');
+ }
+ }
+ }
+});
+
+/***/ })
+/******/ ]);
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/actionsheet/actionsheet.json b/eaterplanet_ecommerce/components/actionsheet/actionsheet.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/actionsheet/actionsheet.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/actionsheet/actionsheet.wxml b/eaterplanet_ecommerce/components/actionsheet/actionsheet.wxml
new file mode 100644
index 0000000..1d3646d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/actionsheet/actionsheet.wxml
@@ -0,0 +1,52 @@
+
+ var join = function(a,b) {
+ return a+b
+ };
+ var isNotSlot = function(v) {
+ return typeof v !== 'string'
+ }
+ module.exports = {
+ join: join,
+ isNotSlot: isNotSlot
+ }
+
+
+
+
+
+
+
+ {{title}}
+
+
+
+
+
+
+ {{cancelText}}
+
+
diff --git a/eaterplanet_ecommerce/components/actionsheet/actionsheet.wxss b/eaterplanet_ecommerce/components/actionsheet/actionsheet.wxss
new file mode 100644
index 0000000..0b4bc62
--- /dev/null
+++ b/eaterplanet_ecommerce/components/actionsheet/actionsheet.wxss
@@ -0,0 +1,10 @@
+.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-actionsheet{position:fixed;left:0;bottom:0;transform:translate(0, 100%);backface-visibility:hidden;z-index:5000;width:100%;background-color:#EAE7E8;transition:transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:flex;justify-content:center;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,0.5);line-height:1.4;background:#FFFFFF}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,0.9);background-color:#FFFFFF}.weui-actionsheet__action{margin-top:8px;background-color:#FFFFFF;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-actionsheet__cell:active{background-color:#ECECEC}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#FA5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;transform:translate(-50%, -50%);width:274px;box-sizing:border-box;backface-visibility:hidden;background:transparent;transition:transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,0.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,0.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{transform:translate(0, 0)}.weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-mask{opacity:1;transform:scale3d(1, 1, 1);transition:all .3s}
+
+.btn.weui-actionsheet__cell {
+ background-color: transparent;
+ color: inherit;
+}
+
+.btn.weui-actionsheet__cell::before {
+ border: 0;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/ad-alert/index.js b/eaterplanet_ecommerce/components/ad-alert/index.js
new file mode 100644
index 0000000..7d7fffe
--- /dev/null
+++ b/eaterplanet_ecommerce/components/ad-alert/index.js
@@ -0,0 +1,121 @@
+// eaterplanet_ecommerce/components/ad-alert/index.js
+Component({
+ /**
+ * 组件的属性列表
+ * pop_page 投放页面类型:0、商城首页,1、商品分类,2、商城购物车,3、商城个人中心
+ */
+ properties: {
+ pop_page: {
+ type: Number,
+ value: ''
+ }
+ },
+
+ data: {
+ imgheights: [],//所有图片的高度
+ current:0,
+ visible: false,
+ adv_list: []
+ },
+
+ attached: function() {
+ // this.getData();
+ },
+
+ pageLifetimes: {
+ show: function () {
+ this.getData();
+ }
+ },
+
+ methods: {
+ getData: function(){
+ let token = wx.getStorageSync('token');
+ let pop_page = this.data.pop_page;
+ getApp().util.ProReq('popadv.popadv_list', {token, pop_page}).catch(res=>{
+ console.log(res.popadvs)
+ if(res.popadvs) {
+ let adv_list = res.popadvs.adv_list || [];
+ this.setData({
+ adv_list,
+ visible: adv_list.length>0
+ })
+ }
+ })
+ },
+ imageLoad(e){
+ //当图片载入完毕时
+ var imgwidth = e.detail.width,
+ imgheight = e.detail.height,
+ //宽高比
+ ratio = imgwidth / imgheight;
+ console.log(imgwidth, imgheight)
+ // 计算的高度值
+ var viewHeight = 600 / ratio;
+ var imgheight = viewHeight;
+ var imgheights = this.data.imgheights;
+ //把每一张图片的对应的高度记录到数组里
+ imgheights[e.target.dataset.id] = imgheight;
+ console.log('图片的高度:'+imgheights)
+ this.setData({
+ imgheights: imgheights
+ })
+ },
+ bindchange: function (e) {
+ // current 改变时会触发 change 事件
+ this.setData({ current: e.detail.current })
+ },
+ close: function() {
+ this.setData({ visible: false })
+ },
+ popclick: function(e){
+ let idx = e.currentTarget.dataset.idx;
+ if(idx!=='') {
+ let adv_list = this.data.adv_list;
+ let linktype = adv_list[idx].linktype;
+ let url = adv_list[idx].link;
+ let ad_id = adv_list[idx].ad_id;
+ if (linktype == 0) {
+ // 跳转webview
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url),
+ })
+ } else if (linktype == 1) {
+ let tabUrls = ['/eaterplanet_ecommerce/pages/index/index', '/eaterplanet_ecommerce/pages/order/shopCart', '/eaterplanet_ecommerce/pages/user/me', '/eaterplanet_ecommerce/pages/type/index'];
+ if (tabUrls.indexOf(url) != -1) {
+ url && wx.switchTab({ url: url })
+ } else {
+ url && wx.navigateTo({ url: url })
+ }
+ } else if (linktype == 2) {
+ // 跳转小程序
+ let appId = adv_list[idx].appid;
+ appId && wx.navigateToMiniProgram({
+ appId,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ console.log(`弹窗广告:打开外链 appId:${appId} url:${url} 成功`)
+ },
+ fail(error) {
+ console.log(`弹窗广告:打开外链 appId:${appId} url:${url} 失败`)
+ console.log('失败原因:' + error.errMsg)
+ if(error.errMsg == 'navigateToMiniProgram:fail invalid appid') {
+ wx.showToast({
+ icon: 'none',
+ title: 'appid验证失败,请检查!',
+ })
+ }
+ }
+ })
+ }
+ //添加点击量
+ this.addview(ad_id);
+ }
+ },
+ addview: function(id){
+ getApp().util.ProReq('popadv.popadv_click', {id})
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/ad-alert/index.json b/eaterplanet_ecommerce/components/ad-alert/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/ad-alert/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/ad-alert/index.wxml b/eaterplanet_ecommerce/components/ad-alert/index.wxml
new file mode 100644
index 0000000..0a75e66
--- /dev/null
+++ b/eaterplanet_ecommerce/components/ad-alert/index.wxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/ad-alert/index.wxss b/eaterplanet_ecommerce/components/ad-alert/index.wxss
new file mode 100644
index 0000000..64e92c5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/ad-alert/index.wxss
@@ -0,0 +1,40 @@
+.fixed {
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ z-index: 1000;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+}
+
+.mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ background: rgba(0, 0, 0, 0.6);
+}
+
+.cont {
+ z-index: 1001;
+ width: 80%;
+}
+
+.cont .img {
+ width: 100%;
+}
+
+.close-img {
+ margin-top: 40rpx;
+ width: 60rpx;
+ height: 60rpx;
+}
+
+.swiper {
+ width: 100%;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/addCartBtn/index.js b/eaterplanet_ecommerce/components/addCartBtn/index.js
new file mode 100644
index 0000000..4af3057
--- /dev/null
+++ b/eaterplanet_ecommerce/components/addCartBtn/index.js
@@ -0,0 +1,18 @@
+Component({
+ externalClasses: ['i-class'],
+ properties: {
+ fontsize: {
+ type: Number,
+ value: 24
+ }
+ },
+ data: {
+ skin: getApp().globalData.skin,
+ },
+
+ attached(){
+ this.setData({
+ skin: getApp().globalData.skin,
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/components/addCartBtn/index.json b/eaterplanet_ecommerce/components/addCartBtn/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/addCartBtn/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/addCartBtn/index.wxml b/eaterplanet_ecommerce/components/addCartBtn/index.wxml
new file mode 100644
index 0000000..11fab14
--- /dev/null
+++ b/eaterplanet_ecommerce/components/addCartBtn/index.wxml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/eaterplanet_ecommerce/components/addCartBtn/index.wxss b/eaterplanet_ecommerce/components/addCartBtn/index.wxss
new file mode 100644
index 0000000..b5e1df2
--- /dev/null
+++ b/eaterplanet_ecommerce/components/addCartBtn/index.wxss
@@ -0,0 +1,11 @@
+@import "/icon.wxss";
+
+.btn {
+ width: 60rpx;
+ height: 60rpx;
+ border-radius: 50%;
+ background: linear-gradient(to top, #ff5345, #ff8379);
+ display: flex!important;
+ align-items: center;
+ justify-content: center;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/advimg/index.js b/eaterplanet_ecommerce/components/advimg/index.js
new file mode 100644
index 0000000..1a84838
--- /dev/null
+++ b/eaterplanet_ecommerce/components/advimg/index.js
@@ -0,0 +1,108 @@
+Component({
+ properties: {
+ pos: {
+ type: String,
+ value: 0
+ }
+ },
+ data: {
+ info: '',
+ ishow: false
+ },
+
+ attached: function(){
+ this.getData();
+ },
+
+ pageLifetimes: {
+ show: function() {
+ console.log('pageLifetimes')
+ this.getData();
+ }
+ },
+
+ methods: {
+ getData: function() {
+ let that = this;
+ getApp().util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.get_advimg'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if(res.data.code==0) {
+ let info = res.data.data;
+ let pos = info.pos || [];
+ let ishow = pos.includes(that.data.pos);
+ that.setData({ info, ishow })
+ } else {
+ that.setData({ ishow: false })
+ }
+ }
+ })
+ },
+ goNav: function(){
+ let info = this.data.info;
+ let type = info.linktype;
+ let url = info.link;
+ if (type == 0) {
+ // 跳转webview
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url),
+ })
+ } else if (type == 1) {
+ if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
+ url && wx.switchTab({ url })
+ } else {
+ url && wx.navigateTo({ url })
+ }
+ } else if (type == 2) {
+ // 跳转小程序
+ let appId = info.appid;
+ appId && wx.navigateToMiniProgram({
+ appId,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ // 打开成功
+ },
+ fail(error) {
+ console.log(error)
+ }
+ })
+ } else if (type == 3) {
+ if(this.data.pos==0) {
+ this.triggerEvent("switchType", url);
+ } else {
+ getApp().globalData.indexCateId = url;
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ })
+ }
+ } else if (type == 4) {
+ //独立分类
+ getApp().globalData.typeCateId = url;
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/type/index'
+ })
+ }else if (type==5){
+ // 跳转小程序
+ let appId = info.appid;
+ appId && wx.navigateToMiniProgram({
+ appId,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ // 打开成功
+ },
+ fail(error) {
+ console.log(error)
+ }
+ })
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/advimg/index.json b/eaterplanet_ecommerce/components/advimg/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/advimg/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/advimg/index.wxml b/eaterplanet_ecommerce/components/advimg/index.wxml
new file mode 100644
index 0000000..694b18b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/advimg/index.wxml
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/advimg/index.wxss b/eaterplanet_ecommerce/components/advimg/index.wxss
new file mode 100644
index 0000000..7e9da23
--- /dev/null
+++ b/eaterplanet_ecommerce/components/advimg/index.wxss
@@ -0,0 +1,24 @@
+.wrap {
+ padding: 0 20rpx;
+ margin: 10rpx 0;
+ filter: drop-shadow(0 10rpx 15rpx rgb(0, 0, 0, 0.4));
+}
+
+.wrap .img {
+ width: 100%;
+ border-radius: 20rpx;
+
+}
+
+.contact {
+ font-size: inherit;
+ line-height: inherit;
+ border-radius: 0;
+ background: transparent;
+ color: inherit;
+ padding: 0;
+}
+
+.contact::after {
+ content: none;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/asideBtn/index.js b/eaterplanet_ecommerce/components/asideBtn/index.js
new file mode 100644
index 0000000..4c94c3f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/asideBtn/index.js
@@ -0,0 +1,29 @@
+// eaterplanet_ecommerce/components/cartBtn/index.js
+Component({
+ externalClasses: ["i-class", "i-icon"],
+ properties: {
+ showHome: {
+ type: Boolean,
+ value: false
+ },
+ showShare: {
+ type: Boolean,
+ value: false
+ },
+ showContact: {
+ type: Boolean,
+ value: false
+ },
+ cartNum: {
+ type: Number,
+ value: 0
+ }
+ },
+
+ methods: {
+ goLink: function (e) {
+ let url = e.currentTarget.dataset.link;
+ wx.switchTab({ url })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/asideBtn/index.json b/eaterplanet_ecommerce/components/asideBtn/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/asideBtn/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/asideBtn/index.wxml b/eaterplanet_ecommerce/components/asideBtn/index.wxml
new file mode 100644
index 0000000..947fd0a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/asideBtn/index.wxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ 首页
+
+
diff --git a/eaterplanet_ecommerce/components/asideBtn/index.wxss b/eaterplanet_ecommerce/components/asideBtn/index.wxss
new file mode 100644
index 0000000..b3f98ab
--- /dev/null
+++ b/eaterplanet_ecommerce/components/asideBtn/index.wxss
@@ -0,0 +1,59 @@
+@import "../../../icon.wxss";
+.cart-btn {
+ position: fixed;
+ right: 0rpx;
+ bottom: 40%;
+ z-index: 100;
+}
+
+.cart-btn .icon {
+ position: relative;
+ margin-bottom: 20rpx;
+ right: 0rpx;
+ width: 70rpx;
+ height: 100rpx;
+ background: #4facfe86;
+ border-radius: 30rpx 0rpx 0rpx 30rpx;
+ text-align: center;
+ color: #fff;
+ box-sizing: border-box;
+ font-size: 20rpx;
+ padding: 10rpx;
+ line-height: 1.4;
+ z-index: 100;
+}
+
+.cart-btn .btn.icon {
+ line-height: 1.5;
+ z-index: 100;
+}
+
+.cart-btn .iconfont {
+ font-size: 30rpx;
+ color: #fff;
+}
+
+
+.cart-btn .none-btn.icon .iconfont {
+ font-size: 35rpx;
+}
+
+.cart-btn .none-btn.icon .name {
+ margin-top: -3rpx;
+}
+
+.button::after {
+width: 200%;
+height: 200%;
+position: absolute;
+top: 0;
+left: 0;
+border: 0px solid rgba(0,0,0,.2);
+-webkit-transform: scale(.5);
+transform: scale(.5);
+-webkit-transform-origin: 0 0;
+transform-origin: 0 0;
+box-sizing: border-box;
+border-radius: 10px;
+
+}
diff --git a/eaterplanet_ecommerce/components/auth/index.js b/eaterplanet_ecommerce/components/auth/index.js
new file mode 100644
index 0000000..f234d4d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/auth/index.js
@@ -0,0 +1,144 @@
+var util = require('../../utils/util.js');
+var wcache = require('../../utils/wcache.js');
+var app = getApp();
+var flag = true;
+
+Component({
+ properties: {
+ needAuth: {
+ type: Boolean,
+ value: false
+ },
+ needPosition: {
+ type: Boolean,
+ value: true
+ },
+ navBackUrl: {
+ type: String,
+ value: '',
+ observer: function (t) {
+ if (t) app.globalData.navBackUrl = t;
+ }
+ }
+ },
+ data: {
+ btnLoading: false,
+ isIpx: false,
+ auth_bg: '',
+ loaded: false
+ },
+ attached: function() {
+ this.getBg();
+ app.globalData.isIpx && this.setData({
+ isIpx: true
+ });
+ },
+ methods: {
+ getBg: function(){
+ let that = this;
+ let auth_bg = wcache.get('auth_bg', false);
+ if (!auth_bg){
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.get_auth_bg'
+ },
+ dataType: 'json',
+ success: function (res) {
+ that.setData({ loaded: true })
+ if (res.data.code == 0) {
+ wcache.put('auth_bg', res.data.data, 600);
+ res.data.data && that.setData({ auth_bg: res.data.data })
+ }
+ }
+ })
+ } else {
+ that.setData({ auth_bg, loaded: true })
+ }
+ },
+ bindGetUserInfo: function (t) {
+ var that = this;
+ if (!this.data.btnLoading) {
+ wx.getUserProfile({
+ desc: "获取你的昵称、头像、地区及性别",
+ success: function (msg) {
+ var userInfo = msg.userInfo
+ wx.setStorage({
+ key: "userInfo",
+ data: userInfo
+ })
+ that.setData({ btnLoading: true });
+ util.login_prosime(that.data.needPosition, userInfo).then(function () {
+ console.log("授权成功")
+ that.setData({ btnLoading: false });
+ wx.showToast({
+ title: '登录成功',
+ icon: 'success',
+ duration: 2000
+ })
+ that.triggerEvent("authSuccess");
+ app.globalData.changedCommunity = true;
+ //检查获取位置权限
+ that.data.needPosition && location.getGps();
+ }).catch(function () {
+ that.triggerEvent("cancel");
+ console.log('授权失败');
+ })
+ },
+ fail: ()=>{
+ wx.showToast({
+ title: "授权失败,为了完整体验,获取更多优惠活动,需要您的授权。",
+ icon: "none"
+ });
+ that.triggerEvent("cancel");
+ that.setData({ btnLoading: false });
+ }
+ })
+ }
+ },
+ bindGetUserInfoTwo: function (t) {
+ var that = this;
+ wx.showLoading({ title: '授权中' });
+ if (flag) {
+ flag = false;
+ var n = t.detail;
+ if ("getUserInfo:ok" === n.errMsg) {
+ util.login_prosime().then(function () {
+ console.log("授权成功")
+ wx.hideLoading();
+ flag = true;
+ wx.showToast({
+ title: '登录成功',
+ icon: 'success',
+ duration: 2000
+ })
+ that.triggerEvent("authSuccess");
+ }).catch(function () {
+ flag = true;
+ wx.hideLoading();
+ console.log('授权失败')
+ })
+ } else {
+ wx.hideLoading();
+ wx.showToast({
+ title: "授权失败,为了完整体验,获取更多优惠活动,需要您的授权。",
+ icon: "none"
+ });
+ flag = true;
+ }
+ }
+ }
+ // openSetting: function () {
+ // location.openSetting().then(function (t) {
+ // app.globalData.location = {
+ // lat: t.latitude,
+ // lng: t.longitude
+ // };
+ // app.globalData.community.communityId || wx.redirectTo({
+ // url: "/eaterplanet_ecommerce/pages/position/communities"
+ // });
+ // app.globalData.canGetGPS = true;
+ // });
+ // }
+ }
+});
diff --git a/eaterplanet_ecommerce/components/auth/index.json b/eaterplanet_ecommerce/components/auth/index.json
new file mode 100644
index 0000000..67def3c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/auth/index.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../button/index",
+ "i-router-link": "../router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/auth/index.wxml b/eaterplanet_ecommerce/components/auth/index.wxml
new file mode 100644
index 0000000..cc5f101
--- /dev/null
+++ b/eaterplanet_ecommerce/components/auth/index.wxml
@@ -0,0 +1,14 @@
+
+
+
+
+ 我们的小程序将获取您的以下权限:
+ ·获取您的公开信息(昵称和头像等)
+ (如未授权,可能无法正常使用该小程序)
+ 确认授权
+ 请升级微信版本
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/auth/index.wxss b/eaterplanet_ecommerce/components/auth/index.wxss
new file mode 100644
index 0000000..c4f98f7
--- /dev/null
+++ b/eaterplanet_ecommerce/components/auth/index.wxss
@@ -0,0 +1,61 @@
+.mb20 {
+ margin-bottom: 40rpx;
+}
+
+.wrap {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.wrap .auth-login {
+ margin: 100rpx 0 50rpx;
+ width: 550rpx;
+}
+
+.auth_bg {
+ width: 100%;
+ height: 100%;
+ border-radius: 0;
+}
+
+.auth_bg::after {
+ border: 0;
+}
+
+.wrap .line1 {
+ line-height: 50rpx;
+ color: #333;
+ font-size: 30rpx;
+}
+
+.wrap .line2 {
+ line-height: 50rpx;
+ color: #999;
+ font-size: 26rpx;
+}
+
+.wrap .line3 {
+ line-height: 50rpx;
+ color: #333;
+ font-size: 24rpx;
+}
+
+.wrap .confirm {
+ width: 500rpx;
+ height: 90rpx;
+ line-height: 90rpx;
+ margin-top: 40rpx;
+ background: #4facfe;
+ color: #fff;
+ border-radius: 10rpx;
+ font-size: 34rpx;
+ margin-bottom: 40%;
+}
+
+.button-hover {
+ opacity: 0.8;
+}
diff --git a/eaterplanet_ecommerce/components/behavior/goods.js b/eaterplanet_ecommerce/components/behavior/goods.js
new file mode 100644
index 0000000..f2843ee
--- /dev/null
+++ b/eaterplanet_ecommerce/components/behavior/goods.js
@@ -0,0 +1,318 @@
+var t = require("../../utils/public");
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+var app = getApp();
+
+module.exports = Behavior({
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ spuId: "",
+ skuId: "",
+ spuImage: "",
+ spuName: "",
+ endTime: 0,
+ beginTime: "",
+ actPrice: ["", ""],
+ marketPrice: ["", ""],
+ spuCanBuyNum: "",
+ soldNum: "",
+ actId: "",
+ limitMemberNum: "",
+ limitOrderNum: "",
+ serverTime: "",
+ isLimit: false,
+ skuList: [],
+ spuDescribe: "",
+ is_take_fullreduction: 0,
+ label_info: "",
+ car_count: 0
+ },
+ observer: function (t) {
+ let url = `/eaterplanet_ecommerce/pages/goods/goodsDetail?id=${t.actId}`;
+ // if (t && t.is_video) url = `/eaterplanet_ecommerce/moduleA/video/detail?&id=${t.actId}`;
+ this.setData({ url });
+ }
+ },
+ isPast: {
+ type: Boolean,
+ value: false
+ },
+ actEnd: {
+ type: Boolean,
+ value: false
+ },
+ reduction: {
+ type: Object,
+ value: {
+ full_money: '',
+ full_reducemoney: '',
+ is_open_fullreduction: 0
+ }
+ },
+ isShowListCount: {
+ type: Number,
+ value: 0
+ },
+ changeCarCount: {
+ type: Boolean,
+ value: false,
+ observer: function (t) {
+ if (t) this.setData({ number: this.data.spuItem.car_count || 0 });
+ }
+ },
+ needAuth: {
+ type: Boolean,
+ value: false
+ },
+ is_open_vipcard_buy: {
+ type: Number,
+ value: 0
+ },
+ canLevelBuy: {
+ type: Boolean,
+ value: false
+ },
+ isShowListTimer: {
+ type: Boolean,
+ value: true
+ },
+ showPickTime: {
+ type: Boolean,
+ value: false
+ },
+ skin: {
+ type: Object
+ },
+ saleUnit: {
+ type: String
+ },
+ width250: {
+ type: Boolean,
+ value: false
+ },
+ diyInfo: {
+ type: Object,
+ value: {
+ goodsTag: 'default'
+ }
+ }
+ },
+ attached() {
+ this.setData({ placeholdeImg: app.globalData.placeholdeImg})
+ },
+ data: {
+ disabled: false,
+ placeholdeImg: '',
+ number: 0,
+ url: '',
+ canClick: true
+ },
+ ready: function () {
+ this.setData({
+ number: this.data.spuItem.car_count || 0
+ });
+ },
+ methods: {
+ openSku: function() {
+ if (this.data.needAuth) {
+ this.triggerEvent("authModal", true);
+ return;
+ }
+ console.log( 'step1');
+ this.setData({
+ stopClick:true,
+ disabled:false
+ })
+ let spuItem = this.data.spuItem;
+ if (this.data.spuItem.skuList.length === void 0) {
+ this.triggerEvent("openSku", {
+ actId:spuItem.actId,
+ skuList: spuItem.skuList,
+ promotionDTO: spuItem.promotionDTO,
+ is_take_vipcard: spuItem.is_take_vipcard,
+ is_mb_level_buy: spuItem.is_mb_level_buy,
+ allData: {
+ spuName: spuItem.spuName,
+ skuImage: spuItem.skuImage,
+ actPrice: spuItem.actPrice,
+ canBuyNum: spuItem.spuCanBuyNum,
+ stock: spuItem.spuCanBuyNum,
+ marketPrice: spuItem.marketPrice,
+ oneday_limit_count: spuItem.oneday_limit_count,
+ total_limit_count: spuItem.total_limit_count,
+ one_limit_count: spuItem.one_limit_count,
+ goods_start_count: spuItem.goods_start_count
+ }
+ });
+ } else {
+ this.addCart({ value: 1, type: "plus" });
+ }
+ },
+ countDownEnd: function() {
+ this.setData({
+ actEnd: true
+ });
+ },
+ submit2: function(e) {
+ (0, t.collectFormIds)(e.detail.formId);
+ },
+ changeNumber: function (t) {
+ var e = t.detail;
+ e && this.addCart(e);
+ },
+ outOfMax: function (t) {
+ var e = t.detail;
+ let { spuCanBuyNum, one_limit_count } = this.data.spuItem;
+ let canBuyNum = spuCanBuyNum= canBuyNum) {
+ wx.showToast({
+ title: "不能购买更多啦",
+ icon: "none"
+ })
+ }
+ },
+ addCart: function (t) {
+ // {value: 2, type: "plus/minus"}
+ var token = wx.getStorageSync('token');
+ var community = wx.getStorageSync('community');
+ let spuItem = this.data.spuItem;
+ var goods_id = spuItem.actId;
+ var community_id = community.communityId;
+ let { car_count, goods_start_count } = spuItem;
+ let quantity = 1;
+ let number = this.data.number || 0;
+
+ let that = this;
+ if (t.type =='plus'){
+ if(number{
+ if(res.showVipModal==1) {
+ let { pop_vipmember_buyimage } = res.data;
+ that.triggerEvent("vipModal", { pop_vipmember_buyimage, showVipModal: true, visible: false });
+ } else {
+ if (res.data.code == 3) {
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({ number: that.data.number })
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 4) {
+ that.setData({ needAuth: true })
+ that.triggerEvent("authModal", true);
+ } else if (res.data.code == 6 || res.data.code == 7) {
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({ number: that.data.number })
+ var msg = res.data.msg;
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ that.triggerEvent("changeCartNum", res.data.total);
+ that.setData({ number: res.data.cur_count })
+ wx.showToast({
+ title: "已加入购物车",
+ image: "../../images/addShopCart.png"
+ })
+ status.indexListCarCount(goods_id, res.data.cur_count);
+ }
+ }
+ })
+ } else {
+ console.log('goods_start_count',goods_start_count)
+ console.log('number',number)
+ if(number<=goods_start_count) {
+ quantity = number;
+ }
+
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'car.reduce_car_goods',
+ token: token,
+ goods_id: goods_id,
+ community_id: community_id,
+ quantity,
+ sku_str: '',
+ buy_type: 'dan',
+ pin_id: 0,
+ is_just_addcar: 1
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function (res) {
+ if (res.data.code == 3) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 4) {
+ if (that.data.needAuth) {
+ that.setData({ needAuth: true })
+ that.triggerEvent("authModal", true);
+ return;
+ }
+ } else {
+ that.triggerEvent("changeCartNum", res.data.total);
+ that.setData({ number: res.data.cur_count })
+ status.indexListCarCount(goods_id, res.data.cur_count);
+ }
+ }
+ })
+ }
+
+ },
+ goDetails: function(t){
+ if(!this.data.canClick) {
+ return;
+ }
+ let that = this;
+ this.setData({
+ canClick: false
+ });
+ let goodsid = t.currentTarget.dataset.id || '';
+ let img = t.currentTarget.dataset.img || '';
+ let url = '/eaterplanet_ecommerce/pages/goods/goodsDetail?id='+goodsid;
+ util.getStorageImage(img).then(res=>{
+ wx.navigateTo({
+ url,
+ complete: function () {
+ setTimeout(function () {
+ that.setData({
+ canClick: true
+ });
+ }, 400);
+ }
+ })
+ }).catch(err=>{
+ wx.navigateTo({
+ url,
+ complete: function () {
+ setTimeout(function () {
+ that.setData({
+ canClick: true
+ });
+ }, 400);
+ }
+ })
+ });
+ }
+ }
+});
diff --git a/eaterplanet_ecommerce/components/button/index.js b/eaterplanet_ecommerce/components/button/index.js
new file mode 100644
index 0000000..fe5c832
--- /dev/null
+++ b/eaterplanet_ecommerce/components/button/index.js
@@ -0,0 +1,81 @@
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ type: {
+ type: String,
+ value: ""
+ },
+ inline: {
+ type: Boolean,
+ value: false
+ },
+ size: {
+ type: String,
+ value: ""
+ },
+ shape: {
+ type: String,
+ value: "square"
+ },
+ disabled: {
+ type: Boolean,
+ value: false
+ },
+ loading: {
+ type: Boolean,
+ value: false
+ },
+ long: {
+ type: Boolean,
+ value: false
+ },
+ openType: String,
+ appParameter: String,
+ hoverStopPropagation: Boolean,
+ hoverStartTime: {
+ type: Number,
+ value: 20
+ },
+ hoverStayTime: {
+ type: Number,
+ value: 140
+ },
+ lang: {
+ type: String,
+ value: "en"
+ },
+ sessionFrom: {
+ type: String,
+ value: ""
+ },
+ sendMessageTitle: String,
+ sendMessagePath: String,
+ sendMessageImg: String,
+ showMessageCard: Boolean,
+ styleStr: {
+ type: String,
+ value: ""
+ }
+ },
+ methods: {
+ handleTap: function () {
+ return !this.data.disabled && (!this.data.loading && void this.triggerEvent("click"));
+ },
+ bindgetuserinfo: function () {
+ var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).detail, t = void 0 === e ? {} : e;
+ this.triggerEvent("getuserinfo", t);
+ },
+ bindcontact: function () {
+ var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).detail, t = void 0 === e ? {} : e;
+ this.triggerEvent("contact", t);
+ },
+ bindgetphonenumber: function () {
+ var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).detail, t = void 0 === e ? {} : e;
+ this.triggerEvent("getphonenumber", t);
+ },
+ binderror: function () {
+ var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).detail, t = void 0 === e ? {} : e;
+ this.triggerEvent("error", t);
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/button/index.json b/eaterplanet_ecommerce/components/button/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/button/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/button/index.wxml b/eaterplanet_ecommerce/components/button/index.wxml
new file mode 100644
index 0000000..526ce13
--- /dev/null
+++ b/eaterplanet_ecommerce/components/button/index.wxml
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/button/index.wxss b/eaterplanet_ecommerce/components/button/index.wxss
new file mode 100644
index 0000000..c8b9c38
--- /dev/null
+++ b/eaterplanet_ecommerce/components/button/index.wxss
@@ -0,0 +1,127 @@
+.i-btn {
+ text-align: center;
+ vertical-align: middle;
+ touch-action: manipulation;
+ cursor: pointer;
+ background-image: none;
+ white-space: nowrap;
+ user-select: none;
+ font-size: 28rpx;
+ border-radius: 4rpx;
+ border: 0 !important;
+ position: relative;
+ text-decoration: none;
+ height: 88rpx;
+ line-height: 88rpx;
+ background: #f7f7f7;
+ color: #495060;
+ margin: 20rpx;
+}
+
+.i-btn-hover {
+ opacity: 0.7;
+}
+
+.i-btn-long {
+ border-radius: 0;
+ margin: 0;
+ box-shadow: none;
+}
+
+.i-btn-large {
+ height: 96rpx;
+ line-height: 96rpx;
+}
+
+.i-btn-small {
+ height: 80rpx;
+ line-height: 80rpx;
+}
+
+.i-btn-primary {
+ color: #fff;
+ background: #2d8cf0;
+}
+
+.i-btn-ghost {
+ background: #fff;
+ color: #495060;
+}
+
+.i-btn-success {
+ color: #fff;
+ background: #19be6b;
+}
+
+.i-btn-warning {
+ color: #fff;
+ background: #f90;
+}
+
+.i-btn-error {
+ color: #fff;
+ background: #ed3f14;
+}
+
+.i-btn-info {
+ color: #fff;
+ background: #2db7f5;
+}
+
+.i-btn-circle {
+ border-radius: 88rpx;
+}
+
+.i-btn-large.i-btn-circle {
+ border-radius: 96rpx;
+}
+
+.i-btn-small.i-btn-circle {
+ border-radius: 80rpx;
+}
+
+.i-btn-loading {
+ opacity: 0.6;
+}
+
+.i-btn-loading-inner {
+ display: inline-block;
+ margin-right: 24rpx;
+ vertical-align: middle;
+ width: 28rpx;
+ height: 28rpx;
+ background: 0 0;
+ border: 4rpx solid #e9eaec;
+ border-color: #e9eaec #e9eaec #e9eaec #2d8cf0;
+ border-radius: 50%;
+ animation: btn-spin 0.6s linear;
+ animation-iteration-count: infinite;
+}
+
+.i-btn-disabled {
+ opacity: 0.9;
+}
+
+.i-btn-inline {
+ display: inline-block;
+}
+
+@-webkit-keyframes btn-spin {
+ 0% {
+ transform: rotate(0);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+}
+
+@keyframes btn-spin {
+ 0% {
+ transform: rotate(0);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+}
diff --git a/eaterplanet_ecommerce/components/card/index.js b/eaterplanet_ecommerce/components/card/index.js
new file mode 100644
index 0000000..800dc9a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/card/index.js
@@ -0,0 +1,7 @@
+// eaterplanet_ecommerce/components/cart/index.js
+Component({
+ options: {
+ multipleSlots: true
+ },
+ externalClasses: ["i-class", "i-card-header", "i-card-body", "i-card-footer"]
+})
diff --git a/eaterplanet_ecommerce/components/card/index.json b/eaterplanet_ecommerce/components/card/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/card/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/card/index.wxml b/eaterplanet_ecommerce/components/card/index.wxml
new file mode 100644
index 0000000..310fb5a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/card/index.wxml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/card/index.wxss b/eaterplanet_ecommerce/components/card/index.wxss
new file mode 100644
index 0000000..0b831e8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/card/index.wxss
@@ -0,0 +1,9 @@
+.i-card {
+ width: 710rpx;
+ border-radius: 20rpx;
+ background: #fff;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ box-shadow: 10rpx 10rpx 20rpx 0rpx #afafafa1;
+}
diff --git a/eaterplanet_ecommerce/components/cartBtn/index.js b/eaterplanet_ecommerce/components/cartBtn/index.js
new file mode 100644
index 0000000..5de5a4d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/cartBtn/index.js
@@ -0,0 +1,21 @@
+// eaterplanet_ecommerce/components/fixed-cart/index.js
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ cartNum: {
+ type: Number,
+ default: 0
+ }
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ goCart: function () {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/order/shopCart',
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/cartBtn/index.json b/eaterplanet_ecommerce/components/cartBtn/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/cartBtn/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/cartBtn/index.wxml b/eaterplanet_ecommerce/components/cartBtn/index.wxml
new file mode 100644
index 0000000..cc93ea5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/cartBtn/index.wxml
@@ -0,0 +1,5 @@
+
+
+ 购物车
+ {{cartNum}}
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/cartBtn/index.wxss b/eaterplanet_ecommerce/components/cartBtn/index.wxss
new file mode 100644
index 0000000..8260c9b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/cartBtn/index.wxss
@@ -0,0 +1,37 @@
+.cart {
+ position: fixed;
+ left: 0rpx;
+ bottom: 80rpx;
+ width: 160rpx;
+ height: 100rpx;
+ border-radius: 0rpx 30rpx 30rpx 0rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ line-height: 1.5;
+ font-size: 24rpx;
+ background: #4facfe86;
+ backdrop-filter: blur(40rpx);
+ color: #fff;
+ /**box-shadow: 0 0 15rpx rgba(0,0,0,0.2);**/
+}
+
+.cart .img {
+ width: 54rpx;
+ height: 54rpx;
+}
+
+.cart .num {
+ color: #fff;
+ background-color: #4facfe;
+ position: absolute;
+ top: -15rpx;
+ right: -15rpx;
+ min-width: 54rpx;
+ height: 54rpx;
+ line-height: 54rpx;
+ border-radius: 54rpx;
+ text-align: center;
+ font-size: 26rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/cashon_delivery/index.js b/eaterplanet_ecommerce/components/cashon_delivery/index.js
new file mode 100644
index 0000000..81ee7b7
--- /dev/null
+++ b/eaterplanet_ecommerce/components/cashon_delivery/index.js
@@ -0,0 +1,40 @@
+// eaterplanet_ecommerce/components/cashon_delivery/index.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ paymentCode: {
+ type: String,
+ value: ""
+ },
+ codeImg: {
+ type: String,
+ value: ""
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ showTipDialog: false,
+ showImgDialog: false
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ handleTipDialog() {
+ this.setData({
+ showTipDialog: !this.data.showTipDialog
+ })
+ },
+ handleImgDialog() {
+ this.setData({
+ showImgDialog: !this.data.showImgDialog
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/cashon_delivery/index.json b/eaterplanet_ecommerce/components/cashon_delivery/index.json
new file mode 100644
index 0000000..979d4f5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/cashon_delivery/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-modal": "../modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/cashon_delivery/index.wxml b/eaterplanet_ecommerce/components/cashon_delivery/index.wxml
new file mode 100644
index 0000000..f655705
--- /dev/null
+++ b/eaterplanet_ecommerce/components/cashon_delivery/index.wxml
@@ -0,0 +1,25 @@
+
+ 出示收款码
+ 暂无收款码,请线下收款
+
+
+
+
+
+ 收款码
+
+ 该订单为 “货到付款” 支付方式,用户订单签收的时候请出示“收款码”进行收款,或者其他方式收款,提前沟通确认,防止订单出错。
+
+ 知道了
+
+
+
+
+
+ 收款码
+
+
+
+ 关闭
+
+
diff --git a/eaterplanet_ecommerce/components/cashon_delivery/index.wxss b/eaterplanet_ecommerce/components/cashon_delivery/index.wxss
new file mode 100644
index 0000000..bf09988
--- /dev/null
+++ b/eaterplanet_ecommerce/components/cashon_delivery/index.wxss
@@ -0,0 +1,2 @@
+@import "../../../common.wxss";
+@import "../../../icon.wxss";
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/changeCommunity/index.js b/eaterplanet_ecommerce/components/changeCommunity/index.js
new file mode 100644
index 0000000..9dd4c5a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/changeCommunity/index.js
@@ -0,0 +1,85 @@
+Component({
+ properties: {
+ changeCommunity: {
+ type: Object,
+ value: {}
+ },
+ community: {
+ type: Object,
+ value: {}
+ },
+ visible: {
+ type: Boolean,
+ value: false
+ },
+ canChange: {
+ type: Boolean,
+ value: true
+ },
+ groupInfo: {
+ type: Object,
+ value: {
+ group_name: '社区',
+ owner_name: '团长'
+ }
+ },
+ cancelFn: {
+ type: Boolean,
+ value: false
+ }
+ },
+
+ attached() {
+ this.countDistance()
+ },
+
+ methods: {
+ countDistance: function () {
+ let that = this;
+ wx.getLocation({
+ type: 'wgs84',
+ success(res) {
+ let {changeCommunity, community} = that.data;
+ const latitude = res.latitude;
+ const longitude = res.longitude;
+ let lat1 = community.lat || '';
+ let lon1 = community.lon || '';
+ let lat2 = changeCommunity.lat || '';
+ let lon2 = community.lon || '';
+ if(lat1 && lon1 && lat2 && lon2) {
+ let distance1 = that.getDistance(latitude, longitude, lat1, lon1);
+ let distance2 = that.getDistance(latitude, longitude, lat2, lon2);
+ community.distance = "距您"+distance1.toFixed(2)+"km";
+ changeCommunity.distance = "距您"+distance2.toFixed(2)+"km";
+ that.setData({ community, changeCommunity })
+ }
+ }
+ })
+ },
+ getDistance: function (lat1, lng1, lat2, lng2) {
+ var radLat1 = lat1 * Math.PI / 180.0;
+ var radLat2 = lat2 * Math.PI / 180.0;
+ var a = radLat1 - radLat2;
+ var b = lng1 * Math.PI / 180.0 - lng2 * Math.PI / 180.0;
+ var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
+ Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
+ s = s * 6378.137;
+ s = Math.round(s * 10000) / 10000;
+ return s;
+ },
+ switchCommunity: function (e) {
+ let type = e.currentTarget.dataset.type;
+ if (type == 0 || !this.data.canChange) {
+ this.closeModal();
+ } else {
+ this.data.canChange && this.triggerEvent('changeComunity'), getApp().globalData.goodsListCarCount = [];
+ }
+ },
+ closeModal: function () {
+ this.data.cancelFn && this.triggerEvent('noChange');
+ this.setData({
+ visible: false
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/changeCommunity/index.json b/eaterplanet_ecommerce/components/changeCommunity/index.json
new file mode 100644
index 0000000..979d4f5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/changeCommunity/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-modal": "../modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/changeCommunity/index.wxml b/eaterplanet_ecommerce/components/changeCommunity/index.wxml
new file mode 100644
index 0000000..8b9576c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/changeCommunity/index.wxml
@@ -0,0 +1,39 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/changeCommunity/index.wxss b/eaterplanet_ecommerce/components/changeCommunity/index.wxss
new file mode 100644
index 0000000..f65a8dd
--- /dev/null
+++ b/eaterplanet_ecommerce/components/changeCommunity/index.wxss
@@ -0,0 +1,112 @@
+.community-box {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+}
+
+.community-content {
+ width: 620rpx;
+ background: #fff;
+ border-radius: 10rpx;
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-start;
+ margin: 30px auto;
+ overflow: hidden;
+ z-index: 1001;
+}
+
+.community-content-title {
+ position: relative;
+ font-size: 30rpx;
+ width: 100%;
+ box-sizing: border-box;
+ text-align: center;
+ padding: 20rpx;
+}
+
+.community-content-change {
+ color: #4facfe;
+ margin-left: 15rpx;
+}
+
+.community-content-tip {
+ color: #666;
+ font-size: 32rpx;
+ line-height: 1.6;
+ padding: 20rpx;
+}
+
+.community-content-tip .item {
+ border: 1rpx solid #ccc;
+ padding: 10rpx;
+ margin-bottom: 20rpx;
+ border-radius: 10rpx;
+}
+
+.community-content-tip .item-l {
+ min-width: 110rpx;
+ max-width: 150rpx;
+ text-align: center;
+}
+
+.community-content-tip .item-l .type {
+ font-size: 24rpx;
+ background-color: #4facfe;
+ color: #fff;
+ border-radius: 3px;
+ padding: 3rpx 5rpx;
+}
+
+.community-content-tip .item-l .type.green {
+ background-color: green;
+}
+
+.community-content-tip .item-r {
+ flex: 1;
+ margin-left: 5px;
+}
+
+.community-content-tip .item-ft {
+ width: 20rpx;
+}
+
+.community-content-tip .item-ft .img {
+ width: 20rpx;
+}
+
+.community-content-tip .item {
+ display: flex;
+ align-items: center;
+}
+
+.community-content-tip .img {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+}
+
+.community-content-tip .name {
+ font-weight: bold;
+ color: #333;
+}
+
+.community-content-tip .address {
+ color: #999;
+ font-size: 28rpx;
+}
+
+.community-box .closeBtn {
+ width: 80rpx;
+ height: 80rpx;
+ margin: 0 auto;
+}
+
+.distance {
+ font-size: 24rpx;
+ color: #f75451;
+ font-weight: normal;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/chooseImage/index.js b/eaterplanet_ecommerce/components/chooseImage/index.js
new file mode 100644
index 0000000..3ca6f0b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/chooseImage/index.js
@@ -0,0 +1,106 @@
+function e(e, t, a) {
+ return t in e ? Object.defineProperty(e, t, {
+ value: a,
+ enumerable: !0,
+ configurable: !0,
+ writable: !0
+ }) : e[t] = a, e;
+}
+
+var t = [],
+ a = 0,
+ r = [];
+
+var app = getApp();
+
+Component({
+ properties: {
+ imgMax: {
+ type: Number,
+ value: 0
+ },
+ token: String,
+ key: {
+ type: String,
+ value: "wx-upload"
+ }
+ },
+ data: {
+ imgGroup: [],
+ progressList: []
+ },
+ methods: {
+ addImg: function() {
+ var s = this,
+ i = this.data.imgGroup;
+ wx.chooseMedia({
+ count: this.data.imgMax - i.length,
+ success: function(n) {
+ const tempFiles = n.tempFiles;
+ s.triggerEvent("on-chooseImage", {key: s.data.key}), (i = i.concat(tempFiles)).length > s.data.imgMax && i.splice(s.data.imgMax),
+ s.setData({
+ imgGroup: i
+ });
+ var o = tempFiles.length;
+ a = i.length;
+ for (var g = 0; g < o; g++) ! function(i) {
+ var g = tempFiles[i].tempFilePath.split(".")[tempFiles[i].tempFilePath.split(".").length - 1],
+ l = new Date().getTime(),
+ p = Math.round(1e6 * Math.random());
+ r[i + a - o] = wx.uploadFile({
+ url: app.util.url('entry/wxapp/index', {
+ 'm': 'eaterplanet_ecommerce',
+ 'controller': 'goods.doPageUpload'
+ }),
+ filePath: tempFiles[i].tempFilePath,
+ name: "upfile",
+ header: {
+ "Content-Type": "multipart/form-data"
+ },
+ formData: {
+ token: s.data.token,
+ key: s.data.key + "-" + l + "-" + p + "." + g
+ },
+ success: function(r) {
+ t[i + a - o] = JSON.parse(r.data).image_o, s.setData(e({}, "progressList[" + (i + a - o) + "]", 100)),
+ s.triggerEvent("on-changeImage", {
+ value: t,
+ len: a,
+ key: s.data.key
+ });
+ }
+ }), r[i + a - o].onProgressUpdate(function(t) {
+ var r = t.progress;
+ s.setData(e({}, "progressList[" + (i + a - o) + "]", r));
+ });
+ }(g);
+ }
+ });
+ },
+ remove: function(e) {
+ var s = e.currentTarget.dataset.idx,
+ i = this.data.imgGroup,
+ n = this.data.progressList;
+ n[s] < 100 && r[s].abort(), i.splice(s, 1), r.splice(s, 1), n.splice(s, 1), t.splice(s, 1),
+ a = i.length, this.setData({
+ imgGroup: i,
+ progressList: n
+ }), this.triggerEvent("on-changeImage", {
+ value: t,
+ len: a,
+ key: this.data.key
+ });
+ },
+ bigImg: function(e) {
+ var t = e.currentTarget.dataset.src,
+ a = e.currentTarget.dataset.list;
+ wx.previewImage({
+ current: t,
+ urls: a
+ });
+ }
+ },
+ detached: function() {
+ console.log("detached"), t = [], a = 0, r = [];
+ }
+});
diff --git a/eaterplanet_ecommerce/components/chooseImage/index.json b/eaterplanet_ecommerce/components/chooseImage/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/chooseImage/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/chooseImage/index.wxml b/eaterplanet_ecommerce/components/chooseImage/index.wxml
new file mode 100644
index 0000000..286770a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/chooseImage/index.wxml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{imgGroup.length?imgGroup.length+'/'+imgMax:'上传图片'}}
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/chooseImage/index.wxss b/eaterplanet_ecommerce/components/chooseImage/index.wxss
new file mode 100644
index 0000000..5ba56b4
--- /dev/null
+++ b/eaterplanet_ecommerce/components/chooseImage/index.wxss
@@ -0,0 +1,81 @@
+.img-group {
+ display: flex;
+ flex-wrap: wrap;
+ font-size: 24rpx;
+ margin-top: 30rpx;
+}
+
+.img-group .img-item {
+ margin: 0 6rpx;
+ width: 150rpx;
+ height: 150rpx;
+ position: relative;
+ box-sizing: border-box;
+}
+
+.img-group .img-item .img {
+ width: 150rpx;
+ height: 150rpx;
+}
+
+.img-group .img-item .progress {
+ position: absolute;
+ left: 16rpx;
+ bottom: 20rpx;
+ width: 120rpx;
+ height: 16rpx;
+ border-radius: 20rpx;
+ border: 2rpx solid #ddd;
+ display: flex;
+ align-items: center;
+}
+
+.img-group .img-item .progress .span {
+ height: 8rpx;
+ width: 0;
+ max-width: 112rpx;
+ border-radius: 12rpx;
+ position: absolute;
+ left: 4rpx;
+ top: 4rpx;
+ background: #f5f5f5;
+}
+
+.img-group .img-item .hide-progress {
+ opacity: 0;
+}
+
+.img-group .img-item .close {
+ width: 32rpx;
+ height: 32rpx;
+ position: absolute;
+ right: -8rpx;
+ top: -8rpx;
+ z-index: 1;
+}
+
+.img-group .img-item .closeImg {
+ height: 100%;
+ width: 100%;
+ font-size: 40rpx;
+ color: #a0a0a0;
+}
+
+.img-group .img-add {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ border: 2rpx dashed #dedede;
+ color: #bcbcbc;
+}
+
+.img-group .img-add .cameraImg {
+ width: 44rpx;
+ height: 44rpx;
+ color: #cdcdcd;
+ margin-bottom: 8rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
diff --git a/eaterplanet_ecommerce/components/comming-spu-disabled/index.js b/eaterplanet_ecommerce/components/comming-spu-disabled/index.js
new file mode 100644
index 0000000..e22926b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/comming-spu-disabled/index.js
@@ -0,0 +1,43 @@
+var e = require("../../utils/timeFormat");
+
+Component({
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ spuImage: "",
+ spuName: "",
+ endTime: "",
+ beginTime: "",
+ actPrice: [],
+ marketPrice: [],
+ desc: "新鲜自然 唇齿留香",
+ surplusNum: 0,
+ soldNum: 0,
+ limitOrderNum: 0,
+ limitMemberNum: 0,
+ serverTime: 0,
+ skuImage: ""
+ },
+ observer: function (m) {
+ if (m) {
+ var i = (0, e.formatTime)(new Date(1 * m.endTime)), r = (0, e.getBeginTime)(m.beginTime, m.serverTime), t = (0,
+ e.formatNumber)(i.month) + "月" + (0, e.formatNumber)(i.day) + "日 " + (0, e.formatNumber)(i.hour) + ":" + (0,
+ e.formatNumber)(i.minute);
+ this.setData({
+ formatBeginTime: r,
+ endTime: t
+ });
+ }
+ }
+ },
+ isPast: {
+ type: Boolean,
+ value: false
+ }
+ },
+ data: {
+ formatBeginTime: "",
+ endTime: ""
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/comming-spu-disabled/index.json b/eaterplanet_ecommerce/components/comming-spu-disabled/index.json
new file mode 100644
index 0000000..27cb8c9
--- /dev/null
+++ b/eaterplanet_ecommerce/components/comming-spu-disabled/index.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../img/index",
+ "i-router-link": "../router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/comming-spu-disabled/index.wxml b/eaterplanet_ecommerce/components/comming-spu-disabled/index.wxml
new file mode 100644
index 0000000..c5dd0d5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/comming-spu-disabled/index.wxml
@@ -0,0 +1,20 @@
+
+
+
+ {{spuItem.spuName}}
+
+ 结束时间 {{endTime}}
+ {{formatBeginTime}}{{spuItem.limitOrderNum>-1||spuItem.limitMemberNum>-1?' | 限购':''}}
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+ ¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}
+
+
+ 已结束
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/comming-spu-disabled/index.wxss b/eaterplanet_ecommerce/components/comming-spu-disabled/index.wxss
new file mode 100644
index 0000000..9300a07
--- /dev/null
+++ b/eaterplanet_ecommerce/components/comming-spu-disabled/index.wxss
@@ -0,0 +1,113 @@
+.icon-shop {
+ position: absolute;
+ right: 20rpx;
+ bottom: 20rpx;
+ width: 54rpx;
+ height: 54rpx;
+}
+
+.icon-shop .img {
+ width: 54rpx;
+ height: 54rpx;
+}
+
+.mask {
+ width: 348rpx;
+ height: 240rpx;
+ position: absolute;
+ left: 0;
+ top: 30rpx;
+ background: rgba(255, 255, 255, 0.5);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.mask .toast {
+ width: 196rpx;
+ height: 60rpx;
+ background: rgba(0, 0, 0, 0.5);
+ border-radius: 10rpx;
+ text-align: center;
+ line-height: 60rpx;
+ color: #fff;
+ font-weight: bold;
+ font-size: 28rpx;
+}
+
+.spu-img {
+ width: 240rpx;
+ height: 240rpx;
+ border-radius: 10rpx;
+}
+
+.comming-spu-content {
+ width: 348rpx;
+ height: 452rpx;
+ border-radius: 20rpx;
+ background: #fff;
+ box-sizing: border-box;
+ padding: 30rpx 26rpx 30rpx 26rpx;
+ box-shadow: 0 0 40rpx rgba(0, 0, 0, 0.05);
+ position: relative;
+}
+
+.comming-spu-content .spu-img-content {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 296rpx;
+ height: 240rpx;
+ margin: 0 auto 34rpx;
+}
+
+.comming-spu-content .spu-name {
+ font-size: 28rpx;
+ line-height: 28rpx;
+ height: 36rpx;
+ color: #444;
+ margin-bottom: 16rpx;
+ font-weight: 500;
+ position: relative;
+}
+
+.comming-spu-content .spu-name .span {
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ position: absolute;
+ left: 0;
+ top: -4rpx;
+ line-height: 36rpx;
+}
+
+.comming-spu-content .spu-desc {
+ color: #ffab20;
+ font-size: 24rpx;
+ line-height: 24rpx;
+ margin-bottom: 14rpx;
+}
+
+.comming-spu-content .spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 20rpx;
+}
+
+.comming-spu-content .spu-price .sale-price {
+ color: #ff758c;
+ margin-right: 8rpx;
+}
+
+.comming-spu-content .spu-price .sale-price .span {
+ font-size: 40rpx;
+ line-height: 40rpx;
+ margin-left: 4rpx;
+ font-weight: 500;
+}
+
+.comming-spu-content .spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+}
diff --git a/eaterplanet_ecommerce/components/community-item/index.js b/eaterplanet_ecommerce/components/community-item/index.js
new file mode 100644
index 0000000..156babb
--- /dev/null
+++ b/eaterplanet_ecommerce/components/community-item/index.js
@@ -0,0 +1,66 @@
+var utils = require("../../utils/index");
+var location = require("../../utils/Location");
+var app = getApp();
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ item: {
+ type: Object,
+ value: {
+ rest: 0
+ }
+ },
+ city: Object,
+ isOld: {
+ type: Boolean,
+ value: false
+ },
+ groupInfo: {
+ type: Object,
+ value: {
+ group_name: '社区',
+ owner_name: '团长'
+ }
+ },
+ hiddenDetails: {
+ type: Number,
+ value: 0
+ },
+ skin: {
+ type: Object
+ }
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ chooseCommunity: function (event) {
+ var community = event.currentTarget.dataset.val;
+ if ("火星社区" !== community.communityName || community.communityId) {
+ var disUserHeadImg = community.disUserHeadImg || community.headImg || "",
+ disUserName = community.disUserName || community.realName || "",
+ data = {
+ communityId: community.communityId,
+ communityName: community.communityName,
+ disUserName: disUserName,
+ disUserHeadImg: disUserHeadImg,
+ communityAddress: community.communityAddress,
+ distance: community.distance,
+ fullAddress: community.fullAddress || community.communityAddress,
+ lat: community.lat,
+ lon: community.lon
+ },
+ city = this.data.city;
+ (0, utils.changeCommunity)(data, city);
+ } else {
+ location.openSetting(app).then(function () {
+ location.checkGPS(app, function () { });
+ });
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/community-item/index.json b/eaterplanet_ecommerce/components/community-item/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/community-item/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/community-item/index.wxml b/eaterplanet_ecommerce/components/community-item/index.wxml
new file mode 100644
index 0000000..cec97fb
--- /dev/null
+++ b/eaterplanet_ecommerce/components/community-item/index.wxml
@@ -0,0 +1,18 @@
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/community-item/index.wxss b/eaterplanet_ecommerce/components/community-item/index.wxss
new file mode 100644
index 0000000..a25b9f0
--- /dev/null
+++ b/eaterplanet_ecommerce/components/community-item/index.wxss
@@ -0,0 +1,88 @@
+.community-item {
+ box-sizing: border-box;
+ display: flex;
+ padding: 60rpx 30rpx;
+ margin: 20rpx 0rpx 20rpx 0rpx;
+ border-radius: 20rpx;
+}
+
+.community-item .group-head {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 80rpx;
+ margin-right: 20rpx;
+}
+
+.community-item .community-title {
+ font-size: 32rpx;
+ line-height: 32rpx;
+ height: 32rpx;
+ width: 520rpx;
+ margin-bottom: 20rpx;
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-end;
+}
+
+.community-item .community-title .span {
+ color: #444;
+ font-weight: 500;
+}
+
+.community-item .community-title .em {
+ color: #4facfe;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ white-space: nowrap;
+}
+
+.community-item .community-address {
+ font-size: 26rpx;
+ line-height: 34rpx;
+ color: #666;
+ width: 520rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ text-overflow: initial;
+ white-space: normal;
+}
+
+.community-item .group-master {
+ width: 560rpx;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ color: #aaa;
+ position: relative;
+ margin-bottom: 6rpx;
+}
+
+.community-item .group-master .right-arrow {
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 14rpx;
+ height: 28rpx;
+}
+
+.group-img {
+ position: relative;
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 80rpx;
+ margin-right: 20rpx;
+ overflow: hidden;
+}
+
+.rest {
+ position: absolute;
+ left: 0;
+ bottom: 8rpx;
+ right: 0;
+ font-size: 18rpx;
+ background: rgba(255, 83, 68, 0.8);
+ text-align: center;
+ color: #fff;
+ padding: 2rpx 0 3rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/count-down/index.js b/eaterplanet_ecommerce/components/count-down/index.js
new file mode 100644
index 0000000..bae330b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/count-down/index.js
@@ -0,0 +1,81 @@
+var t = require("../../utils/timeFormat");
+
+Component({
+ properties: {
+ target: {
+ type: String,
+ observer: function(t) {
+ this.init(t);
+ }
+ },
+ showDay: Boolean,
+ beginTime: String,
+ callback: String,
+ format: Array,
+ clearTimer: {
+ type: Boolean,
+ observer: function (t) {
+ t&&clearTimeout(this.data.timer);
+ }
+ }
+ },
+ externalClasses: ["countdown-class", "item-class"],
+ data: {
+ time: {
+ day: "0",
+ second: "00",
+ minute: "00",
+ hour: "00"
+ },
+ resultFormat: [],
+ changeFormat: false,
+ timeStamp: 0,
+ timer: null
+ },
+ methods: {
+ init: function(t) {
+ var e = {
+ day: "0",
+ second: "00",
+ minute: "00",
+ hour: "00"
+ };
+ if (t - new Date().getTime() <= 0) return this.setData({
+ time: e
+ }), void this.triggerEvent("callback");
+ this.interval(t);
+ },
+ interval: function(e) {
+ var a = this,
+ i = e - new Date().getTime();
+ if (i <= 0) return clearTimeout(this.data.timer), this.triggerEvent("callback"),
+ void this.setData({
+ time: {
+ day: "0",
+ second: "00",
+ minute: "00",
+ hour: "00"
+ }
+ });
+ var r = Math.ceil(i / 1000),
+ n = parseInt(r / 86400),
+ o = r % 86400,
+ s = (0, t.formatNumber)(parseInt(o / 3600));
+ o %= 3600;
+ var m = {
+ day: n,
+ hour: s,
+ minute: (0, t.formatNumber)(parseInt(o / 60)),
+ second: (0, t.formatNumber)(o % 60)
+ };
+ this.setData({
+ time: m
+ }), this.data.timer = setTimeout(function() {
+ a.interval(e);
+ }, 1000);
+ }
+ },
+ detached: function() {
+ clearTimeout(this.data.timer);
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/count-down/index.json b/eaterplanet_ecommerce/components/count-down/index.json
new file mode 100644
index 0000000..590ae39
--- /dev/null
+++ b/eaterplanet_ecommerce/components/count-down/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "routerLink": "../router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/count-down/index.wxml b/eaterplanet_ecommerce/components/count-down/index.wxml
new file mode 100644
index 0000000..06fe84f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/count-down/index.wxml
@@ -0,0 +1,7 @@
+
+
+ {{time.day}}天
+ {{time.hour}}:
+ {{time.minute}}:
+ {{time.second}}
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/count-down/index.wxss b/eaterplanet_ecommerce/components/count-down/index.wxss
new file mode 100644
index 0000000..7f9e91a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/count-down/index.wxss
@@ -0,0 +1,12 @@
+.i-count-down {
+ white-space: nowrap;
+}
+
+.em {
+ margin-right: 12rpx;
+}
+
+.item-class {
+ display: inline-block;
+ margin: 0 4rpx;
+}
diff --git a/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.js b/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.js
new file mode 100644
index 0000000..5e37eb6
--- /dev/null
+++ b/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.js
@@ -0,0 +1,277 @@
+// components/datatimepicker/datatimepicker.js
+
+Component({
+ behaviors: ['wx://form-field'],
+ externalClasses: ["i-class"],
+ properties: {
+ format: {
+ type: String
+ },
+ name: {
+ type: String
+ },
+ placeholder: {
+ type: String
+ }
+ },
+ data: {},
+ lifetimes: {
+ attached: function() {
+ //当前时间 年月日 时分秒
+ const date = new Date()
+ const curYear = date.getFullYear()
+ const curMonth = date.getMonth() + 1
+ const curDay = date.getDate()
+ const curHour = date.getHours()
+ const curMinute = date.getMinutes()
+ const curSecond = date.getSeconds()
+
+ //初始化时间选择轴
+ this.setData({
+ chooseYear: curYear
+ })
+ this.initColumn(curMonth);
+ if(curMonth==2) this.setData({ days: this.data.multiArray[2] })
+
+ //不足两位的前面好补0 因为后面要获取在时间轴上的索引 时间轴初始化的时候都是两位
+ var showMonth = curMonth < 10 ? ('0' + curMonth) : curMonth
+ var showDay = curDay < 10 ? ('0' + curDay) : curDay
+ var showHour = curHour < 10 ? ('0' + curHour) : curHour
+ var showMinute = curMinute < 10 ? ('0' + curMinute) : curMinute
+ var showSecond = curSecond < 10 ? ('0' + curSecond) : curSecond
+
+ //当前时间在picker列上面的索引 为了当打开时间选择轴时选中当前的时间
+ var indexYear = this.data.years.indexOf(curYear + '')
+ var indexMonth = this.data.months.indexOf(showMonth + '')
+ var indexDay = this.data.days.indexOf(showDay + '')
+ var indexHour = this.data.hours.indexOf(showHour + '')
+ var indexMinute = this.data.minutes.indexOf(showMinute + '')
+ var indexSecond = this.data.seconds.indexOf(showSecond + '')
+
+ var multiIndex = []
+ var multiArray = []
+ var value = ''
+
+ var format = this.properties.format;
+ if (format == 'yyyy-MM-dd') {
+ multiIndex = [indexYear, indexMonth, indexDay]
+ value = `${curYear}-${showMonth}-${showDay}`
+ multiArray = [this.data.years, this.data.months, this.data.days]
+ }
+ if (format == 'HH:mm:ss') {
+ multiIndex = [indexHour, indexMinute, indexSecond]
+ value = `${showHour}:${showMinute}:${showSecond}`
+ multiArray = [this.data.hours, this.data.minutes, this.data.seconds]
+ }
+ if (format == 'yyyy-MM-dd HH:mm') {
+ multiIndex = [indexYear, indexMonth, indexDay, indexHour, indexMinute]
+ value = `${curYear}-${showMonth}-${showDay} ${showHour}:${showMinute}`
+ multiArray = [this.data.years, this.data.months, this.data.days, this.data.hours, this.data.minutes]
+ }
+ if (format == 'yyyy-MM-dd HH:mm:ss') {
+ multiIndex = [indexYear, indexMonth, indexDay, indexHour, indexMinute, indexSecond]
+ value = `${curYear}-${showMonth}-${showDay} ${showHour}:${showMinute}:${showSecond}`
+ multiArray = [this.data.years, this.data.months, this.data.days, this.data.hours, this.data.minutes, this.data.seconds]
+
+ }
+ this.setData({
+ // value, // 初始时间
+ multiIndex,
+ multiArray,
+ curMonth,
+ chooseYear: curYear,
+ })
+ }
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ //获取时间日期
+ bindPickerChange: function(e) {
+ this.setData({
+ multiIndex: e.detail.value
+ })
+ const index = this.data.multiIndex
+ var format = this.properties.format
+ var showTime = ''
+
+ if (format == 'yyyy-MM-dd') {
+ const year = this.data.multiArray[0][index[0]]
+ const month = this.data.multiArray[1][index[1]]
+ const day = this.data.multiArray[2][index[2]]
+ showTime = `${year}-${month}-${day}`
+ }
+ if (format == 'HH:mm:ss') {
+ const hour = this.data.multiArray[0][index[0]]
+ const minute = this.data.multiArray[1][index[1]]
+ const second = this.data.multiArray[2][index[2]]
+ showTime = `${hour}:${minute}:${second}`
+ }
+ if (format == 'yyyy-MM-dd HH:mm') {
+ const year = this.data.multiArray[0][index[0]]
+ const month = this.data.multiArray[1][index[1]]
+ const day = this.data.multiArray[2][index[2]]
+ const hour = this.data.multiArray[3][index[3]]
+ const minute = this.data.multiArray[4][index[4]]
+ showTime = `${year}-${month}-${day} ${hour}:${minute}`
+ }
+ if (format == 'yyyy-MM-dd HH:mm:ss') {
+ const year = this.data.multiArray[0][index[0]]
+ const month = this.data.multiArray[1][index[1]]
+ const day = this.data.multiArray[2][index[2]]
+ const hour = this.data.multiArray[3][index[3]]
+ const minute = this.data.multiArray[4][index[4]]
+ const second = this.data.multiArray[5][index[5]]
+ showTime = `${year}-${month}-${day} ${hour}:${minute}:${second}`
+ }
+ this.setData({
+ value: showTime
+ })
+ this.triggerEvent('dateTimePicker', showTime)
+ },
+ //初始化时间选择轴
+ initColumn(curMonth) {
+ const years = []
+ const months = []
+ const days = []
+ const hours = []
+ const minutes = []
+ const seconds = []
+ for (let i = 2019; i <= 2099; i++) {
+ years.push(i + '')
+ }
+ for (let i = 1; i <= 12; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ months.push(i + '')
+ }
+
+ if (curMonth == 1 || curMonth == 3 || curMonth == 5 || curMonth == 7 || curMonth == 8 || curMonth == 10 || curMonth == 12) {
+ for (let i = 1; i <= 31; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ days.push(i + '')
+ }
+ }
+ if (curMonth == 4 || curMonth == 6 || curMonth == 9 || curMonth == 11) {
+ for (let i = 1; i <= 30; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ days.push(i + '')
+ }
+ }
+ if (curMonth == 2) {
+ this.setFebDays()
+ }
+ for (let i = 0; i <= 23; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ hours.push(i + '')
+ }
+ for (let i = 0; i <= 59; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ minutes.push(i + '')
+ }
+ for (let i = 0; i <= 59; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ seconds.push(i + '')
+ }
+ this.setData({
+ years,
+ months,
+ days,
+ hours,
+ minutes,
+ seconds
+ })
+ },
+
+ /**
+ * 列改变时触发
+ */
+ bindPickerColumnChange: function(e) {
+ //获取年份 用于计算改年的2月份为平年还是闰年
+ if (e.detail.column == 0 && this.properties.format != 'HH:mm:ss') {
+ var chooseYear = this.data.multiArray[e.detail.column][e.detail.value];
+ this.setData({
+ chooseYear
+ })
+ if (this.data.curMonth == '02' || this.data.chooseMonth == '02') {
+ this.setFebDays()
+ }
+ }
+ //当前第二为月份时需要初始化当月的天数
+ if (e.detail.column == 1 && this.properties.format != 'HH:mm:ss') {
+ let num = parseInt(this.data.multiArray[e.detail.column][e.detail.value]);
+ let temp = [];
+ if (num == 1 || num == 3 || num == 5 || num == 7 || num == 8 || num == 10 || num == 12) { //31天的月份
+ for (let i = 1; i <= 31; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ temp.push("" + i);
+ }
+ this.setData({
+ ['multiArray[2]']: temp
+ });
+ } else if (num == 4 || num == 6 || num == 9 || num == 11) { //30天的月份
+ for (let i = 1; i <= 30; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ temp.push("" + i);
+ }
+ this.setData({
+ ['multiArray[2]']: temp
+ });
+ } else if (num == 2) { //2月份天数
+ this.setFebDays()
+ }
+ }
+ var data = {
+ multiArray: this.data.multiArray,
+ multiIndex: this.data.multiIndex
+ };
+ data.multiIndex[e.detail.column] = e.detail.value;
+ this.setData(data);
+ },
+ //计算二月份天数
+ setFebDays() {
+ let year = parseInt(this.data.chooseYear);
+ let temp = [];
+ if (year % (year % 100 ? 4 : 400) ? false : true) {
+ for (let i = 1; i <= 29; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ temp.push("" + i);
+ }
+ this.setData({
+ ['multiArray[2]']: temp,
+ chooseMonth: '02'
+
+ });
+ } else {
+ for (let i = 1; i <= 28; i++) {
+ if (i < 10) {
+ i = "0" + i;
+ }
+ temp.push("" + i);
+ }
+ this.setData({
+ ['multiArray[2]']: temp,
+ chooseMonth: '02'
+ });
+ }
+ }
+ },
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.json b/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.wxml b/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.wxml
new file mode 100644
index 0000000..bf37bc8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.wxml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.wxss b/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.wxss
new file mode 100644
index 0000000..62a3bdb
--- /dev/null
+++ b/eaterplanet_ecommerce/components/datetimepicker/datetimepicker.wxss
@@ -0,0 +1,5 @@
+.item-value {
+ text-align: right;
+ font-size: 26rpx;
+ position: relative;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/dialog/index.js b/eaterplanet_ecommerce/components/dialog/index.js
new file mode 100644
index 0000000..431de45
--- /dev/null
+++ b/eaterplanet_ecommerce/components/dialog/index.js
@@ -0,0 +1,29 @@
+Component({
+ externalClasses: ["i-class", "i-btn"],
+ properties: {
+ visible: {
+ type: Boolean,
+ value: false
+ },
+ text: String,
+ confirmText: {
+ type: String,
+ value: "确定"
+ },
+ showCancel: {
+ type: Boolean,
+ value: true
+ }
+ },
+ methods: {
+ confirm: function () {
+ this.triggerEvent("confirm");
+ },
+ cancel: function () {
+ this.triggerEvent("cancel");
+ },
+ close: function () {
+ this.triggerEvent("cancel");
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/dialog/index.json b/eaterplanet_ecommerce/components/dialog/index.json
new file mode 100644
index 0000000..7b873d8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/dialog/index.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-modal": "../modal/index",
+ "i-button": "../button/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/dialog/index.wxml b/eaterplanet_ecommerce/components/dialog/index.wxml
new file mode 100644
index 0000000..71bb52f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/dialog/index.wxml
@@ -0,0 +1,22 @@
+
+
+ {{text}}
+
+
+
+
+
+
+ 取消
+
+
+
+ {{confirmText}}
+
+
+
+ {{confirmText}}
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/dialog/index.wxss b/eaterplanet_ecommerce/components/dialog/index.wxss
new file mode 100644
index 0000000..7d420c3
--- /dev/null
+++ b/eaterplanet_ecommerce/components/dialog/index.wxss
@@ -0,0 +1,46 @@
+.dialog-content {
+ width: 540rpx;
+ height: 208rpx;
+ border-radius: 30rpx;
+ background: #fff;
+}
+
+.dialog-content .text {
+ height: 120rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-bottom: 2rpx solid #d2d2d2;
+}
+
+.dialog-content .button-group {
+ display: flex;
+}
+
+.dialog-content .left-btn, .dialog-content .right-btn {
+ width: 270rpx;
+ height: 88rpx;
+ text-align: center;
+ line-height: 88rpx;
+ font-size: 36rpx;
+ color: #0076ff;
+ margin: 0;
+ padding: 0;
+}
+
+.dialog-content .split-line {
+ width: 0;
+ height: 88rpx;
+ border-right: 2rpx solid #d2d2d2;
+}
+
+.dialog-content .r-btn {
+ width: 540rpx;
+ height: 88rpx;
+ text-align: center;
+ line-height: 88rpx;
+ font-size: 36rpx;
+ color: #0076ff;
+ margin: 0;
+ padding: 0;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/diy-goods-list/index.js b/eaterplanet_ecommerce/components/diy-goods-list/index.js
new file mode 100644
index 0000000..b5e422e
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-goods-list/index.js
@@ -0,0 +1,64 @@
+var app = getApp();
+
+Component({
+ properties: {
+ value: {
+ type: Object,
+ value: {}
+ },
+ idx: {
+ type: Number,
+ value: 0
+ }
+ },
+
+ data: {
+ // list: [],
+ _lock: false
+ },
+
+ attached: function() {
+ this.setData({_lock: true },()=>{
+ this.getGoodsList();
+ })
+ },
+
+ pageLifetimes: {
+ show: function () {
+ this.data._lock || this.getGoodsList();
+ }
+ },
+
+ methods: {
+ getGoodsList() {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ let value = this.data.value;
+ let sources = value.sources;
+ let params = {};
+ if(sources=='category') {
+ params.gid = value.categoryId;
+ params.is_random = 0;
+ } else {
+ params.is_random = 1;
+ }
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.load_gps_goodslist',
+ token,
+ pageNum: 1,
+ head_id: cur_community.communityId || '',
+ per_page: value.goodsCount,
+ ...params
+ },
+ dataType: 'json',
+ success: function (res) {
+ that.setData({ _lock: false })
+ that.triggerEvent('diyGoodsList', { id: that.data.idx, data: res.data });
+ }
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/diy-goods-list/index.json b/eaterplanet_ecommerce/components/diy-goods-list/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-goods-list/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/diy-goods-list/index.wxml b/eaterplanet_ecommerce/components/diy-goods-list/index.wxml
new file mode 100644
index 0000000..355f382
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-goods-list/index.wxml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/diy-goods-list/index.wxss b/eaterplanet_ecommerce/components/diy-goods-list/index.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/eaterplanet_ecommerce/components/diy-many-goods-list/index.js b/eaterplanet_ecommerce/components/diy-many-goods-list/index.js
new file mode 100644
index 0000000..271872e
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-many-goods-list/index.js
@@ -0,0 +1,75 @@
+var app = getApp();
+
+Component({
+ properties: {
+ value: {
+ type: Object,
+ value: {}
+ },
+ idx: {
+ type: Number,
+ value: 0
+ }
+ },
+
+ data: {
+ // list: [],
+ _lock: false,
+ current: 0
+ },
+
+ attached: function() {
+ this.setData({_lock: true },()=>{
+ this.getGoodsList();
+ })
+ },
+
+ pageLifetimes: {
+ show: function () {
+ this.data._lock || this.getGoodsList();
+ }
+ },
+
+ methods: {
+ getGoodsList() {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ let { current, value } = this.data;
+ let vlist = value.list;
+ let sources = vlist[current].sources;
+ let params = {};
+ if(sources=='category') {
+ params.gid = vlist[current].categoryId;
+ params.is_random = 0;
+ } else {
+ params.is_random = 1;
+ }
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.load_gps_goodslist',
+ token,
+ pageNum: 1,
+ head_id: cur_community.communityId || '',
+ per_page: 20 || value.goodsCount,
+ ...params
+ },
+ dataType: 'json',
+ success: function (res) {
+ console.log('many_goods_list')
+ that.setData({ _lock: false })
+ that.triggerEvent('diyGoodsList', { id: that.data.idx, data: res.data });
+ }
+ })
+ },
+ changeCate(e) {
+ let idx = e.currentTarget.dataset.idx;
+ this.setData({
+ current: idx
+ },()=>{
+ this.getGoodsList();
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/diy-many-goods-list/index.json b/eaterplanet_ecommerce/components/diy-many-goods-list/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-many-goods-list/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/diy-many-goods-list/index.wxml b/eaterplanet_ecommerce/components/diy-many-goods-list/index.wxml
new file mode 100644
index 0000000..f0300ba
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-many-goods-list/index.wxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ {{item.title}}
+ {{item.desc}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/diy-many-goods-list/index.wxss b/eaterplanet_ecommerce/components/diy-many-goods-list/index.wxss
new file mode 100644
index 0000000..fa0573f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-many-goods-list/index.wxss
@@ -0,0 +1,47 @@
+.navlist {
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+ align-items: center;
+ margin-left: 20rpx;
+ margin-right: 20rpx;
+ margin-bottom: 20rpx;
+}
+
+.navlist .item {
+ width: 120rpx;
+ flex-shrink: 0;
+ text-align: center;
+}
+
+.navlist .item .name {
+ font-size: 32rpx;
+ color: #303133;
+ line-height: 1;
+}
+
+.navlist .item .tag {
+ font-size: 24rpx;
+ color: #909399;
+ margin-top: 10rpx;
+ line-height: 36rpx;
+}
+
+.navlist .item.active .name {
+ font-weight: bold;
+}
+
+.navlist .item.active .tag {
+ background: rgb(255, 69, 68);
+ color: #FFFFFF;
+ border-radius: 20rpx;
+}
+
+.split-line {
+ width: 1rpx;
+ height: 30rpx;
+ background-color: #E5E5E5;
+ margin-right: calc((100% - 121rpx * 4) / 6);
+ margin-left: calc((100% - 121rpx * 4) / 6);
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/diy-nav/index.js b/eaterplanet_ecommerce/components/diy-nav/index.js
new file mode 100644
index 0000000..8831662
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-nav/index.js
@@ -0,0 +1,133 @@
+var util = require('../../utils/util.js');
+var app = getApp();
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ list: {
+ type: Object,
+ value: {},
+ observer: function (t) {
+ if(t.selectedTemplate=="imageNavigation") {
+ let num = t.showType*2;
+ let len = t.list.length;
+ let number = Math.ceil(len/num);
+ let isSwiper = false;
+ if(number>1) {
+ isSwiper = true;
+ }
+ let newlist = this.chunk(t.list, num);
+ this.setData({ isSwiper, number, newlist })
+ }
+ }
+ },
+ skin: {
+ type: Object
+ },
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ isSwiper: false,
+ number: 0,
+ newlist: [],
+ current: 0,
+ swiperHeight: 0
+ },
+
+ attached() {
+ this.getCurH()
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ chunk: function(array, size) {
+ var result = [];
+ for (var x = 0; x < Math.ceil(array.length / size); x++) {
+ var start = x * size;
+ var end = start + size;
+ result.push(array.slice(start, end));
+ }
+ return result;
+ },
+ getCurH() {
+ let current = this.data.current;
+ let that = this;
+ const query = wx.createSelectorQuery().in(this);
+ query.select('#nav_'+current).boundingClientRect(function (rect) {
+ rect&&that.setData({ swiperHeight: rect.height })
+ }).exec();
+ },
+ goDiysliderUrl: function(t) {
+ let link = t.currentTarget.dataset.link;
+ let needAuth = this.data.needAuth;
+
+ if (Object.keys(link).length > 0) {
+ let type = link.parents;
+ if (util.checkRedirectTo(link.wap_url, needAuth)) {
+ this.authModal();
+ return;
+ }
+ switch(type) {
+ case "WEBVIEW":
+ let url = link.wap_url;
+ url && wx.navigateTo({ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url) });
+ break;
+ case "MALL_LINK":
+ url = link.wap_url;
+ if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
+ url && wx.switchTab({ url })
+ } else {
+ url && wx.navigateTo({ url })
+ }
+ break;
+ case "OTHER_APPLET":
+ // 跳转小程序
+ let appId = link.appid;
+ let path = link.wap_url;
+ appId && wx.navigateToMiniProgram({
+ appId,
+ path,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {},
+ fail(error) { wx.showModal({ title: "提示", content: error.errMsg, showCancel: false }) }
+ })
+ break;
+ case "CUSTOM_LINK":
+ url = link.wap_url;
+ if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
+ url && wx.switchTab({ url })
+ } else {
+ url && wx.navigateTo({ url })
+ }
+ break;
+ case "GOODS_CATEGORY":
+ //独立分类
+ let cateId = link.id;
+ app.globalData.typeCateId = cateId;
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/type/index'
+ })
+ break;
+ default:
+ url = link.wap_url;
+ url && wx.navigateTo({ url })
+ break;
+ }
+ }
+ },
+ onCurrent(e) {
+ this.setData({
+ current: e.detail.current
+ }, ()=>{
+ this.getCurH()
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/diy-nav/index.json b/eaterplanet_ecommerce/components/diy-nav/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-nav/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/diy-nav/index.wxml b/eaterplanet_ecommerce/components/diy-nav/index.wxml
new file mode 100644
index 0000000..876fa2c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-nav/index.wxml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+ {{navItem.title}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{navItem.title}}
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/diy-nav/index.wxss b/eaterplanet_ecommerce/components/diy-nav/index.wxss
new file mode 100644
index 0000000..0b0df71
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-nav/index.wxss
@@ -0,0 +1,48 @@
+.ep-icon-group {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 0 5px;
+}
+
+.ep-icon-col {
+ text-align: center;
+ display: inline-block;
+ box-sizing: border-box;
+ padding: 8px 5px;
+}
+
+.col-3 .ep-icon-col {
+ width: 33.33%;
+}
+
+.col-4 .ep-icon-col {
+ width: 25%;
+}
+
+.col-5 .ep-icon-col {
+ width: 20%;
+}
+
+.ep-icon-col .nav-img {
+ width: 86rpx;
+ height: 86rpx;
+}
+
+.ep-icon-group.fillet .nav-img {
+ border-radius: 50%;
+}
+
+.navigation-indicator {
+ text-align: center;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin: 10rpx 0 20rpx;
+}
+
+.navigation-indicator .item {
+ width: 30rpx;
+ height: 6rpx;
+ background: #cccccc;
+ margin: 0 5rpx;
+}
diff --git a/eaterplanet_ecommerce/components/diy-pintuan/index.js b/eaterplanet_ecommerce/components/diy-pintuan/index.js
new file mode 100644
index 0000000..6fa0c0e
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-pintuan/index.js
@@ -0,0 +1,81 @@
+var app = getApp();
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ refresh: {
+ type: Boolean,
+ value: false,
+ observer: function (t) {
+ if (t) this.setData({ list: [] }), this.getPinList();
+ }
+ },
+ diyInfo: {
+ type: Object,
+ observer: function (t) {
+ if (t) {
+ let list = t.list || [];
+ list.forEach((item, index)=>{
+ if(item.imageUrl.indexOf('http')==-1) {
+ list[index].imageUrl = t.host + item.imageUrl;
+ }
+ })
+ this.setData({ style: t.style*1-1, styleList: list });
+ }
+ }
+ },
+ skin: {
+ type: Object
+ }
+ },
+
+ data: {
+ style: 0,
+ list: [],
+ styleList: [],
+ placeholdeImg: app.globalData.placeholdeImg
+ },
+
+ attached() {
+ this.getPinList();
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ getPinList: function () {
+ let that = this;
+ var community = wx.getStorageSync('community');
+ let head_id = community.communityId || '';
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'group.get_pintuan_list',
+ is_index: 1,
+ head_id,
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let pinList = {};
+ let { list, pintuan_index_coming_img, pintuan_index_show } = res.data;
+ pinList.list = list || [];
+ pinList.img = pintuan_index_coming_img || '';
+ pinList.show = pintuan_index_show || 0;
+ that.setData({ pinList })
+ console.log('pinList', pinList)
+ }
+ }
+ })
+ },
+ goLink: function(event) {
+ let url = event.currentTarget.dataset.link;
+ url && wx.navigateTo({ url })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/diy-pintuan/index.json b/eaterplanet_ecommerce/components/diy-pintuan/index.json
new file mode 100644
index 0000000..fe5a8d2
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-pintuan/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../img/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/diy-pintuan/index.wxml b/eaterplanet_ecommerce/components/diy-pintuan/index.wxml
new file mode 100644
index 0000000..1bb61a3
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-pintuan/index.wxml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+ {{item.label_info.tagcontent}}
+
+
+ 已抢光
+ {{item.spuName}}
+ {{item.pin_count}}人团
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+ ¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 更多拼团
+
+
+
+
+
+
+
+
+
+ {{item.label_info.tagcontent}}
+
+
+ 已抢光
+
+
+
+ {{item.spuName}}
+
+
+
+ {{item.pin_count}}人团
+
+
+ 已拼{{item.soldNum}}件
+
+
+
+
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+ ¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}
+
+ 去拼团
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.label_info.tagcontent}}
+
+
+ 已抢光
+
+
+
+ {{item.spuName}}
+
+
+
+ {{item.pin_count}}人团
+
+
+ 已拼{{item.soldNum}}件
+
+
+
+
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+ ¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}
+
+ 去拼团
+
+
+
+
+
+ 更多拼团
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/diy-pintuan/index.wxss b/eaterplanet_ecommerce/components/diy-pintuan/index.wxss
new file mode 100644
index 0000000..6d53c08
--- /dev/null
+++ b/eaterplanet_ecommerce/components/diy-pintuan/index.wxss
@@ -0,0 +1,243 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+
+.pin-spec {
+ position: relative;
+ background: #fff;
+ margin: 20rpx;
+ border-radius: 10rpx;
+ overflow: hidden;
+}
+
+.pin-spec-img {
+ width: 100%;
+ vertical-align: top;
+ border-radius: 10rpx 10rpx 0 0;
+}
+
+.pin-spec-scroll {
+ max-height: 380rpx;
+}
+
+.pin-spec-wrap {
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+}
+
+.pin-spec-item {
+ position: relative;
+ width: 240rpx;
+ box-sizing: border-box;
+ padding: 20rpx;
+ font-size: 28rpx;
+}
+
+.pin-spec-item .pin-img {
+ width: 200rpx;
+ height: 200rpx;
+ margin-bottom: 20rpx;
+}
+
+.pin-spec-item .title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.pin-spec-item .new-bot {
+ margin-top: 10rpx;
+ display: flex;
+ align-items: center;
+}
+
+.pin-spec-item .price {
+ color: #ff5041;
+}
+
+.pin-spec-item .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 80rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.pin-spec-item .market-price {
+ text-decoration: line-through;
+ color: #999;
+ font-size: 22rpx;
+ margin-left: 10rpx;
+}
+
+.pin-spec-item .pin-tag {
+ display: inline-block;
+ font-size: 22rpx;
+ padding: 0 6rpx;
+ margin-right: 10rpx;
+ border: 0.1rpx solid #ff5344;
+ vertical-align: middle;
+ color: #ff5344;
+ border-radius: 4rpx;
+}
+
+/* 标签 */
+
+.pin-spec .item-tag {
+ position: absolute;
+ left: 20rpx;
+ top: 20rpx;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.pin-spec .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.pin-spec .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.pin-s2-tit {
+ width: 240rpx;
+ height: 70rpx;
+ line-height: 70rpx;
+}
+
+.pin-s2 .pin-img {
+ width: 200rpx;
+ height: 200rpx;
+ margin-bottom: 0;
+}
+
+.pin-s2 .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 24rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 80rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.pin-s2 .title {
+ height: 64rpx;
+}
+
+.pin-s2 .label {
+ padding: 4rpx 12rpx 6rpx;
+ line-height: 1;
+ font-size: 75%;
+ font-weight: 700;
+ color: #fff;
+ text-align: center;
+ white-space: nowrap;
+}
+
+.pin-s2 .label .tag {
+ height: 30rpx;
+ line-height: 30rpx;
+ border: 1rpx solid #FF4544;
+ border-radius: 4rpx;
+ margin-right: 10rpx;
+}
+
+.pin-s2 .label .tag.label-person .iconfont {
+ display: inline-block;
+ width: 30rpx;
+ height: 30rpx;
+ background-color: #FF4544;
+ font-size: 18rpx;
+ color: #FFFFFF;
+ text-align: center;
+}
+
+.pin-s2 .label .label-name {
+ font-size: 20rpx;
+ padding: 0 10rpx;
+ color: #FF4544;
+}
+
+.pin-s2 .bot {
+ line-height: 1;
+}
+
+.pin-s2 .bot .content-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 24rpx;
+ color: #FF4544;
+ margin-top: 20rpx;
+ height: 32rpx;
+ font-weight: 600;
+}
+
+.content-num {
+ font-weight: 500;
+ margin-top: 0;
+ font-size: 24rpx;
+ line-height: 24rpx;
+ color: #909399;
+ text-decoration: line-through;
+}
+
+.pin-s2-item-r {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ border-bottom: 1rpx solid #EEEEEE;
+}
+
+.pin-s2 .pin-s2-item:last-child .pin-s2-item-r {
+ border-bottom: 0;
+}
+
+.pin-s2-btn {
+ background-color: #FF4544;
+ width: 160rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+ text-align: center;
+ border-radius: 50rpx;
+ font-size: 28rpx;
+ color: #FFFFFF;
+}
+
+.pin-s3-tit {
+ width: 348rpx;
+ height: 74rpx;
+ text-align: center;
+ line-height: 74rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/empty/index.js b/eaterplanet_ecommerce/components/empty/index.js
new file mode 100644
index 0000000..3b97ab1
--- /dev/null
+++ b/eaterplanet_ecommerce/components/empty/index.js
@@ -0,0 +1,23 @@
+// eaterplanet_ecommerce/components/empty/index.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/components/empty/index.json b/eaterplanet_ecommerce/components/empty/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/empty/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/empty/index.wxml b/eaterplanet_ecommerce/components/empty/index.wxml
new file mode 100644
index 0000000..9398f6a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/empty/index.wxml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/empty/index.wxss b/eaterplanet_ecommerce/components/empty/index.wxss
new file mode 100644
index 0000000..523e5f5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/empty/index.wxss
@@ -0,0 +1,21 @@
+.none-rush-list {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding-bottom: 140rpx;
+ padding-top: 140rpx;
+}
+
+.none-rush-list .img-block {
+ width: 240rpx;
+ height: 240rpx;
+ margin-bottom: 30rpx;
+}
+
+.none-rush-list .h1 {
+ font-size: 32rpx;
+ line-height: 32rpx;
+ color: #444;
+ margin-bottom: 20rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/fetch-coder/index.js b/eaterplanet_ecommerce/components/fetch-coder/index.js
new file mode 100644
index 0000000..8abcd83
--- /dev/null
+++ b/eaterplanet_ecommerce/components/fetch-coder/index.js
@@ -0,0 +1,23 @@
+Component({
+ properties: {
+ visible: {
+ type: Boolean,
+ value: false
+ },
+ coderList: {
+ type: Array
+ },
+ codeImg: {
+ type: String,
+ value: ''
+ }
+ },
+ data: {
+ selected: null
+ },
+ methods: {
+ close: function () {
+ this.triggerEvent("cancel");
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/fetch-coder/index.json b/eaterplanet_ecommerce/components/fetch-coder/index.json
new file mode 100644
index 0000000..979d4f5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/fetch-coder/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-modal": "../modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/fetch-coder/index.wxml b/eaterplanet_ecommerce/components/fetch-coder/index.wxml
new file mode 100644
index 0000000..c0162ff
--- /dev/null
+++ b/eaterplanet_ecommerce/components/fetch-coder/index.wxml
@@ -0,0 +1,15 @@
+
+
+
+
+
+ 您的提货码为
+
+
+
+
+ 提货时,请出示提货二维码。
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/fetch-coder/index.wxss b/eaterplanet_ecommerce/components/fetch-coder/index.wxss
new file mode 100644
index 0000000..0d39e80
--- /dev/null
+++ b/eaterplanet_ecommerce/components/fetch-coder/index.wxss
@@ -0,0 +1,65 @@
+.coder-content {
+ position: relative;
+ height: 650rpx;
+ width: 630rpx;
+ background: #fff;
+ border-radius: 20rpx;
+ text-align: center;
+ font-family: PingFangSC-Medium;
+}
+
+.coder-content .t1 {
+ font-size: 36rpx;
+ font-weight: 500;
+ color: #444;
+ line-height: 36rpx;
+ margin-bottom: 60rpx;
+ margin-top: 60rpx;
+}
+
+.coder-content .t2 {
+ font-size: 24rpx;
+ font-weight: 400;
+ color: #bababa;
+ line-height: 24rpx;
+ margin-top: 40rpx;
+}
+
+.coder-content .item {
+ display: inline-block;
+ margin-left: 20rpx;
+ width: 68rpx;
+ height: 68rpx;
+ line-height: 68rpx;
+ text-align: center;
+ border-radius: 10rpx;
+ border: 2rpx solid #444;
+ font-size: 40rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+ color: #444;
+}
+
+.coder-content .item:first-of-type {
+ margin-left: 0;
+}
+
+.coder-content .icon-wrap {
+ height: 60rpx;
+ width: 60rpx;
+ position: absolute;
+ right: 10rpx;
+ top: 10rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.coder-content .icon-close {
+ height: 24rpx;
+ width: 24rpx;
+}
+
+.coder-content .code-img .img {
+ width: 60%;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/fixed-bottom/index.js b/eaterplanet_ecommerce/components/fixed-bottom/index.js
new file mode 100644
index 0000000..4569fb2
--- /dev/null
+++ b/eaterplanet_ecommerce/components/fixed-bottom/index.js
@@ -0,0 +1,12 @@
+var t = getApp();
+
+Component({
+ data: {
+ isIpx: false
+ },
+ attached: function () {
+ t.globalData.isIpx && this.setData({
+ isIpx: true
+ });
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/fixed-bottom/index.json b/eaterplanet_ecommerce/components/fixed-bottom/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/fixed-bottom/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/fixed-bottom/index.wxml b/eaterplanet_ecommerce/components/fixed-bottom/index.wxml
new file mode 100644
index 0000000..fb23641
--- /dev/null
+++ b/eaterplanet_ecommerce/components/fixed-bottom/index.wxml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/fixed-bottom/index.wxss b/eaterplanet_ecommerce/components/fixed-bottom/index.wxss
new file mode 100644
index 0000000..6ea088d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/fixed-bottom/index.wxss
@@ -0,0 +1,13 @@
+.fixed-bar {
+ left: 0;
+ bottom: 0;
+ position: fixed;
+ background: #fff;
+ width: 100%;
+ z-index: 2;
+ padding-bottom: calc(env(safe-area-inset-bottom) - 30rpx);
+}
+
+.pb20 {
+ padding-bottom: 40rpx;
+}
diff --git a/eaterplanet_ecommerce/components/form/apply.js b/eaterplanet_ecommerce/components/form/apply.js
new file mode 100644
index 0000000..e6f726b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/form/apply.js
@@ -0,0 +1,118 @@
+var app = getApp();
+import WxValidate from '../../utils/WxValidate.js';
+var u = true;
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+
+ },
+
+ attached: function() {
+ this.initValidate();
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ //资料验证函数
+ initValidate() {
+ const rules = {
+ form_username: {
+ required: true,
+ minlength: 1
+ },
+ form_mobile: {
+ required: true,
+ tel: true
+ }
+ }
+ const messages = {
+ form_username: {
+ required: '请填写真实姓名',
+ minlength: '请输入正确的姓名'
+ },
+ form_mobile: {
+ required: '请填写手机号',
+ tel: '请填写正确的手机号'
+ }
+ }
+ this.WxValidate = new WxValidate(rules, messages)
+ },
+
+ /**
+ * 输入框获得焦点
+ */
+ iptFocus: function (t) {
+ let name = t.currentTarget.dataset.name;
+ this.setData({
+ currentFocus: name
+ })
+ },
+
+ /**
+ * 输入框失去焦点
+ */
+ iptBlur: function () {
+ this.setData({
+ currentFocus: ''
+ })
+ },
+
+ //报错
+ showModal(error) {
+ wx.showModal({
+ content: error.msg,
+ showCancel: false,
+ })
+ },
+
+ /**
+ * 资料修改表单提交
+ */
+ formSubmit(e) {
+ this.setData({
+ btnLoading: true
+ })
+ const params = e.detail.value;
+ //校验表单
+ if (!this.WxValidate.checkForm(params)) {
+ const error = this.WxValidate.errorList[0];
+ this.showModal(error);
+ this.setData({
+ btnLoading: false
+ })
+ return false;
+ }
+ let token = wx.getStorageSync('token');
+ params.token = token;
+ app.util.ProReq('user.save_formData', params).then(res=>{
+ wx.showModal({
+ content: res.msg || '提交成功,等待审核后才可查看价格和购买',
+ showCancel: false,
+ success: ()=>{
+ wx.setStorageSync('isparse_formdata', 0);
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ }
+ })
+ }).catch(err=>{
+ this.setData({
+ btnLoading: false
+ })
+ app.util.message(err.msg || '提交失败,请重试', '', 'error');
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/form/apply.json b/eaterplanet_ecommerce/components/form/apply.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/form/apply.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/form/apply.wxml b/eaterplanet_ecommerce/components/form/apply.wxml
new file mode 100644
index 0000000..25e2cc0
--- /dev/null
+++ b/eaterplanet_ecommerce/components/form/apply.wxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/form/apply.wxss b/eaterplanet_ecommerce/components/form/apply.wxss
new file mode 100644
index 0000000..02efa00
--- /dev/null
+++ b/eaterplanet_ecommerce/components/form/apply.wxss
@@ -0,0 +1,70 @@
+page {
+ background-color: #fff;
+}
+
+.gcs-box {
+ padding-bottom: 100rpx;
+}
+
+.gcs-box .card {
+ position: relative;
+ background: #fff;
+}
+
+.card-header {
+ display: flex;
+ padding: 30rpx;
+ box-shadow: 0 0 40rpx rgba(0, 0, 0, 0.1);
+}
+
+.card-header .title {
+ flex: 1;
+ color: #4d9ee9;
+ font-size: 30rpx;
+ font-weight: bold;
+}
+
+.bot-line {
+ width: 100%;
+ height: 1rpx;
+ border-bottom: 1rpx solid #f5f5f5;
+ transition: 200ms all ease-in-out;
+}
+
+.bot-line.focus {
+ border-bottom: 2rpx solid #4d9ee9;
+}
+
+.info-item {
+ margin-top: 54rpx;
+}
+
+.info-item .item-title {
+ font-size: 22rpx;
+ color: #7593b4;
+ margin-bottom: 15rpx;
+}
+
+.info-item .item-content {
+ font-size: 26rpx;
+ color: #000;
+}
+
+.card-body {
+ padding: 0 36rpx;
+}
+
+.edit-btn button {
+ background-color: #4d9ee9;
+ text-align: center;
+ line-height: 90rpx;
+ margin: 80rpx 36rpx;
+ color: #fff;
+ border-radius: 6rpx;
+ font-size: 38rpx;
+ font-weight: bold;
+}
+
+.edit-btn button::after {
+ border: 0;
+}
diff --git a/eaterplanet_ecommerce/components/get-phone/index.js b/eaterplanet_ecommerce/components/get-phone/index.js
new file mode 100644
index 0000000..929a9be
--- /dev/null
+++ b/eaterplanet_ecommerce/components/get-phone/index.js
@@ -0,0 +1,84 @@
+var app = getApp();
+
+Component({
+ properties: {
+ visible: {
+ type: Boolean,
+ value: false
+ }
+ },
+ methods: {
+ close: function() {
+ this.triggerEvent("cancel");
+ },
+ getPhoneNumber: function(res) {
+ var that = this;
+ wx.checkSession({
+ success: function() {
+ console.log("session:", 1), that.getMobile(res);
+ },
+ fail: function() {
+ console.log("session:", 2), wx.removeStorageSync("token");
+ that.triggerEvent("cancel");
+ that.triggerEvent("needAuth");
+ }
+ });
+ },
+ getMobile: function(e) {
+ var that = this;
+ if ("getPhoneNumber:ok" === e.detail.errMsg) {
+ var token = wx.getStorageSync('token');
+ this.setData({
+ loading: true
+ });
+ wx.checkSession({
+ success() {
+ console.log("session_key有效");
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'user.getPhoneNumber',
+ token: token,
+ encryptedData: e.detail.encryptedData,
+ iv: e.detail.iv
+ },
+ method: 'post',
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let phoneNumber = res.data.phoneNumber;
+ wx.setStorage({
+ key: "mobile",
+ data: phoneNumber
+ });
+ that.triggerEvent("confirm", phoneNumber);
+ } else {
+ that.setData({
+ visible: false
+ });
+ wx.showToast({
+ title: "授权失败",
+ icon: "none"
+ });
+ }
+ }
+ })
+ },
+ fail() {
+ console.log("session_key 已经失效");
+ wx.removeStorageSync("token");
+ that.triggerEvent("needAuth");
+ }
+ })
+ } else {
+ that.setData({
+ visible: false
+ });
+ wx.showToast({
+ title: "授权失败",
+ icon: "none"
+ });
+ }
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/get-phone/index.json b/eaterplanet_ecommerce/components/get-phone/index.json
new file mode 100644
index 0000000..7b873d8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/get-phone/index.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-modal": "../modal/index",
+ "i-button": "../button/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/get-phone/index.wxml b/eaterplanet_ecommerce/components/get-phone/index.wxml
new file mode 100644
index 0000000..e5c000e
--- /dev/null
+++ b/eaterplanet_ecommerce/components/get-phone/index.wxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ 需要您的同意
+
+ 需要您的手机授权
+ 授权后可享受更多优质服务
+
+ 确认授权
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/get-phone/index.wxss b/eaterplanet_ecommerce/components/get-phone/index.wxss
new file mode 100644
index 0000000..a24f1fe
--- /dev/null
+++ b/eaterplanet_ecommerce/components/get-phone/index.wxss
@@ -0,0 +1,66 @@
+.auth-content {
+ width: 520rpx;
+ height: 660rpx;
+ background: #fff;
+ border-radius: 24rpx;
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-end;
+}
+
+.auth-content .bg {
+ width: 520rpx;
+ height: 354rpx;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+.auth-content .h1 {
+ color: #444;
+ font-size: 32rpx;
+ margin-bottom: 20rpx;
+}
+
+.auth-content .h2 {
+ font-size: 24rpx;
+ line-height: 36rpx;
+ color: #999;
+ width: 408rpx;
+ margin-bottom: 44rpx;
+}
+
+.auth-content .h2 .p {
+ text-align: center;
+ display: block;
+}
+
+.auth-content .confirm {
+ width: 432rpx;
+ height: 72rpx;
+ color: #fff;
+ background: linear-gradient(100deg,#4facfe 0%,#00f2fe 100%);
+ font-size: 32rpx;
+ line-height: 72rpx;
+ border-radius: 12rpx;
+ margin: 0 0 30rpx;
+}
+
+.auth-content .close {
+ position: absolute;
+ right: 28rpx;
+ top: 28rpx;
+ width: 40rpx;
+ height: 40rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 9;
+}
+
+.auth-content .close .close-img {
+ width: 26rpx;
+ height: 26rpx;
+}
diff --git a/eaterplanet_ecommerce/components/goodsInfo/index.js b/eaterplanet_ecommerce/components/goodsInfo/index.js
new file mode 100644
index 0000000..2860a7d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/goodsInfo/index.js
@@ -0,0 +1,65 @@
+// eaterplanet_ecommerce/components/goodsInfo/index.js
+Component({
+ properties: {
+ order: {
+ type: Object,
+ observer: function (t) {
+ let real_total = t.order_info.real_total * 1;
+ let shipping_tel = t && t.order_info && t.order_info.shipping_tel || '';
+ var goodsTotal = parseFloat(real_total) - parseFloat(t.order_info.shipping_fare);
+ let h = {};
+ h.goodsTotal = goodsTotal;
+ if(shipping_tel) {
+ shipping_tel = "" + shipping_tel;
+ var pat=/(\d{3})\d*(\d{4})/;
+ let tel = shipping_tel.replace(pat,'$1****$2');
+ h.tel = tel;
+ }
+ this.setData(h);
+ }
+ },
+ showNickname: {
+ type: Boolean,
+ default: false
+ },
+ hidePhone: {
+ type: Number,
+ default: 0
+ },
+ groupInfo: {
+ type: Object,
+ default: {
+ group_name: '社区',
+ owner_name: '团长',
+ delivery_ziti_name: '社区自提',
+ delivery_tuanzshipping_name: '团长配送',
+ delivery_express_name: '快递配送'
+ }
+ },
+ hideInfo: {
+ type: Boolean,
+ default: false
+ },
+ goodsTot: {
+ type: Number,
+ default: 0
+ },
+ goods_sale_unit: {
+ type: String
+ }
+ },
+ data: {
+ isCalling: false
+ },
+ methods: {
+ callTelphone: function(t) {
+ var e = this;
+ this.data.isCalling || (this.data.isCalling = true, wx.makePhoneCall({
+ phoneNumber: t.currentTarget.dataset.phone,
+ complete: function() {
+ e.data.isCalling = false;
+ }
+ }));
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/goodsInfo/index.json b/eaterplanet_ecommerce/components/goodsInfo/index.json
new file mode 100644
index 0000000..2000c46
--- /dev/null
+++ b/eaterplanet_ecommerce/components/goodsInfo/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-card": "../card/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/goodsInfo/index.wxml b/eaterplanet_ecommerce/components/goodsInfo/index.wxml
new file mode 100644
index 0000000..735ecb1
--- /dev/null
+++ b/eaterplanet_ecommerce/components/goodsInfo/index.wxml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+ 提货人
+ {{order.order_info.shipping_name}} {{hideInfo?tel:order.order_info.shipping_tel}}
+
+
+ {{order.order_info.order_note_name}}
+ {{order.order_info.note_content}}
+
+
+ 昵称
+ {{order.order_info.name}}
+
+
+ 提货地点
+ {{hideInfo?'***':order.order_info.shipping_address}}
+
+
+ 配送方式
+ {{order.order_info.delivery_name}}
+
+
+ {{groupInfo.owner_name}}信息
+
+ {{order.order_info.ziti_name}}
+
+
+ 联系{{groupInfo.owner_name}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/goodsInfo/index.wxss b/eaterplanet_ecommerce/components/goodsInfo/index.wxss
new file mode 100644
index 0000000..aab2228
--- /dev/null
+++ b/eaterplanet_ecommerce/components/goodsInfo/index.wxss
@@ -0,0 +1,62 @@
+.header {
+ padding: 20rpx 30rpx;
+ color: #444;
+ font-size: 28rpx;
+ font-weight: 500;
+}
+
+.content-wrap {
+ border-top: 0.1rpx solid #efefef;
+ padding-bottom: 20rpx;
+}
+
+.content-wrap .item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 24rpx;
+ padding: 16rpx 30rpx 0;
+}
+
+.content-wrap .item .title {
+ word-break: keep-all;
+ color: #aaa;
+}
+
+.content-wrap .item .detail {
+ color: #444;
+ text-align: right;
+ display: flex;
+ align-items: center;
+}
+
+.content-wrap .item .detail .phone {
+ margin-left: 20rpx;
+ padding: 0 20rpx;
+ height: 44rpx;
+ display: flex;
+ align-items: center;
+ border: 0.1rpx solid #efefef;
+ border-radius: 26rpx;
+}
+
+.content-wrap .item .detail .phone .icon-phone {
+ width: 20rpx;
+ height: 20rpx;
+ margin-right: 10rpx;
+}
+
+.footer {
+ border-top: 0.1rpx solid #efefef;
+ padding: 42rpx 30rpx 32rpx 0;
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ font-size: 30rpx;
+ font-weight: 500;
+}
+
+.footer .money {
+ color: #4facfe;
+ font-size: 40rpx;
+}
diff --git a/eaterplanet_ecommerce/components/guess-like/index.js b/eaterplanet_ecommerce/components/guess-like/index.js
new file mode 100644
index 0000000..dc128ac
--- /dev/null
+++ b/eaterplanet_ecommerce/components/guess-like/index.js
@@ -0,0 +1,239 @@
+var app = getApp();
+var status = require('../../utils/index.js');
+var util = require('../../utils/util.js');
+
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ updateCart: {
+ type: Number,
+ value: 0,
+ observer: function (val) {
+ if (val>0) {
+ this.updateCartNum();
+ }
+ }
+ },
+ likeTitle: {
+ type: String,
+ value: '大家常买'
+ },
+ controller: {
+ type: String,
+ value: 'index.load_gps_goodslist'
+ },
+ gid: {
+ type: Number,
+ value: 0
+ }
+ },
+
+ data: {
+ disabled: false,
+ list: [],
+ show_goods_guess_like: 1,
+ _lock: false
+ },
+
+ attached: function() {
+ console.log('guess like attached');
+ this.setData({_lock: true },()=>{
+ this.initFn();
+ })
+ },
+
+ pageLifetimes: {
+ show: function () {
+ this.data._lock || this.initFn();
+ console.log('guess like show');
+ }
+ },
+
+ methods: {
+ initFn: function(){
+ let that = this;
+ this.setData({list: []}, ()=>{
+ that.getData();
+ that.updateCartNum();
+ })
+ },
+ getData: function () {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ let { controller, gid }= this.data;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller,
+ token: token,
+ pageNum: 1,
+ is_random: 1,
+ head_id: cur_community.communityId || '',
+ id: gid
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let oldList = that.data.list;
+ let list = res.data.list || [];
+ list = oldList.concat(list);
+ let show_goods_guess_like = 1;
+ if (gid) show_goods_guess_like = res.data.show_goods_guess_like || 0;
+ that.setData({ list, show_goods_guess_like, _lock: false })
+ } else {
+ that.setData({ noMore: true, _lock: false })
+ }
+ }
+ })
+ },
+ openSku: function (e) {
+ let idx = e.currentTarget.dataset.idx;
+ this.setData({ disabled: false })
+ let spuItem = this.data.list[idx];
+ if (spuItem.skuList.length === void 0) {
+ this.triggerEvent("openSku", {
+ actId: spuItem.actId,
+ skuList: spuItem.skuList,
+ promotionDTO: spuItem.promotionDTO || '',
+ allData: {
+ spuName: spuItem.spuName,
+ skuImage: spuItem.skuImage,
+ actPrice: spuItem.actPrice,
+ canBuyNum: spuItem.spuCanBuyNum,
+ stock: spuItem.spuCanBuyNum,
+ marketPrice: spuItem.marketPrice,
+ oneday_limit_count: spuItem.oneday_limit_count,
+ total_limit_count: spuItem.total_limit_count,
+ one_limit_count: spuItem.one_limit_count,
+ goods_start_count: spuItem.goods_start_count
+ }
+ })
+ } else {
+ this.addCart({ value: 1, type: "plus", idx });
+ }
+ },
+ changeNumber: function (t) {
+ var e = t.detail;
+ e && this.addCart(e);
+ },
+ outOfMax: function (t) {
+ var e = t.detail, idx = t.idx, list = this.data.list, spuItem = list[idx], canBuyNum = spuItem.spuCanBuyNum;
+ if (list[idx].car_count >= canBuyNum) {
+ wx.showToast({
+ title: "不能购买更多啦",
+ icon: "none"
+ })
+ }
+ },
+ addCart: function (t) {
+ var token = wx.getStorageSync('token');
+ var community = wx.getStorageSync('community');
+ let idx = t.idx;
+ let list = this.data.list;
+ let spuItem = list[idx];
+ var goods_id = spuItem.actId;
+ var community_id = community.communityId;
+ let goods_start_count = spuItem.goods_start_count;
+ let number = spuItem.car_count || 0;
+ let quantity = 1;
+
+ let that = this;
+ if (t.type == 'plus') {
+ if(number{
+ if(res.showVipModal==1) {
+ let { pop_vipmember_buyimage } = res.data;
+ that.triggerEvent("vipModal", { pop_vipmember_buyimage, showVipModal: true, visible: false });
+ } else {
+ if (res.data.code == 3 || res.data.code == 7) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 6) {
+ let max_quantity = res.data.max_quantity || '';
+ list[idx].car_count = res.data.max_quantity || 0;
+ (max_quantity > 0) && that.setData({ list })
+ var msg = res.data.msg;
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ that.triggerEvent("changeCartNum", res.data.total);
+ list[idx].car_count = res.data.cur_count || 0;
+ that.setData({ list })
+ wx.showToast({
+ title: "已加入购物车",
+ image: "../../images/addShopCart.png"
+ })
+ status.indexListCarCount(goods_id, res.data.cur_count);
+ }
+ }
+ })
+ } else {
+ if(number<=goods_start_count) {
+ quantity = number;
+ }
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'car.reduce_car_goods',
+ token: token,
+ goods_id: goods_id,
+ community_id: community_id,
+ quantity,
+ sku_str: '',
+ buy_type: 'dan',
+ pin_id: 0,
+ is_just_addcar: 1
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function (res) {
+ if (res.data.code == 3) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ that.triggerEvent("changeCartNum", res.data.total);
+ list[idx].car_count = res.data.cur_count || 0;
+ that.setData({ list })
+ status.indexListCarCount(goods_id, res.data.cur_count);
+ }
+ }
+ })
+ }
+ },
+ updateCartNum: function () {
+ let goodsListCarCount = app.globalData.goodsListCarCount; //[{ actId: 84, num: 2}]
+ let list = this.data.list;
+ if (goodsListCarCount.length > 0 && list.length > 0) {
+ goodsListCarCount.forEach(function (item) {
+ let k = list.findIndex((n) => n.actId == item.actId);
+ if (k != -1 && list[k].skuList.length === 0) {
+ let newNum = item.num * 1;
+ list[k].car_count = newNum >= 0 ? newNum : 0;
+ }
+ })
+ this.setData({ list })
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/guess-like/index.json b/eaterplanet_ecommerce/components/guess-like/index.json
new file mode 100644
index 0000000..70b4e42
--- /dev/null
+++ b/eaterplanet_ecommerce/components/guess-like/index.json
@@ -0,0 +1,11 @@
+{
+ "component": true,
+ "usingComponents": {
+ "comming-spu": "../comming-spu-disabled/index",
+ "i-img": "../img/index",
+ "i-button": "../button/index",
+ "i-router-link": "../router-link/router-link",
+ "i-input-number": "../input-number/index",
+ "i-addcart": "../addCartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/guess-like/index.wxml b/eaterplanet_ecommerce/components/guess-like/index.wxml
new file mode 100644
index 0000000..a0301cb
--- /dev/null
+++ b/eaterplanet_ecommerce/components/guess-like/index.wxml
@@ -0,0 +1,22 @@
+
+ ——{{likeTitle}}——
+
+
+
+ 已抢光
+ {{item.spuName}}
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/guess-like/index.wxss b/eaterplanet_ecommerce/components/guess-like/index.wxss
new file mode 100644
index 0000000..9bb87cb
--- /dev/null
+++ b/eaterplanet_ecommerce/components/guess-like/index.wxss
@@ -0,0 +1,90 @@
+.like {
+ margin-bottom: 100rpx;
+}
+
+.like-title {
+ font-size: 30rpx;
+ text-align: center;
+ font-weight: bold;
+ margin-bottom: 20rpx;
+}
+
+.like-list {
+ position: relative;
+ padding: 20rpx;
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ z-index: 0;
+}
+
+.new-comers-item {
+ background-color: #fff;
+ width: 345rpx;
+ box-sizing: border-box;
+ padding: 30rpx;
+ border-radius: 10px;
+ font-size: 28rpx;
+ margin-bottom: 20rpx;
+ box-shadow: 10rpx 10rpx 20rpx 0rpx #afafafa1;
+}
+
+.new-comers-item .new-img {
+ width: 285rpx;
+ height: 240rpx;
+ margin-bottom: 20rpx;
+}
+
+.new-comers-item .title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.new-comers-item .new-bot {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 10rpx;
+}
+
+.new-comers-item .add-cart {
+ width: 44rpx;
+ height: 44rpx;
+ padding: 0;
+ margin: 0;
+}
+
+.new-comers-item .add-cart .img {
+ width: 44rpx;
+ height: 44rpx;
+ display: block;
+}
+
+.new-comers-item .price {
+ font-family: DIN;
+ color: #ff758c;
+}
+
+.new-comers-item {
+ position: relative;
+}
+
+.new-comers-item .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 120rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.i-number-img {
+ font-size: 44rpx!important;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/image/index.js b/eaterplanet_ecommerce/components/image/index.js
new file mode 100644
index 0000000..9c1a3e8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/image/index.js
@@ -0,0 +1,65 @@
+Component({
+ properties: {
+ defaultImage: String,
+ imgType: {
+ type: Number,
+ value: 2
+ },
+ loadImage: {
+ type: String,
+ observer: function (t) {
+ if (t) {
+ var e = Math.ceil(wx.getSystemInfoSync().pixelRatio), i = t + "?imageView2/" + this.data.imgType + "/w/" + this.getPx(this.data.width) * e + "/h/" + this.getPx(this.data.height) * e + "/ignore-error/1";
+ this.setData({
+ img: i,
+ w: this.getPx(this.data.width),
+ h: this.getPx(this.data.height)
+ });
+ }
+ }
+ },
+ width: String,
+ height: String,
+ canPreview: {
+ type: Boolean,
+ value: false
+ },
+ isLazy: {
+ type: Boolean,
+ value: false
+ },
+ isCircle: {
+ type: Boolean,
+ value: false
+ }
+ },
+ data: {
+ isLoad: false,
+ img: "",
+ systemInfo: {},
+ w: 0,
+ h: 0
+ },
+ methods: {
+ imageLoad: function () {
+ this.setData({
+ isLoad: true
+ });
+ },
+ getPx: function (t) {
+ var e = wx.getSystemInfoSync();
+ return Math.round(e.windowWidth / 375 * t);
+ },
+ preview: function () {
+ this.data.canPreview && wx.previewImage({
+ urls: [this.data.loadImage],
+ fail: function (t) {
+ wx.showToast({
+ title: "预览图片失败,请重试",
+ icon: "none"
+ }), console.log(t);
+ }
+ });
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/image/index.json b/eaterplanet_ecommerce/components/image/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/image/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/image/index.wxml b/eaterplanet_ecommerce/components/image/index.wxml
new file mode 100644
index 0000000..40c6cff
--- /dev/null
+++ b/eaterplanet_ecommerce/components/image/index.wxml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/image/index.wxss b/eaterplanet_ecommerce/components/image/index.wxss
new file mode 100644
index 0000000..ea0abb3
--- /dev/null
+++ b/eaterplanet_ecommerce/components/image/index.wxss
@@ -0,0 +1,8 @@
+.img-view {
+ display: inline-block;
+ position: relative;
+}
+
+.img-view .img-image {
+ position: absolute;
+}
diff --git a/eaterplanet_ecommerce/components/img/index.js b/eaterplanet_ecommerce/components/img/index.js
new file mode 100644
index 0000000..4c3e1a2
--- /dev/null
+++ b/eaterplanet_ecommerce/components/img/index.js
@@ -0,0 +1,60 @@
+var app = getApp();
+
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ defaultImage: String,
+ imgType: {
+ type: Number,
+ value: 2
+ },
+ loadImage: {
+ type: String,
+ observer: function (val) {
+ if (val) {
+ var pixelRatio = Math.ceil(app.globalData.systemInfo.pixelRatio),
+ img = val + "?imageView2/" + this.data.imgType + "/w/" + this.getPx(this.data.width) * pixelRatio + "/h/" + this.getPx(this.data.height) * pixelRatio + "/ignore-error/1";
+ this.setData({
+ img: img
+ });
+ }
+ }
+ },
+ width: String,
+ height: String,
+ canPreview: {
+ type: Boolean,
+ value: false
+ },
+ isLazy: {
+ type: Boolean,
+ value: false
+ }
+ },
+ methods: {
+ imageLoad: function () {
+ this.setData({
+ isLoad: true
+ });
+ },
+ bindError: function (error) {
+ console.log(error);
+ },
+ getPx: function (e) {
+ var sysInfo = wx.getSystemInfoSync();
+ console.log()
+ return Math.round(sysInfo.windowWidth / 375 * e);
+ },
+ preview: function () {
+ this.data.canPreview && wx.previewImage({
+ urls: [this.data.loadImage],
+ fail: function (error) {
+ wx.showToast({
+ title: "预览图片失败,请重试",
+ icon: "none"
+ }), console.log(error);
+ }
+ });
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/img/index.json b/eaterplanet_ecommerce/components/img/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/img/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/img/index.wxml b/eaterplanet_ecommerce/components/img/index.wxml
new file mode 100644
index 0000000..a0f50e8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/img/index.wxml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/img/index.wxss b/eaterplanet_ecommerce/components/img/index.wxss
new file mode 100644
index 0000000..b63b5a1
--- /dev/null
+++ b/eaterplanet_ecommerce/components/img/index.wxss
@@ -0,0 +1,16 @@
+.img-content {
+ position: relative;
+}
+
+.img-def {
+ position: absolute !important;
+ transition: opacity 0.1s;
+}
+
+.opacity {
+ opacity: 0;
+}
+
+.show-img {
+ opacity: 1;
+}
diff --git a/eaterplanet_ecommerce/components/index-item/index.js b/eaterplanet_ecommerce/components/index-item/index.js
new file mode 100644
index 0000000..5025ca4
--- /dev/null
+++ b/eaterplanet_ecommerce/components/index-item/index.js
@@ -0,0 +1,31 @@
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ name: {
+ type: String,
+ value: ""
+ }
+ },
+ relations: {
+ "../index/index": {
+ type: "parent"
+ }
+ },
+ data: {
+ top: 0,
+ height: 0,
+ currentName: ""
+ },
+ methods: {
+ updateDataChange: function () {
+ var that = this;
+ wx.createSelectorQuery().in(this).select(".i-index-item").boundingClientRect(function (t) {
+ that.setData({
+ top: t.top,
+ height: t.height,
+ currentName: that.data.name
+ });
+ }).exec();
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/index-item/index.json b/eaterplanet_ecommerce/components/index-item/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/index-item/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/index-item/index.wxml b/eaterplanet_ecommerce/components/index-item/index.wxml
new file mode 100644
index 0000000..64e532d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/index-item/index.wxml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/index-item/index.wxss b/eaterplanet_ecommerce/components/index-item/index.wxss
new file mode 100644
index 0000000..141b65f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/index-item/index.wxss
@@ -0,0 +1,12 @@
+.i-index-item-header {
+ height: 70rpx;
+ line-height: 70rpx;
+ font-size: 26rpx;
+ padding-left: 40rpx;
+ color: #999;
+ background: #f6f6f6;
+}
+
+.i-index-item-content {
+ background: #fff;
+}
diff --git a/eaterplanet_ecommerce/components/index/index.js b/eaterplanet_ecommerce/components/index/index.js
new file mode 100644
index 0000000..2fec2eb
--- /dev/null
+++ b/eaterplanet_ecommerce/components/index/index.js
@@ -0,0 +1,155 @@
+var t = getApp();
+
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ height: {
+ type: String,
+ value: "300",
+ observer: function (val) {
+ if (val) {
+ var sHeight = this.setScrollStyle(val);
+ this.setData({
+ scrollHeight: sHeight
+ });
+ }
+ }
+ },
+ itemHeight: {
+ type: Number,
+ value: 18
+ },
+ localCity: {
+ type: Object,
+ },
+ skin: {
+ type: Object
+ }
+ },
+ relations: {
+ "../index-item/index": {
+ type: "child",
+ linked: function () {
+ this._updateDataChange();
+ },
+ linkChanged: function () {
+ this._updateDataChange();
+ },
+ unlinked: function () {
+ this._updateDataChange();
+ }
+ }
+ },
+ data: {
+ scrollTop: 0,
+ fixedData: [],
+ current: 0,
+ timer: null,
+ startTop: 0,
+ itemLength: 0,
+ currentName: "",
+ isTouches: false,
+ localCity: {},
+ scrollHeight: ""
+ },
+ attached: function () {
+ // let city = wx.getStorageSync('city');
+ // this.setData({
+ // localCity: city
+ // });
+ },
+ methods: {
+ changeGPSCommunity: function () {
+ wx.setStorage({
+ key: "city_id",
+ data: 0
+ })
+ var e = getCurrentPages(), a = 1;
+ e[e.length - 2].route.indexOf("/position/search") > -1 && (a = 2), t.globalData.changeCity = this.data.localCity,
+ wx.navigateBack({
+ delta: a
+ });
+ },
+ setScrollStyle: function (t) {
+ for (var e = ["%", "px", "rem", "rpx", "em", "rem"], a = !1, i = 0; i < e.length; i++) {
+ var n = e[i];
+ if (t.indexOf(n) > -1) {
+ a = !0;
+ break;
+ }
+ }
+ return "height:" + (a ? t : t + "px");
+ },
+ loop: function () { },
+ _updateDataChange: function () {
+ var t = this, e = this.getRelationNodes("../index-item/index"), a = e.length, i = this.data.fixedData;
+ a > 0 && (this.data.timer && (clearTimeout(this.data.timer), this.setData({
+ timer: null
+ })), this.data.timer = setTimeout(function () {
+ var a = [];
+ e.forEach(function (t) {
+ t.data.name && -1 === i.indexOf(t.data.name) && (a.push(t.data.name), t.updateDataChange());
+ }), t.setData({
+ fixedData: a,
+ itemLength: e.length
+ }), t.setTouchStartVal();
+ }, 0), this.setData({
+ timer: this.data.timer
+ }));
+ },
+ handlerScroll: function (t) {
+ var e = this, a = t.detail.scrollTop;
+ this.getRelationNodes("../index-item/index").forEach(function (t, i) {
+ var n = t.data, r = n.top + n.height;
+ a < r && a >= n.top && e.setData({
+ current: i,
+ currentName: n.currentName
+ });
+ });
+ },
+ getCurrentItem: function (t) {
+ var e = this.getRelationNodes("../index-item/index"), a = {};
+ return t < 0 && (t = 0), a = e[t].data, a.total = e.length, a;
+ },
+ triggerCallback: function (t) {
+ this.triggerEvent("change", t);
+ },
+ handlerFixedTap: function (t) {
+ var e = t.currentTarget.dataset.index, a = this.getCurrentItem(e);
+ this.setData({
+ scrollTop: a.top,
+ currentName: a.currentName,
+ isTouches: !0
+ }), this.triggerCallback({
+ index: e,
+ current: a.currentName
+ });
+ },
+ handlerTouchMove: function (t) {
+ var e = this.data, a = (t.touches[0] || {}).pageY - e.startTop, i = Math.ceil(a / e.itemHeight);
+ i = i >= e.itemLength ? e.itemLength - 1 : i;
+ var n = this.getCurrentItem(i);
+ n.name !== this.data.currentName && wx.vibrateShort(), this.setData({
+ scrollTop: n.top,
+ currentName: n.name,
+ isTouches: !0
+ }), this.triggerCallback({
+ index: i,
+ current: n.name
+ });
+ },
+ handlerTouchEnd: function () {
+ this.setData({
+ isTouches: !1
+ });
+ },
+ setTouchStartVal: function () {
+ var t = this;
+ wx.createSelectorQuery().in(this).select(".i-index-fixed").boundingClientRect(function (e) {
+ t.setData({
+ startTop: e.top
+ });
+ }).exec();
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/index/index.json b/eaterplanet_ecommerce/components/index/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/index/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/index/index.wxml b/eaterplanet_ecommerce/components/index/index.wxml
new file mode 100644
index 0000000..fd529e6
--- /dev/null
+++ b/eaterplanet_ecommerce/components/index/index.wxml
@@ -0,0 +1,16 @@
+
+
+ 当前定位
+
+ {{localCity.districtName}}
+ GPS定位
+
+
+
+
+ {{item}}
+
+
+ {{currentName}}
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/index/index.wxss b/eaterplanet_ecommerce/components/index/index.wxss
new file mode 100644
index 0000000..03747c8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/index/index.wxss
@@ -0,0 +1,91 @@
+.i-index {
+ width: 100%;
+ height: 100%;
+}
+
+.i-index-line {
+ position: absolute;
+ left: 0;
+ width: 100%;
+ height: 2rpx;
+ background-color: #f7f7f7;
+ top: 50%;
+}
+
+.i-index-content {
+ background: #fff;
+ position: relative;
+ z-index: 1;
+ display: inline-block;
+ padding: 0 20rpx;
+}
+
+.i-index-fixed {
+ position: fixed;
+ right: 0;
+ top: 50%;
+ z-index: 10;
+ padding-left: 20rpx;
+ transform: translateY(-50%);
+}
+
+.i-index-fixed-item {
+ display: block;
+ height: 36rpx;
+ line-height: 36rpx;
+ padding: 0 10rpx;
+ text-align: center;
+ color: #595959;
+ font-size: 24rpx;
+ border-radius: 50%;
+}
+
+.i-index-fixed-item-current {
+ background: #2d8cf0;
+ color: #fff;
+}
+
+.i-index-tooltip {
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ transform: translate3d(-50%, -50%, 0);
+ background: rgba(0, 0, 0, 0.7);
+ color: #fff;
+ font-size: 48rpx;
+ border-radius: 50%;
+ width: 160rpx;
+ height: 160rpx;
+ line-height: 160rpx;
+ text-align: center;
+}
+
+.local-position-content {
+ height: 160rpx;
+ padding-left: 40rpx;
+ display: flex;
+ align-items: center;
+ color: #999;
+ background: #fff;
+ font-size: 24rpx;
+}
+
+.local-position-content span {
+ font-size: 40rpx;
+ font-weight: bold;
+ color: #9F99AA;
+ margin-right: 8rpx;
+}
+
+.index-title {
+ height: 70rpx;
+ line-height: 70rpx;
+ font-size: 26rpx;
+ padding-left: 40rpx;
+ color: #999;
+ background: #f6f6f6;
+}
+
+.router-hover {
+ opacity: 1;
+}
diff --git a/eaterplanet_ecommerce/components/input-number/index.js b/eaterplanet_ecommerce/components/input-number/index.js
new file mode 100644
index 0000000..ea85dc0
--- /dev/null
+++ b/eaterplanet_ecommerce/components/input-number/index.js
@@ -0,0 +1,114 @@
+function t(t, a) {
+ var e = void 0,
+ i = void 0,
+ n = void 0;
+ try {
+ e = t.toString().split(".")[1].length;
+ } catch (t) {
+ e = 0;
+ }
+ try {
+ i = a.toString().split(".")[1].length;
+ } catch (t) {
+ i = 0;
+ }
+ return n = Math.pow(10, Math.max(e, i)), (Math.round(t * n) + Math.round(a * n)) / n;
+}
+
+Component({
+ externalClasses: ["i-class", "i-class-number-text", "i-number-view", "i-number-img"],
+ properties: {
+ size: String,
+ value: {
+ type: Number,
+ value: 1
+ },
+ min: {
+ type: Number,
+ value: -1 / 0
+ },
+ max: {
+ type: Number,
+ value: 1 / 0
+ },
+ step: {
+ type: Number,
+ value: 1
+ },
+ reduceImage: {
+ type: String,
+ value: "../../images/icon-input-reduce.png"
+ },
+ addImage: {
+ type: String,
+ value: "../../images/icon-input-add.png"
+ },
+ idx: {
+ type: Number,
+ value: 0
+ }
+ },
+ data: {
+ canChange: true,
+ skin: getApp().globalData.skin,
+ },
+ attached(){
+ this.setData({
+ skin: getApp().globalData.skin,
+ })
+ },
+ methods: {
+ handleChangeStep: function(a, e, i) {
+ var n = this.data.value,
+ s = a.currentTarget.dataset,
+ h = (void 0 === s ? {} : s).disabled,
+ u = this.data.step;
+ if (h) return null;
+ "minus" === e ? n = t(n, -u) : "plus" === e && (n = t(n, u)), this.handleEmit(n, e, i);
+ },
+ handleMinus: function(t) {
+ this.data.canChange && this.handleChangeStep(t, "minus", true);
+ },
+ handlePlus: function(t) {
+ this.data.canChange && this.handleChangeStep(t, "plus", true);
+ },
+ handleFocus: function() {
+ this.data.canChange = false, this.triggerEvent("focus");
+ },
+ getType: function(t) {
+ return t > this.data.value ? "plus" : t < this.data.value ? "minus" : "";
+ },
+ handleBlur: function(t) {
+ this.data.canChange = true;
+ var oldValue = this.data.value;
+ var a = t.detail.value,
+ e = "";
+ "" === a && (a = 1);
+ a = (a - oldValue);
+ (a<=0) && (a=1);
+ var i = this.data.min;
+ // e = this.getType(a)
+ if (!(a *= 1)) return a = 0 === a ? i : 1, e = 'plus', void this.handleEmit(a, e, this.data.value !== a);
+ a = +a, e = this.getType(a);
+ var n = this.data.value !== a;
+ this.handleEmit(a, e, n);
+ },
+ handleEmit: function(t, a) {
+ t < this.data.min && this.triggerEvent("outOfMin", t), t > this.data.max && this.triggerEvent("outOfMax", t);
+ var e = this.data,
+ i = e.min,
+ n = e.max;
+ t > n ? t = n : t < i ? t = i : t || (t = i);
+ var s = t !== this.data.value,
+ h = {
+ value: t,
+ type: a,
+ idx: this.data.idx
+ };
+ a && (h.type = a), s ? this.triggerEvent("change", h) : (this.setData({
+ value: t
+ }), this.triggerEvent("change"));
+ },
+ returnTap: function(){}
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/input-number/index.json b/eaterplanet_ecommerce/components/input-number/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/input-number/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/input-number/index.wxml b/eaterplanet_ecommerce/components/input-number/index.wxml
new file mode 100644
index 0000000..bf320b9
--- /dev/null
+++ b/eaterplanet_ecommerce/components/input-number/index.wxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/input-number/index.wxss b/eaterplanet_ecommerce/components/input-number/index.wxss
new file mode 100644
index 0000000..40c3056
--- /dev/null
+++ b/eaterplanet_ecommerce/components/input-number/index.wxss
@@ -0,0 +1,41 @@
+@import "/icon.wxss";
+
+.i-input-number {
+ color: #495060;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.i-input-number .i-input-number-view {
+ width: 48rpx;
+ height: 48rpx;
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.i-input-number .i-input-number-view .img {
+ width: 48rpx;
+ height: 48rpx;
+ font-size: 48rpx;
+}
+
+.i-input-number-minus {
+ border-right: none;
+ border-radius: 4rpx 0 0 4rpx;
+}
+
+.i-input-number-plus {
+ border-left: none;
+ border-radius: 0 4rpx 4rpx 0;
+}
+
+.i-input-number .i-input-number-text {
+ position: relative;
+ text-align: center;
+ height: 48rpx;
+ width: 66rpx;
+ font-size: 24rpx;
+ line-height: 48rpx;
+ z-index: 0;
+}
diff --git a/eaterplanet_ecommerce/components/load-more/index.js b/eaterplanet_ecommerce/components/load-more/index.js
new file mode 100644
index 0000000..8eed444
--- /dev/null
+++ b/eaterplanet_ecommerce/components/load-more/index.js
@@ -0,0 +1,16 @@
+// eaterplanet_ecommerce/components/load-more/index.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ loading: {
+ type: Boolean,
+ value: true
+ },
+ tip: {
+ type: String,
+ value: ""
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/load-more/index.json b/eaterplanet_ecommerce/components/load-more/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/load-more/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/load-more/index.wxml b/eaterplanet_ecommerce/components/load-more/index.wxml
new file mode 100644
index 0000000..256db41
--- /dev/null
+++ b/eaterplanet_ecommerce/components/load-more/index.wxml
@@ -0,0 +1,8 @@
+
+
+
+ {{tip}}
+ 正在加载
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/load-more/index.wxss b/eaterplanet_ecommerce/components/load-more/index.wxss
new file mode 100644
index 0000000..1d1b45f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/load-more/index.wxss
@@ -0,0 +1,69 @@
+.i-load-more {
+ width: 65%;
+ font-size: 24rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 60rpx 0;
+ margin: 0 auto;
+}
+
+.i-load-more-loading {
+ display: inline-block;
+ margin-right: 24rpx;
+ vertical-align: middle;
+ width: 28rpx;
+ height: 28rpx;
+ background: 0 0;
+ border-radius: 50%;
+ border: 4rpx solid #e9eaec;
+ border-color: #e9eaec #e9eaec #e9eaec #2d8cf0;
+ animation: btn-spin 0.6s linear;
+ animation-iteration-count: infinite;
+}
+
+.i-load-more-tip {
+ display: inline-block;
+ vertical-align: middle;
+ color: #fff;
+}
+
+.i-load-more-line {
+ display: flex;
+ border-top: 0;
+}
+
+.i-load-more-line .i-load-more-tip {
+ position: relative;
+ top: -.1em;
+ padding: 0 0.55em;
+}
+
+.i-load-more-empty {
+ border-radius: 50%;
+ background-color: #e5e5e5;
+ display: inline-block;
+ position: relative;
+ vertical-align: 0;
+ top: -.16em;
+}
+
+@-webkit-keyframes btn-spin {
+ 0% {
+ transform: rotate(0);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+}
+
+@keyframes btn-spin {
+ 0% {
+ transform: rotate(0);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+}
diff --git a/eaterplanet_ecommerce/components/menutabs/index.js b/eaterplanet_ecommerce/components/menutabs/index.js
new file mode 100644
index 0000000..926257e
--- /dev/null
+++ b/eaterplanet_ecommerce/components/menutabs/index.js
@@ -0,0 +1,113 @@
+var t = require("../../utils/index");
+
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ lineBgColor: {
+ type: String
+ },
+ fontColor: {
+ type: String
+ },
+ tabs: {
+ type: Array,
+ value: []
+ },
+ activeIndex: {
+ type: Number,
+ value: 0,
+ observer: function (e) {
+ if(-1 === this.properties.activeIndex) {
+ this.resetIndicator();
+ } else {
+ this.executeAnimcation(e)
+ }
+ }
+ }
+ },
+ data: {
+ out_link: "",
+ indicatorAnamationData: {},
+ scrollLeft: 0
+ },
+ ready: function () {
+ this.tabsWidth = [], this.tabsLeft = [], this.screenWidth = wx.getSystemInfoSync().screenWidth,
+ this.setData({
+ fontColor: this.data.fontColor ? this.data.fontColor : "#fff!important"
+ }), this.data.lineColor && this.setData({
+ lineBgColor: this.data.lineBgColor
+ });
+ },
+ methods: {
+ handleTabItemTap: function (t) {
+ var e = t.target.dataset.index, a = t.target.dataset.id;
+ e !== this.data.activeIndex && (this.setData({
+ activeIndex: e
+ }), this.triggerEvent("activeIndexChange", {a,e}));
+ },
+ goLink: function () {
+ wx.switchTab({
+ url: "/eaterplanet_ecommerce/pages/type/index",
+ });
+ },
+ executeAnimcation: function (t) {
+ var e = this;
+ this.getLeftAndWidth(t).then(function (a) {
+ var i = e.generateAnimationData(a.left, a.width, a.firstTabLeft);
+ e.centerTheTab(t, a), e.setData({
+ indicatorAnamationData: i
+ });
+ });
+ },
+ centerTheTab: function (t, e) {
+ var a = e.width, i = (e.left, this.tabsWidth.slice(0, t).reduce(function (t, e) {
+ return t + e + 25;
+ }, 15));
+ this.setData({
+ scrollLeft: i - (this.screenWidth - a) / 2
+ });
+ },
+ getLeftAndWidth: function (e) {
+ var a = this;
+ return new Promise(function (i) {
+ (0, t.getRect)(a, ".tabs__nav", !0).then(function (t) {
+ a.tabsWidth = t.map(function (t) {
+ return t.width;
+ }), a.tabsLeft = t.map(function (t) {
+ return t.left;
+ }), i({
+ width: a.tabsWidth[e],
+ left: a.tabsLeft[e],
+ firstTabLeft: a.tabsLeft[0]
+ });
+ });
+ });
+ },
+ generateAnimationData: function (t, e) {
+ var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i = wx.createAnimation({
+ duration: 200,
+ timingFunction: "ease"
+ });
+ return [{
+ width: e,
+ left: t - a
+ }].forEach(function (t) {
+ var e = t.width, a = t.left;
+ i.translateX(a).width(e).step();
+ }), i.export();
+ },
+ resetIndicator: function () {
+ let tabs = this.data.tabs || [];
+ let initWidth = 28;
+ if (tabs.length) initWidth = (tabs[0].name && tabs[0].name.length*14);
+ var t = wx.createAnimation({
+ duration: 200,
+ timingFunction: "ease"
+ });
+ t.translateX(0).width(initWidth).step(), this.setData({
+ scrollLeft: 0,
+ indicatorAnamationData: t.export()
+ });
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/menutabs/index.json b/eaterplanet_ecommerce/components/menutabs/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/menutabs/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/menutabs/index.wxml b/eaterplanet_ecommerce/components/menutabs/index.wxml
new file mode 100644
index 0000000..3a413cd
--- /dev/null
+++ b/eaterplanet_ecommerce/components/menutabs/index.wxml
@@ -0,0 +1,11 @@
+
+
+
+ {{tabItem.name}}
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/menutabs/index.wxss b/eaterplanet_ecommerce/components/menutabs/index.wxss
new file mode 100644
index 0000000..bce5a1d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/menutabs/index.wxss
@@ -0,0 +1,85 @@
+.tabs {
+ position: relative;
+ padding-left: 0rpx;
+ padding-right:0rpx;
+ padding-bottom: -5rpx;
+ margin-right: 10rpx;
+ display: flex;
+}
+
+.tabs__nav {
+ position: relative;
+ padding-bottom: 16rpx;
+ padding-right: 16rpx;
+ margin-right: 50rpx;
+ font-size: 28rpx;
+ font-weight: bold;
+ line-height: 58rpx;
+ flex-shrink: 0;
+ transition: all 0.6s ease;
+ color: #fff;
+ padding-top: 10rpx;
+}
+
+.tabs__nav.active {
+ font-weight: bold;
+ font-size: 35rpx;
+ color: #42add5;
+}
+
+.tabs__nav:first-child {
+ margin-left: 20rpx;
+}
+
+.tabs__navs__wrap {
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+}
+
+.tabs__navs__wrap .activeIndicator {
+ width: 80rpx!important;
+ height: 6rpx;
+ margin-left: 20rpx;
+ margin-right: 20rpx;
+ position: absolute;
+ vertical-align:baseline ;
+ bottom: 10rpx;
+ left: 0rpx;
+ /**border-radius: 24rpx;**/
+ background: linear-gradient(to right,#fff,#4d9ee9)!;
+ /**box-shadow: 0rpx 4rpx 4rpx 0rpx rgba(0, 26, 255, 0.39);**/
+ transition: all 1s ease-in-out;
+}
+
+.gototype {
+ position: relative;
+ padding-bottom: 16rpx;
+display: flex;
+ flex-shrink: 0;
+ color: #fff!important;
+ padding-top: 10rpx;
+ font-size: 28rpx;
+ font-weight: bold;
+ line-height: 58rpx;
+
+ height: 100%;
+ padding-left:10rpx;
+padding-right:0rpx;
+margin-right: 0rpx;
+
+ box-shadow: -12rpx 0rpx 10rpx -10rpx rgba(27, 27, 27, 0.39);
+}
+.gototype .image{
+ position: relative;
+ margin-right: 0rpx;
+margin: 12rpx 10rpx 0rpx 10rpx;
+ width:36rpx;
+ height: 36rpx;
+background-repeat: no-repeat;
+ background-size: 100%;
+background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAVzklEQVR4Xu1dDbCtVVl+nmGoNIv+ICjEMA3lT8zkMlnEnwaCAdLgCAqTgMXlR1BoADMwjcsIKsK9FxOowMCRIiBBMu9FwijALJE/GfGaZAOBWZSZDsM8zcv9zmGfc/Y++32/71vf+fbe75rZc+bOfdZa73qe/ez3+1k/RJZkIBkYyQCTm2QgGRjNQKsGkbQzgF0B7DDw2WoKBHgCwKMDn3tIPjZJ45K0HYA9F2mzzSSNYUSsTy3S5n6SD7Y1rsYGkbQvgP0AHA5gl7YCm4B27gJwC4A7SN7Rx3gl7Q3APgcD2KuPMRaK6QEANwC4jeTnmvRR2yCSjgFwUvWr1CSGaah7D4B1JK/uw2BSmwUqNNImbBBJhwE4GcD+ffgy9CyGjQDWkrxxJeJKbZZlvZY2IYNIWgdg9UqIP2F9ridp2bWzktq4qQ5p4zaIJLuW28cdRgJvJ2n3Z8VLahOm2K2NyyCS7CnO1uEwssKTJIs+KUptan/JXNqMNYikTQB2rB1GVvw6yReXoCG1aczqWG2WNYikywEc3ziMbOAKkie0SUNq0xqby2oz0iCSzgdwdmthZENrSJ7TBg2pTRssLmhjpDZDDVI9LrQXLVnaZeDwpo+AU5t2BRlobag2owyyocF7DrtnuW/gYzf4k15+DoBNo7GZAvbX/l2nbCR5QJ2Kc3UkNdHmXwDYNAx702x/7d+TXuwhyG4Dn7r3e0O1WWKQ6i3sVTVYewbAaSTX1qg7UVUk2YvSiwFsUSPwY+u+cU9txrPdtjbDDHJ3jekj9ot0BMmHxw9hOhCSdgJwfY35ZzbRcVUdFiSlNg7i2tRmgUEkHQTg044YBiHnkXxvsM7UwCWdC+C84IBeT/LWSJ3UJsLWZmwb2iw2yCUATgmEYrMlZ35OliSb52Mzmr3lUpKnesGV2KlNhLAK21SbxQb5KoCXOON42tYWkHzciZ9amKRtqzUJWzoH+QjJlzqxc7+GqU2EsOcM0kibeYNIsicBXw7EcAzJjwfwUw2V9FYAkenuu5O0p31jS2ozlqJlAU20GTTIkQA+6QzlGyTrPup0djF5MEn22PRFzsgPIWkLrsYWSbbg6eaxwM2A1GYIUUFt3kTyOmtm0CBnALjQKcJfk7Qb+iwDDEiyG+8DnaQcTfJaD1bSUQCu8WABpDbDDRLR5kySFy02SOQm8IMkzVBZFhrESH2Xk5TVJC/zYCWdCGC9BwsgtRlukIg28w9RBjOIrYI71CnCUSQ/4cTODEzSmwG4soLNcyN5gYccSWcBWOPBAkhthhskos1NJG3l7IJLrMiCqH1J3u4UbGZgkmxBmXeTAPf7o+Dz/NRmuEEi2swvqBrMIGmQhlZOgzQksGD1oDZpkBJaBEXIDFJChBFtBrVJg5TQJihCGqSECGmQDlkNdpUGCRLWITyoTWaQEtoERcgMUkKEzCAdshrsKg0SJKxDeFCbzCAltAmKkBmkhAiZQTpkNdhVGiRIWIfwoDaZQUpoExQhM0gJETKDdMhqsKs0SJCwDuFBbTKDlNAmKEJmkBIiZAbpkNVgV2mQIGEdwoPaZAYpoU1QhMwgJUTIDNIhq8Gu0iBBwjqEB7XJDFJCm6AImUFKiJAZpENWg12lQYKEdQgPapMZpIQ2QREyg5QQITNIh6wGu0qDBAnrEB7UJjNICW2CImQGKSFCZpAOWQ12lQYJEtYhPKhNZpAS2gRFyAxSQoTMIB2yGuwqDRIkrEN4UJvMICW0CYqQGaSECJlBOmQ12FUaJEhYh/CgNplBSmgTFCEzSAkRMoN0yGqwqzRIkLAO4UFtMoOU0CYoQmaQEiJkBumQ1WBXaZAgYR3Cg9pkBimhTVCEzCAlRMgM0iGrwa7SIEHCOoQHtckMUkKboAiZQUqIkBmkQ1aDXaVBgoR1CA9qMzSDXAXgGGfMJ5H0HgnmbHLyYZJWA1jnHMnpJC/2YPMAHQ9Ly2PaMMj7APyeM5T1JE9yYmcGJsnMYSbxlLeR/BMPMA3iYam8QU4A8DFnKPMpyImfCZikyCldR5D8Sw8xaRAPS+UN8ut2hLAzlCdJbuPEzgxM0hMAtnYO+ACSGz3YNIiHpfIGeR6A7wZC+QjJ0wL4qYZKsvuJdwQG+XyS/+fBp0E8LBU2iDUv6VMADgmEk0cOb+YtcsSw0XszyTd4eU6DeJkajWt8k14Z5BQAlwTC+T7JHwrgpxIq6XsAfjAwuFNJXurFp0G8TJU3yCsAfCkYzhcA2PX0fwfrTTxc0o8C2ADg1cHB7EHyXm+dNIiXqcIGqbKIPVk5vEZIx5O8ska9iawi6TgAV9QI/gaSb4zUS4NE2BqObeUSqzLI/tWvYp2oPgPgegB3knywTgN9riNpDwB7ArAvuD31q1PcT6/mGk+D1KF5YZ3WDFKZJPJWfVT0mwD8HQD7O+llzhg/03AgV5M8NtpGGiTK2FJ82waxX8m7m4eVLSxiYBXJe6KspEGijBU2SJVFTgfwoeahZQsVA+8k+eE6bKRB6rBW8BJr4NrXbkLtZjRLMwauJHl83SbSIHWZe65eq5dYg+FIsukndW9Im49s8lv4DMkDmwwjDdKEvc11ixmkatymtp/YPMyZa+Eykt7ZvSPJSYM0/94UNUhlkt8BcFnzUGemhRNJfrSN0aZBmrNY3CCVSY4GcBGAbZuHPLUtPA7gDJLXtDXCNEhzJjsxSGWSHQCcDMAWTD2/eehT04LNhLYFU2tJPtrmqNIgzdnszCBzoUratTLJkQB+ovkQJraFJ6vZA+tI3l9iFGmQ5qx2bpABo/wwgIMHPj/ZfDi9b+FrAGxazbMfkt8vGXEapDm7K2aQxaFLMsNsNfCZhunw3wHw1NyntCGGcHougPOcX5N9Sd7uxM4MrDcGmRnGOxxoZpDmZKdBmnPY2xbSIM2lSYM057C3LaRBmkuTBmnOYW9bSIM0lyYN0pzD3raQBmkuTRqkOYe9bSEN0lyaNEhzDnvbQhqkuTRpkOYc9raFNEhzadIgzTnsbQtpkObSpEGac9jbFtIgzaVZcYNIeiEA205zx0VTTSI7DjZnokwL/zs41QSAbfr2WZL/Uaa7ha1KsmMp7HgKTzmE5C0e4CxhJNl8wZudY55fBUpnhaEwSb9YLcd9HYB9mrQ1oXVtObIdebCB5D+VGoOkyJawZ5O8oFQsk9qupLMArHHGfznJtxu2lkEkvbSa6m7rQrZwdjrNsGdsHYitByH51bYHKslO/rK9yjzlWpK2sC3LAAOSbAHbUU5S3kPy/WGDSNoSwO9X5vhxZ2ezBPvPatHUH5B8uq2BSzoUwI3O9u4jubsTOzMwSV8GsJtzwMeSvDpkEEnbAbgOwK84O5llmO0oeSTJx9ogIXiDaV0eRNJ7GFIbIfa6DUm2q8ytgSDnlwy4LrEk2S+SXWvP8srBAL/PQr8NwIi2X67GJXh61cMkX9a40ylpQNJXAOzkHM6C09PGGkTSKgB3ORtP2FIG9iLZeBvX4AGhFsVNJA+bdUEk2aWpXaJ6y4IDapc1iKSfBfBNb8uJG8nA9iT/rQk/kmxHeds5P1IOJflXkQrThJX0G/ZDERzTgsNVRxpE0o8A+HsAtjlDlmYM2GYOv0zyf+o2I+nHAFg79qMVKb9L8sJIhWnASjoTwAeCY7EfsV1J/tdcveUMUvcgnWBMMwMPH5yzmBlJZwM4vwZjdvbku0neV6PuRFWRZE+q/rB6aR2N/RySC96VDDWIJNvzyp7rZ2mXgZNJ2t5ZtUqV1e34hDo34LbphD3JsRvWB+yoPZKP1AqkR5Wqp6uvAmBnuLy82l3HNg2JFuNlz8VZfolBGopgm6fZdbI9ubHPvST/PRpp3/CSbPrMLtXlpl1y2hF1dTbNGypCZLz54xVhK4Qd+uM1zCB10/g/AziN5B2hsCYQLGlvAHYu+itrhL8kjUfbyB33o4yNxY/cgX+BQSTZew775Y/eCNY6Wmxs2D0HSKpzVJ3dCO5O0t6T1CqSfgqA/SBtX6uBrDTIgD2lfSXJbw2jZbFBbA7PnwX5O5Ck7TA4k0WSnZ0SfWv9lqabW0uy6+2pOyh1Bb5EO5N8aFS/iw1i5ohMdDuf5LtXYFC96lKSPTU5JxDUNSTfEsAPhUr6VQBTf0nblKdl6u9N8vPLtb/YILa+wTud5PMk7Vo8y+YTjOyLal9YT/k2yVb2MJZku+3fmZdbHtrnMXZZ9RrPLvzzBqkxIe7XZuGG3Et7deP+t158NU+rlT10JdnMarsfsgVrWZZnwN4J2Wxdm3k9tgwaJLLm4CGSO49tfcYAkuyewO4NPOUwktFpECPblWTrcmyDa3uHlUsRljI1txThPJK2fsdVBg0SWdZ5PcnfdPUwQyBJfwHgCOeQ59ccOPEuWC5mW0JTo8Vsgwb5GIATXCoA5sL3OrEzAwturnAqyUtLkVMth349gNcCmMV7RZtBbTMHPtVkOfSgQSLHPb+BpHcBfKnvQO/alXSICeIMbH5ZpxNfGyZp62rvAJsNMHh2i53lMunFDi+aP7sFgB1/dwvJTW0MbNAgtiDKu/FCHtIyhP3gg47Mwm18gwu3kQZpkeA0SItk9qSpNEiLQqRBWiSzJ02lQVoUIg3SIpk9aSoN0qIQaZAWyexJU2mQFoVIg7RIZk+aSoO0KEQapEUye9JUGqRFIdIgLZLZk6bSIC0KkQZpkcyeNJUGaVGINEiLZPakqTRIi0L03SCS7KyWwakmL2hx+CvV1PcGp5qQtLNcWitpkNaofHbRlE3VsSk7nlJ8qomkH6gmKu4PwLYhrbNdkGcsfcI8CeDPAXzatCBpO+3ULmmQ2tQtrdgXg0iyrYlsXYiZYtsWhzhpTZlZbBsqO7fFdqUMlzRImLLRFVbaINXyWzvUyMxRZ9+uFtnoVVOWRWzDvrWeZbaDkadBWtRxJQ0i6berFYWznDHGqfm4cUTyj8YB5/4/DeJlyoFbKYNI+giAUx0hJmQzA5eQfIeHjDSIhyUnZiUMIsmON8jNGpwaDcBspaEdj7BsSYOMYyjw/10bRNK1AN4cCDGhCxn4BMllD/ZMg7T4lenSILmJdWvCLbvjfhqkNZ67ew8SPBa6xRFObVMjd5hJg7SoeRcZRNKeABqfedjisKelqVUk7eyVBSUN0qK8HRmkzo7yi0dpW2/+Q3WQTosMrEhTtvWqHU3+Cw17H3pCQRqkIauD1UsbRJJNGdlQM2Q7u/1PzRgkp25X+GrDPDPK2yrD1KHpAJIbByumQerQOKJOBwape27kh0i+q8Wh9ropSR8E8M4aQS45RzINUoPFUVVKGkTSLwH4QjBcOwzpddNwDF5w3DZx9KcB/I0dVhSs+2qS/zhXJw0SZG85eGGDRI/G+y7Jadg5sZFCkmz6e2Re2oIj8tIgjehfWLmwQW6zIxMC4e5FcuafdklaBeCuAG82RX6/zCABxrzQUgaRZJngO944AHS2728gphWDSoqcXGBxvmBu4VVmkBZlK2iQyNOrb5G0zaqzDDAgydaG2OGnnjJ/7mYaxEOXE1PQIG+sFv54IrmTpD3uzLLQIPaY+zVOUt5O8nLDpkGcjHlgBQ3yWwD+2BOD4Uge58TODEzSldU7Es+Y30/yPWkQD1UBTEGDnAbgw85QTid5sRM7MzBJEQ7n36pnBmnxK1LQIOdWqwU90ebZLUNYCmpzO8lnnximQTxfOScmKIJ7V5Pg0W5pkDSI8xvbMSwN0jHhge6C2mQGCXDrhgZFyAziZrY5MKhNGqQ55UtbCIqQBikhwog2g9qkQUpoExQhDVJChDRIh6wGu0qDBAnrEB7UJjNICW2CImQGKSFCZpAOWQ12lQYJEtYhPKhNZpAS2gRFyAxSQoTMIB2yGuwqDRIkrEN4UJvMICW0CYqQGaSECJlBOmQ12FUaJEhYh/CgNplBSmgTFCEzSAkRMoN0yGqwqzRIkLAO4UFtMoOU0CYoQmaQEiJkBumQ1WBXaZAgYR3Cg9pkBimhTVCEzCAlRMgM0iGrwa7SIEHCOoQHtckMUkKboAiZQUqIkBmkQ1aDXaVBgoR1CA9qkxmkhDZBETKDlBAhM0iHrAa7SoMECesQHtQmM0gJbYIiZAYpIUJmkA5ZDXaVBgkS1iE8qE1mkBLaBEXIDFJChMwgHbIa7CoNEiSsQ3hQm8wgJbQJipAZpIQImUE6ZDXYVRokSFiH8KA2mUFKaBMUITNICREyg3TIarCrNEiQsA7hQW0yg5TQJihCZpASImQG6ZDVYFdpkCBhHcKD2gzNIDcCONQZ85tIXufEzgxM0pEAPukc8NkkL/BgJZ0FYI0HCyC1GUJUUJubSB5mzQweoHMJgFOcIsyf4ebEzwRM0vsA2JHDnrKa5GUeoKQTAaz3YAGkNsMNEtHmUpKnLjbIGQAudIow7zAnfiZgkiJZ+GiS13qIkXQUgGs8WACpzXCDRLQ5k+RFiw0SuTzYRPLnnYLNDEzS1wC82DngQ0je4sFKOhjAzR4sgNRmuEEi2sxfpg5eYu0M4AGnCAY7heTaAH6qoZJOBnBpYJC7kHzQg5eU2niIGoFpos28QaxtSfcD2MUZyzOGJfmwEz+1MEk7VT8uWzgH+QDJXZ3YZ2GpTYSt57BNtVlskMiNjEURFrreMPtdK/jltcGEb6SDDwBSm+or01SbxQaxs6FvC34d3S+8gu1OBDx4RPPcmPYj+bnIACWlNhHCNmfdyPnyQ7VZYJAqld8NYM9gLGYqeyrzeLDexMIlbVs9WdovOIh7SK4K1pm7zEptHMS1qc0wgxwD4CpHHIshTwM4juTHa9SdqCqS3grgSgBb1gj8WJJX16hnv4ipzRji2tZmiUGqLLIBwP51RATwDQAPVTetXwTwWM12+lTtJQBeAcBuxl8G4IU1g9tI8oCadeeySBNt/hXAVwDYg5V7ATzSJJae1N0OwKuqh0svB/CimnEN1WaUQew1+w01O8pqoxk4nKS9sKpdJKU2tdlbtuJQbYYapMoi6wCsLhPLTLa6nuRJbYxcUmrTBpHPtTFSm5EGqUxiT1r2aTeWmWxtfnZoW6OXlNq0Q+ay2ixrkMokTwDYup1YZrKVJ0luU2LkklKbZsSO1WasQSqTbAKwY7NYZrL210l652bVIkhSalOLObi0cRmkMsnlAI6vF8tM1rqC5AldjFxSahMj2q2N2yCVSc4HcHYslplEryF5Tpcjl5Ta+AgPaRMySGUSe8xoM1frvifxDWMyURsBrG36KLfu0KtHwKnNcAJraRM2yFzf1Vtde2wZnZZSV/8+17sHwLq6b8jbHlhqs4DRRtrUNsiAUQ4CMPexN86zUr4E4LP2IWl/e1ckvRbA3GeP3gVYLiCbIXCrfUja39qlsUEGe5a0GwB73b/DwGer2tH1p6I9Tn104PNFkt/sT3jjI5G0fTUlY1CbIo+fx0fTKuKpRdo8RPK+tnpo1SBtBZXtJAN9YSAN0hclMo5eMvD/Vzc/jKAc1v4AAAAASUVORK5CYII=);
+
+
+}
diff --git a/eaterplanet_ecommerce/components/modal-userProfile/index.js b/eaterplanet_ecommerce/components/modal-userProfile/index.js
new file mode 100644
index 0000000..cf7a482
--- /dev/null
+++ b/eaterplanet_ecommerce/components/modal-userProfile/index.js
@@ -0,0 +1,237 @@
+var util = require('../../utils/util.js');
+var location = require('../../utils/Location.js');
+
+var app = getApp();
+const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
+const defaultAvatarUrl2 = 'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132'
+
+Component({
+ properties: {
+ showUserProfile: {
+ type: Boolean,
+ value: false
+ },
+ navBackUrl: {
+ type: String,
+ value: '',
+ observer: function (t) {
+ if (t) app.globalData.navBackUrl = t;
+ }
+ },
+ nickName: {
+ type: String,
+ value: '',
+ },
+ avatar: {
+ type: String,
+ value: '',
+ }
+ },
+
+ attached: function () {
+ this.setData({
+ skin: getApp().globalData.skin,
+ })
+ this.getBg();
+ let member_info = wx.getStorageSync('member_info');
+ if (member_info!==null) {
+ this.setData({
+ nickname: member_info.username,
+ avatarUrl: member_info.avatar
+ })
+ }
+ },
+ data: {
+ nickname: '微信用户',
+ avatarUrl: defaultAvatarUrl2,
+ image_o: '',
+ btnLoading: false,
+ loginSuccess: false,
+ canIUse: wx.canIUse('button.open-type.getUserInfo')
+ },
+ methods: {
+ onChooseAvatar(e) {
+ this.setData({
+ avatarUrl: e.detail.avatarUrl
+ })
+ },
+ nicknameInput(e){
+ const {value}= e.detail;
+ console.log(value);
+ this.setData({
+ nickname:value
+ })
+ },
+ getBg: function () {
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.get_newauth_bg'
+ },
+ dataType: 'json',
+ success: function (res) {
+ that.setData({
+ loaded: true
+ })
+ if (res.data.code == 0) {
+ let {
+ newauth_bg_image,
+ newauth_confirm_image,
+ newauth_cancel_image
+ } = res.data.data;
+ that.setData({
+ newauth_bg_image,
+ newauth_confirm_image,
+ newauth_cancel_image
+ })
+ }
+ }
+ })
+ },
+ close: function () {
+ this.triggerEvent("cancel");
+ },
+ noCover: function () {
+ this.triggerEvent("cancel");
+ },
+ getMemberInfo: function () {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.get_user_info',
+ token: token
+ },
+
+ dataType: 'json',
+ success: function (res) {
+ if (!res.data.needAuth) {
+ that.setData({
+ nickname: res.data.data.username,
+ avatarUrl: res.data.data.avatar
+ })
+ }
+ }
+ })
+ },
+ uploaduserInfo: function () {
+
+ console.log(1111)
+ console.log(this.data.avatarUrl)
+ console.log( app.util.url )
+ var that = this;
+ var token = wx.getStorageSync('token');
+ wx.uploadFile({
+ url: app.util.url('entry/wxapp/index', {
+ 'm': 'eaterplanet_ecommerce',
+ 'controller': 'goods.doPageUpload'
+ }),
+ filePath: that.data.avatarUrl,
+ name: 'upfile',
+ formData: {
+ 'name': that.data.avatarUrl
+ },
+ header: {
+ 'content-type': 'multipart/form-data'
+ },
+ success: function (res) {
+ console.log(res.data)
+ var data = JSON.parse(res.data);
+ that.setData({
+ avatarUrl: data.image_o
+ })
+ }
+ })
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.get_user_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ let member_info = res.data.data;
+ wx.getUserProfile({
+ desc: "获取你的昵称、头像、地区及性别",
+
+ success: function (msg) {
+ wx.getStorageSync(member_info)
+ var userInfo = msg.userInfo
+ userInfo['nickName'] = that.data.nickname
+ userInfo['avatarUrl'] = that.data.avatarUrl
+ member_info['username'] = that.data.nickname
+ member_info['avatar'] = that.data.avatarUrl
+ that.setData({
+ avatarUrl: that.data.avatarUrl,
+ nickname: that.data.nickname,
+ });
+ let invalidAvatars = [defaultAvatarUrl, defaultAvatarUrl2, "", "undefined"];
+ let invalidUsernames = ["微信用户", "", "undefined"];
+ if (invalidAvatars.includes(member_info.avatar)) {
+ wx.showToast({
+ title: "请选择头像",
+ icon: "none"
+ });
+ return false;
+ }
+ if (invalidUsernames.includes(member_info.username)) {
+ wx.showToast({
+ title: "请修改昵称",
+ icon: "none"
+ });
+ return false;
+ }
+ wx.setStorage({
+ key: "userInfo",
+ data: userInfo
+ })
+ wx.setStorage({
+ key: "member_info",
+ data: member_info
+ })
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.applogin_do',
+ token,
+ member_info,
+ nickName: member_info.username,
+ avatarUrl: member_info.avatar,
+ },
+ method: 'post',
+ dataType: 'json',
+ success: function (res) {
+ let isblack = res.data.isblack || 0;
+ if (isblack == 1) {
+ app.globalData.isblack = 1;
+ wx.removeStorageSync('token');
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ } else {
+ wx.setStorage({
+ key: "member_id",
+ data: res.data.member_id
+ })
+ }
+ that.setData({
+ btnLoading: false,
+ loginSuccess: true
+ });
+ wx.showToast({
+ title: '修改成功',
+ duration: 2000
+ })
+ that.triggerEvent("authSuccess",res);
+ console.log("下一步刷新页面")
+ },
+ })
+ }
+ })
+ }
+ })
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/modal-userProfile/index.json b/eaterplanet_ecommerce/components/modal-userProfile/index.json
new file mode 100644
index 0000000..6478ceb
--- /dev/null
+++ b/eaterplanet_ecommerce/components/modal-userProfile/index.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-modal": "../modal/index",
+ "i-button": "../button/index"
+ }
+ }
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/modal-userProfile/index.wxml b/eaterplanet_ecommerce/components/modal-userProfile/index.wxml
new file mode 100644
index 0000000..0c63bc4
--- /dev/null
+++ b/eaterplanet_ecommerce/components/modal-userProfile/index.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ 昵称
+
+
+
+
+
+
+ 暂不修改
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/modal-userProfile/index.wxss b/eaterplanet_ecommerce/components/modal-userProfile/index.wxss
new file mode 100644
index 0000000..4887da3
--- /dev/null
+++ b/eaterplanet_ecommerce/components/modal-userProfile/index.wxss
@@ -0,0 +1,113 @@
+.auth-content {
+ width: 400rpx;
+ min-height: 200rpx;
+ max-height: 500rpx;
+ border-radius: 24rpx;
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-end;
+}
+
+.auth-content .bg {
+ width: 400rpx;
+ margin-top: -100rpx;
+}
+
+.auth-content .h1 {
+ color: #000;
+ font-size: 32rpx;
+ margin-bottom: 20rpx;
+ font-weight: bold;
+}
+
+.auth-content .h2 {
+ font-size: 24rpx;
+ line-height: 36rpx;
+ color: #999;
+ width: 408rpx;
+ margin-bottom: 44rpx;
+}
+
+.auth-content .btn {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: -200rpx;
+ align-items: center;
+ justify-content: center;
+ font-size: 28rpx;
+}
+
+.auth-content .btn .close-btn {
+ color: #fff;
+ border: 1rpx solid #fff;
+ border-radius: 36rpx;
+ margin: 0 15rpx;
+ text-align: center;
+ height: 64rpx;
+ line-height: 64rpx;
+}
+
+.auth-content .btn .close-img {
+ margin: 0 15rpx;
+}
+
+.auth-content .btn .img {
+ width: 180rpx;
+}
+
+.auth-content .confirm {
+ height: 64rpx;
+ line-height: 64rpx;
+ font-size: 29rpx;
+ background: #fff;
+ border-radius: 36rpx;
+ margin: 20rpx 15rpx;
+}
+
+.auth-content .avatar {
+ width: 400rpx;
+ margin-top: -100rpx;
+ margin-bottom: 20rpx;
+ font-size: 32rpx;
+}
+
+.avatar-wrapper {
+ margin: auto auto 40rpx;
+ height: 160rpx;
+ width: 160rpx;
+}
+
+.avatar-img {
+border-radius: 20rpx;
+ height: 160rpx;
+ width: 160rpx;
+}
+
+.nickname {
+ margin: auto;
+ font-size: 32rpx;
+ display: flex;
+ justify-content: center;
+}
+
+.nickname-wrapper {
+ font-size: 32rpx;
+ max-width: 240rpx;
+ height: 50rpx;
+ border-radius: 10rpx;
+ background-color: #bfbfbf;
+}
+
+.nickname .title {
+ width: 80rpx;
+ color: #bfbfbf;
+}
+
+.nickname-wrapper .input {
+ text-align: center;
+ font-weight: bold;
+ color: #1d252f;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/modal/index.js b/eaterplanet_ecommerce/components/modal/index.js
new file mode 100644
index 0000000..ed6a0b5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/modal/index.js
@@ -0,0 +1,51 @@
+var app = getApp();
+
+Component({
+ externalClasses: ["i-class", "i-class-mask"],
+ properties: {
+ visible: {
+ type: Boolean,
+ value: !1,
+ observer: function(e) {
+ var that = this;
+ this.data.closeDelay ? setTimeout(function() {
+ that.setData({
+ isShow: e
+ });
+ }, this.data.closeDelay) : this.setData({
+ isShow: e
+ });
+ }
+ },
+ maskClosable: {
+ type: Boolean,
+ value: true
+ },
+ scrollUp: {
+ type: Boolean,
+ value: true
+ },
+ closeDelay: {
+ type: Number,
+ value: 0
+ }
+ },
+ data: {
+ isIpx: false,
+ isShow: false
+ },
+ attached: function() {
+ this.setData({
+ isIpx: app.globalData.isIpx
+ });
+ },
+ methods: {
+ stopMove: function() {},
+ handleClickMask: function() {
+ this.data.maskClosable && this.handleClickCancel();
+ },
+ handleClickCancel: function() {
+ this.triggerEvent("cancel");
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/modal/index.json b/eaterplanet_ecommerce/components/modal/index.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/eaterplanet_ecommerce/components/modal/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/modal/index.wxml b/eaterplanet_ecommerce/components/modal/index.wxml
new file mode 100644
index 0000000..8434ec7
--- /dev/null
+++ b/eaterplanet_ecommerce/components/modal/index.wxml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/modal/index.wxss b/eaterplanet_ecommerce/components/modal/index.wxss
new file mode 100644
index 0000000..8af6d06
--- /dev/null
+++ b/eaterplanet_ecommerce/components/modal/index.wxss
@@ -0,0 +1,70 @@
+.i-as {
+ position: fixed;
+ width: 100%;
+ box-sizing: border-box;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: #fff;
+ transform: translate3d(0,100%,0);
+ transform-origin: center;
+ transition: all 0.2s ease-in-out;
+ z-index: 9001;
+ visibility: hidden;
+ border-radius: 30rpx 30rpx 0 0;
+}
+
+.i-as-mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0,0,0,0.7);
+ backdrop-filter: blur(30rpx);
+ transition: all 0.2s ease-in-out;
+ opacity: 0;
+ visibility: hidden;
+ z-index: 9000;
+}
+
+.i-as-mask-show {
+ opacity: 1;
+ visibility: visible;
+}
+
+.i-as-show {
+ transform: translate3d(0, 0, 0);
+ visibility: visible;
+}
+
+.i-modal-content {
+ position: fixed;
+ overflow: auto;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 9001;
+ display: flex;
+ width: auto;
+ height: auto;
+ outline: 0;
+ -webkit-box-align: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ justify-content: center;
+ transform: translateZ(2rpx);
+ opacity: 0;
+ visibility: hidden;
+ -webkit-overflow-scrolling: touch;
+}
+
+.i-modal-show {
+ visibility: visible;
+ opacity: 1;
+}
+
+.ipx {
+ padding-bottom: calc(env(safe-area-inset-bottom) - 30rpx);
+}
diff --git a/eaterplanet_ecommerce/components/mp-dialog/dialog.js b/eaterplanet_ecommerce/components/mp-dialog/dialog.js
new file mode 100644
index 0000000..a105076
--- /dev/null
+++ b/eaterplanet_ecommerce/components/mp-dialog/dialog.js
@@ -0,0 +1,168 @@
+module.exports =
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 20);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 20:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Component({
+ options: {
+ multipleSlots: true,
+ addGlobalClass: true
+ },
+ properties: {
+ title: {
+ type: String,
+ value: ''
+ },
+ extClass: {
+ type: String,
+ value: ''
+ },
+ maskClosable: {
+ type: Boolean,
+ value: true
+ },
+ mask: {
+ type: Boolean,
+ value: true
+ },
+ show: {
+ type: Boolean,
+ value: false,
+ observer: '_showChange'
+ },
+ buttons: {
+ type: Array,
+ value: []
+ }
+ },
+ data: {
+ innerShow: false
+ },
+ ready: function ready() {
+ var buttons = this.data.buttons;
+ var len = buttons.length;
+ buttons.forEach(function (btn, index) {
+ if (len === 1) {
+ btn.className = 'weui-dialog__btn_primary';
+ } else if (index === 0) {
+ btn.className = 'weui-dialog__btn_default';
+ } else {
+ btn.className = 'weui-dialog__btn_primary';
+ }
+ });
+ this.setData({
+ buttons: buttons
+ });
+ },
+
+ methods: {
+ buttonTap: function buttonTap(e) {
+ var index = e.currentTarget.dataset.index;
+
+ this.triggerEvent('buttontap', { index: index, item: this.data.buttons[index] }, {});
+ },
+ close: function close() {
+ var data = this.data;
+ if (!data.maskClosable) return;
+ this.setData({
+ show: false
+ });
+ this.triggerEvent('close', {}, {});
+ },
+ stopEvent: function stopEvent() {}
+ }
+});
+
+/***/ })
+
+/******/ });
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/mp-dialog/dialog.json b/eaterplanet_ecommerce/components/mp-dialog/dialog.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/mp-dialog/dialog.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/mp-dialog/dialog.wxml b/eaterplanet_ecommerce/components/mp-dialog/dialog.wxml
new file mode 100644
index 0000000..a74c219
--- /dev/null
+++ b/eaterplanet_ecommerce/components/mp-dialog/dialog.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+ {{title}}
+
+
+
+
+
+
+
+
+ {{item.text}}
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/mp-dialog/dialog.wxss b/eaterplanet_ecommerce/components/mp-dialog/dialog.wxss
new file mode 100644
index 0000000..6dae715
--- /dev/null
+++ b/eaterplanet_ecommerce/components/mp-dialog/dialog.wxss
@@ -0,0 +1 @@
+.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-dialog__wrp{position:fixed;z-index:5000;top:16px;bottom:16px;left:16px;right:16px;text-align:center;font-size:0;display:-webkit-box;display:-webkit-flex;display:flex;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__wrp .weui-dialog{max-height:100%}.weui-dialog{background-color:#FFFFFF;text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:24px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;min-height:40px;font-size:17px;line-height:1.4;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:rgba(0,0,0,0.5)}.weui-dialog__bd:first-child{padding:32px 24px 0;font-weight:700;color:rgba(0,0,0,0.9);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__ft{position:relative;line-height:54px;min-height:54px;font-size:17px;display:flex}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-dialog__btn{display:block;flex:1;color:#576B95;font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#ECECEC}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:rgba(0,0,0,0.9)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}.weui-dialog.weui-dialog_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-dialog{opacity:1;-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1);transition:all .3s ease-in}.weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-mask{opacity:1;transform:scale3d(1, 1, 1);transition:all .3s ease-in}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/navigation-bar/index.js b/eaterplanet_ecommerce/components/navigation-bar/index.js
new file mode 100644
index 0000000..35f692a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/navigation-bar/index.js
@@ -0,0 +1,255 @@
+module.exports =
+Component({
+ onHide: function () { },
+ onUnload: function () { },
+ options: {
+ multipleSlots: true,
+ addGlobalClass: true
+ },
+ properties: {
+ extClass: {
+ type: String,
+ value: ''
+ },
+ background: {
+ type: String,
+ value: '',
+ observer: '_showChange'
+ },
+ backgroundColorTop: {
+ type: String,
+ value: 'rgba(44, 44, 44, 0)',
+ observer: '_showChangeBackgroundColorTop'
+ },
+ color: {
+ type: String,
+ value: 'rgba(0, 0, 0, 1)'
+ },
+ title: {
+ type: String,
+ value: ''
+ },
+ searchText: {
+ type: String,
+ value: '点我搜索'
+ },
+ titleimg: {
+ type: Boolean,
+ value: false
+ },
+ titleimgplus: {
+ type: Boolean,
+ value: false
+ },
+ weather: {
+ type: Boolean,
+ value: false
+ },
+ filter: {
+ type: Boolean,
+ value: false
+ },
+ group: {
+ type: Boolean,
+ value: false
+ },
+ searchBar: {
+ type: Boolean,
+ value: false
+ },
+ back: {
+ type: Boolean,
+ value: false
+ },
+ home: {
+ type: Boolean,
+ value: false
+ },
+ iconTheme: {
+ type: String,
+ value: 'black'
+ },
+ /* animated: {
+ type: Boolean,
+ value: true
+ },
+ show: {
+ type: Boolean,
+ value: true,
+ observer: '_showChange'
+ }, */
+ delta: {
+ type: Number,
+ value: 1
+ }
+ },
+ created: function created() {
+ this.getSystemInfo();
+ },
+ attached: function attached() {
+ this.setStyle(); // 设置样式
+ },
+
+ data: {},
+ pageLifetimes: {
+ show: function show() {
+ if (getApp().globalSystemInfo.ios) {
+ this.getSystemInfo();
+ this.setStyle(); // 设置样式1
+ }
+ },
+ hide: function hide() {}
+ },
+ methods: {
+ goResult: function (t) {
+ var a = t.detail.value.replace(/\s+/g, "");
+ a ? wx.navigateTo({
+ url: "/eaterplanet_ecommerce/pages/type/result?keyword=" + a
+ }) : wx.showToast({
+ title: "请输入关键词",
+ icon: "none"
+ });
+ },
+ setStyle: function setStyle(life) {
+ var _getApp$globalSystemI = getApp().globalSystemInfo,
+ statusBarHeight = _getApp$globalSystemI.statusBarHeight,
+ navBarHeight = _getApp$globalSystemI.navBarHeight,
+ capsulePosition = _getApp$globalSystemI.capsulePosition,
+ navBarExtendHeight = _getApp$globalSystemI.navBarExtendHeight,
+ ios = _getApp$globalSystemI.ios,
+ windowWidth = _getApp$globalSystemI.windowWidth;
+ var _data = this.data,
+ back = _data.back,
+ home = _data.home,
+ title = _data.title;
+
+ var rightDistance = windowWidth - capsulePosition.right; // 胶囊按钮右侧到屏幕右侧的边距
+ var leftWidth = windowWidth - capsulePosition.left; // 胶囊按钮左侧到屏幕右侧的边距
+
+ var navigationbarinnerStyle = ['color: ' + this.data.color, 'background: ' + this.data.background, 'height:' + (navBarHeight + navBarExtendHeight) + 'px', 'padding-top:' + statusBarHeight + 'px', 'padding-right:' + leftWidth + 'px', 'padding-bottom:' + navBarExtendHeight + 'px'].join(';');
+ var navBarLeft = [];
+ if (back && !home || !back && home) {
+ navBarLeft = ['width:' + capsulePosition.width + 'px', 'height:' + capsulePosition.height + 'px'].join(';');
+ } else if (back && home || title) {
+ navBarLeft = ['width:' + capsulePosition.width + 'px', 'height:' + capsulePosition.height + 'px', 'margin-left:' + rightDistance + 'px'].join(';');
+ } else {
+ navBarLeft = ['width:auto', 'margin-left:0px'].join(';');
+ }
+ if (life === 'created') {
+ this.data = {
+ navigationbarinnerStyle: navigationbarinnerStyle,
+ navBarLeft: navBarLeft,
+ navBarHeight: navBarHeight,
+ capsulePosition: capsulePosition,
+ navBarExtendHeight: navBarExtendHeight,
+ ios: ios
+ };
+ } else {
+ this.setData({
+ navigationbarinnerStyle: navigationbarinnerStyle,
+ navBarLeft: navBarLeft,
+ navBarHeight: navBarHeight,
+ capsulePosition: capsulePosition,
+ navBarExtendHeight: navBarExtendHeight,
+ ios: ios
+ });
+ }
+ },
+ _showChange: function _showChange() {
+ this.setStyle();
+ },
+
+ // 返回事件
+ back: function back() {
+ this.triggerEvent('back', { delta: this.data.delta });
+ },
+ home: function home() {
+ this.triggerEvent('home', { delta: this.data.delta });
+ },
+ search: function search() {
+ this.triggerEvent('search', {});
+ },
+ getMenuButtonBoundingClientRect: function getMenuButtonBoundingClientRect(systemInfo) {
+ var ios = !!(systemInfo.system.toLowerCase().search('ios') + 1);
+ var rect = void 0;
+ try {
+ rect = wx.getMenuButtonBoundingClientRect ? wx.getMenuButtonBoundingClientRect() : null;
+ if (rect === null) {
+ throw new Error('getMenuButtonBoundingClientRect error');
+ }
+ } catch (error) {
+ var gap = ''; // 胶囊按钮上下间距 使导航内容居中
+ var width = 96; // 胶囊的宽度
+ if (systemInfo.platform === 'android') {
+ gap = 8;
+ width = 96;
+ } else if (systemInfo.platform === 'devtools') {
+ if (ios) {
+ gap = 5.5; // 开发工具中ios手机
+ } else {
+ gap = 7.5; // 开发工具中android和其他手机
+ }
+ } else {
+ gap = 4;
+ width = 88;
+ }
+ if (!systemInfo.statusBarHeight) {
+ // 开启wifi的情况下修复statusBarHeight值获取不到
+ systemInfo.statusBarHeight = systemInfo.screenHeight - systemInfo.windowHeight - 20;
+ }
+ rect = {
+ // 获取不到胶囊信息就自定义重置一个
+ bottom: systemInfo.statusBarHeight + gap + 32,
+ height: 32,
+ left: systemInfo.windowWidth - width - 10,
+ right: systemInfo.windowWidth - 10,
+ top: systemInfo.statusBarHeight + gap,
+ width: width
+ };
+ }
+ return rect;
+ },
+ getSystemInfo: function getSystemInfo() {
+ var app = getApp();
+ if (app.globalSystemInfo && !app.globalSystemInfo.ios) {
+ return app.globalSystemInfo;
+ } else {
+ var systemInfo = wx.getSystemInfoSync();
+ var ios = !!(systemInfo.system.toLowerCase().search('ios') + 1);
+ var rect = this.getMenuButtonBoundingClientRect(systemInfo);
+
+ var navBarHeight = '';
+ if (!systemInfo.statusBarHeight) {
+ systemInfo.statusBarHeight = systemInfo.screenHeight - systemInfo.windowHeight - 20;
+ navBarHeight = function () {
+ var gap = rect.top - systemInfo.statusBarHeight;
+ return 2 * gap + rect.height;
+ }();
+
+ systemInfo.statusBarHeight = 0;
+ systemInfo.navBarExtendHeight = 0; // 下方扩展4像素高度 防止下方边距太小
+ } else {
+ navBarHeight = function () {
+ var gap = rect.top - systemInfo.statusBarHeight;
+ return systemInfo.statusBarHeight + 2 * gap + rect.height;
+ }();
+ if (ios) {
+ systemInfo.navBarExtendHeight = 4; // 下方扩展4像素高度 防止下方边距太小
+ } else {
+ systemInfo.navBarExtendHeight = 0;
+ }
+ }
+ systemInfo.navBarHeight = navBarHeight; // 导航栏高度不包括statusBarHeight
+ systemInfo.capsulePosition = rect;
+ systemInfo.ios = ios; // 是否ios
+
+ app.globalSystemInfo = systemInfo; // 将信息保存到全局变量中,后边再用就不用重新异步获取了
+
+ // console.log('systemInfo', systemInfo);
+ return systemInfo;
+ }
+ }
+
+ }
+});
+
diff --git a/eaterplanet_ecommerce/components/navigation-bar/index.json b/eaterplanet_ecommerce/components/navigation-bar/index.json
new file mode 100644
index 0000000..9c90020
--- /dev/null
+++ b/eaterplanet_ecommerce/components/navigation-bar/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+
+ }
+}
diff --git a/eaterplanet_ecommerce/components/navigation-bar/index.wxml b/eaterplanet_ecommerce/components/navigation-bar/index.wxml
new file mode 100644
index 0000000..8b63c66
--- /dev/null
+++ b/eaterplanet_ecommerce/components/navigation-bar/index.wxml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{title}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/navigation-bar/index.wxss b/eaterplanet_ecommerce/components/navigation-bar/index.wxss
new file mode 100644
index 0000000..831070b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/navigation-bar/index.wxss
@@ -0,0 +1,260 @@
+.page {
+ --height: 44px; /* 4*2+32 */
+ --right: 97px; /* 10+87 */
+ --navBarExtendHeight: 4px;
+ box-sizing: border-box;
+}
+.page-group{
+
+ background-color: rgba(00, 00, 00, 1);
+ width: 100%;
+
+ position: absolute;
+ top: 50rpx;
+ left: 0;
+ z-index: 23;
+
+}
+.group{
+
+ background-color: rgba(77, 158, 233, 1);
+ width: 100%;
+ display: block;
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 1000;
+
+}
+ .filter {
+ background: #4d9ee986;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 899;
+ width: 100%;
+ height: calc(var(--height) + var(--navBarExtendHeight));
+ backdrop-filter: blur(40rpx) ;
+ overflow: hidden;
+}
+.filter .ios {
+ --height: 90px;
+ box-sizing: border-box; /* 8*2+32 */
+}
+.filter .android {
+ --height: 48px;
+ box-sizing: border-box; /* 8*2+32 */
+}
+.filter .devtools {
+ --height: 42px;
+ box-sizing: border-box;/* 5*2+32 */
+}
+
+.navbar {
+
+ position:relative;
+ opacity: 1;
+
+}
+
+.navbar .android {
+ --height: 48px;
+ box-sizing: border-box; /* 8*2+32 */
+}
+.navbar .devtools {
+ --height: 42px;
+ box-sizing: border-box;/* 5*2+32 */
+}
+.navbar-inner {
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 5001;
+ height: var(--height);
+ display: flex;
+ align-items: center;
+ padding-right: var(--right);
+ width: 100%;
+ padding-bottom: var(--navBarExtendHeight);
+ box-sizing: border-box;
+}
+.navbar-inner .navbar-left {
+ position: relative;
+ width: var(--right);
+ height: 32px;
+ /* padding-left: 10px; */
+ display: flex;
+ align-items: center;
+ box-sizing: border-box;
+}
+.navbar-buttons {
+ height: 100%;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ border-radius: 15px;
+ border: 1rpx solid rgba(204, 204, 204, 0.6);
+ position: relative;
+ box-sizing: border-box;
+}
+.navbar-buttons.android {
+ border: 1rpx solid rgba(234, 234, 234, 0.6);
+ box-sizing: border-box;
+}
+.navbar-buttons::after {
+ position: absolute;
+ content: '';
+ width: 1rpx;
+ height: 18.4px;
+ background: rgba(204, 204, 204, 0.6);
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ box-sizing: border-box;
+}
+.navbar-buttons.android::after {
+ background: rgba(234, 234, 234, 0.6);
+}
+.navbar-button {
+ width: 50%;
+ height: 100%;
+ display: flex;
+ font-size: 12px;
+ background-repeat: no-repeat;
+ background-position: center center;
+ background-size: 1em 2em;
+}
+
+.navbar-inner .navbar-left .navbar-btn_goback:active,
+.navbar-inner .navbar-left .navbar-btn_gohome:active {
+ opacity: 1;
+}
+.navbar-inner .navbar-center {
+ font-size: 34rpx;
+ line-height: 34rpx;
+ text-align: center;
+ position: relative;
+ flex: 1;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding-left: 20rpx;
+}
+.navbar-inner .navbar-center {
+ margin-top: -2px;
+}
+.navbar-inner .navbar-loading {
+ font-size: 0;
+}
+.navbar-inner .navbar-loading .navbar-loading {
+ margin-left: 0;
+}
+.navbar-inner .navbar-right {
+ margin-right: 10px;
+}
+.navbar-placeholder {
+ height: var(--height);
+ background: #f8f8f8;
+ position: relative;
+ z-index: 50;
+}
+
+.navbar-search {
+ width: 520rpx;
+ display: flex;
+ align-content: center;
+ align-items: center;
+ height: 60rpx;
+ border-radius: 30rpx;
+ position: relative;
+ background: #f6f6f6;
+}
+
+.navbar-search-input {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ align-content: center;
+ color: #999;
+ font-size: 15px;
+ line-height: 15px;
+}
+.navbar-inner .navbar-left .navbar-btn_goback {
+ background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E");
+}
+.navbar-inner .navbar-left .navbar-btn_goback.white {
+ background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z' fill='%23ffffff'/%3E%3C/svg%3E");
+}
+.navbar-inner .navbar-left .navbar-btn_gohome {
+ background-image: url("data:image/svg+xml,%3Csvg t='1565752242401' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4326' width='48' height='48'%3E%3Cpath d='M931.148 451.25L591.505 97.654c-21.106-21.953-49.313-34.034-79.551-34.034-30.235 0-58.448 12.081-79.554 34.034L92.76 451.25c-35.049 36.498-30.536 68.044-24.742 81.222 4.13 9.35 18.07 35.05 58.231 35.05h49.78v272.016c0 61.756 44.342 119.906 107.357 119.906h144.587v-287.87c0-30.866-4.675-48.062 26.848-48.062h114.268c31.52 0 26.845 17.196 26.845 48.061v287.872h144.588c63.013 0 107.358-58.15 107.358-119.906V567.523h49.782c40.16 0 54.1-25.7 58.229-35.05 5.793-13.18 10.306-44.726-24.743-81.224z m-33.486 60.28h-105.77v328.007c0 30.865-19.877 63.917-51.37 63.917h-88.6V671.572c0-61.761-19.79-104.05-82.832-104.05H454.821c-63.045 0-82.836 42.289-82.836 104.05v231.883h-88.599c-31.495 0-51.37-33.052-51.37-63.917V511.529H126.25c-0.984 0-1.888-3.852-2.708-3.907 1.94-3.388 5.276-11.975 10.825-17.743l339.671-353.35c10.142-10.578 24.467-17.057 38.353-16.924 13.888-0.133 27.342 6.346 37.483 16.923L889.54 489.88c5.549 5.768 8.885 14.355 10.825 17.743-0.818 0.055-1.72 3.907-2.704 3.907z' fill='%23000000' p-id='4327'%3E%3C/path%3E%3C/svg%3E");
+ background-size: 22px 22px;
+}
+.navbar-inner .navbar-left .navbar-btn_gohome.white {
+ background-image: url("data:image/svg+xml,%3Csvg t='1565752242401' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4326' width='48' height='48'%3E%3Cpath d='M931.148 451.25L591.505 97.654c-21.106-21.953-49.313-34.034-79.551-34.034-30.235 0-58.448 12.081-79.554 34.034L92.76 451.25c-35.049 36.498-30.536 68.044-24.742 81.222 4.13 9.35 18.07 35.05 58.231 35.05h49.78v272.016c0 61.756 44.342 119.906 107.357 119.906h144.587v-287.87c0-30.866-4.675-48.062 26.848-48.062h114.268c31.52 0 26.845 17.196 26.845 48.061v287.872h144.588c63.013 0 107.358-58.15 107.358-119.906V567.523h49.782c40.16 0 54.1-25.7 58.229-35.05 5.793-13.18 10.306-44.726-24.743-81.224z m-33.486 60.28h-105.77v328.007c0 30.865-19.877 63.917-51.37 63.917h-88.6V671.572c0-61.761-19.79-104.05-82.832-104.05H454.821c-63.045 0-82.836 42.289-82.836 104.05v231.883h-88.599c-31.495 0-51.37-33.052-51.37-63.917V511.529H126.25c-0.984 0-1.888-3.852-2.708-3.907 1.94-3.388 5.276-11.975 10.825-17.743l339.671-353.35c10.142-10.578 24.467-17.057 38.353-16.924 13.888-0.133 27.342 6.346 37.483 16.923L889.54 489.88c5.549 5.768 8.885 14.355 10.825 17.743-0.818 0.055-1.72 3.907-2.704 3.907z' fill='%23ffffff' p-id='4327'%3E%3C/path%3E%3C/svg%3E");
+ background-size: 22px 22px;
+}
+.navbar-search-icon {
+ position: absolute;
+ left: 20rpx;
+ margin-left: rpx;
+ margin-right: 12rpx;
+ width: 28px;
+
+ height: 28px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-image: url("data:image/svg+xml,%3Csvg t='1565691512239' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1240' width='48' height='48'%3E%3Cpath d='M819.2 798.254545L674.909091 653.963636c46.545455-48.872727 74.472727-114.036364 74.472727-186.181818 0-151.272727-123.345455-274.618182-274.618182-274.618182-151.272727 0-274.618182 123.345455-274.618181 274.618182 0 151.272727 123.345455 274.618182 274.618181 274.618182 65.163636 0 128-23.272727 174.545455-62.836364l144.290909 144.290909c2.327273 2.327273 6.981818 4.654545 11.636364 4.654546s9.309091-2.327273 11.636363-4.654546c6.981818-6.981818 6.981818-18.618182 2.327273-25.6zM235.054545 467.781818c0-132.654545 107.054545-239.709091 239.709091-239.709091 132.654545 0 239.709091 107.054545 239.709091 239.709091 0 132.654545-107.054545 239.709091-239.709091 239.709091-132.654545 0-239.709091-107.054545-239.709091-239.709091z' fill='%23999999' p-id='1241'%3E%3C/path%3E%3C/svg%3E");
+ background-repeat: no-repeat;
+ background-size: cover;
+}
+
+.navbar-img-icon {
+ position: absolute;
+ left: 20rpx;
+ width: 64rpx;
+ height: 64rpx;
+ display: flex;
+ filter: drop-shadow(0 0rpx 5rpx rgba(0,0,0,0.3));
+ align-items: center;
+ justify-content: center;
+ background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAArlBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8tivQqAAAAOXRSTlMADAMGvy4ioAj0MujU0IzemoNOPigZ7+O4tKqVY1VFQjbaxXZaFfr3rkvsyqSQe3FoOh0SDtZuEH8l89QcAAADU0lEQVRYw7WX55LqMAyFj9MIJZTQQ91AqLu0pfn9X+wOkCIbJ8DO3O8XIJBlSUcKSEGz3E21uz5VKqd1t7pxGzo+QK9fjSIXWPm1kY33aO6MGVcw88+Hd36++eKpVK6vXGj9Es/ka5eZDHPBX9ItIJVpm79BsZ8W/pW/SVlX1q7K3ybH8ISd4x/gPXnQqvwjvuVb1PiHlKX8848RatEocgWtktH1vK5xyiutBZKALn+m0zeP2t36aw7KDn/CSMTVV1iXGigX9/mQLUKCypPwakzRpye5JSNlXblsGUCFtVBXotmWf1+HGrsnTRkLN85cJL9EKlK7be5u18rA1DCfU0q3VNVnUgAmMqjPOeUWbFkeW0dkIWquB+i+LFXg/RAchkaLvq/6uSYyYUJPzseYite38YoOp+wEHc+2eE1XLJmYFA8xb2ZxIUbUGVoBY0FjXB8VfqFm3OIEH47Uxo7jVFbzGc+XegUo2QmthC9h7/T6gySk1fb1JSpok9MntxJuibkGysUO1UcObRMH/iPkCScMaAeY0SQeUAfxMDGa4fd6JXJFkkrTQoRHruBErxLz77cqBFbXEVHIJ0k04gGXMKRqiWjUVXn0EZ7WauDO0Tro+g9Z5omKaFX387iRamEo2uOY4XjvfvOEKiKWDboJo8B/IjFV7v6boyMQkFbgQ0QMTNUq3MEM81HsMWDcfPjftuIDYtwRCMtQfnvo66gLL0AsgGG12nFKxlYjGpgKipjHQ7EcCQkIdgFCmgXNPmogsH4gOIhTNIqmiZcrrawkzyNIDF1ExM14+8h2lDtbG8hitKcHRITVP13k5jeSqH+nDCKTRWx150RsB/pwQMKsm9IV2rzKwpdF2n3CWPTtpHeH4vn5+9ZngLVpiUU+tIV1F2HRHRlXa73oRF8vxik/09EeZ98U67CfcYlJbNMNOtbCi2lmAEogP8WvSZLNFjVYD6/HzI3C83sQ+tTkjNJmKeUMgbK4r1T8SHtZRCdDwNNeO1jYkGDe42a5mjeGEvqA1FXsLXaLoeUiFY+cf4ECvZz1dEFr3WNQ089nOChMwpZfnZHKaMOQxrJwvLeSsUcGmp7+b9a+DeD2hOFvmEPo5dWPhT+iu5Y2npj4M7YFranhP/APIKuEh5ZCRwQAAAAASUVORK5CYII=');
+
+
+ background-repeat: no-repeat;
+ background-size: contain;
+}
+.navbar-img-plus {
+ position: absolute;
+ margin-top: 14rpx;
+ left: 92rpx;
+ width: 168rpx;
+ height: 32rpx;
+ display: flex;
+ filter: drop-shadow(0 0rpx 5rpx rgba(0,0,0,0.3));
+ align-items: center;
+ justify-content: center;
+ background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVMAAABBCAMAAABb/LdiAAAAM1BMVEUAAAD///////////////////////////////////////////////////////////////+3leKCAAAAEHRSTlMAgEC/7yAQYN+fj89wMFCvp7wr3QAABlFJREFUeNrcmdly2zAMRQHupEQJ//+17ai1bxOKNhe1UXqeMhkHEo8vwSXUiAae+kj4q9elM30f9AMaJguw1MUmB0w15IGiNjwfRD1AkF/QJCKfClk+UNTMCqWRunDmcqda5lFXO3VyEKiZfTimUb6DU8s1VKNTWuTAUytmNKZKvoVTJTW41SkjqJZfoj4/ctEv8MXMD3/PaeAayXCNeLXTooTHjxUY3wFof4Ek806zV6dONdWI9Rmo3sz9ZwZi39zHXDauzakedKpkzqndWBsRbnWKFu77nJZ9RXWuUVhzuM2pDDpdxp06xXuQg06nK4r9Q6fYG5nnQ3TRdzAceF/VSyx9gGXMaV7jIqDPqZcDk69zKn2QOn3vj79OY4u+Nf1OrU9aQLdTfP/G3trpIs/224OWPqfM2sgZvt1pRoXF3dipg5cevDQ7rWN2VpVjhK5NDUi9r9NtKKbOzDrVyVs6gQVO1QM+WORPgtaJn2zqJ9evUSUtTtNQTKM0Oc2rnBDiWh8UPz4j3ejtJk7DSEyV1J3C526kYCniWcupZSM9REt0D6dWfpGoh6x+s5w7VaylRLNyVFKf+36RRgI7ors49biQGkEX9d2WtJyQMI42pwcqSgPHVcR9nEbsTS9w6tZl9k4TTg8aWkBE6RGnGYeaqlOrHrgGpwExnXWKwmAZdwp8kCqGLdGU0xVTqeo04YK5wSm43KnZvaUZp2CTCsERTTrFtlBXnQacNb/QaUgbXm/aaZIaKxGwQ/2UobDi1CKmX+Z0X9GarnC6SRWTp++lEFRVcboipo1O+R2q3SkCOuu0eib1mYOAZdopgsoVpztubhqdyju42aldbW1bErmCeutUCzrKr/oqQjOX49q6nCKouuIUj/oCpyXSVx1OyxiZqAge/FNQLsfV5xRPOHeKK5H/xWl+7OsdfcRywA3VjFMENZ86TSjb6lSdYm7i1IXj6GmLyugBadIpgrqWTosrkZF1H09BZ67i361iDMb6aRQTM52BHqDmnCKo+5lTi6qDTsuldqN/Ccsc5bhwtFw+/+etuGE8c7oiplNOtTzZ6SXfwWm1ZhFUe+J0R9EZp756+gNZT+Nv4/TxEV86dYjpjFNnGu6T1JVjB/5HOWe63DYMA+HyPqzr/Z+202Sma2tFhUA1jOrsX4mJ+ZkGF+DhoNUoNFkbhEzR5UJMaTuokulK3R7A9Eop6qeL+aPETK35UPw3pstz5vdTmF65HsWKmW1U+28Xq9CkZgos/xXTSpW0Q1kdF27b3IAb3oapJRs1lCm+Ufc+4xTLHT5+A9OMuPM2TA3ZKAVTmNcqbDs/LbSSKBVqKd6KaQDSKh9rHECcsG3drpC9FVNHm7zGMvXvx3TaNir1jmS6fHVaw+OFE80ypghVEzMNyKRVTKMnGzWWacFi2kh/mvCAx2lGVzRMVzIyg5l6xJ2RTOvWrPXhoVcxXSiBGsx0QdwZyvSBaZmYwooEBdOYqQ6tZBpWrL9L2q6IO0OZbifrUSCeFEwrnZHUMY2Gzk/0tY0Y20OZWlSMmCkm7ipnaqkOrWHKW8ay7WYKxz6QKaBNR0zh2Z2cKe3BUzG1biOtYf/SvepSKwLm6T4UMVNDv1YF01AaOxq7mVrTEB8ZbSvImGaUjA6ZJjQTMZ2pDi1mikDKyraTqRmfR0XMQUdMYdsnIVMHGyVnyoGU5cJdmS4owx0yxW5yGdOJEigZUw6kvuwZ19jBNDloUG5qQAzjFikAqGcR0+BRh1Yw5UDqTeSDI97cco5y8OSHCQsibsRTLBrxuehPwaNHOVMOpHmKx6M3pxsy9Ug9P7SwTa9oZzvXLReKRCKmKRM4aHcc52GHMz0JHAn2s3Luk/YzuOlnGj3q0ELxUHTIa48NlgOOMUzPCMApzbx8E/bm3fUzrbBRYsX6au+5rxwb1nAnpp8dyDxdr5S3+957e0D+vA7dAauE9ouZqI5i+gUB92p3Zk//AoyC+HMWwd0d7Eh95Tf4ZRira5nq9UwrLqWxHudll3Y55U4c+yDzdK7kyFjxgFLlpqwkmGu5iM+1ucKcr2ca3MtUH+XzWU40Yq6Tk91WmMD0rF7vrmbanJoefYOCTYCz38+0/HXzYOpLaCzr/JJcjynceD/Rg26FZgXJXKgk6n16/mzT3KYUfgMiLs6L5j6d2gAAAABJRU5ErkJggg==');
+ overflow: visible;
+ background-repeat: no-repeat;
+ background-size: contain;
+}
+
+.navbar-img {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 32px;
+ border-radius: 16px;
+ position: relative;
+
+}
diff --git a/eaterplanet_ecommerce/components/new-auth/index.js b/eaterplanet_ecommerce/components/new-auth/index.js
new file mode 100644
index 0000000..b963394
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-auth/index.js
@@ -0,0 +1,210 @@
+var util = require('../../utils/util.js');
+var location = require('../../utils/Location.js');
+
+var app = getApp();
+const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
+const defaultAvatarUrl2 = 'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132'
+
+Component({
+ properties: {
+ needAuth: {
+ type: Boolean,
+ value: false
+ },
+ needPosition: {
+ type: Boolean,
+ value: true
+ },
+ navBackUrl: {
+ type: String,
+ value: '',
+ observer: function (t) {
+ if (t) app.globalData.navBackUrl = t;
+ }
+ },
+ nickName: {
+ type: String,
+ value: '',
+ }
+ },
+ attached: function () {
+ this.setData({
+ skin: getApp().globalData.skin,
+ })
+ this.getBg();
+ },
+ data: {
+ nickname: '微信用户',
+ avatarUrl: defaultAvatarUrl2,
+ image_o: '',
+ btnLoading: false,
+ loginSuccess: false,
+ canIUse: wx.canIUse('button.open-type.getUserInfo')
+ },
+ methods: {
+ onChooseAvatar(e) {
+ this.setData({
+ avatarUrl: e.detail.avatarUrl
+ })
+ },
+ getBg: function () {
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.get_newauth_bg'
+ },
+ dataType: 'json',
+ success: function (res) {
+ that.setData({
+ loaded: true
+ })
+ if (res.data.code == 0) {
+ let {
+ newauth_bg_image,
+ newauth_confirm_image,
+ newauth_cancel_image
+ } = res.data.data;
+ that.setData({
+ newauth_bg_image,
+ newauth_confirm_image,
+ newauth_cancel_image
+ })
+ }
+ }
+ })
+ },
+ close: function () {
+ this.triggerEvent("cancel");
+ },
+ bindGetUserInfo: function (t) {
+ var that = this;
+ if (!this.data.btnLoading) {
+ var n = t.detail;
+ if (this.setData({
+ btnLoading: true
+ }), "getUserInfo:ok" === n.errMsg) {
+ util.login_prosime(that.data.needPosition).then(function () {
+ console.log("授权成功")
+ that.setData({
+ btnLoading: false
+ });
+ wx.showToast({
+ title: '登录成功',
+ icon: 'success',
+ duration: 2000
+ })
+ that.triggerEvent("authSuccess");
+ app.globalData.changedCommunity = true;
+ //检查获取位置权限
+ that.data.needPosition && location.getGps();
+ }).catch(function () {
+ that.triggerEvent("cancel");
+ console.log('授权失败');
+ })
+ } else {
+ wx.showToast({
+ title: "授权失败,为了完整体验,获取更多优惠活动,需要您的授权。",
+ icon: "none"
+ });
+ this.triggerEvent("cancel");
+ this.setData({
+ btnLoading: false
+ });
+ }
+ }
+ },
+ getProfile: function () {
+ wx.removeStorageSync('token');
+ var that = this;
+ if (!that.data.btnLoading) {
+ wx.getUserProfile({
+ desc: "获取你的昵称、头像、地区及性别",
+ success: function (msg) {
+ var userInfo = msg.userInfo
+ wx.setStorage({
+ key: "userInfo",
+ data: userInfo
+ })
+ that.setData({
+ btnLoading: true,
+ });
+ util.login_promise(that.data.needPosition, userInfo).then(res => {
+ userInfo.nickName = that.data.nickname
+ userInfo.avatarUrl = that.data.avatarUrl
+ var member_info = wx.getStorageSync('member_info');
+ if (member_info!==null) {
+ member_info.username = that.data.nickname
+ member_info.avatar = that.data.avatarUrl
+ }
+ wx.showToast({
+ title: '登录成功',
+ icon: 'success',
+ duration: 2000
+ })
+ console.log("查询用户数据", that)
+ that.triggerEvent("authSuccess", res);
+ console.log("授权成功")
+ app.globalData.changedCommunity = true;
+ //检查获取位置权限
+ that.data.needPosition && location.getGps();
+ }).catch(function () {
+ that.triggerEvent("cancel");
+ console.log('授权失败');
+ })
+ },
+ fail: () => {
+ wx.showToast({
+ title: "授权失败,为了完整体验,获取更多优惠活动,需要您的授权。",
+ icon: "none"
+ });
+ that.triggerEvent("cancel");
+ that.setData({
+ btnLoading: false
+ });
+ }
+ });
+ }
+ },
+
+ checkWxLogin: function () {
+ return new Promise((resolve, reject) => {
+ wx.getSetting({
+ success(res) {
+ if (!res.authSetting['scope.userInfo']) {
+ return reject({
+ authSetting: false
+ });
+ } else {
+ wx.getStorage({
+ key: 'token',
+ success(token) {
+ util.check_login_new().then(isLogin => {
+ if (isLogin) {
+ // 已登录未过期
+ return resolve(false);
+ console.log('已登录未过期')
+ } else {
+ console.log('过期')
+ if (token) {
+ return resolve(token);
+ } else {
+ return reject(res);
+ }
+ }
+ })
+ },
+ fail(res) {
+ return reject(res);
+ }
+ })
+ }
+ },
+ fail(res) {
+ return reject(res);
+ }
+ })
+ })
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/new-auth/index.json b/eaterplanet_ecommerce/components/new-auth/index.json
new file mode 100644
index 0000000..7b873d8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-auth/index.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-modal": "../modal/index",
+ "i-button": "../button/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/new-auth/index.wxml b/eaterplanet_ecommerce/components/new-auth/index.wxml
new file mode 100644
index 0000000..a907586
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-auth/index.wxml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+ 暂不登录
+
+
+
+ 请升级微信版本
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/new-auth/index.wxss b/eaterplanet_ecommerce/components/new-auth/index.wxss
new file mode 100644
index 0000000..f39b2a8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-auth/index.wxss
@@ -0,0 +1,93 @@
+.auth-content {
+ width: 400rpx;
+ min-height: 200rpx;
+ max-height: 500rpx;
+ border-radius: 24rpx;
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-end;
+}
+
+.auth-content .bg {
+ width: 400rpx;
+ margin-top: -100rpx;
+}
+
+.auth-content .h1 {
+ color: #000;
+ font-size: 32rpx;
+ margin-bottom: 20rpx;
+ font-weight: bold;
+}
+
+.auth-content .h2 {
+ font-size: 24rpx;
+ line-height: 36rpx;
+ color: #999;
+ width: 408rpx;
+ margin-bottom: 44rpx;
+}
+
+.auth-content .h2 {
+ text-align: center;
+ display: block;
+}
+
+.auth-content .btn {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: -200rpx;
+
+ align-items: center;
+ justify-content: center;
+ font-size: 28rpx;
+}
+
+.auth-content .btn .close-btn {
+ color: #fff;
+ border: 1rpx solid #fff;
+ border-radius: 36rpx;
+ margin: 0 15rpx;
+ text-align: center;
+ height: 64rpx;
+ line-height: 64rpx;
+}
+
+.auth-content .btn .close-img {
+ margin: 0 15rpx;
+}
+
+.auth-content .btn .img {
+ width: 180rpx;
+}
+
+.auth-content .confirm {
+ height: 64rpx;
+ line-height: 64rpx;
+ font-size: 29rpx;
+ background: #fff;
+ border-radius: 36rpx;
+ margin: 20rpx 15rpx;
+}
+
+.auth-content .confirm-img {
+ width: 180rpx;
+ height: 64rpx;
+ line-height: 64rpx;
+ margin: 0 15rpx;
+ padding: 0;
+}
+
+.updateWx {
+ width: 425rpx;
+ height: 64rpx;
+ line-height: 64rpx;
+ color: #fff;
+ background: #4facfe;
+ border-radius: 36rpx;
+ margin: 0 0 30rpx;
+ text-align: center;
+}
diff --git a/eaterplanet_ecommerce/components/new-comer/index.js b/eaterplanet_ecommerce/components/new-comer/index.js
new file mode 100644
index 0000000..5bd7abb
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-comer/index.js
@@ -0,0 +1,94 @@
+// eaterplanet_ecommerce/components/new-comer/index.js
+var app = getApp();
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ refresh: {
+ type: Boolean,
+ value: false,
+ observer: function (t) {
+ let that = this;
+ if (t) this.setData({ pageNum: 1, noMore: false, list: [] }, () => { that.getData() })
+ }
+ },
+ skin: {
+ type: Object
+ },
+ diyData: {
+ type: Object
+ },
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ disabled: false,
+ list: [],
+ pageNum: 1,
+ noMore: false
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ getData: function() {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.load_new_buy_goodslist',
+ token: token,
+ pageNum: that.data.pageNum,
+ head_id: cur_community.communityId
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let oldList = that.data.list;
+ let list = oldList.concat(res.data.list);
+ that.setData({ list })
+ } else {
+ that.setData({ noMore: true })
+ }
+ }
+ })
+ },
+ getMore: function(){
+ if(this.data.noMore) return;
+ let that = this;
+ let pageNum = that.data.pageNum+1;
+ console.log(pageNum)
+ this.setData({ pageNum },
+ ()=>{
+ that.getData();
+ })
+ },
+ openSku: function (e) {
+ let idx = e.currentTarget.dataset.idx;
+ this.setData({ disabled: false })
+ let spuItem = this.data.list[idx];
+ this.triggerEvent("openSku", {
+ actId: spuItem.actId,
+ skuList: spuItem.skuList,
+ promotionDTO: spuItem.promotionDTO || '',
+ is_take_vipcard: spuItem.is_take_vipcard,
+ is_mb_level_buy: spuItem.is_mb_level_buy,
+ allData: {
+ spuName: spuItem.spuName,
+ skuImage: spuItem.skuImage,
+ actPrice: spuItem.actPrice,
+ canBuyNum: spuItem.spuCanBuyNum,
+ stock: spuItem.spuCanBuyNum,
+ marketPrice: spuItem.marketPrice
+ }
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/new-comer/index.json b/eaterplanet_ecommerce/components/new-comer/index.json
new file mode 100644
index 0000000..af994ed
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-comer/index.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../img/index",
+ "i-button": "../button/index",
+ "i-router-link": "../router-link/router-link",
+ "i-addcart": "../addCartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/new-comer/index.wxml b/eaterplanet_ecommerce/components/new-comer/index.wxml
new file mode 100644
index 0000000..0411b9c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-comer/index.wxml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ {{diyData.list[0].title}}
+
+
+
+
+ 新人专享
+
+
+
+
+
+
+
+ {{item.label_info.tagcontent}}
+
+
+ 已抢光
+ {{item.spuName}}
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/new-comer/index.wxss b/eaterplanet_ecommerce/components/new-comer/index.wxss
new file mode 100644
index 0000000..fb060fc
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-comer/index.wxss
@@ -0,0 +1,194 @@
+/* 新人专享 */
+.new-comers {
+ position: relative;
+ padding: 20rpx 0;
+ margin: 20rpx;
+ background: #fff;
+ border-radius: 10rpx;
+ overflow: hidden;
+ z-index: 0;
+}
+
+.new-comers-title {
+ position: relative;
+ margin-bottom: 20rpx;
+ font-size: 30rpx;
+ font-weight: bold;
+ color: #333;
+ padding-left: 20rpx;
+}
+
+.leftBorder {
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ border-left: 8rpx solid #4facfe;
+}
+
+.new-comers-scroll {
+ max-height: 340rpx;
+}
+
+.new-comers-wrap {
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+}
+
+.new-comers-item {
+ width: 240rpx;
+ box-sizing: border-box;
+ padding: 20rpx;
+ font-size: 28rpx;
+}
+
+.new-comers-item .new-img {
+ width: 200rpx;
+ height: 180rpx;
+ margin-bottom: 20rpx;
+}
+
+.new-comers-item .title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.new-comers-item .new-bot {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 10rpx;
+}
+
+.new-comers-item .add-cart {
+ width: 44rpx;
+ height: 44rpx;
+ padding: 0;
+ margin: 0;
+}
+
+.new-comers-item .add-cart .img {
+ width: 44rpx;
+ height: 44rpx;
+ display: block;
+}
+
+.new-comers-item .price {
+ color: #ff758c;
+}
+
+.new-comers-item {
+ position: relative;
+}
+
+.new-comers-item .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 80rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+/* 标签 */
+.new-comers-item .item-tag {
+ position: absolute;
+ left: 20rpx;
+ top: 20rpx;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.new-comers-item .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.new-comers-item .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.onlyThree .new-comers-item {
+ width: 236rpx!important;
+}
+
+.onlyThree .new-comers-item .new-img {
+ width: 196rpx!important;
+ height: 196rpx!important;
+}
+
+/* diy */
+.diylist-theme-bg {
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ height: 160rpx;
+}
+
+.diylist-theme-red {
+ background: linear-gradient(180deg, #FFD8D8, transparent);
+}
+
+.diylist-theme-blue {
+ background: linear-gradient(180deg, #D7FAFF, transparent);
+}
+
+.diylist-theme-yellow {
+ background: linear-gradient(180deg, #FFF4E0, transparent);
+}
+
+.diylist-theme-violet {
+ background: linear-gradient(180deg, #F9E5FF, transparent);
+}
+
+.diylist-head {
+ position: relative;
+ line-height: 30rpx;
+ height: 30rpx;
+ padding: 30rpx 20rpx 10rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.diylist-s1-lefticon {
+ width: 125rpx;
+ height: 30rpx;
+ flex-shrink: 0;
+ margin-right: 20rpx;
+}
+
+.diylist-s1-name {
+ color: #909399;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ flex: 1;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/new-rush-spu/index.js b/eaterplanet_ecommerce/components/new-rush-spu/index.js
new file mode 100644
index 0000000..14a267c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-rush-spu/index.js
@@ -0,0 +1,5 @@
+var goodsBehavior = require('../behavior/goods.js');
+
+Component({
+ behaviors: [goodsBehavior]
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/new-rush-spu/index.json b/eaterplanet_ecommerce/components/new-rush-spu/index.json
new file mode 100644
index 0000000..8c65565
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-rush-spu/index.json
@@ -0,0 +1,12 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../button/index",
+ "i-img": "../img/index",
+ "i-sku": "../sku/index",
+ "i-router-link": "../router-link/router-link",
+ "i-input-number": "../input-number/index",
+ "i-vip-price": "../vipPrice/vipPrice",
+ "i-addcart": "../addCartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/new-rush-spu/index.wxml b/eaterplanet_ecommerce/components/new-rush-spu/index.wxml
new file mode 100644
index 0000000..d33af50
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-rush-spu/index.wxml
@@ -0,0 +1,65 @@
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/new-rush-spu/index.wxss b/eaterplanet_ecommerce/components/new-rush-spu/index.wxss
new file mode 100644
index 0000000..c25b0c6
--- /dev/null
+++ b/eaterplanet_ecommerce/components/new-rush-spu/index.wxss
@@ -0,0 +1,364 @@
+.i-btn {
+ text-align: center;
+ vertical-align: middle;
+ touch-action: manipulation;
+ cursor: pointer;
+ background-image: none;
+ white-space: nowrap;
+ user-select: none;
+ font-size: 28rpx;
+ border: 0 !important;
+ position: relative;
+ text-decoration: none;
+ height: 88rpx;
+ line-height: 88rpx;
+ background: none;
+ color: #495060;
+ border-radius: 0;
+ margin: 0;
+ box-shadow: none;
+}
+
+.i-btn::after {
+ border: none;
+}
+
+.spu {
+ width: 100%;
+ display: block;
+}
+
+.spu .img-class {
+ width: 285rpx;
+ height: 285rpx;
+ box-shadow:inset 0 0 10rpx rgba(0,0,0,0.1);
+ border-radius: 20rpx 0rpx 0rpx 20rpx;
+}
+
+.spu .mask {
+ background: rgba(255,255,255,0.5);
+ width: 285rpx;
+ height: 285rpx;
+ position: absolute;
+ left: 0rpx;
+ top: 0rpx;
+ border-radius: 20rpx 0rpx 0rpx 20rpx;
+}
+
+.spu .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.6);
+ color: #fff;
+ font-size: 30rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 142rpx;
+ top: 122rpx;
+ padding: 0 30rpx;
+ transform: translateX(-50%);
+}
+
+.spu .act-end.act-out {
+ left: 140rpx;
+}
+
+.spu .spu-content {
+ background:linear-gradient(100deg, #cbebfd 0%, #cbebfd 1%, #e5e8eb 100%);
+ width: 710rpx;
+ border-radius: 20rpx;
+ overflow: hidden;
+ position: relative;
+ box-shadow: -10rpx -10rpx 30rpx 5rpx #ffffff,10rpx 10rpx 20rpx 0rpx #4571a1a1;
+ margin: 0 auto 20rpx;
+ display: flex;
+
+ box-sizing: border-box;
+}
+
+.spu .spu-content.disabled {
+ opacity: 0.6;
+}
+
+.spu .spu-content .item-left {
+ width: 285rpx;
+ height: 285rpx;
+ position: relative;
+ border-radius: 20rpx 20rpx 20rpx 20rpx;
+}
+
+.spu .spu-content .item-right {
+ box-sizing: border-box;
+
+ padding: 20rpx 20rpx 20rpx 20rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ box-shadow: -12rpx 0rpx 10rpx -10rpx rgba(27, 27, 27, 0.39);
+}
+
+.spu .spu-content .item-right .spu-title {
+ color: #222;
+ font-size: 30rpx;
+ height: 32rpx;
+ width: 400rpx;
+ margin-bottom: 12rpx;
+ margin-top: 10rpx;
+ font-weight: bold;
+ position: relative;
+}
+
+.spu .spu-content .item-right .spu-title .span {
+ width: 100%;
+ height: 40rpx;
+ position: absolute;
+ left: 0;
+ top: -4rpx;
+ line-height: 40rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ margin: 0;
+}
+
+.spu .spu-content .item-right .spu-tag {
+ padding-left: 196rpx;
+ margin-bottom: 6rpx;
+ display: flex;
+ height: 28rpx;
+}
+
+.spu .spu-content .item-right .spu-desc {
+ font-size: 26rpx;
+ line-height: 26rpx;
+ color: #999;
+ position: relative;
+ width: 400rpx;
+ height: 26rpx;
+ margin-bottom: 5rpx;
+}
+
+.spu .spu-content .item-right .spu-desc .em {
+ font-size: 20rpx;
+ width: 100%;
+ height: 32rpx;
+ position: absolute;
+ left: 0;
+ top: -2rpx;
+ line-height: 32rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu .spu-content .item-right .spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ overflow: hidden;
+ margin-bottom: 10rpx;
+}
+
+.spu .spu-content .item-right .spu-price .sale-price {
+ font-family: 'DIN';
+ color: #ff758c;
+ margin-right: 14rpx;
+ font-weight: bold;
+}
+
+.spu .spu-content .item-right .spu-price .sale-price .span {
+ font-size: 46rpx;
+ line-height: 42rpx;
+ margin: 0;
+
+}
+
+.spu .spu-content .item-right .spu-price .market-price {
+ font-family: DIN;
+ font-size: 30rpx;
+ text-decoration: line-through;
+ color: #999;
+ margin-right: 30rpx;
+}
+
+.spu .spu-content .item-right .spu-count {
+ font-size: 22rpx;
+ height: 22rpx;
+ color: #999;
+ margin-bottom: 16rpx;
+}
+
+.spu .spu-content .item-right .spu-count .spu-count-border {
+ display: inline-block;
+ border: 1rpx solid #42ADD5;
+ border-radius: 20rpx;
+ overflow: hidden;
+ height: 30rpx;
+ line-height: 32rpx;
+}
+
+.spu .spu-content .item-right .spu-count .spu-count-border .txt {
+ padding: 0 15rpx;
+ color: #007FAF;
+ height: 32rpx;
+ line-height: 32rpx;
+}
+
+.spu .spu-content .item-right .spu-count .spu-count-border .spu-count-num {
+ background-color: #42ADD5;
+ color: #fff;
+}
+
+.spu .spu-content .add-cart {
+ width: 68rpx;
+ height: 68rpx;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ right: 28rpx;
+ bottom: 20rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.spu .spu-content .add-cart .img {
+ width: 54rpx;
+ height: 54rpx;
+ display: block;
+}
+
+.spu .spu-content .spu-active {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ z-index: 9;
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: flex-start;
+}
+
+.spu .spu-content .spu-active .tag {
+ background: linear-gradient(to right,#4facfe,#00f2fe);
+ border-radius: 0 14rpx 14rpx 0;
+ padding: 0 12rpx;
+ height: 30rpx;
+ font-size: 22rpx;
+ line-height: 30rpx;
+ color: #fff;
+ display: inline-block;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ max-width: 180rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu .spu-content .spu-active .tag-green {
+ background: linear-gradient(to left, #46c8d0, #29ba9a);
+}
+
+/* 标签 */
+
+.spu .item-tag {
+ position: absolute;
+ left: 10rpx;
+ top: 0;
+ width: 70rpx;
+ height: 70rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+ filter: drop-shadow(5rpx 5rpx 10rpx rgba(23, 81, 129, 0.5));
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 8rpx;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.spu .item-tag .tag-name {
+ position: relative;
+ font-size: 20rpx;
+ line-height: 1;
+ z-index: 1;
+}
+
+.spu .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.spu .index-input-number {
+ position: absolute;
+ right: 20rpx;
+ bottom: 0rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.spu .index-input-number .i-input-number-view {
+ width: 80rpx;
+ height: 80rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.spu .index-input-number .i-input-number-view .img{
+ width: 40rpx;
+ height: 40rpx;
+}
+
+.spu .index-input-number .i-input-number-minus {
+ justify-content: flex-end;
+}
+
+.spu .index-input-number .i-input-number-plus {
+ justify-content: flex-start;
+}
+
+.spu .index-input-number .input-number-text {
+ height: 88rpx;
+ line-height: 88rpx;
+ font-size: 24rpx;
+ color: #333;
+ width: 58rpx;
+}
+
+.spu-play {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ width: 100rpx;
+ height: 100rpx;
+ margin-top: -50rpx;
+ margin-left: -50rpx;
+}
+
+.spu-play .img {
+ width: 100%;
+ height: 100%;
+}
+
+.picktime {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 24rpx;
+ font-weight: bold;
+ margin-top: 20rpx;
+ color: #ed7b3a;
+ border-top: 0.1rpx solid #e5e5e5;
+ padding: 20rpx 20rpx 0;
+
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/order-notify/index.js b/eaterplanet_ecommerce/components/order-notify/index.js
new file mode 100644
index 0000000..d34e381
--- /dev/null
+++ b/eaterplanet_ecommerce/components/order-notify/index.js
@@ -0,0 +1,75 @@
+let app = getApp();
+var ctime = null;
+
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ stopNotify: {
+ type: Boolean,
+ value: true,
+ observer: function(t){
+ t ? (clearInterval(ctime), ctime = null) : this._startReq();
+ }
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ userInfo: '',
+ hide: false,
+ order_id: 0
+ },
+
+ pageLifetimes: {
+ hide: function() {
+ console.log('notify hide')
+ clearInterval(ctime), ctime = null;
+ }
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ _startReq: function(){
+ var that = this;
+ ctime = setInterval(function(){
+ that.getOrderNotify();
+ }, 3000);
+ },
+ getOrderNotify: function (){
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'goods.notify_order'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let username = res.data.username;
+ let avatar = res.data.avatar;
+ let order_id = res.data.order_id;
+ let userInfo = { username, avatar }
+ if (that.data.order_id != order_id){
+ that.setData({
+ hide: false,
+ userInfo,
+ order_id
+ })
+ setTimeout(() => {
+ that.setData({ hide: true });
+ }, 5000)
+ } else {
+ !that.data.hide && setTimeout(() => {
+ that.setData({ hide: true });
+ }, 5000)
+ }
+ }
+ }
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/order-notify/index.json b/eaterplanet_ecommerce/components/order-notify/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/order-notify/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/order-notify/index.wxml b/eaterplanet_ecommerce/components/order-notify/index.wxml
new file mode 100644
index 0000000..f91cf2c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/order-notify/index.wxml
@@ -0,0 +1,4 @@
+
+
+ {{userInfo.username}}刚刚下单啦
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/order-notify/index.wxss b/eaterplanet_ecommerce/components/order-notify/index.wxss
new file mode 100644
index 0000000..47c1911
--- /dev/null
+++ b/eaterplanet_ecommerce/components/order-notify/index.wxss
@@ -0,0 +1,52 @@
+.orderNotify {
+ background-color: rgba(0,0,0,.6);
+ color: #fff;
+ border-radius: 30rpx;
+ line-height: 60rpx;
+ padding: 0 20rpx;
+ display: flex;
+ align-content: center;
+ align-items: center;
+ transform: translateX(-100%);
+}
+
+.orderNotify.ani-in {
+ animation: aniIn 400ms ease-in forwards;
+}
+
+.orderNotify.ani-out {
+ animation: aniOut 400ms ease-out forwards;
+}
+
+.orderNotifyAvatar {
+ width: 40rpx;
+ height: 40rpx;
+ border-radius: 50%;
+ margin-right: 8rpx;
+}
+
+.orderNotifyName {
+ display: inline-block;
+ max-width: 200rpx;
+ overflow: hidden;
+ text-overflow:ellipsis;
+ white-space: nowrap;
+}
+
+@keyframes aniIn {
+ from {
+ transform: translateX(-100%);
+ }
+ to {
+ transform: translateX(0%);
+ }
+}
+
+@keyframes aniOut {
+ from {
+ transform: translateX(0%);
+ }
+ to {
+ transform: translateX(-100%);
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/order/orderInfoExpress.js b/eaterplanet_ecommerce/components/order/orderInfoExpress.js
new file mode 100644
index 0000000..2869e18
--- /dev/null
+++ b/eaterplanet_ecommerce/components/order/orderInfoExpress.js
@@ -0,0 +1,74 @@
+Component({
+ properties: {
+ order: {
+ type: Object,
+ observer: function (t) {
+ let real_total = t.order_info.real_total * 1;
+ var goodsTotal = parseFloat(real_total) - parseFloat(t.order_info.shipping_fare);
+ let h = {};
+ h.goodsTotal = goodsTotal.toFixed(2);
+
+ let shipping_tel = t && t.order_info.shipping_tel || '';
+ if(!shipping_tel) shipping_tel = t && t.order_info.ziti_mobile || '';
+ if(shipping_tel) {
+ var pat=/(\d{7})\d*(\d{0})/;
+ let tel = shipping_tel.replace(pat,'$1****$2');
+ h.tel = tel;
+ }
+ this.setData(h);
+ }
+ },
+ showNickname: {
+ type: Boolean,
+ default: false
+ },
+ hidePhone: {
+ type: Number,
+ default: 0
+ },
+ groupInfo: {
+ type: Object,
+ default: {
+ group_name: '社区',
+ owner_name: '团长',
+ diyshipname: '快递费',
+ delivery_ziti_name: '社区自提',
+ delivery_tuanzshipping_name: '团长配送',
+ delivery_express_name: '快递配送'
+ }
+ },
+ hideInfo: {
+ type: Boolean,
+ default: false
+ },
+ goodsTot: {
+ type: Number,
+ default: 0
+ },
+ goods_sale_unit: String,
+ presale: {
+ type: Object,
+ default: {}
+ }
+ },
+ data: {
+ isCalling: false
+ },
+ methods: {
+ callTelphone: function (t) {
+ var e = this;
+ this.data.isCalling || (this.data.isCalling = true, wx.makePhoneCall({
+ phoneNumber: t.currentTarget.dataset.phone,
+ complete: function () {
+ e.data.isCalling = false;
+ }
+ }));
+ },
+ goExpress: function(){
+ let order_id = this.data.order.order_info.order_id;
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/order/goods_express?id=' + order_id,
+ })
+ }
+ }
+});
diff --git a/eaterplanet_ecommerce/components/order/orderInfoExpress.json b/eaterplanet_ecommerce/components/order/orderInfoExpress.json
new file mode 100644
index 0000000..2000c46
--- /dev/null
+++ b/eaterplanet_ecommerce/components/order/orderInfoExpress.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-card": "../card/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/order/orderInfoExpress.wxml b/eaterplanet_ecommerce/components/order/orderInfoExpress.wxml
new file mode 100644
index 0000000..3df97c0
--- /dev/null
+++ b/eaterplanet_ecommerce/components/order/orderInfoExpress.wxml
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+ 收货人
+ {{order.order_info.shipping_name}} {{hideInfo?tel:order.order_info.shipping_tel}}
+
+
+ {{order.order_info.order_note_name}}
+ {{order.order_info.note_content}}
+
+
+ 昵称
+ {{order.order_info.name}}
+
+
+ 收货地址
+ {{order.shipping_province.name}}{{order.shipping_city.name}}{{order.shipping_country.name}}{{hideInfo?'***':order.order_info.shipping_address}}
+
+
+ 收货地址
+ {{order.shipping_province.name}}{{order.shipping_city.name}}{{order.shipping_country.name}}{{hideInfo?'***':order.order_info.shipping_address}}
+
+
+ 收货地址
+ {{hideInfo?'***':order.order_info.tuan_send_address}}
+
+
+
+ 配送方式
+ {{groupInfo.delivery_express_name}}({{order.order_info.dispatchname}})
+
+ 查看物流
+
+
+
+
+ 快递单号
+ {{order.order_info.shipping_no}}
+
+
+ {{groupInfo.delivery_express_name}}
+ {{presale.presale_sendorder_date}}开始发货
+
+
+
+ 配送方式
+ 同城配送
+
+
+ 配送方式
+ {{groupInfo.delivery_tuanzshipping_name}}
+
+
+ 预计送达时间
+ {{order.order_info.expected_delivery_time}}
+
+
+ {{groupInfo.owner_name}}信息
+
+ {{order.order_info.ziti_name}}
+
+
+ 联系{{groupInfo.owner_name}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/order/orderInfoExpress.wxss b/eaterplanet_ecommerce/components/order/orderInfoExpress.wxss
new file mode 100644
index 0000000..76f9409
--- /dev/null
+++ b/eaterplanet_ecommerce/components/order/orderInfoExpress.wxss
@@ -0,0 +1,64 @@
+.header {
+ padding: 20rpx 30rpx;
+ color: #444;
+ font-size: 28rpx;
+ font-weight: 500;
+}
+
+.content-wrap {
+ border-top: 0.1rpx solid #efefef;
+ padding-bottom: 20rpx;
+}
+
+.content-wrap .item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 24rpx;
+ padding: 16rpx 30rpx 0;
+}
+
+.content-wrap .item .title {
+ word-break: keep-all;
+ color: #aaa;
+}
+
+.content-wrap .item .detail {
+ color: #444;
+ text-align: right;
+ display: flex;
+ align-items: center;
+}
+
+.content-wrap .item .detail .phone {
+ margin-left: 20rpx;
+ padding: 0 20rpx;
+ height: 44rpx;
+ display: flex;
+ align-items: center;
+ border: 0.1rpx solid #efefef;
+ border-radius: 26rpx;
+}
+
+.content-wrap .item .detail .phone .icon-phone {
+ width: 20rpx;
+ height: 20rpx;
+ margin-right: 10rpx;
+}
+
+.footer {
+ border-top: 0.1rpx solid #efefef;
+ padding: 32rpx;
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ font-size: 30rpx;
+ font-weight: 500;
+}
+
+.footer .money {
+ font-family: DIN;
+ color: #ff758c;
+ font-size: 40rpx;
+ font-weight: bold;
+}
diff --git a/eaterplanet_ecommerce/components/orderComment/index.js b/eaterplanet_ecommerce/components/orderComment/index.js
new file mode 100644
index 0000000..b17f97a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/orderComment/index.js
@@ -0,0 +1,10 @@
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ comment: {
+ type: String
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/orderComment/index.json b/eaterplanet_ecommerce/components/orderComment/index.json
new file mode 100644
index 0000000..2000c46
--- /dev/null
+++ b/eaterplanet_ecommerce/components/orderComment/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-card": "../card/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/orderComment/index.wxml b/eaterplanet_ecommerce/components/orderComment/index.wxml
new file mode 100644
index 0000000..2245849
--- /dev/null
+++ b/eaterplanet_ecommerce/components/orderComment/index.wxml
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/orderComment/index.wxss b/eaterplanet_ecommerce/components/orderComment/index.wxss
new file mode 100644
index 0000000..322c85d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/orderComment/index.wxss
@@ -0,0 +1,17 @@
+.comment-card {
+ margin: 0 auto 20rpx;
+}
+
+.comment-card .header {
+ padding:20rpx 30rpx;
+ color:#444;
+ font-size:28rpx;
+ font-weight:500;
+}
+
+.comment-card .content-wrap {
+ padding: 16rpx 30rpx;
+ font-size: 26rpx;
+ color: #444;
+ border-top:0.1rpx solid #efefef;
+}
diff --git a/eaterplanet_ecommerce/components/orderInfo/index.js b/eaterplanet_ecommerce/components/orderInfo/index.js
new file mode 100644
index 0000000..cb947c9
--- /dev/null
+++ b/eaterplanet_ecommerce/components/orderInfo/index.js
@@ -0,0 +1,92 @@
+// eaterplanet_ecommerce/components/orderInfo/index.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ orderInfo: {
+ type: Object,
+ observer: function (t) {
+ let real_total = t.real_total * 1;
+ var goodsTotal = parseFloat(real_total) - parseFloat(t.shipping_fare);
+
+ let disAmount = parseFloat(t.voucher_credit) + parseFloat(t.fullreduction_money);
+ disAmount = (disAmount > goodsTotal) ? goodsTotal : disAmount;
+
+ let diyshipname = '';
+ let groupInfo = this.data.groupInfo;
+ if(t.delivery=='express') {
+ diyshipname = groupInfo.placeorder_trans_name;
+ } else {
+ diyshipname = groupInfo.placeorder_tuan_name;
+ }
+
+ let changePrice = 0;
+ if(t.is_change_price==1) {
+ changePrice = Math.abs(t.admin_change_price);
+ }
+
+ this.setData({
+ goodsTotal: goodsTotal.toFixed(2),
+ disAmount: disAmount.toFixed(2),
+ diyshipname,
+ changePrice: changePrice.toFixed(2)
+ });
+ }
+ },
+ order_goods_list: {
+ type: Array,
+ observer: function (t) {
+ let levelAmount = 0;
+ let is_vipcard_buy = 0;
+ let is_level_buy = 0;
+ if(t&&t.length) {
+ t.forEach(function(item){
+ let total = item.total * 1;
+ let old_total = item.old_total * 1;
+ if (item.is_level_buy==1 || item.is_vipcard_buy==1) {
+ levelAmount += old_total - total;
+ is_vipcard_buy = item.is_vipcard_buy;
+ is_level_buy = item.is_level_buy;
+ }
+ })
+ }
+ this.setData({
+ levelAmount: levelAmount.toFixed(2),
+ is_level_buy,
+ is_vipcard_buy
+ });
+ }
+ },
+ ordername: {
+ type: String,
+ value: "订单"
+ },
+ groupInfo: {
+ type: Object,
+ value: {
+ group_name: '社区',
+ owner_name: '团长',
+ delivery_ziti_name: '社区自提',
+ delivery_tuanzshipping_name: '团长配送',
+ delivery_express_name: '快递配送',
+ placeorder_trans_name: '配送费',
+ placeorder_tuan_name: '配送费',
+ localtown_modifypickingname: '包装费'
+ }
+ },
+ goodsTot: {
+ type: Number,
+ default: 0
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ disAmount: 0,
+ goodsTotal: 0,
+ changePrice: 0
+ }
+})
diff --git a/eaterplanet_ecommerce/components/orderInfo/index.json b/eaterplanet_ecommerce/components/orderInfo/index.json
new file mode 100644
index 0000000..2000c46
--- /dev/null
+++ b/eaterplanet_ecommerce/components/orderInfo/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-card": "../card/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/orderInfo/index.wxml b/eaterplanet_ecommerce/components/orderInfo/index.wxml
new file mode 100644
index 0000000..f026b94
--- /dev/null
+++ b/eaterplanet_ecommerce/components/orderInfo/index.wxml
@@ -0,0 +1,134 @@
+
+var getPrice = function(a, b) {
+ b = b?b:0;
+ var c = a*1+b*1;
+ return c.toFixed(2);
+}
+module.exports.getPrice = getPrice;
+
+
+
+
+
+
+
+
+
+ {{ordername}}编号
+ {{orderInfo.order_num_alias}}
+
+
+ 下单时间
+
+ {{orderInfo.date_added}}
+
+
+
+ 支付时间
+
+ {{orderInfo.pay_date}}
+
+
+
+ 送达时间
+
+ {{orderInfo.express_tuanz_date}}
+
+
+
+ 收货时间
+
+ {{orderInfo.receive_date}}
+
+
+
+
+ 同城配送费
+
+
+ {{groupInfo.placeorder_trans_name}}
+ {{diyshipname}}
+
+
+ + ¥{{orderInfo.shipping_fare}}
+
+
+
+
+
+ 满金额免{{diyshipname}}
+
+ - ¥{{orderInfo.fare_shipping_free}}
+
+
+
+
+ 积分抵扣
+
+ - ¥{{orderInfo.score_for_money}}
+
+
+
+ 会员优惠
+
+ - ¥{{m1.getPrice(levelAmount, orderInfo.admin_change_price)}}
+
+
+
+ 等级折扣
+
+ - ¥{{m1.getPrice(levelAmount, orderInfo.admin_change_price)}}
+
+
+
+ 优惠券
+
+ - ¥{{orderInfo.voucher_credit}}
+
+
+
+ 满减
+
+ - ¥{{orderInfo.fullreduction_money}}
+
+
+
+ {{groupInfo.localtown_modifypickingname}}
+ + ¥{{orderInfo.packing_fare}}
+
+
+ 加价配送费
+ + ¥{{orderInfo.localtown_add_shipping_fare}}
+
+
+ 商家改价
+ {{orderInfo.total>orderInfo.old_price?'+':'-'}} ¥{{changePrice}}
+
+
+ 商品金额
+
+ + ¥{{goodsTotal}}积分
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/orderInfo/index.wxss b/eaterplanet_ecommerce/components/orderInfo/index.wxss
new file mode 100644
index 0000000..8006ca8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/orderInfo/index.wxss
@@ -0,0 +1,43 @@
+.header {
+ padding: 20rpx 30rpx;
+ color: #444;
+ font-size: 28rpx;
+ font-weight: 500;
+}
+
+.content-wrap {
+ border-top: 0.1rpx solid #efefef;
+ padding-bottom: 20rpx;
+}
+
+.content-wrap .item {
+ display: flex;
+ justify-content: space-between;
+ font-size: 26rpx;
+ padding: 16rpx 30rpx;
+ padding-bottom: 0;
+}
+
+.content-wrap .item .title {
+ color: #aaa;
+}
+
+.content-wrap .item .detail {
+ color: #444;
+}
+
+.footer {
+ border-top: 0.1rpx solid #efefef;
+ padding: 32rpx;
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ font-size: 28rpx;
+}
+
+.footer .money {
+ font-family: DIN;
+ color: #ff758c;
+ font-weight: bold;
+ font-size: 40rpx;
+}
diff --git a/eaterplanet_ecommerce/components/painter/lib/calc.js b/eaterplanet_ecommerce/components/painter/lib/calc.js
new file mode 100644
index 0000000..e6788de
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/lib/calc.js
@@ -0,0 +1,54 @@
+/* eslint-disable */
+// 四则运算
+
+!(function () {
+ var calculate = function (s) {
+ s = s.trim();
+ const stack = new Array();
+ let preSign = '+';
+ let numStr = '';
+ const n = s.length;
+ for (let i = 0; i < n; ++i) {
+ if (s[i] === '.' || (!isNaN(Number(s[i])) && s[i] !== ' ')) {
+ numStr += s[i];
+ } else if (s[i] === '(') {
+ let isClose = 1;
+ let j = i;
+ while (isClose > 0) {
+ j += 1;
+ if (s[j] === '(') isClose += 1;
+ if (s[j] === ')') isClose -= 1;
+ }
+ numStr = `${calculate(s.slice(i + 1, j))}`;
+ i = j;
+ }
+ if ((isNaN(Number(s[i])) && s[i] !== '.') || i === n - 1) {
+ let num = parseFloat(numStr);
+ switch (preSign) {
+ case '+':
+ stack.push(num);
+ break;
+ case '-':
+ stack.push(-num);
+ break;
+ case '*':
+ stack.push(stack.pop() * num);
+ break;
+ case '/':
+ stack.push(stack.pop() / num);
+ break;
+ default:
+ break;
+ }
+ preSign = s[i];
+ numStr = '';
+ }
+ }
+ let ans = 0;
+ while (stack.length) {
+ ans += stack.pop();
+ }
+ return ans;
+ };
+ module.exports = calculate;
+})();
diff --git a/eaterplanet_ecommerce/components/painter/lib/downloader.js b/eaterplanet_ecommerce/components/painter/lib/downloader.js
new file mode 100644
index 0000000..73a894e
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/lib/downloader.js
@@ -0,0 +1,363 @@
+/**
+ * LRU 文件存储,使用该 downloader 可以让下载的文件存储在本地,下次进入小程序后可以直接使用
+ * 详细设计文档可查看 https://juejin.im/post/5b42d3ede51d4519277b6ce3
+ */
+const util = require('./util');
+const sha1 = require('./sha1');
+
+const SAVED_FILES_KEY = 'savedFiles';
+const KEY_TOTAL_SIZE = 'totalSize';
+const KEY_PATH = 'path';
+const KEY_TIME = 'time';
+const KEY_SIZE = 'size';
+
+// 可存储总共为 6M,目前小程序可允许的最大本地存储为 10M
+let MAX_SPACE_IN_B = 6 * 1024 * 1024;
+let savedFiles = {};
+
+export default class Dowloader {
+ constructor() {
+ // app 如果设置了最大存储空间,则使用 app 中的
+ if (getApp().PAINTER_MAX_LRU_SPACE) {
+ MAX_SPACE_IN_B = getApp().PAINTER_MAX_LRU_SPACE;
+ }
+ wx.getStorage({
+ key: SAVED_FILES_KEY,
+ success: function (res) {
+ if (res.data) {
+ savedFiles = res.data;
+ }
+ },
+ });
+ }
+
+ /**
+ * 下载文件,会用 lru 方式来缓存文件到本地
+ * @param {String} url 文件的 url
+ */
+ download(url, lru) {
+ return new Promise((resolve, reject) => {
+ if (!(url && util.isValidUrl(url))) {
+ resolve(url);
+ return;
+ }
+ const fileName = getFileName(url);
+ if (!lru) {
+ // 无 lru 情况下直接判断 临时文件是否存在,不存在重新下载
+ wx.getFileInfo({
+ filePath: fileName,
+ success: () => {
+ resolve(url);
+ },
+ fail: () => {
+ if (util.isOnlineUrl(url)) {
+ downloadFile(url, lru).then((path) => {
+ resolve(path);
+ }, () => {
+ reject();
+ });
+ } else if (util.isDataUrl(url)) {
+ transformBase64File(url, lru).then(path => {
+ resolve(path);
+ }, () => {
+ reject();
+ });
+ }
+ },
+ })
+ return
+ }
+
+ const file = getFile(fileName);
+
+ if (file) {
+ if (file[KEY_PATH].indexOf('//usr/') !== -1) {
+ wx.getFileInfo({
+ filePath: file[KEY_PATH],
+ success() {
+ resolve(file[KEY_PATH]);
+ },
+ fail(error) {
+ console.error(`base64 file broken, ${JSON.stringify(error)}`);
+ transformBase64File(url, lru).then(path => {
+ resolve(path);
+ }, () => {
+ reject();
+ });
+ }
+ })
+ } else {
+ // 检查文件是否正常,不正常需要重新下载
+ wx.getSavedFileInfo({
+ filePath: file[KEY_PATH],
+ success: (res) => {
+ resolve(file[KEY_PATH]);
+ },
+ fail: (error) => {
+ console.error(`the file is broken, redownload it, ${JSON.stringify(error)}`);
+ downloadFile(url, lru).then((path) => {
+ resolve(path);
+ }, () => {
+ reject();
+ });
+ },
+ });
+ }
+ } else {
+ if (util.isOnlineUrl(url)) {
+ downloadFile(url, lru).then((path) => {
+ resolve(path);
+ }, () => {
+ reject();
+ });
+ } else if (util.isDataUrl(url)) {
+ transformBase64File(url, lru).then(path => {
+ resolve(path);
+ }, () => {
+ reject();
+ });
+ }
+ }
+ });
+ }
+}
+
+function getFileName(url) {
+ if (util.isDataUrl(url)) {
+ const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(url) || [];
+ const fileName = `${sha1.hex_sha1(bodyData)}.${format}`;
+ return fileName;
+ } else {
+ return url;
+ }
+}
+
+function transformBase64File(base64data, lru) {
+ return new Promise((resolve, reject) => {
+ const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || [];
+ if (!format) {
+ console.error('base parse failed');
+ reject();
+ return;
+ }
+ const fileName = `${sha1.hex_sha1(bodyData)}.${format}`;
+ const path = `${wx.env.USER_DATA_PATH}/${fileName}`;
+ const buffer = wx.base64ToArrayBuffer(bodyData.replace(/[\r\n]/g, ""));
+ wx.getFileSystemManager().writeFile({
+ filePath: path,
+ data: buffer,
+ encoding: 'binary',
+ success() {
+ wx.getFileInfo({
+ filePath: path,
+ success: (tmpRes) => {
+ const newFileSize = tmpRes.size;
+ lru ? doLru(newFileSize).then(() => {
+ saveFile(fileName, newFileSize, path, true).then((filePath) => {
+ resolve(filePath);
+ });
+ }, () => {
+ resolve(path);
+ }) : resolve(path);
+ },
+ fail: (error) => {
+ // 文件大小信息获取失败,则此文件也不要进行存储
+ console.error(`getFileInfo ${path} failed, ${JSON.stringify(error)}`);
+ resolve(path);
+ },
+ });
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
+ });
+}
+
+function downloadFile(url, lru) {
+ return new Promise((resolve, reject) => {
+ const downloader = url.startsWith('cloud://')?wx.cloud.downloadFile:wx.downloadFile
+ downloader({
+ url: url,
+ fileID: url,
+ success: function (res) {
+ if (res.statusCode !== 200) {
+ console.error(`downloadFile ${url} failed res.statusCode is not 200`);
+ reject();
+ return;
+ }
+ const {
+ tempFilePath
+ } = res;
+ wx.getFileInfo({
+ filePath: tempFilePath,
+ success: (tmpRes) => {
+ const newFileSize = tmpRes.size;
+ lru ? doLru(newFileSize).then(() => {
+ saveFile(url, newFileSize, tempFilePath).then((filePath) => {
+ resolve(filePath);
+ });
+ }, () => {
+ resolve(tempFilePath);
+ }) : resolve(tempFilePath);
+ },
+ fail: (error) => {
+ // 文件大小信息获取失败,则此文件也不要进行存储
+ console.error(`getFileInfo ${res.tempFilePath} failed, ${JSON.stringify(error)}`);
+ resolve(res.tempFilePath);
+ },
+ });
+ },
+ fail: function (error) {
+ console.error(`downloadFile failed, ${JSON.stringify(error)} `);
+ reject();
+ },
+ });
+ });
+}
+
+function saveFile(key, newFileSize, tempFilePath, isDataUrl = false) {
+ return new Promise((resolve, reject) => {
+ if (isDataUrl) {
+ const totalSize = savedFiles[KEY_TOTAL_SIZE] ? savedFiles[KEY_TOTAL_SIZE] : 0;
+ savedFiles[key] = {};
+ savedFiles[key][KEY_PATH] = tempFilePath;
+ savedFiles[key][KEY_TIME] = new Date().getTime();
+ savedFiles[key][KEY_SIZE] = newFileSize;
+ savedFiles['totalSize'] = newFileSize + totalSize;
+ wx.setStorage({
+ key: SAVED_FILES_KEY,
+ data: savedFiles,
+ });
+ resolve(tempFilePath);
+ return;
+ }
+ wx.saveFile({
+ tempFilePath: tempFilePath,
+ success: (fileRes) => {
+ const totalSize = savedFiles[KEY_TOTAL_SIZE] ? savedFiles[KEY_TOTAL_SIZE] : 0;
+ savedFiles[key] = {};
+ savedFiles[key][KEY_PATH] = fileRes.savedFilePath;
+ savedFiles[key][KEY_TIME] = new Date().getTime();
+ savedFiles[key][KEY_SIZE] = newFileSize;
+ savedFiles['totalSize'] = newFileSize + totalSize;
+ wx.setStorage({
+ key: SAVED_FILES_KEY,
+ data: savedFiles,
+ });
+ resolve(fileRes.savedFilePath);
+ },
+ fail: (error) => {
+ console.error(`saveFile ${key} failed, then we delete all files, ${JSON.stringify(error)}`);
+ // 由于 saveFile 成功后,res.tempFilePath 处的文件会被移除,所以在存储未成功时,我们还是继续使用临时文件
+ resolve(tempFilePath);
+ // 如果出现错误,就直接情况本地的所有文件,因为你不知道是不是因为哪次lru的某个文件未删除成功
+ reset();
+ },
+ });
+ });
+}
+
+/**
+ * 清空所有下载相关内容
+ */
+function reset() {
+ wx.removeStorage({
+ key: SAVED_FILES_KEY,
+ success: () => {
+ wx.getSavedFileList({
+ success: (listRes) => {
+ removeFiles(listRes.fileList);
+ },
+ fail: (getError) => {
+ console.error(`getSavedFileList failed, ${JSON.stringify(getError)}`);
+ },
+ });
+ },
+ });
+}
+
+function doLru(size) {
+ if (size > MAX_SPACE_IN_B) {
+ return Promise.reject()
+ }
+ return new Promise((resolve, reject) => {
+ let totalSize = savedFiles[KEY_TOTAL_SIZE] ? savedFiles[KEY_TOTAL_SIZE] : 0;
+
+ if (size + totalSize <= MAX_SPACE_IN_B) {
+ resolve();
+ return;
+ }
+ // 如果加上新文件后大小超过最大限制,则进行 lru
+ const pathsShouldDelete = [];
+ // 按照最后一次的访问时间,从小到大排序
+ const allFiles = JSON.parse(JSON.stringify(savedFiles));
+ delete allFiles[KEY_TOTAL_SIZE];
+ const sortedKeys = Object.keys(allFiles).sort((a, b) => {
+ return allFiles[a][KEY_TIME] - allFiles[b][KEY_TIME];
+ });
+
+ for (const sortedKey of sortedKeys) {
+ totalSize -= savedFiles[sortedKey].size;
+ pathsShouldDelete.push(savedFiles[sortedKey][KEY_PATH]);
+ delete savedFiles[sortedKey];
+ if (totalSize + size < MAX_SPACE_IN_B) {
+ break;
+ }
+ }
+
+ savedFiles['totalSize'] = totalSize;
+
+ wx.setStorage({
+ key: SAVED_FILES_KEY,
+ data: savedFiles,
+ success: () => {
+ // 保证 storage 中不会存在不存在的文件数据
+ if (pathsShouldDelete.length > 0) {
+ removeFiles(pathsShouldDelete);
+ }
+ resolve();
+ },
+ fail: (error) => {
+ console.error(`doLru setStorage failed, ${JSON.stringify(error)}`);
+ reject();
+ },
+ });
+ });
+}
+
+function removeFiles(pathsShouldDelete) {
+ for (const pathDel of pathsShouldDelete) {
+ let delPath = pathDel;
+ if (typeof pathDel === 'object') {
+ delPath = pathDel.filePath;
+ }
+ if (delPath.indexOf('//usr/') !== -1) {
+ wx.getFileSystemManager().unlink({
+ filePath: delPath,
+ fail(error) {
+ console.error(`removeSavedFile ${pathDel} failed, ${JSON.stringify(error)}`);
+ }
+ })
+ } else {
+ wx.removeSavedFile({
+ filePath: delPath,
+ fail: (error) => {
+ console.error(`removeSavedFile ${pathDel} failed, ${JSON.stringify(error)}`);
+ },
+ });
+ }
+ }
+}
+
+function getFile(key) {
+ if (!savedFiles[key]) {
+ return;
+ }
+ savedFiles[key]['time'] = new Date().getTime();
+ wx.setStorage({
+ key: SAVED_FILES_KEY,
+ data: savedFiles,
+ });
+ return savedFiles[key];
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/painter/lib/gradient.js b/eaterplanet_ecommerce/components/painter/lib/gradient.js
new file mode 100644
index 0000000..13c7258
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/lib/gradient.js
@@ -0,0 +1,102 @@
+/* eslint-disable */
+// 当ctx传入当前文件,const grd = ctx.createCircularGradient() 和
+// const grd = this.ctx.createLinearGradient() 无效,因此只能分开处理
+// 先分析,在外部创建grd,再传入使用就可以
+
+!(function () {
+
+ var api = {
+ isGradient: function(bg) {
+ if (bg && (bg.startsWith('linear') || bg.startsWith('radial'))) {
+ return true;
+ }
+ return false;
+ },
+
+ doGradient: function(bg, width, height, ctx) {
+ if (bg.startsWith('linear')) {
+ linearEffect(width, height, bg, ctx);
+ } else if (bg.startsWith('radial')) {
+ radialEffect(width, height, bg, ctx);
+ }
+ },
+ }
+
+ function analizeGrad(string) {
+ const colorPercents = string.substring(0, string.length - 1).split("%,");
+ const colors = [];
+ const percents = [];
+ for (let colorPercent of colorPercents) {
+ colors.push(colorPercent.substring(0, colorPercent.lastIndexOf(" ")).trim());
+ percents.push(colorPercent.substring(colorPercent.lastIndexOf(" "), colorPercent.length) / 100);
+ }
+ return {colors: colors, percents: percents};
+ }
+
+ function radialEffect(width, height, bg, ctx) {
+ const colorPer = analizeGrad(bg.match(/radial-gradient\((.+)\)/)[1]);
+ const grd = ctx.createRadialGradient(0, 0, 0, 0, 0, width < height ? height / 2 : width / 2);
+ for (let i = 0; i < colorPer.colors.length; i++) {
+ grd.addColorStop(colorPer.percents[i], colorPer.colors[i]);
+ }
+ ctx.fillStyle = grd;
+ //ctx.fillRect(-(width / 2), -(height / 2), width, height);
+ }
+
+ function analizeLinear(bg, width, height) {
+ const direction = bg.match(/([-]?\d{1,3})deg/);
+ const dir = direction && direction[1] ? parseFloat(direction[1]) : 0;
+ let coordinate;
+ switch (dir) {
+ case 0: coordinate = [0, -height / 2, 0, height / 2]; break;
+ case 90: coordinate = [width / 2, 0, -width / 2, 0]; break;
+ case -90: coordinate = [-width / 2, 0, width / 2, 0]; break;
+ case 180: coordinate = [0, height / 2, 0, -height / 2]; break;
+ case -180: coordinate = [0, -height / 2, 0, height / 2]; break;
+ default:
+ let x1 = 0;
+ let y1 = 0;
+ let x2 = 0;
+ let y2 = 0;
+ if (direction[1] > 0 && direction[1] < 90) {
+ x1 = (width / 2) - ((width / 2) * Math.tan((90 - direction[1]) * Math.PI * 2 / 360) - height / 2) * Math.sin(2 * (90 - direction[1]) * Math.PI * 2 / 360) / 2;
+ y2 = Math.tan((90 - direction[1]) * Math.PI * 2 / 360) * x1;
+ x2 = -x1;
+ y1 = -y2;
+ } else if (direction[1] > -180 && direction[1] < -90) {
+ x1 = -(width / 2) + ((width / 2) * Math.tan((90 - direction[1]) * Math.PI * 2 / 360) - height / 2) * Math.sin(2 * (90 - direction[1]) * Math.PI * 2 / 360) / 2;
+ y2 = Math.tan((90 - direction[1]) * Math.PI * 2 / 360) * x1;
+ x2 = -x1;
+ y1 = -y2;
+ } else if (direction[1] > 90 && direction[1] < 180) {
+ x1 = (width / 2) + (-(width / 2) * Math.tan((90 - direction[1]) * Math.PI * 2 / 360) - height / 2) * Math.sin(2 * (90 - direction[1]) * Math.PI * 2 / 360) / 2;
+ y2 = Math.tan((90 - direction[1]) * Math.PI * 2 / 360) * x1;
+ x2 = -x1;
+ y1 = -y2;
+ } else {
+ x1 = -(width / 2) - (-(width / 2) * Math.tan((90 - direction[1]) * Math.PI * 2 / 360) - height / 2) * Math.sin(2 * (90 - direction[1]) * Math.PI * 2 / 360) / 2;
+ y2 = Math.tan((90 - direction[1]) * Math.PI * 2 / 360) * x1;
+ x2 = -x1;
+ y1 = -y2;
+ }
+ coordinate = [x1, y1, x2, y2];
+ break;
+ }
+ return coordinate;
+ }
+
+ function linearEffect(width, height, bg, ctx) {
+ const param = analizeLinear(bg, width, height);
+ const grd = ctx.createLinearGradient(param[0], param[1], param[2], param[3]);
+ const content = bg.match(/linear-gradient\((.+)\)/)[1];
+ const colorPer = analizeGrad(content.substring(content.indexOf(',') + 1));
+ for (let i = 0; i < colorPer.colors.length; i++) {
+ grd.addColorStop(colorPer.percents[i], colorPer.colors[i]);
+ }
+ ctx.fillStyle = grd
+ //ctx.fillRect(-(width / 2), -(height / 2), width, height);
+ }
+
+ module.exports = { api }
+
+})();
diff --git a/eaterplanet_ecommerce/components/painter/lib/pen.js b/eaterplanet_ecommerce/components/painter/lib/pen.js
new file mode 100644
index 0000000..d0f099b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/lib/pen.js
@@ -0,0 +1,903 @@
+const QR = require('./qrcode.js');
+const GD = require('./gradient.js');
+require('./string-polyfill.js');
+
+export const penCache = {
+ // 用于存储带 id 的 view 的 rect 信息
+ viewRect: {},
+ textLines: {},
+};
+export const clearPenCache = id => {
+ if (id) {
+ penCache.viewRect[id] = null;
+ penCache.textLines[id] = null;
+ } else {
+ penCache.viewRect = {};
+ penCache.textLines = {};
+ }
+};
+export default class Painter {
+ constructor(ctx, data) {
+ this.ctx = ctx;
+ this.data = data;
+ }
+
+ paint(callback) {
+ this.style = {
+ width: this.data.width.toPx(),
+ height: this.data.height.toPx(),
+ };
+
+ this._background();
+ for (const view of this.data.views) {
+ this._drawAbsolute(view);
+ }
+ this.ctx.draw(false, () => {
+ callback && callback();
+ });
+ }
+
+ _background() {
+ this.ctx.save();
+ const { width, height } = this.style;
+ const bg = this.data.background;
+ this.ctx.translate(width / 2, height / 2);
+
+ this._doClip(this.data.borderRadius, width, height);
+ if (!bg) {
+ // 如果未设置背景,则默认使用透明色
+ this.ctx.fillStyle = 'transparent';
+ this.ctx.fillRect(-(width / 2), -(height / 2), width, height);
+ } else if (bg.startsWith('#') || bg.startsWith('rgba') || bg.toLowerCase() === 'transparent') {
+ // 背景填充颜色
+ this.ctx.fillStyle = bg;
+ this.ctx.fillRect(-(width / 2), -(height / 2), width, height);
+ } else if (GD.api.isGradient(bg)) {
+ GD.api.doGradient(bg, width, height, this.ctx);
+ this.ctx.fillRect(-(width / 2), -(height / 2), width, height);
+ } else {
+ // 背景填充图片
+ this.ctx.drawImage(bg, -(width / 2), -(height / 2), width, height);
+ }
+ this.ctx.restore();
+ }
+
+ _drawAbsolute(view) {
+ if (!(view && view.type)) {
+ // 过滤无效 view
+ return;
+ }
+ // 证明 css 为数组形式,需要合并
+ if (view.css && view.css.length) {
+ /* eslint-disable no-param-reassign */
+ view.css = Object.assign(...view.css);
+ }
+ switch (view.type) {
+ case 'image':
+ this._drawAbsImage(view);
+ break;
+ case 'text':
+ this._fillAbsText(view);
+ break;
+ case 'inlineText':
+ this._fillAbsInlineText(view);
+ break;
+ case 'rect':
+ this._drawAbsRect(view);
+ break;
+ case 'qrcode':
+ this._drawQRCode(view);
+ break;
+ default:
+ break;
+ }
+ }
+
+ _border({ borderRadius = 0, width, height, borderWidth = 0, borderStyle = 'solid' }) {
+ let r1 = 0,
+ r2 = 0,
+ r3 = 0,
+ r4 = 0;
+ const minSize = Math.min(width, height);
+ if (borderRadius) {
+ const border = borderRadius.split(/\s+/);
+ if (border.length === 4) {
+ r1 = Math.min(border[0].toPx(false, minSize), width / 2, height / 2);
+ r2 = Math.min(border[1].toPx(false, minSize), width / 2, height / 2);
+ r3 = Math.min(border[2].toPx(false, minSize), width / 2, height / 2);
+ r4 = Math.min(border[3].toPx(false, minSize), width / 2, height / 2);
+ } else {
+ r1 = r2 = r3 = r4 = Math.min(borderRadius && borderRadius.toPx(false, minSize), width / 2, height / 2);
+ }
+ }
+ const lineWidth = borderWidth && borderWidth.toPx(false, minSize);
+ this.ctx.lineWidth = lineWidth;
+ if (borderStyle === 'dashed') {
+ this.ctx.setLineDash([(lineWidth * 4) / 3, (lineWidth * 4) / 3]);
+ // this.ctx.lineDashOffset = 2 * lineWidth
+ } else if (borderStyle === 'dotted') {
+ this.ctx.setLineDash([lineWidth, lineWidth]);
+ }
+ const notSolid = borderStyle !== 'solid';
+ this.ctx.beginPath();
+
+ notSolid && r1 === 0 && this.ctx.moveTo(-width / 2 - lineWidth, -height / 2 - lineWidth / 2); // 顶边虚线规避重叠规则
+ r1 !== 0 && this.ctx.arc(-width / 2 + r1, -height / 2 + r1, r1 + lineWidth / 2, 1 * Math.PI, 1.5 * Math.PI); //左上角圆弧
+ this.ctx.lineTo(
+ r2 === 0 ? (notSolid ? width / 2 : width / 2 + lineWidth / 2) : width / 2 - r2,
+ -height / 2 - lineWidth / 2,
+ ); // 顶边线
+
+ notSolid && r2 === 0 && this.ctx.moveTo(width / 2 + lineWidth / 2, -height / 2 - lineWidth); // 右边虚线规避重叠规则
+ r2 !== 0 && this.ctx.arc(width / 2 - r2, -height / 2 + r2, r2 + lineWidth / 2, 1.5 * Math.PI, 2 * Math.PI); // 右上角圆弧
+ this.ctx.lineTo(
+ width / 2 + lineWidth / 2,
+ r3 === 0 ? (notSolid ? height / 2 : height / 2 + lineWidth / 2) : height / 2 - r3,
+ ); // 右边线
+
+ notSolid && r3 === 0 && this.ctx.moveTo(width / 2 + lineWidth, height / 2 + lineWidth / 2); // 底边虚线规避重叠规则
+ r3 !== 0 && this.ctx.arc(width / 2 - r3, height / 2 - r3, r3 + lineWidth / 2, 0, 0.5 * Math.PI); // 右下角圆弧
+ this.ctx.lineTo(
+ r4 === 0 ? (notSolid ? -width / 2 : -width / 2 - lineWidth / 2) : -width / 2 + r4,
+ height / 2 + lineWidth / 2,
+ ); // 底边线
+
+ notSolid && r4 === 0 && this.ctx.moveTo(-width / 2 - lineWidth / 2, height / 2 + lineWidth); // 左边虚线规避重叠规则
+ r4 !== 0 && this.ctx.arc(-width / 2 + r4, height / 2 - r4, r4 + lineWidth / 2, 0.5 * Math.PI, 1 * Math.PI); // 左下角圆弧
+ this.ctx.lineTo(
+ -width / 2 - lineWidth / 2,
+ r1 === 0 ? (notSolid ? -height / 2 : -height / 2 - lineWidth / 2) : -height / 2 + r1,
+ ); // 左边线
+ notSolid && r1 === 0 && this.ctx.moveTo(-width / 2 - lineWidth, -height / 2 - lineWidth / 2); // 顶边虚线规避重叠规则
+
+ if (!notSolid) {
+ this.ctx.closePath();
+ }
+ }
+
+ /**
+ * 根据 borderRadius 进行裁减
+ */
+ _doClip(borderRadius, width, height, borderStyle) {
+ if (borderRadius && width && height) {
+ // 防止在某些机型上周边有黑框现象,此处如果直接设置 fillStyle 为透明,在 Android 机型上会导致被裁减的图片也变为透明, iOS 和 IDE 上不会
+ // globalAlpha 在 1.9.90 起支持,低版本下无效,但把 fillStyle 设为了 white,相对默认的 black 要好点
+ this.ctx.globalAlpha = 0;
+ this.ctx.fillStyle = 'white';
+ this._border({
+ borderRadius,
+ width,
+ height,
+ borderStyle,
+ });
+ this.ctx.fill();
+ // 在 ios 的 6.6.6 版本上 clip 有 bug,禁掉此类型上的 clip,也就意味着,在此版本微信的 ios 设备下无法使用 border 属性
+ if (!(getApp().systemInfo && getApp().systemInfo.version <= '6.6.6' && getApp().systemInfo.platform === 'ios')) {
+ this.ctx.clip();
+ }
+ this.ctx.globalAlpha = 1;
+ }
+ }
+
+ /**
+ * 画边框
+ */
+ _doBorder(view, width, height) {
+ if (!view.css) {
+ return;
+ }
+ const { borderRadius, borderWidth, borderColor, borderStyle } = view.css;
+ if (!borderWidth) {
+ return;
+ }
+ this.ctx.save();
+ this._preProcess(view, true);
+ this.ctx.strokeStyle = borderColor || 'black';
+ this._border({
+ borderRadius,
+ width,
+ height,
+ borderWidth,
+ borderStyle,
+ });
+ this.ctx.stroke();
+ this.ctx.restore();
+ }
+
+ _preProcess(view, notClip) {
+ let width = 0;
+ let height;
+ let extra;
+ const paddings = this._doPaddings(view);
+ switch (view.type) {
+ case 'inlineText': {
+ {
+ // 计算行数
+ let lines = 0;
+ // 文字总长度
+ let textLength = 0;
+ // 行高
+ let lineHeight = 0;
+ const textList = view.textList || [];
+ for (let i = 0; i < textList.length; i++) {
+ let subView = textList[i];
+ const fontWeight = subView.css.fontWeight || '400';
+ const textStyle = subView.css.textStyle || 'normal';
+ if (!subView.css.fontSize) {
+ subView.css.fontSize = '20rpx';
+ }
+ this.ctx.font = `${textStyle} ${fontWeight} ${subView.css.fontSize.toPx()}px "${subView.css.fontFamily || 'sans-serif'}"`;
+ textLength += this.ctx.measureText(subView.text).width;
+ let tempLineHeight = subView.css.lineHeight ? subView.css.lineHeight.toPx() : subView.css.fontSize.toPx();
+ lineHeight = Math.max(lineHeight, tempLineHeight);
+ }
+ width = view.css.width ? view.css.width.toPx(false, this.style.width) - paddings[1] - paddings[3] : textLength;;
+ const calLines = Math.ceil(textLength / width);
+
+ lines += calLines;
+ // lines = view.css.maxLines < lines ? view.css.maxLines : lines;
+ height = lineHeight * lines;
+ extra = {
+ lines: lines,
+ lineHeight: lineHeight,
+ // textArray: textArray,
+ // linesArray: linesArray,
+ };
+ }
+ break;
+ }
+ case 'text': {
+ const textArray = String(view.text).split('\n');
+ // 处理多个连续的'\n'
+ for (let i = 0; i < textArray.length; ++i) {
+ if (textArray[i] === '') {
+ textArray[i] = ' ';
+ }
+ }
+ const fontWeight = view.css.fontWeight || '400';
+ const textStyle = view.css.textStyle || 'normal';
+ if (!view.css.fontSize) {
+ view.css.fontSize = '20rpx';
+ }
+ this.ctx.font = `${textStyle} ${fontWeight} ${view.css.fontSize.toPx()}px "${
+ view.css.fontFamily || 'sans-serif'
+ }"`;
+ // 计算行数
+ let lines = 0;
+ const linesArray = [];
+ for (let i = 0; i < textArray.length; ++i) {
+ const textLength = this.ctx.measureText(textArray[i]).width;
+ const minWidth = view.css.fontSize.toPx() + paddings[1] + paddings[3];
+ let partWidth = view.css.width
+ ? view.css.width.toPx(false, this.style.width) - paddings[1] - paddings[3]
+ : textLength;
+ if (partWidth < minWidth) {
+ partWidth = minWidth;
+ }
+ const calLines = Math.ceil(textLength / partWidth);
+ // 取最长的作为 width
+ width = partWidth > width ? partWidth : width;
+ lines += calLines;
+ linesArray[i] = calLines;
+ }
+ lines = view.css.maxLines < lines ? view.css.maxLines : lines;
+ const lineHeight = view.css.lineHeight ? view.css.lineHeight.toPx() : view.css.fontSize.toPx();
+ height = lineHeight * lines;
+ extra = {
+ lines: lines,
+ lineHeight: lineHeight,
+ textArray: textArray,
+ linesArray: linesArray,
+ };
+ break;
+ }
+ case 'image': {
+ // image的长宽设置成auto的逻辑处理
+ const ratio = getApp().systemInfo.pixelRatio ? getApp().systemInfo.pixelRatio : 2;
+ // 有css却未设置width或height,则默认为auto
+ if (view.css) {
+ if (!view.css.width) {
+ view.css.width = 'auto';
+ }
+ if (!view.css.height) {
+ view.css.height = 'auto';
+ }
+ }
+ if (!view.css || (view.css.width === 'auto' && view.css.height === 'auto')) {
+ width = Math.round(view.sWidth / ratio);
+ height = Math.round(view.sHeight / ratio);
+ } else if (view.css.width === 'auto') {
+ height = view.css.height.toPx(false, this.style.height);
+ width = (view.sWidth / view.sHeight) * height;
+ } else if (view.css.height === 'auto') {
+ width = view.css.width.toPx(false, this.style.width);
+ height = (view.sHeight / view.sWidth) * width;
+ } else {
+ width = view.css.width.toPx(false, this.style.width);
+ height = view.css.height.toPx(false, this.style.height);
+ }
+ break;
+ }
+ default:
+ if (!(view.css.width && view.css.height)) {
+ console.error('You should set width and height');
+ return;
+ }
+ width = view.css.width.toPx(false, this.style.width);
+ height = view.css.height.toPx(false, this.style.height);
+ break;
+ }
+ let x;
+ if (view.css && view.css.right) {
+ if (typeof view.css.right === 'string') {
+ x = this.style.width - view.css.right.toPx(true, this.style.width);
+ } else {
+ // 可以用数组方式,把文字长度计算进去
+ // [right, 文字id, 乘数(默认 1)]
+ const rights = view.css.right;
+ x =
+ this.style.width -
+ rights[0].toPx(true, this.style.width) -
+ penCache.viewRect[rights[1]].width * (rights[2] || 1);
+ }
+ } else if (view.css && view.css.left) {
+ if (typeof view.css.left === 'string') {
+ x = view.css.left.toPx(true, this.style.width);
+ } else {
+ const lefts = view.css.left;
+ x = lefts[0].toPx(true, this.style.width) + penCache.viewRect[lefts[1]].width * (lefts[2] || 1);
+ }
+ } else {
+ x = 0;
+ }
+ //const y = view.css && view.css.bottom ? this.style.height - height - view.css.bottom.toPx(true) : (view.css && view.css.top ? view.css.top.toPx(true) : 0);
+ let y;
+ if (view.css && view.css.bottom) {
+ y = this.style.height - height - view.css.bottom.toPx(true, this.style.height);
+ } else {
+ if (view.css && view.css.top) {
+ if (typeof view.css.top === 'string') {
+ y = view.css.top.toPx(true, this.style.height);
+ } else {
+ const tops = view.css.top;
+ y = tops[0].toPx(true, this.style.height) + penCache.viewRect[tops[1]].height * (tops[2] || 1);
+ }
+ } else {
+ y = 0;
+ }
+ }
+
+ const angle = view.css && view.css.rotate ? this._getAngle(view.css.rotate) : 0;
+ // 当设置了 right 时,默认 align 用 right,反之用 left
+ const align = view.css && view.css.align ? view.css.align : view.css && view.css.right ? 'right' : 'left';
+ const verticalAlign = view.css && view.css.verticalAlign ? view.css.verticalAlign : 'top';
+ // 记录绘制时的画布
+ let xa = 0;
+ switch (align) {
+ case 'center':
+ xa = x;
+ break;
+ case 'right':
+ xa = x - width / 2;
+ break;
+ default:
+ xa = x + width / 2;
+ break;
+ }
+ let ya = 0;
+ switch (verticalAlign) {
+ case 'center':
+ ya = y;
+ break;
+ case 'bottom':
+ ya = y - height / 2;
+ break;
+ default:
+ ya = y + height / 2;
+ break;
+ }
+ this.ctx.translate(xa, ya);
+ // 记录该 view 的有效点击区域
+ // TODO ,旋转和裁剪的判断
+ // 记录在真实画布上的左侧
+ let left = x;
+ if (align === 'center') {
+ left = x - width / 2;
+ } else if (align === 'right') {
+ left = x - width;
+ }
+ var top = y;
+ if (verticalAlign === 'center') {
+ top = y - height / 2;
+ } else if (verticalAlign === 'bottom') {
+ top = y - height;
+ }
+ if (view.rect) {
+ view.rect.left = left;
+ view.rect.top = top;
+ view.rect.right = left + width;
+ view.rect.bottom = top + height;
+ view.rect.x = view.css && view.css.right ? x - width : x;
+ view.rect.y = y;
+ } else {
+ view.rect = {
+ left: left,
+ top: top,
+ right: left + width,
+ bottom: top + height,
+ x: view.css && view.css.right ? x - width : x,
+ y: y,
+ };
+ }
+
+ view.rect.left = view.rect.left - paddings[3];
+ view.rect.top = view.rect.top - paddings[0];
+ view.rect.right = view.rect.right + paddings[1];
+ view.rect.bottom = view.rect.bottom + paddings[2];
+ if (view.type === 'text') {
+ view.rect.minWidth = view.css.fontSize.toPx() + paddings[1] + paddings[3];
+ }
+
+ this.ctx.rotate(angle);
+ if (!notClip && view.css && view.css.borderRadius && view.type !== 'rect') {
+ this._doClip(view.css.borderRadius, width, height, view.css.borderStyle);
+ }
+ this._doShadow(view);
+ if (view.id) {
+ penCache.viewRect[view.id] = {
+ width,
+ height,
+ left: view.rect.left,
+ top: view.rect.top,
+ right: view.rect.right,
+ bottom: view.rect.bottom,
+ };
+ }
+ return {
+ width: width,
+ height: height,
+ x: x,
+ y: y,
+ extra: extra,
+ };
+ }
+
+ _doPaddings(view) {
+ const { padding } = view.css ? view.css : {};
+ let pd = [0, 0, 0, 0];
+ if (padding) {
+ const pdg = padding.split(/\s+/);
+ if (pdg.length === 1) {
+ const x = pdg[0].toPx();
+ pd = [x, x, x, x];
+ }
+ if (pdg.length === 2) {
+ const x = pdg[0].toPx();
+ const y = pdg[1].toPx();
+ pd = [x, y, x, y];
+ }
+ if (pdg.length === 3) {
+ const x = pdg[0].toPx();
+ const y = pdg[1].toPx();
+ const z = pdg[2].toPx();
+ pd = [x, y, z, y];
+ }
+ if (pdg.length === 4) {
+ const x = pdg[0].toPx();
+ const y = pdg[1].toPx();
+ const z = pdg[2].toPx();
+ const a = pdg[3].toPx();
+ pd = [x, y, z, a];
+ }
+ }
+ return pd;
+ }
+
+ // 画文字的背景图片
+ _doBackground(view) {
+ this.ctx.save();
+ const { width: rawWidth, height: rawHeight } = this._preProcess(view, true);
+
+ const { background } = view.css;
+ let pd = this._doPaddings(view);
+ const width = rawWidth + pd[1] + pd[3];
+ const height = rawHeight + pd[0] + pd[2];
+
+ this._doClip(view.css.borderRadius, width, height, view.css.borderStyle);
+ if (GD.api.isGradient(background)) {
+ GD.api.doGradient(background, width, height, this.ctx);
+ } else {
+ this.ctx.fillStyle = background;
+ }
+ this.ctx.fillRect(-(width / 2), -(height / 2), width, height);
+
+ this.ctx.restore();
+ }
+
+ _drawQRCode(view) {
+ this.ctx.save();
+ const { width, height } = this._preProcess(view);
+ QR.api.draw(view.content, this.ctx, -width / 2, -height / 2, width, height, view.css.background, view.css.color);
+ this.ctx.restore();
+ this._doBorder(view, width, height);
+ }
+
+ _drawAbsImage(view) {
+ if (!view.url) {
+ return;
+ }
+ this.ctx.save();
+ const { width, height } = this._preProcess(view);
+ // 获得缩放到图片大小级别的裁减框
+ let rWidth = view.sWidth;
+ let rHeight = view.sHeight;
+ let startX = 0;
+ let startY = 0;
+ // 绘画区域比例
+ const cp = width / height;
+ // 原图比例
+ const op = view.sWidth / view.sHeight;
+ if (cp >= op) {
+ rHeight = rWidth / cp;
+ startY = Math.round((view.sHeight - rHeight) / 2);
+ } else {
+ rWidth = rHeight * cp;
+ startX = Math.round((view.sWidth - rWidth) / 2);
+ }
+ if (view.css && view.css.mode === 'scaleToFill') {
+ this.ctx.drawImage(view.url, -(width / 2), -(height / 2), width, height);
+ } else {
+ this.ctx.drawImage(view.url, startX, startY, rWidth, rHeight, -(width / 2), -(height / 2), width, height);
+ view.rect.startX = startX / view.sWidth;
+ view.rect.startY = startY / view.sHeight;
+ view.rect.endX = (startX + rWidth) / view.sWidth;
+ view.rect.endY = (startY + rHeight) / view.sHeight;
+ }
+ this.ctx.restore();
+ this._doBorder(view, width, height);
+ }
+ /**
+ *
+ * @param {*} view
+ * @description 一行内文字多样式的方法
+ *
+ * 暂不支持配置 text-align,默认left
+ * 暂不支持配置 maxLines
+ */
+ _fillAbsInlineText(view) {
+ if (!view.textList) {
+ return;
+ }
+ if (view.css.background) {
+ // 生成背景
+ this._doBackground(view);
+ }
+ this.ctx.save();
+ const { width, height, extra } = this._preProcess(view, view.css.background && view.css.borderRadius);
+ const { lines, lineHeight } = extra;
+ let staticX = -(width / 2);
+ let lineIndex = 0; // 第几行
+ let x = staticX; // 开始x位置
+ let leftWidth = width; // 当前行剩余多少宽度可以使用
+
+ let getStyle = css => {
+ const fontWeight = css.fontWeight || '400';
+ const textStyle = css.textStyle || 'normal';
+ if (!css.fontSize) {
+ css.fontSize = '20rpx';
+ }
+ return `${textStyle} ${fontWeight} ${css.fontSize.toPx()}px "${css.fontFamily || 'sans-serif'}"`;
+ }
+
+ // 遍历行内的文字数组
+ for (let j = 0; j < view.textList.length; j++) {
+ const subView = view.textList[j];
+
+ // 某个文字开始位置
+ let start = 0;
+ // 文字已使用的数量
+ let alreadyCount = 0;
+ // 文字总长度
+ let textLength = subView.text.length;
+ // 文字总宽度
+ let textWidth = this.ctx.measureText(subView.text).width;
+ // 每个文字的平均宽度
+ let preWidth = Math.ceil(textWidth / textLength);
+
+ // 循环写文字
+ while (alreadyCount < textLength) {
+ // alreadyCount - start + 1 -> 当前摘取出来的文字
+ // 比较可用宽度,寻找最大可写文字长度
+ while ((alreadyCount - start + 1) * preWidth < leftWidth && alreadyCount < textLength) {
+ alreadyCount++;
+ }
+
+ // 取出文字
+ let text = subView.text.substr(start, alreadyCount - start);
+
+ const y = -(height / 2) + subView.css.fontSize.toPx() + lineIndex * lineHeight;
+
+ // 设置文字样式
+ this.ctx.font = getStyle(subView.css);
+
+ this.ctx.fillStyle = subView.css.color || 'black';
+ this.ctx.textAlign = 'left';
+
+ // 执行画布操作
+ if (subView.css.textStyle === 'stroke') {
+ this.ctx.strokeText(text, x, y);
+ } else {
+ this.ctx.fillText(text, x, y);
+ }
+
+ // 当次已使用宽度
+ let currentUsedWidth = this.ctx.measureText(text).width;
+
+ const fontSize = subView.css.fontSize.toPx();
+
+ // 画 textDecoration
+ let textDecoration;
+ if (subView.css.textDecoration) {
+ this.ctx.lineWidth = fontSize / 13;
+ this.ctx.beginPath();
+ if (/\bunderline\b/.test(subView.css.textDecoration)) {
+ this.ctx.moveTo(x, y);
+ this.ctx.lineTo(x + currentUsedWidth, y);
+ textDecoration = {
+ moveTo: [x, y],
+ lineTo: [x + currentUsedWidth, y],
+ };
+ }
+ if (/\boverline\b/.test(subView.css.textDecoration)) {
+ this.ctx.moveTo(x, y - fontSize);
+ this.ctx.lineTo(x + currentUsedWidth, y - fontSize);
+ textDecoration = {
+ moveTo: [x, y - fontSize],
+ lineTo: [x + currentUsedWidth, y - fontSize],
+ };
+ }
+ if (/\bline-through\b/.test(subView.css.textDecoration)) {
+ this.ctx.moveTo(x, y - fontSize / 3);
+ this.ctx.lineTo(x + currentUsedWidth, y - fontSize / 3);
+ textDecoration = {
+ moveTo: [x, y - fontSize / 3],
+ lineTo: [x + currentUsedWidth, y - fontSize / 3],
+ };
+ }
+ this.ctx.closePath();
+ this.ctx.strokeStyle = subView.css.color;
+ this.ctx.stroke();
+ }
+
+ // 重置数据
+ start = alreadyCount;
+ leftWidth -= currentUsedWidth;
+ x += currentUsedWidth;
+ // 如果剩余宽度 小于等于0 或者小于一个字的平均宽度,换行
+ if (leftWidth <= 0 || leftWidth < preWidth) {
+ leftWidth = width;
+ x = staticX;
+ lineIndex++;
+ }
+ }
+ }
+
+ this.ctx.restore();
+ this._doBorder(view, width, height);
+ }
+
+ _fillAbsText(view) {
+ if (!view.text) {
+ return;
+ }
+ if (view.css.background) {
+ // 生成背景
+ this._doBackground(view);
+ }
+ this.ctx.save();
+ const { width, height, extra } = this._preProcess(view, view.css.background && view.css.borderRadius);
+ this.ctx.fillStyle = view.css.color || 'black';
+ if (view.id && penCache.textLines[view.id]) {
+ this.ctx.textAlign = view.css.textAlign ? view.css.textAlign : 'left';
+ for (const i of penCache.textLines[view.id]) {
+ const { measuredWith, text, x, y, textDecoration } = i;
+ if (view.css.textStyle === 'stroke') {
+ this.ctx.strokeText(text, x, y, measuredWith);
+ } else {
+ this.ctx.fillText(text, x, y, measuredWith);
+ }
+ if (textDecoration) {
+ const fontSize = view.css.fontSize.toPx();
+ this.ctx.lineWidth = fontSize / 13;
+ this.ctx.beginPath();
+ this.ctx.moveTo(...textDecoration.moveTo);
+ this.ctx.lineTo(...textDecoration.lineTo);
+ this.ctx.closePath();
+ this.ctx.strokeStyle = view.css.color;
+ this.ctx.stroke();
+ }
+ }
+ } else {
+ const { lines, lineHeight, textArray, linesArray } = extra;
+ // 如果设置了id,则保留 text 的长度
+ if (view.id) {
+ let textWidth = 0;
+ for (let i = 0; i < textArray.length; ++i) {
+ const _w = this.ctx.measureText(textArray[i]).width;
+ textWidth = _w > textWidth ? _w : textWidth;
+ }
+ penCache.viewRect[view.id].width = width ? (textWidth < width ? textWidth : width) : textWidth;
+ }
+ let lineIndex = 0;
+ for (let j = 0; j < textArray.length; ++j) {
+ const preLineLength = Math.ceil(textArray[j].length / linesArray[j]);
+ let start = 0;
+ let alreadyCount = 0;
+
+ for (let i = 0; i < linesArray[j]; ++i) {
+ // 绘制行数大于最大行数,则直接跳出循环
+ if (lineIndex >= lines) {
+ break;
+ }
+ alreadyCount = preLineLength;
+ let text = textArray[j].substr(start, alreadyCount);
+ let measuredWith = this.ctx.measureText(text).width;
+ // 如果测量大小小于width一个字符的大小,则进行补齐,如果测量大小超出 width,则进行减除
+ // 如果已经到文本末尾,也不要进行该循环
+ while (
+ start + alreadyCount <= textArray[j].length &&
+ (width - measuredWith > view.css.fontSize.toPx() || measuredWith - width > view.css.fontSize.toPx())
+ ) {
+ if (measuredWith < width) {
+ text = textArray[j].substr(start, ++alreadyCount);
+ } else {
+ if (text.length <= 1) {
+ // 如果只有一个字符时,直接跳出循环
+ break;
+ }
+ text = textArray[j].substr(start, --alreadyCount);
+ // break;
+ }
+ measuredWith = this.ctx.measureText(text).width;
+ }
+ start += text.length;
+ // 如果是最后一行了,发现还有未绘制完的内容,则加...
+ if (lineIndex === lines - 1 && (j < textArray.length - 1 || start < textArray[j].length)) {
+ while (this.ctx.measureText(`${text}...`).width > width) {
+ if (text.length <= 1) {
+ // 如果只有一个字符时,直接跳出循环
+ break;
+ }
+ text = text.substring(0, text.length - 1);
+ }
+ text += '...';
+ measuredWith = this.ctx.measureText(text).width;
+ }
+ this.ctx.textAlign = view.css.textAlign ? view.css.textAlign : 'left';
+ let x;
+ let lineX;
+ switch (view.css.textAlign) {
+ case 'center':
+ x = 0;
+ lineX = x - measuredWith / 2;
+ break;
+ case 'right':
+ x = width / 2;
+ lineX = x - measuredWith;
+ break;
+ default:
+ x = -(width / 2);
+ lineX = x;
+ break;
+ }
+
+ const y =
+ -(height / 2) +
+ (lineIndex === 0 ? view.css.fontSize.toPx() : view.css.fontSize.toPx() + lineIndex * lineHeight);
+ lineIndex++;
+ if (view.css.textStyle === 'stroke') {
+ this.ctx.strokeText(text, x, y, measuredWith);
+ } else {
+ this.ctx.fillText(text, x, y, measuredWith);
+ }
+ const fontSize = view.css.fontSize.toPx();
+ let textDecoration;
+ if (view.css.textDecoration) {
+ this.ctx.lineWidth = fontSize / 13;
+ this.ctx.beginPath();
+ if (/\bunderline\b/.test(view.css.textDecoration)) {
+ this.ctx.moveTo(lineX, y);
+ this.ctx.lineTo(lineX + measuredWith, y);
+ textDecoration = {
+ moveTo: [lineX, y],
+ lineTo: [lineX + measuredWith, y],
+ };
+ }
+ if (/\boverline\b/.test(view.css.textDecoration)) {
+ this.ctx.moveTo(lineX, y - fontSize);
+ this.ctx.lineTo(lineX + measuredWith, y - fontSize);
+ textDecoration = {
+ moveTo: [lineX, y - fontSize],
+ lineTo: [lineX + measuredWith, y - fontSize],
+ };
+ }
+ if (/\bline-through\b/.test(view.css.textDecoration)) {
+ this.ctx.moveTo(lineX, y - fontSize / 3);
+ this.ctx.lineTo(lineX + measuredWith, y - fontSize / 3);
+ textDecoration = {
+ moveTo: [lineX, y - fontSize / 3],
+ lineTo: [lineX + measuredWith, y - fontSize / 3],
+ };
+ }
+ this.ctx.closePath();
+ this.ctx.strokeStyle = view.css.color;
+ this.ctx.stroke();
+ }
+ if (view.id) {
+ penCache.textLines[view.id]
+ ? penCache.textLines[view.id].push({
+ text,
+ x,
+ y,
+ measuredWith,
+ textDecoration,
+ })
+ : (penCache.textLines[view.id] = [
+ {
+ text,
+ x,
+ y,
+ measuredWith,
+ textDecoration,
+ },
+ ]);
+ }
+ }
+ }
+ }
+ this.ctx.restore();
+ this._doBorder(view, width, height);
+ }
+
+ _drawAbsRect(view) {
+ this.ctx.save();
+ const { width, height } = this._preProcess(view);
+ if (GD.api.isGradient(view.css.color)) {
+ GD.api.doGradient(view.css.color, width, height, this.ctx);
+ } else {
+ this.ctx.fillStyle = view.css.color;
+ }
+ const { borderRadius, borderStyle, borderWidth } = view.css;
+ this._border({
+ borderRadius,
+ width,
+ height,
+ borderWidth,
+ borderStyle,
+ });
+ this.ctx.fill();
+ this.ctx.restore();
+ this._doBorder(view, width, height);
+ }
+
+ // shadow 支持 (x, y, blur, color), 不支持 spread
+ // shadow:0px 0px 10px rgba(0,0,0,0.1);
+ _doShadow(view) {
+ if (!view.css || !view.css.shadow) {
+ return;
+ }
+ const box = view.css.shadow.replace(/,\s+/g, ',').split(/\s+/);
+ if (box.length > 4) {
+ console.error("shadow don't spread option");
+ return;
+ }
+ this.ctx.shadowOffsetX = parseInt(box[0], 10);
+ this.ctx.shadowOffsetY = parseInt(box[1], 10);
+ this.ctx.shadowBlur = parseInt(box[2], 10);
+ this.ctx.shadowColor = box[3];
+ }
+
+ _getAngle(angle) {
+ return (Number(angle) * Math.PI) / 180;
+ }
+}
diff --git a/eaterplanet_ecommerce/components/painter/lib/qrcode.js b/eaterplanet_ecommerce/components/painter/lib/qrcode.js
new file mode 100644
index 0000000..adf1b64
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/lib/qrcode.js
@@ -0,0 +1,784 @@
+/* eslint-disable */
+!(function () {
+
+ // alignment pattern
+ var adelta = [
+ 0, 11, 15, 19, 23, 27, 31,
+ 16, 18, 20, 22, 24, 26, 28, 20, 22, 24, 24, 26, 28, 28, 22, 24, 24,
+ 26, 26, 28, 28, 24, 24, 26, 26, 26, 28, 28, 24, 26, 26, 26, 28, 28
+ ];
+
+ // version block
+ var vpat = [
+ 0xc94, 0x5bc, 0xa99, 0x4d3, 0xbf6, 0x762, 0x847, 0x60d,
+ 0x928, 0xb78, 0x45d, 0xa17, 0x532, 0x9a6, 0x683, 0x8c9,
+ 0x7ec, 0xec4, 0x1e1, 0xfab, 0x08e, 0xc1a, 0x33f, 0xd75,
+ 0x250, 0x9d5, 0x6f0, 0x8ba, 0x79f, 0xb0b, 0x42e, 0xa64,
+ 0x541, 0xc69
+ ];
+
+ // final format bits with mask: level << 3 | mask
+ var fmtword = [
+ 0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976, //L
+ 0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0, //M
+ 0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed, //Q
+ 0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b //H
+ ];
+
+ // 4 per version: number of blocks 1,2; data width; ecc width
+ var eccblocks = [
+ 1, 0, 19, 7, 1, 0, 16, 10, 1, 0, 13, 13, 1, 0, 9, 17,
+ 1, 0, 34, 10, 1, 0, 28, 16, 1, 0, 22, 22, 1, 0, 16, 28,
+ 1, 0, 55, 15, 1, 0, 44, 26, 2, 0, 17, 18, 2, 0, 13, 22,
+ 1, 0, 80, 20, 2, 0, 32, 18, 2, 0, 24, 26, 4, 0, 9, 16,
+ 1, 0, 108, 26, 2, 0, 43, 24, 2, 2, 15, 18, 2, 2, 11, 22,
+ 2, 0, 68, 18, 4, 0, 27, 16, 4, 0, 19, 24, 4, 0, 15, 28,
+ 2, 0, 78, 20, 4, 0, 31, 18, 2, 4, 14, 18, 4, 1, 13, 26,
+ 2, 0, 97, 24, 2, 2, 38, 22, 4, 2, 18, 22, 4, 2, 14, 26,
+ 2, 0, 116, 30, 3, 2, 36, 22, 4, 4, 16, 20, 4, 4, 12, 24,
+ 2, 2, 68, 18, 4, 1, 43, 26, 6, 2, 19, 24, 6, 2, 15, 28,
+ 4, 0, 81, 20, 1, 4, 50, 30, 4, 4, 22, 28, 3, 8, 12, 24,
+ 2, 2, 92, 24, 6, 2, 36, 22, 4, 6, 20, 26, 7, 4, 14, 28,
+ 4, 0, 107, 26, 8, 1, 37, 22, 8, 4, 20, 24, 12, 4, 11, 22,
+ 3, 1, 115, 30, 4, 5, 40, 24, 11, 5, 16, 20, 11, 5, 12, 24,
+ 5, 1, 87, 22, 5, 5, 41, 24, 5, 7, 24, 30, 11, 7, 12, 24,
+ 5, 1, 98, 24, 7, 3, 45, 28, 15, 2, 19, 24, 3, 13, 15, 30,
+ 1, 5, 107, 28, 10, 1, 46, 28, 1, 15, 22, 28, 2, 17, 14, 28,
+ 5, 1, 120, 30, 9, 4, 43, 26, 17, 1, 22, 28, 2, 19, 14, 28,
+ 3, 4, 113, 28, 3, 11, 44, 26, 17, 4, 21, 26, 9, 16, 13, 26,
+ 3, 5, 107, 28, 3, 13, 41, 26, 15, 5, 24, 30, 15, 10, 15, 28,
+ 4, 4, 116, 28, 17, 0, 42, 26, 17, 6, 22, 28, 19, 6, 16, 30,
+ 2, 7, 111, 28, 17, 0, 46, 28, 7, 16, 24, 30, 34, 0, 13, 24,
+ 4, 5, 121, 30, 4, 14, 47, 28, 11, 14, 24, 30, 16, 14, 15, 30,
+ 6, 4, 117, 30, 6, 14, 45, 28, 11, 16, 24, 30, 30, 2, 16, 30,
+ 8, 4, 106, 26, 8, 13, 47, 28, 7, 22, 24, 30, 22, 13, 15, 30,
+ 10, 2, 114, 28, 19, 4, 46, 28, 28, 6, 22, 28, 33, 4, 16, 30,
+ 8, 4, 122, 30, 22, 3, 45, 28, 8, 26, 23, 30, 12, 28, 15, 30,
+ 3, 10, 117, 30, 3, 23, 45, 28, 4, 31, 24, 30, 11, 31, 15, 30,
+ 7, 7, 116, 30, 21, 7, 45, 28, 1, 37, 23, 30, 19, 26, 15, 30,
+ 5, 10, 115, 30, 19, 10, 47, 28, 15, 25, 24, 30, 23, 25, 15, 30,
+ 13, 3, 115, 30, 2, 29, 46, 28, 42, 1, 24, 30, 23, 28, 15, 30,
+ 17, 0, 115, 30, 10, 23, 46, 28, 10, 35, 24, 30, 19, 35, 15, 30,
+ 17, 1, 115, 30, 14, 21, 46, 28, 29, 19, 24, 30, 11, 46, 15, 30,
+ 13, 6, 115, 30, 14, 23, 46, 28, 44, 7, 24, 30, 59, 1, 16, 30,
+ 12, 7, 121, 30, 12, 26, 47, 28, 39, 14, 24, 30, 22, 41, 15, 30,
+ 6, 14, 121, 30, 6, 34, 47, 28, 46, 10, 24, 30, 2, 64, 15, 30,
+ 17, 4, 122, 30, 29, 14, 46, 28, 49, 10, 24, 30, 24, 46, 15, 30,
+ 4, 18, 122, 30, 13, 32, 46, 28, 48, 14, 24, 30, 42, 32, 15, 30,
+ 20, 4, 117, 30, 40, 7, 47, 28, 43, 22, 24, 30, 10, 67, 15, 30,
+ 19, 6, 118, 30, 18, 31, 47, 28, 34, 34, 24, 30, 20, 61, 15, 30
+ ];
+
+ // Galois field log table
+ var glog = [
+ 0xff, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b,
+ 0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71,
+ 0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45,
+ 0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6,
+ 0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88,
+ 0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40,
+ 0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d,
+ 0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b, 0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57,
+ 0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d, 0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18,
+ 0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c, 0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e,
+ 0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd, 0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61,
+ 0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e, 0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2,
+ 0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76, 0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6,
+ 0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa, 0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a,
+ 0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51, 0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7,
+ 0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8, 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf
+ ];
+
+ // Galios field exponent table
+ var gexp = [
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26,
+ 0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9, 0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0,
+ 0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35, 0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23,
+ 0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, 0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1,
+ 0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc, 0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0,
+ 0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f, 0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2,
+ 0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce,
+ 0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93, 0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc,
+ 0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9, 0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54,
+ 0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa, 0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73,
+ 0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e, 0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff,
+ 0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4, 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41,
+ 0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6,
+ 0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09,
+ 0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16,
+ 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x00
+ ];
+
+ // Working buffers:
+ // data input and ecc append, image working buffer, fixed part of image, run lengths for badness
+ var strinbuf = [], eccbuf = [], qrframe = [], framask = [], rlens = [];
+ // Control values - width is based on version, last 4 are from table.
+ var version, width, neccblk1, neccblk2, datablkw, eccblkwid;
+ var ecclevel = 2;
+ // set bit to indicate cell in qrframe is immutable. symmetric around diagonal
+ function setmask(x, y) {
+ var bt;
+ if (x > y) {
+ bt = x;
+ x = y;
+ y = bt;
+ }
+ // y*y = 1+3+5...
+ bt = y;
+ bt *= y;
+ bt += y;
+ bt >>= 1;
+ bt += x;
+ framask[bt] = 1;
+ }
+
+ // enter alignment pattern - black to qrframe, white to mask (later black frame merged to mask)
+ function putalign(x, y) {
+ var j;
+
+ qrframe[x + width * y] = 1;
+ for (j = -2; j < 2; j++) {
+ qrframe[(x + j) + width * (y - 2)] = 1;
+ qrframe[(x - 2) + width * (y + j + 1)] = 1;
+ qrframe[(x + 2) + width * (y + j)] = 1;
+ qrframe[(x + j + 1) + width * (y + 2)] = 1;
+ }
+ for (j = 0; j < 2; j++) {
+ setmask(x - 1, y + j);
+ setmask(x + 1, y - j);
+ setmask(x - j, y - 1);
+ setmask(x + j, y + 1);
+ }
+ }
+
+ //========================================================================
+ // Reed Solomon error correction
+ // exponentiation mod N
+ function modnn(x) {
+ while (x >= 255) {
+ x -= 255;
+ x = (x >> 8) + (x & 255);
+ }
+ return x;
+ }
+
+ var genpoly = [];
+
+ // Calculate and append ECC data to data block. Block is in strinbuf, indexes to buffers given.
+ function appendrs(data, dlen, ecbuf, eclen) {
+ var i, j, fb;
+
+ for (i = 0; i < eclen; i++)
+ strinbuf[ecbuf + i] = 0;
+ for (i = 0; i < dlen; i++) {
+ fb = glog[strinbuf[data + i] ^ strinbuf[ecbuf]];
+ if (fb != 255) /* fb term is non-zero */
+ for (j = 1; j < eclen; j++)
+ strinbuf[ecbuf + j - 1] = strinbuf[ecbuf + j] ^ gexp[modnn(fb + genpoly[eclen - j])];
+ else
+ for (j = ecbuf; j < ecbuf + eclen; j++)
+ strinbuf[j] = strinbuf[j + 1];
+ strinbuf[ecbuf + eclen - 1] = fb == 255 ? 0 : gexp[modnn(fb + genpoly[0])];
+ }
+ }
+
+ //========================================================================
+ // Frame data insert following the path rules
+
+ // check mask - since symmetrical use half.
+ function ismasked(x, y) {
+ var bt;
+ if (x > y) {
+ bt = x;
+ x = y;
+ y = bt;
+ }
+ bt = y;
+ bt += y * y;
+ bt >>= 1;
+ bt += x;
+ return framask[bt];
+ }
+
+ //========================================================================
+ // Apply the selected mask out of the 8.
+ function applymask(m) {
+ var x, y, r3x, r3y;
+
+ switch (m) {
+ case 0:
+ for (y = 0; y < width; y++)
+ for (x = 0; x < width; x++)
+ if (!((x + y) & 1) && !ismasked(x, y))
+ qrframe[x + y * width] ^= 1;
+ break;
+ case 1:
+ for (y = 0; y < width; y++)
+ for (x = 0; x < width; x++)
+ if (!(y & 1) && !ismasked(x, y))
+ qrframe[x + y * width] ^= 1;
+ break;
+ case 2:
+ for (y = 0; y < width; y++)
+ for (r3x = 0, x = 0; x < width; x++ , r3x++) {
+ if (r3x == 3)
+ r3x = 0;
+ if (!r3x && !ismasked(x, y))
+ qrframe[x + y * width] ^= 1;
+ }
+ break;
+ case 3:
+ for (r3y = 0, y = 0; y < width; y++ , r3y++) {
+ if (r3y == 3)
+ r3y = 0;
+ for (r3x = r3y, x = 0; x < width; x++ , r3x++) {
+ if (r3x == 3)
+ r3x = 0;
+ if (!r3x && !ismasked(x, y))
+ qrframe[x + y * width] ^= 1;
+ }
+ }
+ break;
+ case 4:
+ for (y = 0; y < width; y++)
+ for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++ , r3x++) {
+ if (r3x == 3) {
+ r3x = 0;
+ r3y = !r3y;
+ }
+ if (!r3y && !ismasked(x, y))
+ qrframe[x + y * width] ^= 1;
+ }
+ break;
+ case 5:
+ for (r3y = 0, y = 0; y < width; y++ , r3y++) {
+ if (r3y == 3)
+ r3y = 0;
+ for (r3x = 0, x = 0; x < width; x++ , r3x++) {
+ if (r3x == 3)
+ r3x = 0;
+ if (!((x & y & 1) + !(!r3x | !r3y)) && !ismasked(x, y))
+ qrframe[x + y * width] ^= 1;
+ }
+ }
+ break;
+ case 6:
+ for (r3y = 0, y = 0; y < width; y++ , r3y++) {
+ if (r3y == 3)
+ r3y = 0;
+ for (r3x = 0, x = 0; x < width; x++ , r3x++) {
+ if (r3x == 3)
+ r3x = 0;
+ if (!(((x & y & 1) + (r3x && (r3x == r3y))) & 1) && !ismasked(x, y))
+ qrframe[x + y * width] ^= 1;
+ }
+ }
+ break;
+ case 7:
+ for (r3y = 0, y = 0; y < width; y++ , r3y++) {
+ if (r3y == 3)
+ r3y = 0;
+ for (r3x = 0, x = 0; x < width; x++ , r3x++) {
+ if (r3x == 3)
+ r3x = 0;
+ if (!(((r3x && (r3x == r3y)) + ((x + y) & 1)) & 1) && !ismasked(x, y))
+ qrframe[x + y * width] ^= 1;
+ }
+ }
+ break;
+ }
+ return;
+ }
+
+ // Badness coefficients.
+ var N1 = 3, N2 = 3, N3 = 40, N4 = 10;
+
+ // Using the table of the length of each run, calculate the amount of bad image
+ // - long runs or those that look like finders; called twice, once each for X and Y
+ function badruns(length) {
+ var i;
+ var runsbad = 0;
+ for (i = 0; i <= length; i++)
+ if (rlens[i] >= 5)
+ runsbad += N1 + rlens[i] - 5;
+ // BwBBBwB as in finder
+ for (i = 3; i < length - 1; i += 2)
+ if (rlens[i - 2] == rlens[i + 2]
+ && rlens[i + 2] == rlens[i - 1]
+ && rlens[i - 1] == rlens[i + 1]
+ && rlens[i - 1] * 3 == rlens[i]
+ // white around the black pattern? Not part of spec
+ && (rlens[i - 3] == 0 // beginning
+ || i + 3 > length // end
+ || rlens[i - 3] * 3 >= rlens[i] * 4 || rlens[i + 3] * 3 >= rlens[i] * 4)
+ )
+ runsbad += N3;
+ return runsbad;
+ }
+
+ // Calculate how bad the masked image is - blocks, imbalance, runs, or finders.
+ function badcheck() {
+ var x, y, h, b, b1;
+ var thisbad = 0;
+ var bw = 0;
+
+ // blocks of same color.
+ for (y = 0; y < width - 1; y++)
+ for (x = 0; x < width - 1; x++)
+ if ((qrframe[x + width * y] && qrframe[(x + 1) + width * y]
+ && qrframe[x + width * (y + 1)] && qrframe[(x + 1) + width * (y + 1)]) // all black
+ || !(qrframe[x + width * y] || qrframe[(x + 1) + width * y]
+ || qrframe[x + width * (y + 1)] || qrframe[(x + 1) + width * (y + 1)])) // all white
+ thisbad += N2;
+
+ // X runs
+ for (y = 0; y < width; y++) {
+ rlens[0] = 0;
+ for (h = b = x = 0; x < width; x++) {
+ if ((b1 = qrframe[x + width * y]) == b)
+ rlens[h]++;
+ else
+ rlens[++h] = 1;
+ b = b1;
+ bw += b ? 1 : -1;
+ }
+ thisbad += badruns(h);
+ }
+
+ // black/white imbalance
+ if (bw < 0)
+ bw = -bw;
+
+ var big = bw;
+ var count = 0;
+ big += big << 2;
+ big <<= 1;
+ while (big > width * width)
+ big -= width * width, count++;
+ thisbad += count * N4;
+
+ // Y runs
+ for (x = 0; x < width; x++) {
+ rlens[0] = 0;
+ for (h = b = y = 0; y < width; y++) {
+ if ((b1 = qrframe[x + width * y]) == b)
+ rlens[h]++;
+ else
+ rlens[++h] = 1;
+ b = b1;
+ }
+ thisbad += badruns(h);
+ }
+ return thisbad;
+ }
+
+ function genframe(instring) {
+ var x, y, k, t, v, i, j, m;
+
+ // find the smallest version that fits the string
+ t = instring.length;
+ version = 0;
+ do {
+ version++;
+ k = (ecclevel - 1) * 4 + (version - 1) * 16;
+ neccblk1 = eccblocks[k++];
+ neccblk2 = eccblocks[k++];
+ datablkw = eccblocks[k++];
+ eccblkwid = eccblocks[k];
+ k = datablkw * (neccblk1 + neccblk2) + neccblk2 - 3 + (version <= 9);
+ if (t <= k)
+ break;
+ } while (version < 40);
+
+ // FIXME - insure that it fits insted of being truncated
+ width = 17 + 4 * version;
+
+ // allocate, clear and setup data structures
+ v = datablkw + (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2;
+ for (t = 0; t < v; t++)
+ eccbuf[t] = 0;
+ strinbuf = instring.slice(0);
+
+ for (t = 0; t < width * width; t++)
+ qrframe[t] = 0;
+
+ for (t = 0; t < (width * (width + 1) + 1) / 2; t++)
+ framask[t] = 0;
+
+ // insert finders - black to frame, white to mask
+ for (t = 0; t < 3; t++) {
+ k = 0;
+ y = 0;
+ if (t == 1)
+ k = (width - 7);
+ if (t == 2)
+ y = (width - 7);
+ qrframe[(y + 3) + width * (k + 3)] = 1;
+ for (x = 0; x < 6; x++) {
+ qrframe[(y + x) + width * k] = 1;
+ qrframe[y + width * (k + x + 1)] = 1;
+ qrframe[(y + 6) + width * (k + x)] = 1;
+ qrframe[(y + x + 1) + width * (k + 6)] = 1;
+ }
+ for (x = 1; x < 5; x++) {
+ setmask(y + x, k + 1);
+ setmask(y + 1, k + x + 1);
+ setmask(y + 5, k + x);
+ setmask(y + x + 1, k + 5);
+ }
+ for (x = 2; x < 4; x++) {
+ qrframe[(y + x) + width * (k + 2)] = 1;
+ qrframe[(y + 2) + width * (k + x + 1)] = 1;
+ qrframe[(y + 4) + width * (k + x)] = 1;
+ qrframe[(y + x + 1) + width * (k + 4)] = 1;
+ }
+ }
+
+ // alignment blocks
+ if (version > 1) {
+ t = adelta[version];
+ y = width - 7;
+ for (; ;) {
+ x = width - 7;
+ while (x > t - 3) {
+ putalign(x, y);
+ if (x < t)
+ break;
+ x -= t;
+ }
+ if (y <= t + 9)
+ break;
+ y -= t;
+ putalign(6, y);
+ putalign(y, 6);
+ }
+ }
+
+ // single black
+ qrframe[8 + width * (width - 8)] = 1;
+
+ // timing gap - mask only
+ for (y = 0; y < 7; y++) {
+ setmask(7, y);
+ setmask(width - 8, y);
+ setmask(7, y + width - 7);
+ }
+ for (x = 0; x < 8; x++) {
+ setmask(x, 7);
+ setmask(x + width - 8, 7);
+ setmask(x, width - 8);
+ }
+
+ // reserve mask-format area
+ for (x = 0; x < 9; x++)
+ setmask(x, 8);
+ for (x = 0; x < 8; x++) {
+ setmask(x + width - 8, 8);
+ setmask(8, x);
+ }
+ for (y = 0; y < 7; y++)
+ setmask(8, y + width - 7);
+
+ // timing row/col
+ for (x = 0; x < width - 14; x++)
+ if (x & 1) {
+ setmask(8 + x, 6);
+ setmask(6, 8 + x);
+ }
+ else {
+ qrframe[(8 + x) + width * 6] = 1;
+ qrframe[6 + width * (8 + x)] = 1;
+ }
+
+ // version block
+ if (version > 6) {
+ t = vpat[version - 7];
+ k = 17;
+ for (x = 0; x < 6; x++)
+ for (y = 0; y < 3; y++ , k--)
+ if (1 & (k > 11 ? version >> (k - 12) : t >> k)) {
+ qrframe[(5 - x) + width * (2 - y + width - 11)] = 1;
+ qrframe[(2 - y + width - 11) + width * (5 - x)] = 1;
+ }
+ else {
+ setmask(5 - x, 2 - y + width - 11);
+ setmask(2 - y + width - 11, 5 - x);
+ }
+ }
+
+ // sync mask bits - only set above for white spaces, so add in black bits
+ for (y = 0; y < width; y++)
+ for (x = 0; x <= y; x++)
+ if (qrframe[x + width * y])
+ setmask(x, y);
+
+ // convert string to bitstream
+ // 8 bit data to QR-coded 8 bit data (numeric or alphanum, or kanji not supported)
+ v = strinbuf.length;
+
+ // string to array
+ for (i = 0; i < v; i++)
+ eccbuf[i] = strinbuf.charCodeAt(i);
+ strinbuf = eccbuf.slice(0);
+
+ // calculate max string length
+ x = datablkw * (neccblk1 + neccblk2) + neccblk2;
+ if (v >= x - 2) {
+ v = x - 2;
+ if (version > 9)
+ v--;
+ }
+
+ // shift and repack to insert length prefix
+ i = v;
+ if (version > 9) {
+ strinbuf[i + 2] = 0;
+ strinbuf[i + 3] = 0;
+ while (i--) {
+ t = strinbuf[i];
+ strinbuf[i + 3] |= 255 & (t << 4);
+ strinbuf[i + 2] = t >> 4;
+ }
+ strinbuf[2] |= 255 & (v << 4);
+ strinbuf[1] = v >> 4;
+ strinbuf[0] = 0x40 | (v >> 12);
+ }
+ else {
+ strinbuf[i + 1] = 0;
+ strinbuf[i + 2] = 0;
+ while (i--) {
+ t = strinbuf[i];
+ strinbuf[i + 2] |= 255 & (t << 4);
+ strinbuf[i + 1] = t >> 4;
+ }
+ strinbuf[1] |= 255 & (v << 4);
+ strinbuf[0] = 0x40 | (v >> 4);
+ }
+ // fill to end with pad pattern
+ i = v + 3 - (version < 10);
+ while (i < x) {
+ strinbuf[i++] = 0xec;
+ // buffer has room if (i == x) break;
+ strinbuf[i++] = 0x11;
+ }
+
+ // calculate and append ECC
+
+ // calculate generator polynomial
+ genpoly[0] = 1;
+ for (i = 0; i < eccblkwid; i++) {
+ genpoly[i + 1] = 1;
+ for (j = i; j > 0; j--)
+ genpoly[j] = genpoly[j]
+ ? genpoly[j - 1] ^ gexp[modnn(glog[genpoly[j]] + i)] : genpoly[j - 1];
+ genpoly[0] = gexp[modnn(glog[genpoly[0]] + i)];
+ }
+ for (i = 0; i <= eccblkwid; i++)
+ genpoly[i] = glog[genpoly[i]]; // use logs for genpoly[] to save calc step
+
+ // append ecc to data buffer
+ k = x;
+ y = 0;
+ for (i = 0; i < neccblk1; i++) {
+ appendrs(y, datablkw, k, eccblkwid);
+ y += datablkw;
+ k += eccblkwid;
+ }
+ for (i = 0; i < neccblk2; i++) {
+ appendrs(y, datablkw + 1, k, eccblkwid);
+ y += datablkw + 1;
+ k += eccblkwid;
+ }
+ // interleave blocks
+ y = 0;
+ for (i = 0; i < datablkw; i++) {
+ for (j = 0; j < neccblk1; j++)
+ eccbuf[y++] = strinbuf[i + j * datablkw];
+ for (j = 0; j < neccblk2; j++)
+ eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))];
+ }
+ for (j = 0; j < neccblk2; j++)
+ eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))];
+ for (i = 0; i < eccblkwid; i++)
+ for (j = 0; j < neccblk1 + neccblk2; j++)
+ eccbuf[y++] = strinbuf[x + i + j * eccblkwid];
+ strinbuf = eccbuf;
+
+ // pack bits into frame avoiding masked area.
+ x = y = width - 1;
+ k = v = 1; // up, minus
+ /* inteleaved data and ecc codes */
+ m = (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2;
+ for (i = 0; i < m; i++) {
+ t = strinbuf[i];
+ for (j = 0; j < 8; j++ , t <<= 1) {
+ if (0x80 & t)
+ qrframe[x + width * y] = 1;
+ do { // find next fill position
+ if (v)
+ x--;
+ else {
+ x++;
+ if (k) {
+ if (y != 0)
+ y--;
+ else {
+ x -= 2;
+ k = !k;
+ if (x == 6) {
+ x--;
+ y = 9;
+ }
+ }
+ }
+ else {
+ if (y != width - 1)
+ y++;
+ else {
+ x -= 2;
+ k = !k;
+ if (x == 6) {
+ x--;
+ y -= 8;
+ }
+ }
+ }
+ }
+ v = !v;
+ } while (ismasked(x, y));
+ }
+ }
+
+ // save pre-mask copy of frame
+ strinbuf = qrframe.slice(0);
+ t = 0; // best
+ y = 30000; // demerit
+ // for instead of while since in original arduino code
+ // if an early mask was "good enough" it wouldn't try for a better one
+ // since they get more complex and take longer.
+ for (k = 0; k < 8; k++) {
+ applymask(k); // returns black-white imbalance
+ x = badcheck();
+ if (x < y) { // current mask better than previous best?
+ y = x;
+ t = k;
+ }
+ if (t == 7)
+ break; // don't increment i to a void redoing mask
+ qrframe = strinbuf.slice(0); // reset for next pass
+ }
+ if (t != k) // redo best mask - none good enough, last wasn't t
+ applymask(t);
+
+ // add in final mask/ecclevel bytes
+ y = fmtword[t + ((ecclevel - 1) << 3)];
+ // low byte
+ for (k = 0; k < 8; k++ , y >>= 1)
+ if (y & 1) {
+ qrframe[(width - 1 - k) + width * 8] = 1;
+ if (k < 6)
+ qrframe[8 + width * k] = 1;
+ else
+ qrframe[8 + width * (k + 1)] = 1;
+ }
+ // high byte
+ for (k = 0; k < 7; k++ , y >>= 1)
+ if (y & 1) {
+ qrframe[8 + width * (width - 7 + k)] = 1;
+ if (k)
+ qrframe[(6 - k) + width * 8] = 1;
+ else
+ qrframe[7 + width * 8] = 1;
+ }
+ return qrframe;
+ }
+
+
+
+
+ var _canvas = null;
+
+ var api = {
+
+ get ecclevel() {
+ return ecclevel;
+ },
+
+ set ecclevel(val) {
+ ecclevel = val;
+ },
+
+ get size() {
+ return _size;
+ },
+
+ set size(val) {
+ _size = val
+ },
+
+ get canvas() {
+ return _canvas;
+ },
+
+ set canvas(el) {
+ _canvas = el;
+ },
+
+ getFrame: function (string) {
+ return genframe(string);
+ },
+ //这里的utf16to8(str)是对Text中的字符串进行转码,让其支持中文
+ utf16to8: function (str) {
+ var out, i, len, c;
+
+ out = "";
+ len = str.length;
+ for (i = 0; i < len; i++) {
+ c = str.charCodeAt(i);
+ if ((c >= 0x0001) && (c <= 0x007F)) {
+ out += str.charAt(i);
+ } else if (c > 0x07FF) {
+ out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
+ out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
+ out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
+ } else {
+ out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
+ out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
+ }
+ }
+ return out;
+ },
+ /**
+ * 新增$this参数,传入组件的this,兼容在组件中生成
+ * @param bg 目前只能设置颜色值
+ */
+ draw: function (str, ctx, startX, startY, cavW, cavH, bg, color, $this, ecc) {
+ var that = this;
+ ecclevel = ecc || ecclevel;
+ if (!ctx) {
+ console.warn('No canvas provided to draw QR code in!')
+ return;
+ }
+ var size = Math.min(cavW, cavH);
+ str = that.utf16to8(str);//增加中文显示
+
+ var frame = that.getFrame(str);
+ var px = size / width;
+ if (bg) {
+ ctx.fillStyle = bg;
+ ctx.fillRect(startX, startY, cavW, cavW);
+ }
+ ctx.fillStyle = color || 'black';
+ for (var i = 0; i < width; i++) {
+ for (var j = 0; j < width; j++) {
+ if (frame[j * width + i]) {
+ ctx.fillRect(startX + px * i, startY + px * j, px, px);
+ }
+ }
+ }
+ }
+ }
+ module.exports = { api }
+ // exports.draw = api;
+
+})();
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/painter/lib/sha1.js b/eaterplanet_ecommerce/components/painter/lib/sha1.js
new file mode 100644
index 0000000..e743ec1
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/lib/sha1.js
@@ -0,0 +1,97 @@
+var hexcase = 0;
+var chrsz = 8;
+
+function hex_sha1(s) {
+ return binb2hex(core_sha1(str2binb(s), s.length * chrsz));
+}
+
+function core_sha1(x, len) {
+ x[len >> 5] |= 0x80 << (24 - (len % 32));
+ x[(((len + 64) >> 9) << 4) + 15] = len;
+
+ var w = Array(80);
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+ var e = -1009589776;
+
+ for (var i = 0; i < x.length; i += 16) {
+ var olda = a;
+ var oldb = b;
+ var oldc = c;
+ var oldd = d;
+ var olde = e;
+
+ for (var j = 0; j < 80; j++) {
+ if (j < 16) w[j] = x[i + j];
+ else w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
+ var t = safe_add(
+ safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
+ safe_add(safe_add(e, w[j]), sha1_kt(j))
+ );
+ e = d;
+ d = c;
+ c = rol(b, 30);
+ b = a;
+ a = t;
+ }
+
+ a = safe_add(a, olda);
+ b = safe_add(b, oldb);
+ c = safe_add(c, oldc);
+ d = safe_add(d, oldd);
+ e = safe_add(e, olde);
+ }
+ return Array(a, b, c, d, e);
+}
+
+function sha1_ft(t, b, c, d) {
+ if (t < 20) return (b & c) | (~b & d);
+ if (t < 40) return b ^ c ^ d;
+ if (t < 60) return (b & c) | (b & d) | (c & d);
+ return b ^ c ^ d;
+}
+
+function sha1_kt(t) {
+ return t < 20
+ ? 1518500249
+ : t < 40
+ ? 1859775393
+ : t < 60
+ ? -1894007588
+ : -899497514;
+}
+
+function safe_add(x, y) {
+ var lsw = (x & 0xffff) + (y & 0xffff);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xffff);
+}
+
+function rol(num, cnt) {
+ return (num << cnt) | (num >>> (32 - cnt));
+}
+
+function str2binb(str) {
+ var bin = Array();
+ var mask = (1 << chrsz) - 1;
+ for (var i = 0; i < str.length * chrsz; i += chrsz)
+ bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - (i % 32));
+ return bin;
+}
+
+function binb2hex(binarray) {
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var str = "";
+ for (var i = 0; i < binarray.length * 4; i++) {
+ str +=
+ hex_tab.charAt((binarray[i >> 2] >> ((3 - (i % 4)) * 8 + 4)) & 0xf) +
+ hex_tab.charAt((binarray[i >> 2] >> ((3 - (i % 4)) * 8)) & 0xf);
+ }
+ return str;
+}
+
+module.exports = {
+ hex_sha1,
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/painter/lib/string-polyfill.js b/eaterplanet_ecommerce/components/painter/lib/string-polyfill.js
new file mode 100644
index 0000000..1d13f53
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/lib/string-polyfill.js
@@ -0,0 +1,46 @@
+String.prototype.substr = function (start, length) {
+ if (start === undefined) {
+ return this.toString()
+ }
+ if (typeof start !== 'number' || (typeof length !== 'number' && length !== undefined) ) {
+ return ''
+ }
+ const strArr = [...this]
+ const _length = strArr.length
+ if (_length + start < 0) {
+ start = 0
+ }
+ if (length === undefined || (start < 0 && start + length > 0)) {
+ return strArr.slice(start).join('')
+ } else {
+ return strArr.slice(start, start + length).join('')
+ }
+}
+
+
+String.prototype.substring = function (start, end) {
+ if (start === undefined) {
+ return this.toString()
+ }
+ if (typeof start !== 'number' || (typeof end !== 'number' && end !== undefined) ) {
+ return ''
+ }
+ if (!(start > 0)) {
+ start = 0
+ }
+ if (!(end > 0) && end !== undefined) {
+ end = 0
+ }
+ const strArr = [...this]
+ const _length = strArr.length
+ if (start > _length) {
+ start = _length
+ }
+ if (end > _length) {
+ end = _length
+ }
+ if (end < start) {
+ [start, end] = [end, start]
+ }
+ return strArr.slice(start, end).join('')
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/painter/lib/util.js b/eaterplanet_ecommerce/components/painter/lib/util.js
new file mode 100644
index 0000000..fb1476a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/lib/util.js
@@ -0,0 +1,78 @@
+
+function isValidUrl(url) {
+ return isOnlineUrl(url) || isDataUrl(url);
+}
+
+function isOnlineUrl(url) {
+ return /((ht|f)tp(s?)|cloud):\/\/([^ \\/]*\.)+[^ \\/]*(:[0-9]+)?\/?/.test(url)
+}
+
+function isDataUrl(url) {
+ return /data:image\/(\w+);base64,(.*)/.test(url);
+}
+
+/**
+ * 深度对比两个对象是否一致
+ * from: https://github.com/epoberezkin/fast-deep-equal
+ * @param {Object} a 对象a
+ * @param {Object} b 对象b
+ * @return {Boolean} 是否相同
+ */
+/* eslint-disable */
+function equal(a, b) {
+ if (a === b) return true;
+
+ if (a && b && typeof a == 'object' && typeof b == 'object') {
+ var arrA = Array.isArray(a)
+ , arrB = Array.isArray(b)
+ , i
+ , length
+ , key;
+
+ if (arrA && arrB) {
+ length = a.length;
+ if (length != b.length) return false;
+ for (i = length; i-- !== 0;)
+ if (!equal(a[i], b[i])) return false;
+ return true;
+ }
+
+ if (arrA != arrB) return false;
+
+ var dateA = a instanceof Date
+ , dateB = b instanceof Date;
+ if (dateA != dateB) return false;
+ if (dateA && dateB) return a.getTime() == b.getTime();
+
+ var regexpA = a instanceof RegExp
+ , regexpB = b instanceof RegExp;
+ if (regexpA != regexpB) return false;
+ if (regexpA && regexpB) return a.toString() == b.toString();
+
+ var keys = Object.keys(a);
+ length = keys.length;
+
+ if (length !== Object.keys(b).length)
+ return false;
+
+ for (i = length; i-- !== 0;)
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
+
+ for (i = length; i-- !== 0;) {
+ key = keys[i];
+ if (!equal(a[key], b[key])) return false;
+ }
+
+ return true;
+ }
+
+ return a!==a && b!==b;
+}
+
+module.exports = {
+ isValidUrl,
+ isOnlineUrl,
+ isDataUrl,
+ equal
+};
+
diff --git a/eaterplanet_ecommerce/components/painter/lib/wx-canvas.js b/eaterplanet_ecommerce/components/painter/lib/wx-canvas.js
new file mode 100644
index 0000000..42c8474
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/lib/wx-canvas.js
@@ -0,0 +1,619 @@
+// @ts-check
+export default class WxCanvas {
+ ctx;
+ type;
+ canvasId;
+ canvasNode;
+ stepList = [];
+ canvasPrototype = {};
+
+ constructor(type, ctx, canvasId, isNew, canvasNode) {
+ this.ctx = ctx;
+ this.canvasId = canvasId;
+ this.type = type;
+ if (isNew) {
+ this.canvasNode = canvasNode || {};
+ }
+ }
+
+ set width(w) {
+ if (this.canvasNode) {
+ this.canvasNode.width = w;
+ // 经测试,在 2d 接口中如果不设置这个值,IOS 端有一定几率会出现图片显示不全的情况。
+ this.canvasNode._width = w;
+ }
+ }
+
+ get width() {
+ if (this.canvasNode) return this.canvasNode.width;
+ return 0;
+ }
+
+ set height(h) {
+ if (this.canvasNode) {
+ this.canvasNode.height = h;
+ // 经测试,在 2d 接口中如果不设置这个值,IOS 端有一定几率会出现图片显示不全的情况。
+ this.canvasNode._height = h;
+ }
+ }
+
+ get height() {
+ if (this.canvasNode) return this.canvasNode.height;
+ return 0;
+ }
+
+ set lineWidth(args) {
+ this.canvasPrototype.lineWidth = args;
+ this.stepList.push({
+ action: "lineWidth",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get lineWidth() {
+ return this.canvasPrototype.lineWidth;
+ }
+
+ set lineCap(args) {
+ this.canvasPrototype.lineCap = args;
+ this.stepList.push({
+ action: "lineCap",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get lineCap() {
+ return this.canvasPrototype.lineCap;
+ }
+
+ set lineJoin(args) {
+ this.canvasPrototype.lineJoin = args;
+ this.stepList.push({
+ action: "lineJoin",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get lineJoin() {
+ return this.canvasPrototype.lineJoin;
+ }
+
+ set miterLimit(args) {
+ this.canvasPrototype.miterLimit = args;
+ this.stepList.push({
+ action: "miterLimit",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get miterLimit() {
+ return this.canvasPrototype.miterLimit;
+ }
+
+ set lineDashOffset(args) {
+ this.canvasPrototype.lineDashOffset = args;
+ this.stepList.push({
+ action: "lineDashOffset",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get lineDashOffset() {
+ return this.canvasPrototype.lineDashOffset;
+ }
+
+ set font(args) {
+ this.canvasPrototype.font = args;
+ this.ctx.font = args;
+ this.stepList.push({
+ action: "font",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get font() {
+ return this.canvasPrototype.font;
+ }
+
+ set textAlign(args) {
+ this.canvasPrototype.textAlign = args;
+ this.stepList.push({
+ action: "textAlign",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get textAlign() {
+ return this.canvasPrototype.textAlign;
+ }
+
+ set textBaseline(args) {
+ this.canvasPrototype.textBaseline = args;
+ this.stepList.push({
+ action: "textBaseline",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get textBaseline() {
+ return this.canvasPrototype.textBaseline;
+ }
+
+ set fillStyle(args) {
+ this.canvasPrototype.fillStyle = args;
+ this.stepList.push({
+ action: "fillStyle",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get fillStyle() {
+ return this.canvasPrototype.fillStyle;
+ }
+
+ set strokeStyle(args) {
+ this.canvasPrototype.strokeStyle = args;
+ this.stepList.push({
+ action: "strokeStyle",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get strokeStyle() {
+ return this.canvasPrototype.strokeStyle;
+ }
+
+ set globalAlpha(args) {
+ this.canvasPrototype.globalAlpha = args;
+ this.stepList.push({
+ action: "globalAlpha",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get globalAlpha() {
+ return this.canvasPrototype.globalAlpha;
+ }
+
+ set globalCompositeOperation(args) {
+ this.canvasPrototype.globalCompositeOperation = args;
+ this.stepList.push({
+ action: "globalCompositeOperation",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get globalCompositeOperation() {
+ return this.canvasPrototype.globalCompositeOperation;
+ }
+
+ set shadowColor(args) {
+ this.canvasPrototype.shadowColor = args;
+ this.stepList.push({
+ action: "shadowColor",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get shadowColor() {
+ return this.canvasPrototype.shadowColor;
+ }
+
+ set shadowOffsetX(args) {
+ this.canvasPrototype.shadowOffsetX = args;
+ this.stepList.push({
+ action: "shadowOffsetX",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get shadowOffsetX() {
+ return this.canvasPrototype.shadowOffsetX;
+ }
+
+ set shadowOffsetY(args) {
+ this.canvasPrototype.shadowOffsetY = args;
+ this.stepList.push({
+ action: "shadowOffsetY",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get shadowOffsetY() {
+ return this.canvasPrototype.shadowOffsetY;
+ }
+
+ set shadowBlur(args) {
+ this.canvasPrototype.shadowBlur = args;
+ this.stepList.push({
+ action: "shadowBlur",
+ args,
+ actionType: "set",
+ });
+ }
+
+ get shadowBlur() {
+ return this.canvasPrototype.shadowBlur;
+ }
+
+ save() {
+ this.stepList.push({
+ action: "save",
+ args: null,
+ actionType: "func",
+ });
+ }
+
+ restore() {
+ this.stepList.push({
+ action: "restore",
+ args: null,
+ actionType: "func",
+ });
+ }
+
+ setLineDash(...args) {
+ this.canvasPrototype.lineDash = args;
+ this.stepList.push({
+ action: "setLineDash",
+ args,
+ actionType: "func",
+ });
+ }
+
+ moveTo(...args) {
+ this.stepList.push({
+ action: "moveTo",
+ args,
+ actionType: "func",
+ });
+ }
+
+ closePath() {
+ this.stepList.push({
+ action: "closePath",
+ args: null,
+ actionType: "func",
+ });
+ }
+
+ lineTo(...args) {
+ this.stepList.push({
+ action: "lineTo",
+ args,
+ actionType: "func",
+ });
+ }
+
+ quadraticCurveTo(...args) {
+ this.stepList.push({
+ action: "quadraticCurveTo",
+ args,
+ actionType: "func",
+ });
+ }
+
+ bezierCurveTo(...args) {
+ this.stepList.push({
+ action: "bezierCurveTo",
+ args,
+ actionType: "func",
+ });
+ }
+
+ arcTo(...args) {
+ this.stepList.push({
+ action: "arcTo",
+ args,
+ actionType: "func",
+ });
+ }
+
+ arc(...args) {
+ this.stepList.push({
+ action: "arc",
+ args,
+ actionType: "func",
+ });
+ }
+
+ rect(...args) {
+ this.stepList.push({
+ action: "rect",
+ args,
+ actionType: "func",
+ });
+ }
+
+ scale(...args) {
+ this.stepList.push({
+ action: "scale",
+ args,
+ actionType: "func",
+ });
+ }
+
+ rotate(...args) {
+ this.stepList.push({
+ action: "rotate",
+ args,
+ actionType: "func",
+ });
+ }
+
+ translate(...args) {
+ this.stepList.push({
+ action: "translate",
+ args,
+ actionType: "func",
+ });
+ }
+
+ transform(...args) {
+ this.stepList.push({
+ action: "transform",
+ args,
+ actionType: "func",
+ });
+ }
+
+ setTransform(...args) {
+ this.stepList.push({
+ action: "setTransform",
+ args,
+ actionType: "func",
+ });
+ }
+
+ clearRect(...args) {
+ this.stepList.push({
+ action: "clearRect",
+ args,
+ actionType: "func",
+ });
+ }
+
+ fillRect(...args) {
+ this.stepList.push({
+ action: "fillRect",
+ args,
+ actionType: "func",
+ });
+ }
+
+ strokeRect(...args) {
+ this.stepList.push({
+ action: "strokeRect",
+ args,
+ actionType: "func",
+ });
+ }
+
+ fillText(...args) {
+ this.stepList.push({
+ action: "fillText",
+ args,
+ actionType: "func",
+ });
+ }
+
+ strokeText(...args) {
+ this.stepList.push({
+ action: "strokeText",
+ args,
+ actionType: "func",
+ });
+ }
+
+ beginPath() {
+ this.stepList.push({
+ action: "beginPath",
+ args: null,
+ actionType: "func",
+ });
+ }
+
+ fill() {
+ this.stepList.push({
+ action: "fill",
+ args: null,
+ actionType: "func",
+ });
+ }
+
+ stroke() {
+ this.stepList.push({
+ action: "stroke",
+ args: null,
+ actionType: "func",
+ });
+ }
+
+ drawFocusIfNeeded(...args) {
+ this.stepList.push({
+ action: "drawFocusIfNeeded",
+ args,
+ actionType: "func",
+ });
+ }
+
+ clip() {
+ this.stepList.push({
+ action: "clip",
+ args: null,
+ actionType: "func",
+ });
+ }
+
+ isPointInPath(...args) {
+ this.stepList.push({
+ action: "isPointInPath",
+ args,
+ actionType: "func",
+ });
+ }
+
+ drawImage(...args) {
+ this.stepList.push({
+ action: "drawImage",
+ args,
+ actionType: "func",
+ });
+ }
+
+ addHitRegion(...args) {
+ this.stepList.push({
+ action: "addHitRegion",
+ args,
+ actionType: "func",
+ });
+ }
+
+ removeHitRegion(...args) {
+ this.stepList.push({
+ action: "removeHitRegion",
+ args,
+ actionType: "func",
+ });
+ }
+
+ clearHitRegions(...args) {
+ this.stepList.push({
+ action: "clearHitRegions",
+ args,
+ actionType: "func",
+ });
+ }
+
+ putImageData(...args) {
+ this.stepList.push({
+ action: "putImageData",
+ args,
+ actionType: "func",
+ });
+ }
+
+ getLineDash() {
+ return this.canvasPrototype.lineDash;
+ }
+
+ createLinearGradient(...args) {
+ return this.ctx.createLinearGradient(...args);
+ }
+
+ createRadialGradient(...args) {
+ if (this.type === "2d") {
+ return this.ctx.createRadialGradient(...args);
+ } else {
+ return this.ctx.createCircularGradient(...args.slice(3, 6));
+ }
+ }
+
+ createPattern(...args) {
+ return this.ctx.createPattern(...args);
+ }
+
+ measureText(...args) {
+ return this.ctx.measureText(...args);
+ }
+
+ createImageData(...args) {
+ return this.ctx.createImageData(...args);
+ }
+
+ getImageData(...args) {
+ return this.ctx.getImageData(...args);
+ }
+
+ async draw(reserve, func) {
+ const realstepList = this.stepList.slice();
+ this.stepList.length = 0;
+ if (this.type === "mina") {
+ if (realstepList.length > 0) {
+ for (const step of realstepList) {
+ this.implementMinaStep(step);
+ }
+ realstepList.length = 0;
+ }
+ this.ctx.draw(reserve, func);
+ } else if (this.type === "2d") {
+ if (!reserve) {
+ this.ctx.clearRect(0, 0, this.canvasNode.width, this.canvasNode.height);
+ }
+ if (realstepList.length > 0) {
+ for (const step of realstepList) {
+ await this.implement2DStep(step);
+ }
+ realstepList.length = 0;
+ }
+ if (func) {
+ func();
+ }
+ }
+ realstepList.length = 0;
+ }
+
+ implementMinaStep(step) {
+ switch (step.action) {
+ case "textAlign": {
+ this.ctx.setTextAlign(step.args);
+ break;
+ }
+ case "textBaseline": {
+ this.ctx.setTextBaseline(step.args);
+ break;
+ }
+ default: {
+ if (step.actionType === "set") {
+ this.ctx[step.action] = step.args;
+ } else if (step.actionType === "func") {
+ if (step.args) {
+ this.ctx[step.action](...step.args);
+ } else {
+ this.ctx[step.action]();
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ implement2DStep(step) {
+ return new Promise((resolve) => {
+ if (step.action === "drawImage") {
+ const img = this.canvasNode.createImage();
+ img.src = step.args[0];
+ img.onload = () => {
+ this.ctx.drawImage(img, ...step.args.slice(1));
+ resolve();
+ };
+ } else {
+ if (step.actionType === "set") {
+ this.ctx[step.action] = step.args;
+ } else if (step.actionType === "func") {
+ if (step.args) {
+ this.ctx[step.action](...step.args);
+ } else {
+ this.ctx[step.action]();
+ }
+ }
+ resolve();
+ }
+ });
+ }
+}
diff --git a/eaterplanet_ecommerce/components/painter/painter.js b/eaterplanet_ecommerce/components/painter/painter.js
new file mode 100644
index 0000000..7ee9764
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/painter.js
@@ -0,0 +1,869 @@
+import Pen, { penCache, clearPenCache } from './lib/pen';
+import Downloader from './lib/downloader';
+import WxCanvas from './lib/wx-canvas';
+
+const util = require('./lib/util');
+const calc = require('./lib/calc');
+
+const downloader = new Downloader();
+
+// 最大尝试的绘制次数
+const MAX_PAINT_COUNT = 5;
+const ACTION_DEFAULT_SIZE = 24;
+const ACTION_OFFSET = '2rpx';
+Component({
+ canvasWidthInPx: 0,
+ canvasHeightInPx: 0,
+ canvasNode: null,
+ paintCount: 0,
+ currentPalette: {},
+ outterDisabled: false,
+ isDisabled: false,
+ needClear: false,
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ use2D: {
+ type: Boolean,
+ },
+ customStyle: {
+ type: String,
+ },
+ // 运行自定义选择框和删除缩放按钮
+ customActionStyle: {
+ type: Object,
+ },
+ palette: {
+ type: Object,
+ observer: function (newVal, oldVal) {
+ if (this.isNeedRefresh(newVal, oldVal)) {
+ this.paintCount = 0;
+ clearPenCache();
+ this.startPaint();
+ }
+ },
+ },
+ dancePalette: {
+ type: Object,
+ observer: function (newVal, oldVal) {
+ if (!this.isEmpty(newVal) && !this.properties.use2D) {
+ clearPenCache();
+ this.initDancePalette(newVal);
+ }
+ },
+ },
+ // 缩放比,会在传入的 palette 中统一乘以该缩放比
+ scaleRatio: {
+ type: Number,
+ value: 1,
+ },
+ widthPixels: {
+ type: Number,
+ value: 0,
+ },
+ // 启用脏检查,默认 false
+ dirty: {
+ type: Boolean,
+ value: false,
+ },
+ LRU: {
+ type: Boolean,
+ value: false,
+ },
+ action: {
+ type: Object,
+ observer: function (newVal, oldVal) {
+ if (newVal && !this.isEmpty(newVal) && !this.properties.use2D) {
+ this.doAction(newVal, null, false, true);
+ }
+ },
+ },
+ disableAction: {
+ type: Boolean,
+ observer: function (isDisabled) {
+ this.outterDisabled = isDisabled;
+ this.isDisabled = isDisabled;
+ },
+ },
+ clearActionBox: {
+ type: Boolean,
+ observer: function (needClear) {
+ if (needClear && !this.needClear) {
+ if (this.frontContext) {
+ setTimeout(() => {
+ this.frontContext.draw();
+ }, 100);
+ this.touchedView = {};
+ this.prevFindedIndex = this.findedIndex;
+ this.findedIndex = -1;
+ }
+ }
+ this.needClear = needClear;
+ },
+ },
+ },
+
+ data: {
+ picURL: '',
+ showCanvas: true,
+ painterStyle: '',
+ },
+
+ methods: {
+ /**
+ * 判断一个 object 是否为 空
+ * @param {object} object
+ */
+ isEmpty(object) {
+ for (const i in object) {
+ return false;
+ }
+ return true;
+ },
+
+ isNeedRefresh(newVal, oldVal) {
+ if (!newVal || this.isEmpty(newVal) || (this.data.dirty && util.equal(newVal, oldVal))) {
+ return false;
+ }
+ return true;
+ },
+
+ getBox(rect, type) {
+ const boxArea = {
+ type: 'rect',
+ css: {
+ height: `${rect.bottom - rect.top}px`,
+ width: `${rect.right - rect.left}px`,
+ left: `${rect.left}px`,
+ top: `${rect.top}px`,
+ borderWidth: '4rpx',
+ borderColor: '#1A7AF8',
+ color: 'transparent',
+ },
+ };
+ if (type === 'text') {
+ boxArea.css = Object.assign({}, boxArea.css, {
+ borderStyle: 'dashed',
+ });
+ }
+ if (this.properties.customActionStyle && this.properties.customActionStyle.border) {
+ boxArea.css = Object.assign({}, boxArea.css, this.properties.customActionStyle.border);
+ }
+ Object.assign(boxArea, {
+ id: 'box',
+ });
+ return boxArea;
+ },
+
+ getScaleIcon(rect, type) {
+ let scaleArea = {};
+ const { customActionStyle } = this.properties;
+ if (customActionStyle && customActionStyle.scale) {
+ scaleArea = {
+ type: 'image',
+ url: type === 'text' ? customActionStyle.scale.textIcon : customActionStyle.scale.imageIcon,
+ css: {
+ height: `${2 * ACTION_DEFAULT_SIZE}rpx`,
+ width: `${2 * ACTION_DEFAULT_SIZE}rpx`,
+ borderRadius: `${ACTION_DEFAULT_SIZE}rpx`,
+ },
+ };
+ } else {
+ scaleArea = {
+ type: 'rect',
+ css: {
+ height: `${2 * ACTION_DEFAULT_SIZE}rpx`,
+ width: `${2 * ACTION_DEFAULT_SIZE}rpx`,
+ borderRadius: `${ACTION_DEFAULT_SIZE}rpx`,
+ color: '#0000ff',
+ },
+ };
+ }
+ scaleArea.css = Object.assign({}, scaleArea.css, {
+ align: 'center',
+ left: `${rect.right + ACTION_OFFSET.toPx()}px`,
+ top:
+ type === 'text'
+ ? `${rect.top - ACTION_OFFSET.toPx() - scaleArea.css.height.toPx() / 2}px`
+ : `${rect.bottom - ACTION_OFFSET.toPx() - scaleArea.css.height.toPx() / 2}px`,
+ });
+ Object.assign(scaleArea, {
+ id: 'scale',
+ });
+ return scaleArea;
+ },
+
+ getDeleteIcon(rect) {
+ let deleteArea = {};
+ const { customActionStyle } = this.properties;
+ if (customActionStyle && customActionStyle.scale) {
+ deleteArea = {
+ type: 'image',
+ url: customActionStyle.delete.icon,
+ css: {
+ height: `${2 * ACTION_DEFAULT_SIZE}rpx`,
+ width: `${2 * ACTION_DEFAULT_SIZE}rpx`,
+ borderRadius: `${ACTION_DEFAULT_SIZE}rpx`,
+ },
+ };
+ } else {
+ deleteArea = {
+ type: 'rect',
+ css: {
+ height: `${2 * ACTION_DEFAULT_SIZE}rpx`,
+ width: `${2 * ACTION_DEFAULT_SIZE}rpx`,
+ borderRadius: `${ACTION_DEFAULT_SIZE}rpx`,
+ color: '#0000ff',
+ },
+ };
+ }
+ deleteArea.css = Object.assign({}, deleteArea.css, {
+ align: 'center',
+ left: `${rect.left - ACTION_OFFSET.toPx()}px`,
+ top: `${rect.top - ACTION_OFFSET.toPx() - deleteArea.css.height.toPx() / 2}px`,
+ });
+ Object.assign(deleteArea, {
+ id: 'delete',
+ });
+ return deleteArea;
+ },
+
+ doAction(action, callback, isMoving, overwrite) {
+ if (this.properties.use2D) {
+ return;
+ }
+ let newVal = null;
+ if (action) {
+ newVal = action.view;
+ }
+ if (newVal && newVal.id && this.touchedView.id !== newVal.id) {
+ // 带 id 的动作给撤回时使用,不带 id,表示对当前选中对象进行操作
+ const { views } = this.currentPalette;
+ for (let i = 0; i < views.length; i++) {
+ if (views[i].id === newVal.id) {
+ // 跨层回撤,需要重新构建三层关系
+ this.touchedView = views[i];
+ this.findedIndex = i;
+ this.sliceLayers();
+ break;
+ }
+ }
+ }
+
+ const doView = this.touchedView;
+
+ if (!doView || this.isEmpty(doView)) {
+ return;
+ }
+ if (newVal && newVal.css) {
+ if (overwrite) {
+ doView.css = newVal.css;
+ } else if (Array.isArray(doView.css) && Array.isArray(newVal.css)) {
+ doView.css = Object.assign({}, ...doView.css, ...newVal.css);
+ } else if (Array.isArray(doView.css)) {
+ doView.css = Object.assign({}, ...doView.css, newVal.css);
+ } else if (Array.isArray(newVal.css)) {
+ doView.css = Object.assign({}, doView.css, ...newVal.css);
+ } else {
+ doView.css = Object.assign({}, doView.css, newVal.css);
+ }
+ }
+ if (newVal && newVal.rect) {
+ doView.rect = newVal.rect;
+ }
+ if (newVal && newVal.url && doView.url && newVal.url !== doView.url) {
+ downloader
+ .download(newVal.url, this.properties.LRU)
+ .then(path => {
+ if (newVal.url.startsWith('https')) {
+ doView.originUrl = newVal.url;
+ }
+ doView.url = path;
+ wx.getImageInfo({
+ src: path,
+ success: res => {
+ doView.sHeight = res.height;
+ doView.sWidth = res.width;
+ this.reDraw(doView, callback, isMoving);
+ },
+ fail: () => {
+ this.reDraw(doView, callback, isMoving);
+ },
+ });
+ })
+ .catch(error => {
+ // 未下载成功,直接绘制
+ console.error(error);
+ this.reDraw(doView, callback, isMoving);
+ });
+ } else {
+ newVal && newVal.text && doView.text && newVal.text !== doView.text && (doView.text = newVal.text);
+ newVal &&
+ newVal.content &&
+ doView.content &&
+ newVal.content !== doView.content &&
+ (doView.content = newVal.content);
+ this.reDraw(doView, callback, isMoving);
+ }
+ },
+
+ reDraw(doView, callback, isMoving) {
+ const draw = {
+ width: this.currentPalette.width,
+ height: this.currentPalette.height,
+ views: this.isEmpty(doView) ? [] : [doView],
+ };
+ const pen = new Pen(this.globalContext, draw);
+
+ pen.paint(callbackInfo => {
+ callback && callback(callbackInfo);
+ this.triggerEvent('viewUpdate', {
+ view: this.touchedView,
+ });
+ });
+
+ const { rect, css, type } = doView;
+
+ this.block = {
+ width: this.currentPalette.width,
+ height: this.currentPalette.height,
+ views: this.isEmpty(doView) ? [] : [this.getBox(rect, doView.type)],
+ };
+ if (css && css.scalable) {
+ this.block.views.push(this.getScaleIcon(rect, type));
+ }
+ if (css && css.deletable) {
+ this.block.views.push(this.getDeleteIcon(rect));
+ }
+ const topBlock = new Pen(this.frontContext, this.block);
+ topBlock.paint();
+ },
+
+ isInView(x, y, rect) {
+ return x > rect.left && y > rect.top && x < rect.right && y < rect.bottom;
+ },
+
+ isInDelete(x, y) {
+ for (const view of this.block.views) {
+ if (view.id === 'delete') {
+ return x > view.rect.left && y > view.rect.top && x < view.rect.right && y < view.rect.bottom;
+ }
+ }
+ return false;
+ },
+
+ isInScale(x, y) {
+ for (const view of this.block.views) {
+ if (view.id === 'scale') {
+ return x > view.rect.left && y > view.rect.top && x < view.rect.right && y < view.rect.bottom;
+ }
+ }
+ return false;
+ },
+
+ touchedView: {},
+ findedIndex: -1,
+ onClick() {
+ const x = this.startX;
+ const y = this.startY;
+ const totalLayerCount = this.currentPalette.views.length;
+ let canBeTouched = [];
+ let isDelete = false;
+ let deleteIndex = -1;
+ for (let i = totalLayerCount - 1; i >= 0; i--) {
+ const view = this.currentPalette.views[i];
+ const { rect } = view;
+ if (this.touchedView && this.touchedView.id && this.touchedView.id === view.id && this.isInDelete(x, y, rect)) {
+ canBeTouched.length = 0;
+ deleteIndex = i;
+ isDelete = true;
+ break;
+ }
+ if (this.isInView(x, y, rect)) {
+ canBeTouched.push({
+ view,
+ index: i,
+ });
+ }
+ }
+ this.touchedView = {};
+ if (canBeTouched.length === 0) {
+ this.findedIndex = -1;
+ } else {
+ let i = 0;
+ const touchAble = canBeTouched.filter(item => Boolean(item.view.id));
+ if (touchAble.length === 0) {
+ this.findedIndex = canBeTouched[0].index;
+ } else {
+ for (i = 0; i < touchAble.length; i++) {
+ if (this.findedIndex === touchAble[i].index) {
+ i++;
+ break;
+ }
+ }
+ if (i === touchAble.length) {
+ i = 0;
+ }
+ this.touchedView = touchAble[i].view;
+ this.findedIndex = touchAble[i].index;
+ this.triggerEvent('viewClicked', {
+ view: this.touchedView,
+ });
+ }
+ }
+ if (this.findedIndex < 0 || (this.touchedView && !this.touchedView.id)) {
+ // 证明点击了背景 或无法移动的view
+ this.frontContext.draw();
+ if (isDelete) {
+ this.triggerEvent('touchEnd', {
+ view: this.currentPalette.views[deleteIndex],
+ index: deleteIndex,
+ type: 'delete',
+ });
+ this.doAction();
+ } else if (this.findedIndex < 0) {
+ this.triggerEvent('viewClicked', {});
+ }
+ this.findedIndex = -1;
+ this.prevFindedIndex = -1;
+ } else if (this.touchedView && this.touchedView.id) {
+ this.sliceLayers();
+ }
+ },
+
+ sliceLayers() {
+ const bottomLayers = this.currentPalette.views.slice(0, this.findedIndex);
+ const topLayers = this.currentPalette.views.slice(this.findedIndex + 1);
+ const bottomDraw = {
+ width: this.currentPalette.width,
+ height: this.currentPalette.height,
+ background: this.currentPalette.background,
+ views: bottomLayers,
+ };
+ const topDraw = {
+ width: this.currentPalette.width,
+ height: this.currentPalette.height,
+ views: topLayers,
+ };
+ if (this.prevFindedIndex < this.findedIndex) {
+ new Pen(this.bottomContext, bottomDraw).paint();
+ this.doAction();
+ new Pen(this.topContext, topDraw).paint();
+ } else {
+ new Pen(this.topContext, topDraw).paint();
+ this.doAction();
+ new Pen(this.bottomContext, bottomDraw).paint();
+ }
+ this.prevFindedIndex = this.findedIndex;
+ },
+
+ startX: 0,
+ startY: 0,
+ startH: 0,
+ startW: 0,
+ isScale: false,
+ startTimeStamp: 0,
+ onTouchStart(event) {
+ if (this.isDisabled) {
+ return;
+ }
+ const { x, y } = event.touches[0];
+ this.startX = x;
+ this.startY = y;
+ this.startTimeStamp = new Date().getTime();
+ if (this.touchedView && !this.isEmpty(this.touchedView)) {
+ const { rect } = this.touchedView;
+ if (this.isInScale(x, y, rect)) {
+ this.isScale = true;
+ this.startH = rect.bottom - rect.top;
+ this.startW = rect.right - rect.left;
+ } else {
+ this.isScale = false;
+ }
+ } else {
+ this.isScale = false;
+ }
+ },
+
+ onTouchEnd(e) {
+ if (this.isDisabled) {
+ return;
+ }
+ const current = new Date().getTime();
+ if (current - this.startTimeStamp <= 500 && !this.hasMove) {
+ !this.isScale && this.onClick(e);
+ } else if (this.touchedView && !this.isEmpty(this.touchedView)) {
+ this.triggerEvent('touchEnd', {
+ view: this.touchedView,
+ });
+ }
+ this.hasMove = false;
+ },
+
+ onTouchCancel(e) {
+ if (this.isDisabled) {
+ return;
+ }
+ this.onTouchEnd(e);
+ },
+
+ hasMove: false,
+ onTouchMove(event) {
+ if (this.isDisabled) {
+ return;
+ }
+ this.hasMove = true;
+ if (!this.touchedView || (this.touchedView && !this.touchedView.id)) {
+ return;
+ }
+ const { x, y } = event.touches[0];
+ const offsetX = x - this.startX;
+ const offsetY = y - this.startY;
+ const { rect, type } = this.touchedView;
+ let css = {};
+ if (this.isScale) {
+ clearPenCache(this.touchedView.id);
+ const newW = this.startW + offsetX > 1 ? this.startW + offsetX : 1;
+ if (this.touchedView.css && this.touchedView.css.minWidth) {
+ if (newW < this.touchedView.css.minWidth.toPx()) {
+ return;
+ }
+ }
+ if (this.touchedView.rect && this.touchedView.rect.minWidth) {
+ if (newW < this.touchedView.rect.minWidth) {
+ return;
+ }
+ }
+ const newH = this.startH + offsetY > 1 ? this.startH + offsetY : 1;
+ css = {
+ width: `${newW}px`,
+ };
+ if (type !== 'text') {
+ if (type === 'image') {
+ css.height = `${(newW * this.startH) / this.startW}px`;
+ } else {
+ css.height = `${newH}px`;
+ }
+ }
+ } else {
+ this.startX = x;
+ this.startY = y;
+ css = {
+ left: `${rect.x + offsetX}px`,
+ top: `${rect.y + offsetY}px`,
+ right: undefined,
+ bottom: undefined,
+ };
+ }
+ this.doAction(
+ {
+ view: {
+ css,
+ },
+ },
+ null,
+ !this.isScale,
+ );
+ },
+
+ initScreenK() {
+ if (!(getApp() && getApp().systemInfo && getApp().systemInfo.screenWidth)) {
+ try {
+ getApp().systemInfo = wx.getSystemInfoSync();
+ } catch (e) {
+ console.error(`Painter get system info failed, ${JSON.stringify(e)}`);
+ return;
+ }
+ }
+ this.screenK = 0.5;
+ if (getApp() && getApp().systemInfo && getApp().systemInfo.screenWidth) {
+ this.screenK = getApp().systemInfo.screenWidth / 750;
+ }
+ setStringPrototype(this.screenK, this.properties.scaleRatio);
+ },
+
+ initDancePalette() {
+ if (this.properties.use2D) {
+ return;
+ }
+ this.isDisabled = true;
+ this.initScreenK();
+ this.downloadImages(this.properties.dancePalette).then(async palette => {
+ this.currentPalette = palette;
+ const { width, height } = palette;
+
+ if (!width || !height) {
+ console.error(`You should set width and height correctly for painter, width: ${width}, height: ${height}`);
+ return;
+ }
+ this.setData({
+ painterStyle: `width:${width.toPx()}px;height:${height.toPx()}px;`,
+ });
+ this.frontContext || (this.frontContext = await this.getCanvasContext(this.properties.use2D, 'front'));
+ this.bottomContext || (this.bottomContext = await this.getCanvasContext(this.properties.use2D, 'bottom'));
+ this.topContext || (this.topContext = await this.getCanvasContext(this.properties.use2D, 'top'));
+ this.globalContext || (this.globalContext = await this.getCanvasContext(this.properties.use2D, 'k-canvas'));
+ new Pen(this.bottomContext, palette, this.properties.use2D).paint(() => {
+ this.isDisabled = false;
+ this.isDisabled = this.outterDisabled;
+ this.triggerEvent('didShow');
+ });
+ this.globalContext.draw();
+ this.frontContext.draw();
+ this.topContext.draw();
+ });
+ this.touchedView = {};
+ },
+
+ startPaint() {
+ this.initScreenK();
+ const { width, height } = this.properties.palette;
+
+ if (!width || !height) {
+ console.error(`You should set width and height correctly for painter, width: ${width}, height: ${height}`);
+ return;
+ }
+
+ let needScale = false;
+ // 生成图片时,根据设置的像素值重新绘制
+ if (width.toPx() !== this.canvasWidthInPx) {
+ this.canvasWidthInPx = width.toPx();
+ needScale = this.properties.use2D;
+ }
+ if (this.properties.widthPixels) {
+ setStringPrototype(this.screenK, this.properties.widthPixels / this.canvasWidthInPx);
+ this.canvasWidthInPx = this.properties.widthPixels;
+ }
+
+ if (this.canvasHeightInPx !== height.toPx()) {
+ this.canvasHeightInPx = height.toPx();
+ needScale = needScale || this.properties.use2D;
+ }
+ this.setData(
+ {
+ photoStyle: `width:${this.canvasWidthInPx}px;height:${this.canvasHeightInPx}px;`,
+ },
+ function () {
+ this.downloadImages(this.properties.palette).then(async palette => {
+ if (!this.photoContext) {
+ this.photoContext = await this.getCanvasContext(this.properties.use2D, 'photo');
+ }
+ if (needScale) {
+ const scale = getApp().systemInfo.pixelRatio;
+ this.photoContext.width = this.canvasWidthInPx * scale;
+ this.photoContext.height = this.canvasHeightInPx * scale;
+ this.photoContext.scale(scale, scale);
+ }
+ new Pen(this.photoContext, palette).paint(() => {
+ this.saveImgToLocal();
+ });
+ setStringPrototype(this.screenK, this.properties.scaleRatio);
+ });
+ },
+ );
+ },
+
+ downloadImages(palette) {
+ return new Promise((resolve, reject) => {
+ let preCount = 0;
+ let completeCount = 0;
+ const paletteCopy = JSON.parse(JSON.stringify(palette));
+ if (paletteCopy.background) {
+ preCount++;
+ downloader.download(paletteCopy.background, this.properties.LRU).then(
+ path => {
+ paletteCopy.background = path;
+ completeCount++;
+ if (preCount === completeCount) {
+ resolve(paletteCopy);
+ }
+ },
+ () => {
+ completeCount++;
+ if (preCount === completeCount) {
+ resolve(paletteCopy);
+ }
+ },
+ );
+ }
+ if (paletteCopy.views) {
+ for (const view of paletteCopy.views) {
+ if (view && view.type === 'image' && view.url) {
+ preCount++;
+ /* eslint-disable no-loop-func */
+ downloader.download(view.url, this.properties.LRU).then(
+ path => {
+ view.originUrl = view.url;
+ view.url = path;
+ wx.getImageInfo({
+ src: path,
+ success: res => {
+ // 获得一下图片信息,供后续裁减使用
+ view.sWidth = res.width;
+ view.sHeight = res.height;
+ },
+ fail: error => {
+ // 如果图片坏了,则直接置空,防止坑爹的 canvas 画崩溃了
+ console.warn(`getImageInfo ${view.originUrl} failed, ${JSON.stringify(error)}`);
+ view.url = '';
+ },
+ complete: () => {
+ completeCount++;
+ if (preCount === completeCount) {
+ resolve(paletteCopy);
+ }
+ },
+ });
+ },
+ () => {
+ completeCount++;
+ if (preCount === completeCount) {
+ resolve(paletteCopy);
+ }
+ },
+ );
+ }
+ }
+ }
+ if (preCount === 0) {
+ resolve(paletteCopy);
+ }
+ });
+ },
+
+ saveImgToLocal() {
+ const that = this;
+ const optionsOf2d = {
+ canvas: that.canvasNode,
+ }
+ const optionsOfOld = {
+ canvasId: 'photo',
+ destWidth: that.canvasWidthInPx,
+ destHeight: that.canvasHeightInPx,
+ }
+ setTimeout(() => {
+ wx.canvasToTempFilePath(
+ {
+ ...(that.properties.use2D ? optionsOf2d : optionsOfOld),
+ success: function (res) {
+ that.getImageInfo(res.tempFilePath);
+ },
+ fail: function (error) {
+ console.error(`canvasToTempFilePath failed, ${JSON.stringify(error)}`);
+ that.triggerEvent('imgErr', {
+ error: error,
+ });
+ },
+ },
+ this,
+ );
+ }, 300);
+ },
+
+ getCanvasContext(use2D, id) {
+ const that = this;
+ return new Promise(resolve => {
+ if (use2D) {
+ const query = wx.createSelectorQuery().in(that);
+ const selectId = `#${id}`;
+ query
+ .select(selectId)
+ .fields({ node: true, size: true })
+ .exec(res => {
+ that.canvasNode = res[0].node;
+ const ctx = that.canvasNode.getContext('2d');
+ const wxCanvas = new WxCanvas('2d', ctx, id, true, that.canvasNode);
+ resolve(wxCanvas);
+ });
+ } else {
+ const temp = wx.createCanvasContext(id, that);
+ resolve(new WxCanvas('mina', temp, id, true));
+ }
+ });
+ },
+
+ getImageInfo(filePath) {
+ const that = this;
+ wx.getImageInfo({
+ src: filePath,
+ success: infoRes => {
+ if (that.paintCount > MAX_PAINT_COUNT) {
+ const error = `The result is always fault, even we tried ${MAX_PAINT_COUNT} times`;
+ console.error(error);
+ that.triggerEvent('imgErr', {
+ error: error,
+ });
+ return;
+ }
+ // 比例相符时才证明绘制成功,否则进行强制重绘制
+ if (
+ Math.abs(
+ (infoRes.width * that.canvasHeightInPx - that.canvasWidthInPx * infoRes.height) /
+ (infoRes.height * that.canvasHeightInPx),
+ ) < 0.01
+ ) {
+ that.triggerEvent('imgOK', {
+ path: filePath,
+ });
+ } else {
+ that.startPaint();
+ }
+ that.paintCount++;
+ },
+ fail: error => {
+ console.error(`getImageInfo failed, ${JSON.stringify(error)}`);
+ that.triggerEvent('imgErr', {
+ error: error,
+ });
+ },
+ });
+ },
+ },
+});
+
+function setStringPrototype(screenK, scale) {
+ /* eslint-disable no-extend-native */
+ /**
+ * string 到对应的 px
+ * @param {Number} baseSize 当设置了 % 号时,设置的基准值
+ */
+ String.prototype.toPx = function toPx(_, baseSize) {
+ if (this === '0') {
+ return 0;
+ }
+ const REG = /-?[0-9]+(\.[0-9]+)?(rpx|px|%)/;
+
+ const parsePx = origin => {
+ const results = new RegExp(REG).exec(origin);
+ if (!origin || !results) {
+ console.error(`The size: ${origin} is illegal`);
+ return 0;
+ }
+ const unit = results[2];
+ const value = parseFloat(origin);
+
+ let res = 0;
+ if (unit === 'rpx') {
+ res = Math.round(value * (screenK || 0.5) * (scale || 1));
+ } else if (unit === 'px') {
+ res = Math.round(value * (scale || 1));
+ } else if (unit === '%') {
+ res = Math.round((value * baseSize) / 100);
+ }
+ return res;
+ };
+ const formula = /^calc\((.+)\)$/.exec(this);
+ if (formula && formula[1]) {
+ // 进行 calc 计算
+ const afterOne = formula[1].replace(/([^\s\(\+\-\*\/]+)\.(left|right|bottom|top|width|height)/g, word => {
+ const [id, attr] = word.split('.');
+ return penCache.viewRect[id][attr];
+ });
+ const afterTwo = afterOne.replace(new RegExp(REG, 'g'), parsePx);
+ return calc(afterTwo);
+ } else {
+ return parsePx(this);
+ }
+ };
+}
diff --git a/eaterplanet_ecommerce/components/painter/painter.json b/eaterplanet_ecommerce/components/painter/painter.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/painter.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/painter/painter.wxml b/eaterplanet_ecommerce/components/painter/painter.wxml
new file mode 100644
index 0000000..369e169
--- /dev/null
+++ b/eaterplanet_ecommerce/components/painter/painter.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/parser/libs/CssHandler.js b/eaterplanet_ecommerce/components/parser/libs/CssHandler.js
new file mode 100644
index 0000000..a238794
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/libs/CssHandler.js
@@ -0,0 +1,97 @@
+const cfg = require('./config.js'),
+ isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+
+function CssHandler(tagStyle) {
+ var styles = Object.assign(Object.create(null), cfg.userAgentStyles);
+ for (var item in tagStyle)
+ styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
+ this.styles = styles;
+}
+CssHandler.prototype.getStyle = function (data) {
+ this.styles = new parser(data, this.styles).parse();
+}
+CssHandler.prototype.match = function (name, attrs) {
+ var tmp, matched = (tmp = this.styles[name]) ? tmp + ';' : '';
+ if (attrs.class) {
+ var items = attrs.class.split(' ');
+ for (var i = 0, item; item = items[i]; i++)
+ if (tmp = this.styles['.' + item])
+ matched += tmp + ';';
+ }
+ if (tmp = this.styles['#' + attrs.id])
+ matched += tmp + ';';
+ return matched;
+}
+module.exports = CssHandler;
+
+function parser(data, init) {
+ this.data = data;
+ this.floor = 0;
+ this.i = 0;
+ this.list = [];
+ this.res = init;
+ this.state = this.Space;
+}
+parser.prototype.parse = function () {
+ for (var c; c = this.data[this.i]; this.i++)
+ this.state(c);
+ return this.res;
+}
+parser.prototype.section = function () {
+ return this.data.substring(this.start, this.i);
+}
+// 状态机
+parser.prototype.Space = function (c) {
+ if (c == '.' || c == '#' || isLetter(c)) {
+ this.start = this.i;
+ this.state = this.Name;
+ } else if (c == '/' && this.data[this.i + 1] == '*')
+ this.Comment();
+ else if (!cfg.blankChar[c] && c != ';')
+ this.state = this.Ignore;
+}
+parser.prototype.Comment = function () {
+ this.i = this.data.indexOf('*/', this.i) + 1;
+ if (!this.i) this.i = this.data.length;
+ this.state = this.Space;
+}
+parser.prototype.Ignore = function (c) {
+ if (c == '{') this.floor++;
+ else if (c == '}' && !--this.floor) this.state = this.Space;
+}
+parser.prototype.Name = function (c) {
+ if (cfg.blankChar[c]) {
+ this.list.push(this.section());
+ this.state = this.NameSpace;
+ } else if (c == '{') {
+ this.list.push(this.section());
+ this.Content();
+ } else if (c == ',') {
+ this.list.push(this.section());
+ this.Comma();
+ } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
+ this.state = this.Ignore;
+}
+parser.prototype.NameSpace = function (c) {
+ if (c == '{') this.Content();
+ else if (c == ',') this.Comma();
+ else if (!cfg.blankChar[c]) this.state = this.Ignore;
+}
+parser.prototype.Comma = function () {
+ while (cfg.blankChar[this.data[++this.i]]);
+ if (this.data[this.i] == '{') this.Content();
+ else {
+ this.start = this.i--;
+ this.state = this.Name;
+ }
+}
+parser.prototype.Content = function () {
+ this.start = ++this.i;
+ if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
+ var content = this.section();
+ for (var i = 0, item; item = this.list[i++];)
+ if (this.res[item]) this.res[item] += ';' + content;
+ else this.res[item] = content;
+ this.list = [];
+ this.state = this.Space;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/parser/libs/MpHtmlParser.js b/eaterplanet_ecommerce/components/parser/libs/MpHtmlParser.js
new file mode 100644
index 0000000..0b83cf8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/libs/MpHtmlParser.js
@@ -0,0 +1,526 @@
+/**
+ * html 解析器
+ * @tutorial https://github.com/jin-yufeng/Parser
+ * @version 20200630
+ * @author JinYufeng
+ * @listens MIT
+ */
+const cfg = require('./config.js'),
+ blankChar = cfg.blankChar,
+ CssHandler = require('./CssHandler.js'),
+ windowWidth = wx.getSystemInfoSync().windowWidth;
+var emoji;
+
+function MpHtmlParser(data, options = {}) {
+ this.attrs = {};
+ this.CssHandler = new CssHandler(options.tagStyle, windowWidth);
+ this.data = data;
+ this.domain = options.domain;
+ this.DOM = [];
+ this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
+ options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
+ this.options = options;
+ this.state = this.Text;
+ this.STACK = [];
+ // 工具函数
+ this.bubble = () => {
+ for (var i = this.STACK.length, item; item = this.STACK[--i];) {
+ if (cfg.richOnlyTags[item.name]) {
+ if (item.name == 'table' && !Object.hasOwnProperty.call(item, 'c')) item.c = 1;
+ return false;
+ }
+ item.c = 1;
+ }
+ return true;
+ }
+ this.decode = (val, amp) => {
+ var i = -1,
+ j, en;
+ while (1) {
+ if ((i = val.indexOf('&', i + 1)) == -1) break;
+ if ((j = val.indexOf(';', i + 2)) == -1) break;
+ if (val[i + 1] == '#') {
+ en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
+ if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
+ } else {
+ en = val.substring(i + 1, j);
+ if (cfg.entities[en] || en == amp)
+ val = val.substr(0, i) + (cfg.entities[en] || '&') + val.substr(j + 1);
+ }
+ }
+ return val;
+ }
+ this.getUrl = url => {
+ if (url[0] == '/') {
+ if (url[1] == '/') url = this.options.prot + ':' + url;
+ else if (this.domain) url = this.domain + url;
+ } else if (this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
+ url = this.domain + '/' + url;
+ return url;
+ }
+ this.isClose = () => this.data[this.i] == '>' || (this.data[this.i] == '/' && this.data[this.i + 1] == '>');
+ this.section = () => this.data.substring(this.start, this.i);
+ this.parent = () => this.STACK[this.STACK.length - 1];
+ this.siblings = () => this.STACK.length ? this.parent().children : this.DOM;
+}
+MpHtmlParser.prototype.parse = function () {
+ if (emoji) this.data = emoji.parseEmoji(this.data);
+ for (var c; c = this.data[this.i]; this.i++)
+ this.state(c);
+ if (this.state == this.Text) this.setText();
+ while (this.STACK.length) this.popNode(this.STACK.pop());
+ return this.DOM;
+}
+// 设置属性
+MpHtmlParser.prototype.setAttr = function () {
+ var name = this.attrName.toLowerCase(),
+ val = this.attrVal;
+ if (cfg.boolAttrs[name]) this.attrs[name] = 'T';
+ else if (val) {
+ if (name == 'src' || (name == 'data-src' && !this.attrs.src)) this.attrs.src = this.getUrl(this.decode(val, 'amp'));
+ else if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');
+ else if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
+ }
+ this.attrVal = '';
+ while (blankChar[this.data[this.i]]) this.i++;
+ if (this.isClose()) this.setNode();
+ else {
+ this.start = this.i;
+ this.state = this.AttrName;
+ }
+}
+// 设置文本节点
+MpHtmlParser.prototype.setText = function () {
+ var back, text = this.section();
+ if (!text) return;
+ text = (cfg.onText && cfg.onText(text, () => back = true)) || text;
+ if (back) {
+ this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
+ let j = this.start + text.length;
+ for (this.i = this.start; this.i < j; this.i++) this.state(this.data[this.i]);
+ return;
+ }
+ if (!this.pre) {
+ // 合并空白符
+ var tmp = [];
+ for (let i = text.length, c; c = text[--i];)
+ if (!blankChar[c] || (!blankChar[tmp[0]] && (c = ' '))) tmp.unshift(c);
+ text = tmp.join('');
+ }
+ this.siblings().push({
+ type: 'text',
+ text: this.decode(text)
+ });
+}
+// 设置元素节点
+MpHtmlParser.prototype.setNode = function () {
+ var node = {
+ name: this.tagName.toLowerCase(),
+ attrs: this.attrs
+ },
+ close = cfg.selfClosingTags[node.name];
+ this.attrs = {};
+ if (!cfg.ignoreTags[node.name]) {
+ // 处理属性
+ var attrs = node.attrs,
+ style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
+ styleObj = {};
+ if (attrs.id) {
+ if (this.options.compress & 1) attrs.id = void 0;
+ else if (this.options.useAnchor) this.bubble();
+ }
+ if ((this.options.compress & 2) && attrs.class) attrs.class = void 0;
+ switch (node.name) {
+ case 'a':
+ case 'ad':
+ this.bubble();
+ break;
+ case 'font':
+ if (attrs.color) {
+ styleObj['color'] = attrs.color;
+ attrs.color = void 0;
+ }
+ if (attrs.face) {
+ styleObj['font-family'] = attrs.face;
+ attrs.face = void 0;
+ }
+ if (attrs.size) {
+ var size = parseInt(attrs.size);
+ if (size < 1) size = 1;
+ else if (size > 7) size = 7;
+ var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
+ styleObj['font-size'] = map[size - 1];
+ attrs.size = void 0;
+ }
+ break;
+ case 'embed':
+ var src = node.attrs.src || '',
+ type = node.attrs.type || '';
+ if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
+ node.name = 'video';
+ else if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes('.aac'))
+ node.name = 'audio';
+ else break;
+ if (node.attrs.autostart)
+ node.attrs.autoplay = 'T';
+ node.attrs.controls = 'T';
+ // falls through
+ case 'video':
+ case 'audio':
+ if (!attrs.id) attrs.id = node.name + (++this[`${node.name}Num`]);
+ else this[`${node.name}Num`]++;
+ if (node.name == 'video') {
+ if (this.videoNum > 3)
+ node.lazyLoad = 1;
+ if (attrs.width) {
+ styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
+ attrs.width = void 0;
+ }
+ if (attrs.height) {
+ styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
+ attrs.height = void 0;
+ }
+ }
+ attrs.source = [];
+ if (attrs.src) {
+ attrs.source.push(attrs.src);
+ attrs.src = void 0;
+ }
+ this.bubble();
+ break;
+ case 'td':
+ case 'th':
+ if (attrs.colspan || attrs.rowspan)
+ for (var k = this.STACK.length, item; item = this.STACK[--k];)
+ if (item.name == 'table') {
+ item.c = void 0;
+ break;
+ }
+ }
+ if (attrs.align) {
+ styleObj['text-align'] = attrs.align;
+ attrs.align = void 0;
+ }
+ // 压缩 style
+ var styles = style.split(';');
+ style = '';
+ for (var i = 0, len = styles.length; i < len; i++) {
+ var info = styles[i].split(':');
+ if (info.length < 2) continue;
+ let key = info[0].trim().toLowerCase(),
+ value = info.slice(1).join(':').trim();
+ if (value.includes('-webkit') || value.includes('-moz') || value.includes('-ms') || value.includes('-o') || value.includes('safe'))
+ style += `;${key}:${value}`;
+ else if (!styleObj[key] || value.includes('import') || !styleObj[key].includes('import'))
+ styleObj[key] = value;
+ }
+ if (node.name == 'img') {
+ if (attrs.src && !attrs.ignore) {
+ if (this.bubble())
+ attrs.i = (this.imgNum++).toString();
+ else attrs.ignore = 'T';
+ }
+ if (attrs.ignore) {
+ style += ';-webkit-touch-callout:none';
+ styleObj['max-width'] = '100%';
+ }
+ if (!styleObj.position)
+ styleObj.top = styleObj.bottom = styleObj.left = styleObj.right = styleObj['z-index'] = void 0;
+ var width;
+ if (styleObj.width) width = styleObj.width;
+ else if (attrs.width) width = attrs.width.includes('%') ? attrs.width : attrs.width + 'px';
+ if (width) {
+ styleObj.width = width;
+ attrs.width = '100%';
+ if (parseInt(width) > windowWidth) {
+ styleObj.height = '';
+ if (attrs.height) attrs.height = void 0;
+ }
+ }
+ if (styleObj.height) {
+ attrs.height = styleObj.height;
+ styleObj.height = '';
+ } else if (attrs.height && !attrs.height.includes('%'))
+ attrs.height += 'px';
+ }
+ for (var key in styleObj) {
+ var value = styleObj[key];
+ if (!value) continue;
+ if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
+ // 填充链接
+ if (value.includes('url')) {
+ var j = value.indexOf('(');
+ if (j++ != -1) {
+ while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) j++;
+ value = value.substr(0, j) + this.getUrl(value.substr(j));
+ }
+ }
+ // 转换 rpx
+ else if (value.includes('rpx'))
+ value = value.replace(/[0-9.]+\s*rpx/g, $ => parseFloat($) * windowWidth / 750 + 'px');
+ else if (key == 'white-space' && value.includes('pre') && !close)
+ this.pre = node.pre = true;
+ style += `;${key}:${value}`;
+ }
+ style = style.substr(1);
+ if (style) attrs.style = style;
+ if (!close) {
+ node.children = [];
+ if (node.name == 'pre' && cfg.highlight) {
+ this.remove(node);
+ this.pre = node.pre = true;
+ }
+ this.siblings().push(node);
+ this.STACK.push(node);
+ } else if (!cfg.filter || cfg.filter(node, this) != false)
+ this.siblings().push(node);
+ } else {
+ if (!close) this.remove(node);
+ else if (node.name == 'source') {
+ var parent = this.parent();
+ if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
+ parent.attrs.source.push(node.attrs.src);
+ } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
+ }
+ if (this.data[this.i] == '/') this.i++;
+ this.start = this.i + 1;
+ this.state = this.Text;
+}
+// 移除标签
+MpHtmlParser.prototype.remove = function (node) {
+ var name = node.name,
+ j = this.i;
+ // 处理 svg
+ var handleSvg = () => {
+ var src = this.data.substring(j, this.i + 1);
+ if (!node.attrs.xmlns) src = ' xmlns="http://www.w3.org/2000/svg"' + src;
+ var i = j;
+ while (this.data[j] != '<') j--;
+ src = this.data.substring(j, i) + src;
+ var parent = this.parent();
+ if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
+ parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
+ this.siblings().push({
+ name: 'img',
+ attrs: {
+ src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
+ style: (/vertical[^;]+/.exec(node.attrs.style) || []).shift(),
+ ignore: 'T'
+ }
+ })
+ }
+ if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
+ while (1) {
+ if ((this.i = this.data.indexOf('', this.i + 1)) == -1) {
+ if (name == 'pre' || name == 'svg') this.i = j;
+ else this.i = this.data.length;
+ return;
+ }
+ this.start = (this.i += 2);
+ while (!blankChar[this.data[this.i]] && !this.isClose()) this.i++;
+ if (this.section().toLowerCase() == name) {
+ // 代码块高亮
+ if (name == 'pre') {
+ this.data = this.data.substr(0, j + 1) + cfg.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.substr(this.i - 5);
+ return this.i = j;
+ } else if (name == 'style')
+ this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));
+ else if (name == 'title')
+ this.DOM.title = this.data.substring(j + 1, this.i - 7);
+ if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
+ if (name == 'svg') handleSvg();
+ return;
+ }
+ }
+}
+// 节点出栈处理
+MpHtmlParser.prototype.popNode = function (node) {
+ // 空白符处理
+ if (node.pre) {
+ node.pre = this.pre = void 0;
+ for (let i = this.STACK.length; i--;)
+ if (this.STACK[i].pre)
+ this.pre = true;
+ }
+ var siblings = this.siblings(),
+ len = siblings.length,
+ childs = node.children;
+ if (node.name == 'head' || (cfg.filter && cfg.filter(node, this) == false))
+ return siblings.pop();
+ var attrs = node.attrs;
+ // 替换一些标签名
+ if (cfg.blockTags[node.name]) node.name = 'div';
+ else if (!cfg.trustTags[node.name]) node.name = 'span';
+ // 去除块标签前后空串
+ if (node.name == 'div' || node.name == 'p' || node.name[0] == 't') {
+ if (len > 1 && siblings[len - 2].text == ' ')
+ siblings.splice(--len - 1, 1);
+ if (childs.length && childs[childs.length - 1].text == ' ')
+ childs.pop();
+ }
+ // 处理列表
+ if (node.c && (node.name == 'ul' || node.name == 'ol')) {
+ if ((node.attrs.style || '').includes('list-style:none')) {
+ for (let i = 0, child; child = childs[i++];)
+ if (child.name == 'li')
+ child.name = 'div';
+ } else if (node.name == 'ul') {
+ var floor = 1;
+ for (let i = this.STACK.length; i--;)
+ if (this.STACK[i].name == 'ul') floor++;
+ if (floor != 1)
+ for (let i = childs.length; i--;)
+ childs[i].floor = floor;
+ } else {
+ for (let i = 0, num = 1, child; child = childs[i++];)
+ if (child.name == 'li') {
+ child.type = 'ol';
+ child.num = ((num, type) => {
+ if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
+ if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
+ if (type == 'i' || type == 'I') {
+ num = (num - 1) % 99 + 1;
+ var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
+ ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
+ res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
+ if (type == 'i') return res.toLowerCase();
+ return res;
+ }
+ return num;
+ })(num++, attrs.type) + '.';
+ }
+ }
+ }
+ // 处理表格的边框
+ if (node.name == 'table') {
+ var padding = attrs.cellpadding,
+ spacing = attrs.cellspacing,
+ border = attrs.border;
+ if (node.c) {
+ this.bubble();
+ attrs.style = (attrs.style || '') + ';display:table';
+ if (!padding) padding = 2;
+ if (!spacing) spacing = 2;
+ }
+ if (border) attrs.style = `border:${border}px solid gray;${attrs.style || ''}`;
+ if (spacing) attrs.style = `border-spacing:${spacing}px;${attrs.style || ''}`;
+ if (border || padding || node.c)
+ (function f(ns) {
+ for (var i = 0, n; n = ns[i]; i++) {
+ if (n.type == 'text') continue;
+ var style = n.attrs.style || '';
+ if (node.c && n.name[0] == 't') {
+ n.c = 1;
+ style += ';display:table-' + (n.name == 'th' || n.name == 'td' ? 'cell' : (n.name == 'tr' ? 'row' : 'row-group'));
+ }
+ if (n.name == 'th' || n.name == 'td') {
+ if (border) style = `border:${border}px solid gray;${style}`;
+ if (padding) style = `padding:${padding}px;${style}`;
+ } else f(n.children || []);
+ if (style) n.attrs.style = style;
+ }
+ })(childs)
+ if (this.options.autoscroll) {
+ var table = Object.assign({}, node);
+ node.name = 'div';
+ node.attrs = {
+ style: 'overflow:scroll'
+ }
+ node.children = [table];
+ }
+ }
+ this.CssHandler.pop && this.CssHandler.pop(node);
+ // 自动压缩
+ if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div')
+ siblings[len - 1] = childs[0];
+}
+// 状态机
+MpHtmlParser.prototype.Text = function (c) {
+ if (c == '<') {
+ var next = this.data[this.i + 1],
+ isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+ if (isLetter(next)) {
+ this.setText();
+ this.start = this.i + 1;
+ this.state = this.TagName;
+ } else if (next == '/') {
+ this.setText();
+ if (isLetter(this.data[++this.i + 1])) {
+ this.start = this.i + 1;
+ this.state = this.EndTag;
+ } else this.Comment();
+ } else if (next == '!') {
+ this.setText();
+ this.Comment();
+ }
+ }
+}
+MpHtmlParser.prototype.Comment = function () {
+ var key;
+ if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';
+ else if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';
+ else key = '>';
+ if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;
+ else this.i += key.length - 1;
+ this.start = this.i + 1;
+ this.state = this.Text;
+}
+MpHtmlParser.prototype.TagName = function (c) {
+ if (blankChar[c]) {
+ this.tagName = this.section();
+ while (blankChar[this.data[this.i]]) this.i++;
+ if (this.isClose()) this.setNode();
+ else {
+ this.start = this.i;
+ this.state = this.AttrName;
+ }
+ } else if (this.isClose()) {
+ this.tagName = this.section();
+ this.setNode();
+ }
+}
+MpHtmlParser.prototype.AttrName = function (c) {
+ if (c == '=' || blankChar[c] || this.isClose()) {
+ this.attrName = this.section();
+ if (blankChar[c])
+ while (blankChar[this.data[++this.i]]);
+ if (this.data[this.i] == '=') {
+ while (blankChar[this.data[++this.i]]);
+ this.start = this.i--;
+ this.state = this.AttrValue;
+ } else this.setAttr();
+ }
+}
+MpHtmlParser.prototype.AttrValue = function (c) {
+ if (c == '"' || c == "'") {
+ this.start++;
+ if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
+ this.attrVal = this.section();
+ this.i++;
+ } else {
+ for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++);
+ this.attrVal = this.section();
+ }
+ this.setAttr();
+}
+MpHtmlParser.prototype.EndTag = function (c) {
+ if (blankChar[c] || c == '>' || c == '/') {
+ var name = this.section().toLowerCase();
+ for (var i = this.STACK.length; i--;)
+ if (this.STACK[i].name == name) break;
+ if (i != -1) {
+ var node;
+ while ((node = this.STACK.pop()).name != name) this.popNode(node);
+ this.popNode(node);
+ } else if (name == 'p' || name == 'br')
+ this.siblings().push({
+ name,
+ attrs: {}
+ });
+ this.i = this.data.indexOf('>', this.i);
+ this.start = this.i + 1;
+ if (this.i == -1) this.i = this.data.length;
+ else this.state = this.Text;
+ }
+}
+module.exports = MpHtmlParser;
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/parser/libs/config.js b/eaterplanet_ecommerce/components/parser/libs/config.js
new file mode 100644
index 0000000..fbb0666
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/libs/config.js
@@ -0,0 +1,63 @@
+/* 配置文件 */
+const canIUse = wx.canIUse('editor'); // 高基础库标识,用于兼容
+module.exports = {
+ // 出错占位图
+ errorImg: null,
+ // 过滤器函数
+ filter: null,
+ // 代码高亮函数
+ highlight: null,
+ // 文本处理函数
+ onText: null,
+ // 实体编码列表
+ entities: {
+ quot: '"',
+ apos: "'",
+ semi: ';',
+ nbsp: '\xA0',
+ ndash: '–',
+ mdash: '—',
+ middot: '·',
+ lsquo: '‘',
+ rsquo: '’',
+ ldquo: '“',
+ rdquo: '”',
+ bull: '•',
+ hellip: '…'
+ },
+ blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
+ boolAttrs: makeMap('autoplay,autostart,controls,ignore,loop,muted'),
+ // 块级标签,将被转为 div
+ blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,section' + (canIUse ? '' : ',pre')),
+ // 将被移除的标签
+ ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr' + (canIUse ? ',rp' : '')),
+ // 只能被 rich-text 显示的标签
+ richOnlyTags: makeMap('a,colgroup,fieldset,legend,table' + (canIUse ? ',bdi,bdo,rt,ruby' : '')),
+ // 自闭合的标签
+ selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
+ // 信任的标签
+ trustTags: makeMap('a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video' + (canIUse ? ',bdi,bdo,caption,pre,rt,ruby' : '')),
+ // 默认的标签样式
+ userAgentStyles: {
+ address: 'font-style:italic',
+ big: 'display:inline;font-size:1.2em',
+ blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
+ caption: 'display:table-caption;text-align:center',
+ center: 'text-align:center',
+ cite: 'font-style:italic',
+ dd: 'margin-left:40px',
+ mark: 'background-color:yellow',
+ pre: 'font-family:monospace;white-space:pre;overflow:scroll',
+ s: 'text-decoration:line-through',
+ small: 'display:inline;font-size:0.8em',
+ u: 'text-decoration:underline'
+ }
+}
+
+function makeMap(str) {
+ var map = Object.create(null),
+ list = str.split(',');
+ for (var i = list.length; i--;)
+ map[list[i]] = true;
+ return map;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/parser/parser.js b/eaterplanet_ecommerce/components/parser/parser.js
new file mode 100644
index 0000000..d4e6e87
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/parser.js
@@ -0,0 +1,204 @@
+/**
+ * Parser 富文本组件
+ * @tutorial https://github.com/jin-yufeng/Parser
+ * @version 20200630
+ * @author JinYufeng
+ * @listens MIT
+ */
+var cache = {},
+ Parser = require('./libs/MpHtmlParser.js'),
+ fs = wx.getFileSystemManager && wx.getFileSystemManager();
+var dom;
+// 计算 cache 的 key
+function hash(str) {
+ for (var i = str.length, val = 5381; i--;)
+ val += (val << 5) + str.charCodeAt(i);
+ return val;
+}
+Component({
+ options: {
+ pureDataPattern: /^[acdgtu]|W/
+ },
+ data: {
+ nodes: []
+ },
+ properties: {
+ html: {
+ type: String,
+ observer(html) {
+ this.setContent(html);
+ }
+ },
+ autopause: {
+ type: Boolean,
+ value: true
+ },
+ autoscroll: Boolean,
+ autosetTitle: {
+ type: Boolean,
+ value: true
+ },
+ compress: Number,
+ domain: String,
+ lazyLoad: Boolean,
+ loadingImg: String,
+ selectable: Boolean,
+ tagStyle: Object,
+ showWithAnimation: Boolean,
+ useAnchor: Boolean,
+ useCache: Boolean
+ },
+ relations: {
+ '../parser-group/parser-group': {
+ type: 'ancestor'
+ }
+ },
+ created() {
+ // 图片数组
+ this.imgList = [];
+ this.imgList.setItem = function(i, src) {
+ if (!i || !src) return;
+ // 去重
+ if (src.indexOf('http') == 0 && this.includes(src)) {
+ var newSrc = '';
+ for (var j = 0, c; c = src[j]; j++) {
+ if (c == '/' && src[j - 1] != '/' && src[j + 1] != '/') break;
+ newSrc += Math.random() > 0.5 ? c.toUpperCase() : c;
+ }
+ newSrc += src.substr(j);
+ return this[i] = newSrc;
+ }
+ this[i] = src;
+ // 暂存 data src
+ if (src.includes('data:image')) {
+ var info = src.match(/data:image\/(\S+?);(\S+?),(.+)/);
+ if (!info) return;
+ var filePath = `${wx.env.USER_DATA_PATH}/${Date.now()}.${info[1]}`;
+ fs && fs.writeFile({
+ filePath,
+ data: info[3],
+ encoding: info[2],
+ success: () => this[i] = filePath
+ })
+ }
+ }
+ this.imgList.each = function(f) {
+ for (var i = 0, len = this.length; i < len; i++)
+ this.setItem(i, f(this[i], i, this));
+ }
+ if (dom) this.document = new dom(this);
+ },
+ detached() {
+ // 删除暂存
+ this.imgList.each(src => {
+ if (src && src.includes(wx.env.USER_DATA_PATH) && fs)
+ fs.unlink({
+ filePath: src
+ })
+ })
+ clearInterval(this._timer);
+ },
+ methods: {
+ // 锚点跳转
+ navigateTo(obj) {
+ if (!this.data.useAnchor)
+ return obj.fail && obj.fail({
+ errMsg: 'Anchor is disabled'
+ })
+ this.createSelectorQuery()
+ .select('.top' + (obj.id ? '>>>#' + obj.id : '')).boundingClientRect()
+ .selectViewport().scrollOffset().exec(res => {
+ if (!res[0])
+ return this.group ? this.group.navigateTo(this.i, obj) :
+ obj.fail && obj.fail({
+ errMsg: 'Label not found'
+ });
+ obj.scrollTop = res[1].scrollTop + res[0].top + (obj.offset || 0);
+ wx.pageScrollTo(obj);
+ })
+ },
+ // 获取文本
+ getText(ns = this.data.html) {
+ var txt = '';
+ for (var i = 0, n; n = ns[i++];) {
+ if (n.type == 'text') txt += n.text.replace(/ /g, '\u00A0').replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
+ else if (n.type == 'br') txt += '\n';
+ else {
+ // 块级标签前后加换行
+ var br = n.name == 'p' || n.name == 'div' || n.name == 'tr' || n.name == 'li' || (n.name[0] == 'h' && n.name[1] > '0' && n.name[1] < '7');
+ if (br && txt && txt[txt.length - 1] != '\n') txt += '\n';
+ if (n.children) txt += this.getText(n.children);
+ if (br && txt[txt.length - 1] != '\n') txt += '\n';
+ else if (n.name == 'td' || n.name == 'th') txt += '\t';
+ }
+ }
+ return txt;
+ },
+ // 获取视频 context
+ getVideoContext(id) {
+ if (!id) return this.videoContexts;
+ for (var i = this.videoContexts.length; i--;)
+ if (this.videoContexts[i].id == id) return this.videoContexts[i];
+ },
+ // 渲染富文本
+ setContent(html, append) {
+ var nodes, parser = new Parser(html, this.data);
+ // 缓存读取
+ if (this.data.useCache) {
+ var hashVal = hash(html);
+ if (cache[hashVal]) nodes = cache[hashVal];
+ else cache[hashVal] = nodes = parser.parse();
+ } else nodes = parser.parse();
+ this.triggerEvent('parse', nodes);
+ var data = {};
+ if (append)
+ for (let i = this.data.nodes.length, j = nodes.length; j--;)
+ data[`nodes[${i + j}]`] = nodes[j];
+ else data.nodes = nodes;
+ if (this.showWithAnimation) data.showAm = 'animation: show .5s';
+ this.setData(data, () => {
+ this.triggerEvent('load')
+ });
+ // 设置标题
+ if (nodes.title && this.data.autosetTitle)
+ wx.setNavigationBarTitle({
+ title: nodes.title
+ })
+ this.imgList.length = 0;
+ this.videoContexts = [];
+ var ns = this.selectAllComponents('.top,.top>>>._node');
+ for (let i = 0, n; n = ns[i++];) {
+ n.top = this;
+ for (let j = 0, item; item = n.data.nodes[j++];) {
+ if (item.c) continue;
+ // 获取图片列表
+ if (item.name == 'img')
+ this.imgList.setItem(item.attrs.i, item.attrs.src);
+ // 音视频控制
+ else if (item.name == 'video' || item.name == 'audio') {
+ var ctx;
+ if (item.name == 'video') ctx = wx.createVideoContext(item.attrs.id, n);
+ else ctx = n.selectComponent('#' + item.attrs.id);
+ if (ctx) {
+ ctx.id = item.attrs.id;
+ this.videoContexts.push(ctx);
+ }
+ }
+ }
+ }
+ var height;
+ clearInterval(this._timer);
+ this._timer = setInterval(() => {
+ this.createSelectorQuery().select('.top').boundingClientRect(res => {
+ if (!res) return;
+ this.rect = res;
+ if (res.height == height) {
+ this.triggerEvent('ready', res)
+ clearInterval(this._timer);
+ }
+ height = res.height;
+ }).exec();
+ }, 350)
+ }
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/parser/parser.json b/eaterplanet_ecommerce/components/parser/parser.json
new file mode 100644
index 0000000..85e49c9
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/parser.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "trees": "./trees/trees"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/parser/parser.wxml b/eaterplanet_ecommerce/components/parser/parser.wxml
new file mode 100644
index 0000000..aeeca92
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/parser.wxml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/parser/parser.wxss b/eaterplanet_ecommerce/components/parser/parser.wxss
new file mode 100644
index 0000000..b24180f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/parser.wxss
@@ -0,0 +1,19 @@
+:host {
+ display: block;
+ overflow: scroll;
+ -webkit-overflow-scrolling: touch;
+}
+
+.top {
+ display: inherit;
+}
+
+@keyframes show {
+ 0% {
+ opacity: 0;
+ }
+
+ 100% {
+ opacity: 1;
+ }
+}
diff --git a/eaterplanet_ecommerce/components/parser/trees/trees.js b/eaterplanet_ecommerce/components/parser/trees/trees.js
new file mode 100644
index 0000000..1758b5b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/trees/trees.js
@@ -0,0 +1,122 @@
+const errorImg = require('../libs/config.js').errorImg;
+Component({
+ data: {
+ canIUse: !!wx.chooseMessageFile,
+ placeholder: "data:image/svg+xml;utf8,"
+ },
+ properties: {
+ nodes: Array,
+ lazyLoad: Boolean,
+ loading: String
+ },
+ methods: {
+ // 视频播放事件
+ play(e) {
+ this.top.group && this.top.group.pause(this.top.i);
+ if (this.top.videoContexts.length > 1 && this.top.data.autopause)
+ for (var i = this.top.videoContexts.length; i--;)
+ if (this.top.videoContexts[i].id != e.currentTarget.id)
+ this.top.videoContexts[i].pause();
+ },
+ // 图片事件
+ imgtap(e) {
+ var attrs = e.currentTarget.dataset.attrs;
+ if (!attrs.ignore) {
+ var preview = true;
+ this.top.triggerEvent('imgtap', {
+ id: e.currentTarget.id,
+ src: attrs.src,
+ ignore: () => preview = false
+ })
+ if (preview) {
+ if (this.top.group) return this.top.group.preview(this.top.i, attrs.i);
+ var urls = this.top.imgList,
+ current = urls[attrs.i] ? urls[attrs.i] : (urls = [attrs.src], attrs.src);
+ wx.previewImage({
+ current,
+ urls
+ })
+ }
+ }
+ },
+ loadImg(e) {
+ var i = e.target.dataset.i;
+ if (this.data.lazyLoad && !this.data.nodes[i].load)
+ this.setData({
+ [`nodes[${i}].load`]: 1
+ })
+ else if (this.data.loading && this.data.nodes[i].load != 2)
+ this.setData({
+ [`nodes[${i}].load`]: 2
+ })
+ },
+ // 链接点击事件
+ linkpress(e) {
+ var jump = true,
+ attrs = e.currentTarget.dataset.attrs;
+ attrs.ignore = () => jump = false;
+ this.top.triggerEvent('linkpress', attrs);
+ if (jump) {
+ if (attrs['app-id'])
+ wx.navigateToMiniProgram({
+ appId: attrs['app-id'],
+ path: attrs.path
+ })
+ else if (attrs.href) {
+ if (attrs.href[0] == '#')
+ this.top.navigateTo({
+ id: attrs.href.substring(1)
+ })
+ else if (attrs.href.indexOf('http') == 0 || attrs.href.indexOf('//') == 0)
+ wx.setClipboardData({
+ data: attrs.href,
+ success: () =>
+ wx.showToast({
+ title: '链接已复制'
+ })
+ })
+ else
+ wx.navigateTo({
+ url: attrs.href,
+ fail() {
+ wx.switchTab({
+ url: attrs.href,
+ })
+ }
+ })
+ }
+ }
+ },
+ // 错误事件
+ error(e) {
+ var source = e.target.dataset.source,
+ i = e.target.dataset.i,
+ node = this.data.nodes[i];
+ if (source == 'video' || source == 'audio') {
+ // 加载其他 source
+ var index = (node.i || 0) + 1;
+ if (index < node.attrs.source.length)
+ return this.setData({
+ [`nodes[${i}].i`]: index
+ })
+ } else if (source == 'img' && errorImg) {
+ this.top.imgList.setItem(e.target.dataset.index, errorImg);
+ this.setData({
+ [`nodes[${i}].attrs.src`]: errorImg
+ })
+ }
+ this.top && this.top.triggerEvent('error', {
+ source,
+ target: e.target,
+ errMsg: e.detail.errMsg
+ })
+ },
+ // 加载视频
+ loadVideo(e) {
+ var i = e.target.dataset.i;
+ this.setData({
+ [`nodes[${i}].attrs.autoplay`]: true
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/parser/trees/trees.json b/eaterplanet_ecommerce/components/parser/trees/trees.json
new file mode 100644
index 0000000..07cb773
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/trees/trees.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "trees": "./trees"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/parser/trees/trees.wxml b/eaterplanet_ecommerce/components/parser/trees/trees.wxml
new file mode 100644
index 0000000..d534f7b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/trees/trees.wxml
@@ -0,0 +1,65 @@
+
+
+var inline = {
+ abbr: 1,
+ b: 1,
+ big: 1,
+ code: 1,
+ del: 1,
+ em: 1,
+ i: 1,
+ ins: 1,
+ label: 1,
+ q: 1,
+ small: 1,
+ span: 1,
+ strong: 1
+}
+module.exports = {
+ visited: function (e, owner) {
+ if (!e.instance.hasClass('_visited'))
+ e.instance.addClass('_visited')
+ owner.callMethod('linkpress', e)
+ },
+ use: function (item) {
+ return !item.c && !inline[item.name] && (item.attrs.style || '').indexOf('display:inline') == -1
+ }
+}
+
+
+
+
+
+
+
+
+ {{n.text}}
+ \n
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{n.num}}
+
+ █
+
+ █
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/parser/trees/trees.wxss b/eaterplanet_ecommerce/components/parser/trees/trees.wxss
new file mode 100644
index 0000000..043dd46
--- /dev/null
+++ b/eaterplanet_ecommerce/components/parser/trees/trees.wxss
@@ -0,0 +1,184 @@
+/* 在这里引入自定义样式 */
+
+/* 链接和图片效果 */
+._a {
+ display: inline;
+ padding: 1.5px 0 1.5px 0;
+ color: #366092;
+ word-break: break-all;
+}
+
+._hover {
+ text-decoration: underline;
+ opacity: 0.7;
+}
+
+._visited {
+ color: #551a8b;
+}
+
+._img {
+ position: relative;
+ display: inline-block;
+ max-width: 100%;
+}
+
+/* 内部样式 */
+:host {
+ display: inline;
+}
+
+._blockquote,
+._div,
+._p,
+._ul,
+._ol,
+._li {
+ display: block;
+}
+
+._b,
+._strong {
+ font-weight: bold;
+}
+
+._code {
+ font-family: monospace;
+}
+
+._del {
+ text-decoration: line-through;
+}
+
+._em,
+._i {
+ font-style: italic;
+}
+
+._h1 {
+ font-size: 2em;
+}
+
+._h2 {
+ font-size: 1.5em;
+}
+
+._h3 {
+ font-size: 1.17em;
+}
+
+._h5 {
+ font-size: 0.83em;
+}
+
+._h6 {
+ font-size: 0.67em;
+}
+
+._h1,
+._h2,
+._h3,
+._h4,
+._h5,
+._h6 {
+ display: block;
+ font-weight: bold;
+}
+
+._image {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+}
+
+._ins {
+ text-decoration: underline;
+}
+
+._li {
+ flex: 1;
+ width: 0;
+}
+
+._ol-bef {
+ width: 36px;
+ margin-right: 5px;
+ text-align: right;
+}
+
+._ul-bef {
+ margin: 0 12px 0 23px;
+ line-height: normal;
+}
+
+._ol-bef,
+._ul_bef {
+ flex: none;
+ user-select: none;
+}
+
+._ul-p1 {
+ display: inline-block;
+ width: 0.3em;
+ height: 0.3em;
+ overflow: hidden;
+ line-height: 0.3em;
+}
+
+._ul-p2 {
+ display: inline-block;
+ width: 0.23em;
+ height: 0.23em;
+ border: 0.05em solid black;
+ border-radius: 50%;
+}
+
+._q::before {
+ content: '"';
+}
+
+._q::after {
+ content: '"';
+}
+
+._sub {
+ font-size: smaller;
+ vertical-align: sub;
+}
+
+._sup {
+ font-size: smaller;
+ vertical-align: super;
+}
+
+.__bdi,
+.__bdo,
+.__ruby,
+.__rt {
+ display: inline-block;
+}
+
+._video {
+ position: relative;
+ display: inline-block;
+ width: 300px;
+ height: 225px;
+ background-color: black;
+}
+
+._video::after {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ margin: -15px 0 0 -15px;
+ content: '';
+ border-color: transparent transparent transparent white;
+ border-style: solid;
+ border-width: 15px 0 15px 30px;
+}
+._img {
+ vertical-align: top;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/router-link/router-link.js b/eaterplanet_ecommerce/components/router-link/router-link.js
new file mode 100644
index 0000000..90b4e16
--- /dev/null
+++ b/eaterplanet_ecommerce/components/router-link/router-link.js
@@ -0,0 +1,114 @@
+// eaterplanet_ecommerce/components/router-link/router-link.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ url: String,
+ type: String,
+ disabled: {
+ type: Boolean,
+ value: false
+ },
+ delta: {
+ type: Number,
+ value: 1
+ }
+ },
+ externalClasses: ["router-class"],
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ canClick: true
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ routerLink: function () {
+ var that = this;
+ if (!this.data.disabled && this.data.canClick)
+ if (this.data.url) {
+ this.setData({
+ canClick: false
+ });
+ var data = {
+ url: this.data.url,
+ success: function (e) {
+ that.triggerEvent("on-success", e);
+ },
+ fail: function (e) {
+ console.warn("routerLink Error:", e), that.triggerEvent("on-error", e);
+ },
+ complete: function () {
+ setTimeout(function () {
+ that.setData({
+ canClick: true
+ });
+ }, 400);
+ }
+ };
+
+ let surl = this.data.url;
+ if (surl.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || surl.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || surl.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || surl.indexOf('eaterplanet_ecommerce/pages/type/index') != -1 ) { this.setData({ type: 'switch' })}
+
+ switch (this.data.type) {
+ case "redirect":
+ wx.redirectTo(data);
+ break;
+
+ case "switch":
+ wx.switchTab(data);
+ break;
+
+ case "navigateback":
+ wx.navigateBack({
+ delta: this.data.delta,
+ success: function (e) {
+ that.triggerEvent("on-success", e);
+ },
+ fail: function (t) {
+ console.warn("routerLink Error:", t);
+ },
+ complete: function () {
+ that.setData({
+ canClick: false
+ });
+ }
+ });
+ break;
+
+ case "relaunch":
+ wx.reLaunch(data);
+ break;
+
+ default:
+ let urlArr = that.queryParam(surl);
+ wx.$route(urlArr[0], urlArr[1]);
+ setTimeout(function () {
+ that.setData({
+ canClick: true
+ });
+ }, 400);
+ // wx.navigateTo(data);
+ }
+ } else console.warn("url 不能为空");
+ },
+ queryParam: function(surl){
+ if (surl.indexOf("?") != -1) {
+ let urlArr = surl.split('?');
+ let urls = urlArr[1];
+ let strs = urls.split("&");
+ var obj = new Object();
+ for(var i = 0; i < strs.length; i++) {
+ var tmp_arr = strs[i].split("=");
+ obj[decodeURIComponent(tmp_arr[0])] = decodeURIComponent(tmp_arr[1]);
+ }
+ return [urlArr[0], obj]
+ }
+ return [surl, {}]
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/router-link/router-link.json b/eaterplanet_ecommerce/components/router-link/router-link.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/router-link/router-link.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/router-link/router-link.wxml b/eaterplanet_ecommerce/components/router-link/router-link.wxml
new file mode 100644
index 0000000..1bf02ae
--- /dev/null
+++ b/eaterplanet_ecommerce/components/router-link/router-link.wxml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/router-link/router-link.wxss b/eaterplanet_ecommerce/components/router-link/router-link.wxss
new file mode 100644
index 0000000..58ccb5f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/router-link/router-link.wxss
@@ -0,0 +1,3 @@
+.i-router-hover {
+ opacity: 1;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/rush-spu-big/index.js b/eaterplanet_ecommerce/components/rush-spu-big/index.js
new file mode 100644
index 0000000..14a267c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/rush-spu-big/index.js
@@ -0,0 +1,5 @@
+var goodsBehavior = require('../behavior/goods.js');
+
+Component({
+ behaviors: [goodsBehavior]
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/rush-spu-big/index.json b/eaterplanet_ecommerce/components/rush-spu-big/index.json
new file mode 100644
index 0000000..6c6c2c2
--- /dev/null
+++ b/eaterplanet_ecommerce/components/rush-spu-big/index.json
@@ -0,0 +1,11 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../button/index",
+ "i-img": "../img/index",
+ "i-sku": "../sku/index",
+ "i-router-link": "../router-link/router-link",
+ "i-input-number": "../input-number/index",
+ "i-vip-price": "../vipPrice/vipPrice"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/rush-spu-big/index.wxml b/eaterplanet_ecommerce/components/rush-spu-big/index.wxml
new file mode 100644
index 0000000..2449a46
--- /dev/null
+++ b/eaterplanet_ecommerce/components/rush-spu-big/index.wxml
@@ -0,0 +1,62 @@
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/rush-spu-big/index.wxss b/eaterplanet_ecommerce/components/rush-spu-big/index.wxss
new file mode 100644
index 0000000..39e9aef
--- /dev/null
+++ b/eaterplanet_ecommerce/components/rush-spu-big/index.wxss
@@ -0,0 +1,318 @@
+.spu {
+ width: 100%;
+ display: block;
+}
+
+.spu .img-class {
+ width: 710rpx;
+ height: 400rpx;
+ border-radius: 10rpx 10rpx 0 0;
+ image-rendering: crisp-edges;
+}
+
+.spu .mask {
+ background: rgba(255, 255, 255, 0.5);
+ width: 710rpx;
+ height: 400rpx;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+
+.spu .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 170rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.spu .spu-content {
+ background: #fff;
+ width: 710rpx;
+ border-radius: 20rpx;
+ overflow: hidden;
+ position: relative;
+ box-shadow: 0 0 40rpx rgba(0, 0, 0, 0.05);
+ margin: 0 auto 20rpx;
+ display: flex;
+ flex-direction: column;
+ box-sizing: border-box;
+}
+
+.spu .spu-content.disabled {
+ opacity: 0.6;
+}
+
+.spu .spu-content .item-top {
+ width: 100%;
+ height: 400rpx;
+ position: relative;
+}
+
+.spu .spu-content .item-bottom {
+ box-sizing: border-box;
+ padding: 20rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.spu .spu-content .item-bottom .spu-title {
+ color: #222;
+ font-size: 30rpx;
+ height: 32rpx;
+ width: 100%;
+ margin-bottom: 12rpx;
+ margin-top: 10rpx;
+ font-weight: 500;
+ position: relative;
+}
+
+.spu .spu-content .item-bottom .spu-title .span {
+ width: 100%;
+ height: 40rpx;
+ position: absolute;
+ left: 0;
+ top: -4rpx;
+ line-height: 40rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu .spu-content .item-bottom .spu-tag {
+ padding-left: 196rpx;
+ margin-bottom: 20rpx;
+ display: flex;
+ height: 28rpx;
+}
+
+.spu .spu-content .item-bottom .spu-desc {
+ font-size: 26rpx;
+ line-height: 26rpx;
+ color: #999;
+ position: relative;
+ width: 100%;
+ height: 26rpx;
+ margin-bottom: 12rpx;
+}
+
+.spu .spu-content .item-bottom .spu-desc .em {
+ width: 100%;
+ height: 32rpx;
+ position: absolute;
+ left: 0;
+ top: -2rpx;
+ line-height: 32rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu .spu-content .item-bottom .spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ overflow: hidden;
+ margin-bottom: 10rpx;
+ margin-top: 10rpx;
+}
+
+.spu .spu-content .item-bottom .spu-price .sale-price {
+ color: #ff758c;
+ margin-right: 12rpx;
+}
+
+.spu .spu-content .item-bottom .spu-price .sale-price .span {
+ font-size: 46rpx;
+ line-height: 42rpx;
+ margin: 0;
+ font-weight: bold;
+}
+
+.spu .spu-content .item-bottom .spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+ margin-right: 20rpx;
+}
+
+.spu .spu-content .item-bottom .spu-count {
+ font-size: 24rpx;
+ line-height: 24rpx;
+ color: #999;
+}
+
+.spu .spu-content .add-cart,.spu .spu-content .add-cart-disabled {
+ width: 160rpx;
+ height: 60rpx;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ right: 28rpx;
+ bottom: 20rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #4facfe;
+ color: #fff;
+ border-radius: 30rpx;
+}
+
+.spu .spu-content .add-cart-disabled {
+ background: #ccc;
+}
+
+.spu .item-top .spu-active {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ z-index: 9;
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: flex-start;
+}
+
+.spu .item-top .spu-active .tag {
+ background: linear-gradient(100deg,#4facfe 0%,#00f2fe 100%);
+ border-radius: 0 25rpx 25rpx 0;
+ padding: 0 15rpx;
+ height: 50rpx;
+ font-size: 26rpx;
+ line-height: 50rpx;
+ color: #fff;
+ display: inline-block;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ max-width: 220rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu .item-top .spu-active .tag-green {
+ background: linear-gradient(to left, #46c8d0, #29ba9a);
+}
+
+.spu .spu-content .time-tip {
+ position: absolute;
+ background: #4facfe;
+ left: 0;
+ bottom: 0;
+ width: 250rpx;
+ height: 40rpx;
+ border-radius: 0 8rpx 0 0;
+}
+
+.spu .spu-content .time-tip.notip {
+ display: none;
+}
+
+/* 标签 */
+
+.spu .item-tag {
+ position: absolute;
+ left: 22rpx;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.spu .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.spu .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+
+.spu .index-input-number {
+ position: absolute;
+ right: 0;
+ bottom: 10rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.spu .index-input-number .i-input-number-view {
+ width: 80rpx;
+ height: 80rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.spu .index-input-number .i-input-number-view .img{
+ width: 40rpx;
+ height: 40rpx;
+}
+
+.spu .index-input-number .i-input-number-minus {
+ justify-content: flex-end;
+}
+
+.spu .index-input-number .i-input-number-plus {
+ justify-content: flex-start;
+}
+
+.spu .index-input-number .input-number-text {
+ height: 88rpx;
+ line-height: 88rpx;
+ font-size: 24rpx;
+ color: #333;
+ width: 58rpx;
+}
+
+.spu-play {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ width: 160rpx;
+ height: 160rpx;
+ margin-top: -80rpx;
+ margin-left: -80rpx;
+}
+
+.spu-play .img {
+ width: 100%;
+ height: 100%;
+}
+
+.picktime {
+ font-size: 24rpx;
+ font-weight: bold;
+ margin: 15rpx 0 10rpx;
+ color: #ed7b3a;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/rush-spu-col/index.js b/eaterplanet_ecommerce/components/rush-spu-col/index.js
new file mode 100644
index 0000000..14a267c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/rush-spu-col/index.js
@@ -0,0 +1,5 @@
+var goodsBehavior = require('../behavior/goods.js');
+
+Component({
+ behaviors: [goodsBehavior]
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/rush-spu-col/index.json b/eaterplanet_ecommerce/components/rush-spu-col/index.json
new file mode 100644
index 0000000..095de47
--- /dev/null
+++ b/eaterplanet_ecommerce/components/rush-spu-col/index.json
@@ -0,0 +1,11 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../img/index",
+ "i-button": "../button/index",
+ "i-router-link": "../router-link/router-link",
+ "i-input-number": "../input-number/index",
+ "i-vip-price": "../vipPrice/vipPrice",
+ "i-addcart": "../addCartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/rush-spu-col/index.wxml b/eaterplanet_ecommerce/components/rush-spu-col/index.wxml
new file mode 100644
index 0000000..b19dfa7
--- /dev/null
+++ b/eaterplanet_ecommerce/components/rush-spu-col/index.wxml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ {{spuItem.label_info.tagcontent}}
+
+
+
+
+
+
+
+
+
+
+
+ 满{{reduction.full_money}}减{{reduction.full_reducemoney}}
+ 限购
+
+
+
+
+
+ 已抢光
+ 已结束
+ {{spuItem.spuName}}
+
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/rush-spu-col/index.wxss b/eaterplanet_ecommerce/components/rush-spu-col/index.wxss
new file mode 100644
index 0000000..5a5e188
--- /dev/null
+++ b/eaterplanet_ecommerce/components/rush-spu-col/index.wxss
@@ -0,0 +1,182 @@
+.new-comers-item, .w250 {
+ position: relative;
+ width: 237rpx;
+ box-sizing: border-box;
+ padding: 20rpx 10rpx;
+ font-size: 28rpx;
+}
+
+.w250 {
+ width: 250rpx;
+}
+
+.new-comers-item .new-img {
+ width: 217rpx;
+ height: 217rpx;
+ margin-bottom: 20rpx;
+ overflow: hidden;
+}
+
+.w250 .new-img {
+ width: 230rpx;
+ height: 230rpx;
+ margin-bottom: 20rpx;
+ overflow: hidden;
+}
+
+.new-comers-item .title,
+.w250 .title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.new-comers-item .new-bot,
+.w250 .new-bot {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 10rpx;
+}
+
+.new-comers-item .add-cart,
+.w250 .add-cart {
+ width: 44rpx;
+ height: 44rpx;
+ padding: 0;
+ margin: 0;
+}
+
+.new-comers-item .add-cart .img,
+.w250 .add-cart .img {
+ width: 44rpx;
+ height: 44rpx;
+ display: block;
+}
+
+.new-comers-item .price,
+.w250 .price {
+ color: #ff5041;
+}
+
+.new-comers-item .act-end,
+.w250 .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 80rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.col-input-number .input-number-view {
+ width: 32rpx !important;
+ height: 32rpx !important;
+}
+
+.col-input-number .input-number-img{
+ width: 32rpx !important;
+ height: 32rpx !important;
+ font-size: 32rpx !important;
+}
+
+.col-input-number .input-number-input {
+ height: 32rpx !important;
+ width: 40rpx !important;
+ font-size: 20rpx;
+ line-height: 32rpx !important;
+}
+
+.vip {
+ position: absolute;
+ left: 10rpx;
+ top: 20rpx;
+}
+
+/* 标签 */
+
+.spu .item-tag {
+ position: absolute;
+ right: 10rpx;
+ top: 20rpx;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.spu .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.spu .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.spu .spu-active {
+ position: absolute;
+ left: 10rpx;
+ top: 180rpx;
+ z-index: 9;
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: flex-start;
+}
+
+.spu .spu-active .tag {
+ background: linear-gradient(to right, #ff5041, #ff994b);
+ border-radius: 0 14rpx 14rpx 0;
+ padding: 0 12rpx;
+ height: 30rpx;
+ font-size: 22rpx;
+ line-height: 30rpx;
+ color: #fff;
+ display: inline-block;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ max-width: 180rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu .spu-active .tag-green {
+ background: linear-gradient(to left, #46c8d0, #29ba9a);
+}
+
+.spu-play {
+ position: absolute;
+ left: 50%;
+ top: 20%;
+ width: 100rpx;
+ height: 100rpx;
+ margin-left: -50rpx;
+}
+
+.spu-play .img {
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/s-form-show/index.js b/eaterplanet_ecommerce/components/s-form-show/index.js
new file mode 100644
index 0000000..c71b48c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/s-form-show/index.js
@@ -0,0 +1,40 @@
+// eaterplanet_ecommerce/s-form-show/index.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ formData: {
+ type: Object,
+ value: {}
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ formList: []
+ },
+
+ attached() {
+ let formList = this.data.formData.form_list || [];
+ this.setData({
+ formList
+ })
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ prevImg: function(e){
+ let current = e.currentTarget.dataset.current;
+ let urls = e.currentTarget.dataset.urls;
+ wx.previewImage({
+ current, // 当前显示图片的http链接
+ urls // 需要预览的图片http链接列表
+ })
+ },
+ }
+})
diff --git a/eaterplanet_ecommerce/components/s-form-show/index.json b/eaterplanet_ecommerce/components/s-form-show/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/s-form-show/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/s-form-show/index.wxml b/eaterplanet_ecommerce/components/s-form-show/index.wxml
new file mode 100644
index 0000000..b03aa52
--- /dev/null
+++ b/eaterplanet_ecommerce/components/s-form-show/index.wxml
@@ -0,0 +1,10 @@
+
+ {{item.item_name}}:
+
+ {{item.item_val}}
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/s-form-show/index.wxss b/eaterplanet_ecommerce/components/s-form-show/index.wxss
new file mode 100644
index 0000000..5ad9d13
--- /dev/null
+++ b/eaterplanet_ecommerce/components/s-form-show/index.wxss
@@ -0,0 +1 @@
+@import "/common.wxss";
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/s-form/index.js b/eaterplanet_ecommerce/components/s-form/index.js
new file mode 100644
index 0000000..019c98d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/s-form/index.js
@@ -0,0 +1,345 @@
+import WxValidate from '../../utils/WxValidate.js';
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ formData: {
+ type: Object,
+ value: {}
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ form: {},
+ formList: [],
+ dateParams: {
+ year: true,
+ month: true,
+ day: true,
+ hour: false,
+ minute: false,
+ second: false
+ },
+ rules: {},
+ time: "12:00",
+ },
+
+ attached() {
+ let formList = this.data.formData.form_list || [];
+ let form = {};
+ let fileList = [];
+ let rules = {};
+ let messages = {};
+ Object.keys(formList).length && Object.keys(formList).forEach((index) => {
+ let item = formList[index];
+ let formKey = item.type + '_' + item.random_code;
+ form[formKey] = '';
+ fileList.push([]);
+
+ let message = "请填写正确的" + item.title;
+ if(item.type=='image') {
+ message = "请上传"+item.title;
+ }
+ if(item.type=='select') {
+ item.index = -1;
+ message = "请选择"+item.title;
+ }
+ if(item.type=='area') {
+ item.region = [ item.province_id, item.city_id, item.country_id];
+ form[formKey] = item.region.join(",");
+ message = "请选择"+item.title;
+ }
+ if(item.type=='date') {
+ if(item.date_type=="appoint_date") {
+ item.default_time = item.appoint_date;
+ form[formKey] = item.appoint_date;
+ } else if(item.date_type=="same_day") {
+ item.default_time = new Date().toLocaleDateString();
+ form[formKey] = item.default_time;
+ }
+ message = "请选择"+item.title;
+ }
+ if(item.type=='date_range') {
+ if(item.begin_date_type=="appoint_date") {
+ item.default_begin_date = item.begin_appoint_date;
+ } else if(item.begin_date_type=="same_day") {
+ let cur_date = this.getDate();
+ item.default_begin_date = cur_date;
+ }
+ if(item.end_date_type=="appoint_date") {
+ item.default_end_date = item.end_appoint_date;
+ } else if(item.end_date_type=="same_day") {
+ let cur_date = this.getDate();
+ item.default_end_date = cur_date;
+ }
+ if(item.default_begin_date&&item.default_end_date) {
+ form[formKey] = item.default_begin_date+'~'+item.default_end_date;
+ }
+ item.pickerConfig = {
+ endDate: true,
+ column: "day",
+ dateLimit: true,
+ initStartTime: item.default_begin_date,
+ initEndTime: item.default_end_date,
+ limitStartTime: "2015-05-06",
+ limitEndTime: "2065-05-06"
+ }
+ message = "请选择"+item.title;
+ }
+ if(item.type=='time') {
+ let myDate = new Date();
+ if(item.time_type=="appoint_time") {
+ item.default_time = item.appoint_time;
+ form[item.type+'_'+item.random_code] = item.appoint_time;
+ } else if(item.time_type=="same_time") {
+ item.default_time = myDate.getHours()+':'+myDate.getMinutes()+':'+myDate.getSeconds();
+ form[item.type+'_'+item.random_code] = item.default_time;
+ }
+ message = "请选择"+item.title;
+ }
+ if(item.type=='time_range') {
+ let myDate = new Date();
+ item.beginTime = "";
+ item.endTime = "";
+ if(item.begin_time_type=="appoint_time") {
+ item.beginTime = item.begin_appoint_time;
+ } else if(item.begin_time_type=="same_time") {
+ item.beginTime = myDate.getHours()+':'+myDate.getMinutes()+':'+myDate.getSeconds();
+ }
+ if(item.end_time_type=="appoint_time") {
+ item.endTime = item.end_appoint_time;
+ } else if(item.end_time_type=="same_time") {
+ let timestamp = Date.parse(new Date());
+ let nextDate = new Date(timestamp+1000);
+ item.endTime = nextDate.getHours()+':'+nextDate.getMinutes()+':'+nextDate.getSeconds();
+ }
+ if(item.beginTime&&item.endTime) form[item.type+'_'+item.random_code] = item.beginTime+'~'+item.endTime;
+ message = "请选择"+item.title;
+ }
+
+ //手机格式验证
+ if(item.type=='telephone'&&item.required==1) {
+ rules[formKey] = {
+ required: Boolean(item.required),
+ tel: true
+ }
+ messages[formKey] = {
+ required: message,
+ tel: message
+ }
+ } else if (item.type=='idcard'&&item.required==1) {
+ rules[formKey] = {
+ required: Boolean(item.required),
+ idcard: true
+ }
+ messages[formKey] = {
+ required: message,
+ idcard: message
+ }
+ } else {
+ rules[formKey] = {
+ required: Boolean(item.required)
+ }
+ messages[formKey] = {
+ required: message
+ }
+ }
+
+ item.show = false;
+ })
+
+ this.setData({
+ form,
+ formList,
+ fileList,
+ formList,
+ rules
+ })
+ console.log(rules)
+ this.WxValidate = new WxValidate(rules, messages)
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ getDate() {
+ let myDate = new Date();
+ let y = myDate.getFullYear();
+ let m = myDate.getMonth()+1;
+ let d = myDate.getDate();
+ m = m>10?m:'0'+m;
+ d = d>10?d:'0'+d;
+ return y+'-'+m+'-'+d;
+ },
+ changeImg: function (e) {
+ // console.log(e.detail)
+ let key = e.detail.key;
+ let form = this.data.form;
+ form[key] = e.detail.value.join(",");
+ this.setData({
+ form
+ })
+ },
+ bindPickerChange(e) {
+ // console.log(e)
+ let idx = e.currentTarget.dataset.idx || "";
+ let value = e.detail.value;
+ let { form, formList } = this.data;
+ let item = formList[idx];
+ let key = item.type+'_'+item.random_code;
+ item.index = value;
+ formList[idx] = item;
+ form[key] = item.option_val[value];
+ this.setData({
+ form,
+ formList
+ })
+ },
+ radioChange(e) {
+ // console.log(e)
+ let key = e.currentTarget.dataset.idx || "";
+ let value = e.detail.value;
+ let form = this.data.form;
+ form[key] = value;
+ // console.log(form)
+ this.setData({
+ form
+ })
+ },
+ checkboxChange(e) {
+ // console.log(e)
+ let key = e.currentTarget.dataset.idx || "";
+ let value = e.detail.value;
+ let form = this.data.form;
+ form[key] = value.join(",");
+ // console.log(form)
+ this.setData({
+ form
+ })
+ },
+ bindRegionChange(e) {
+ // console.log(e)
+ let idx = e.currentTarget.dataset.idx || "";
+ let value = e.detail.value;
+ let { form, formList } = this.data;
+ let item = formList[idx];
+ let key = item.type+'_'+item.random_code;
+ item.region = value;
+ formList[idx] = item;
+ form[key] = value.join(",");
+ this.setData({
+ form,
+ formList
+ })
+ },
+ bindDateChange(e) {
+ // console.log(e)
+ let key = e.currentTarget.dataset.idx || "";
+ let form = this.data.form;
+ form[key] = e.detail.value;
+ // console.log(form)
+ this.setData({
+ form
+ })
+ },
+ bindKeyInput(e) {
+ // console.log(e)
+ let key = e.currentTarget.dataset.idx || "";
+ let form = this.data.form;
+ form[key] = e.detail.value;
+ // console.log(form)
+ this.setData({
+ form
+ })
+ },
+ showDateRange(e) {
+ let idx = e.currentTarget.dataset.idx || "";
+ let formList = this.data.formList;
+ formList[idx].show = !formList[idx].show;
+ this.setData({
+ formList
+ })
+ },
+ pickerHide(e) {
+ // console.log(e)
+ let idx = e.currentTarget.dataset.idx || "";
+ let formList = this.data.formList;
+ formList[idx].show = !formList[idx].show;
+ this.setData({
+ formList
+ })
+ },
+ setPickerTime(e) {
+ // console.log(e)
+ let key = e.currentTarget.id || "";
+ let form = this.data.form;
+ let startTime = e.detail.startTime.slice(0, -9);
+ let endTime = e.detail.endTime.slice(0, -9);
+ form[key] = startTime + '~' + endTime;
+ this.setData({
+ form
+ })
+ },
+ showTimeRange(e) {
+ let idx = e.currentTarget.dataset.idx || "";
+ let formList = this.data.formList;
+ formList[idx].show = !formList[idx].show;
+ this.setData({
+ formList
+ })
+ },
+ timeRangeConfirm(e) {
+ // console.log(e)
+ let idx = e.currentTarget.dataset.idx || "";
+ let value = e.detail.time;
+ let { form, formList } = this.data;
+ let item = formList[idx];
+ let key = item.type+'_'+item.random_code;
+ item.show = false;
+ formList[idx] = item;
+ form[key] = value;
+ this.setData({
+ form,
+ formList
+ })
+ },
+ formSubmit(e) {
+ const form = this.data.form
+ console.log('form发生了submit事件,携带数据为:', form)
+ //校验表单
+ if (!this.WxValidate.checkForm(form)) {
+ const error = this.WxValidate.errorList[0];
+ wx.showToast({
+ title: error.msg,
+ icon: "none"
+ })
+ return false;
+ } else {
+ console.log('验证成功');
+ let {formData, form, formList} = this.data;
+ let allform_list = [];
+ formList.forEach(item=>{
+ let params = {
+ title: item.title,
+ type: item.type,
+ item_value: form[item.type+'_'+item.random_code],
+ random_code: item.random_code
+ }
+ allform_list.push(params);
+ })
+ console.log(allform_list);
+ let formParams = {
+ allform_id: formData.order_allform_id,
+ allform_list: JSON.stringify(allform_list)
+ };
+ this.triggerEvent('success', formParams)
+ }
+ }
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/s-form/index.json b/eaterplanet_ecommerce/components/s-form/index.json
new file mode 100644
index 0000000..24270d8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/s-form/index.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "chooseImage": "../chooseImage/index",
+ "timePicker": "../../components/timePicker/timePicker",
+ "time-range": "../../components/time-range/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/s-form/index.wxml b/eaterplanet_ecommerce/components/s-form/index.wxml
new file mode 100644
index 0000000..3d74037
--- /dev/null
+++ b/eaterplanet_ecommerce/components/s-form/index.wxml
@@ -0,0 +1,76 @@
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/s-form/index.wxss b/eaterplanet_ecommerce/components/s-form/index.wxss
new file mode 100644
index 0000000..37eeff1
--- /dev/null
+++ b/eaterplanet_ecommerce/components/s-form/index.wxss
@@ -0,0 +1,41 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+
+.ipt {
+ border: 1rpx solid #E6E7EB;
+ font-size: 28rpx;
+ line-height: 40rpx;
+ resize: none;
+ padding: 10rpx 20rpx;
+}
+
+.ipt-holder {
+ color: rgb(206, 206, 206);
+}
+
+radio {
+ transform: scale(0.7)
+}
+
+checkbox {
+ transform: scale(0.7)
+}
+
+.rightIcon {
+ position: absolute;
+ right: 20rpx;
+ top: 38%;
+ font-size: 16rpx;
+ color: #d2d2d2;
+}
+
+.rightIcon.icon-calendar,
+.rightIcon.icon-time {
+ top: 30%;
+ font-size: 28rpx;
+}
+
+textarea {
+ width: 100%;
+ box-sizing: border-box;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/seckillItem/seckillItem.js b/eaterplanet_ecommerce/components/seckillItem/seckillItem.js
new file mode 100644
index 0000000..39e208f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/seckillItem/seckillItem.js
@@ -0,0 +1,77 @@
+var util = require('../../utils/util.js');
+var app = getApp();
+
+Component({
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ spuId: "",
+ skuId: "",
+ spuImage: "",
+ spuName: "",
+ endTime: 0,
+ beginTime: "",
+ actPrice: ["", ""],
+ marketPrice: ["", ""],
+ spuCanBuyNum: "",
+ soldNum: "",
+ actId: "",
+ limitMemberNum: "",
+ limitOrderNum: "",
+ serverTime: "",
+ isLimit: false,
+ skuList: [],
+ spuDescribe: "",
+ is_take_fullreduction: 0,
+ label_info: "",
+ car_count: 0
+ },
+ observer: function (t) {
+ let totNum = t.soldNum + t.spuCanBuyNum*1;
+ let precent = parseInt((t.soldNum / totNum)*100) || 0;
+ this.setData({ precent })
+ }
+ },
+ actEnd: {
+ type: Boolean,
+ value: false
+ },
+ needAuth: {
+ type: Boolean,
+ value: false
+ },
+ theme: {
+ type: Number,
+ value: 0
+ },
+ begin: {
+ type: Number,
+ value: 1
+ },
+ skin: {
+ type: Object
+ }
+ },
+ attached() {
+ this.setData({ placeholdeImg: app.globalData.placeholdeImg })
+ },
+ data: {
+ disabled: false,
+ placeholdeImg: '',
+ precent: 0,
+ goods_sale_unit: app.globalData.goods_sale_unit
+ },
+ methods: {
+ openSku: function () {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/goods/goodsDetail?id=' + this.data.spuItem.actId,
+ })
+ // if (this.data.needAuth) {
+ // this.triggerEvent("authModal", true);
+ // return;
+ // }
+ console.log('抢购')
+ }
+ }
+});
diff --git a/eaterplanet_ecommerce/components/seckillItem/seckillItem.json b/eaterplanet_ecommerce/components/seckillItem/seckillItem.json
new file mode 100644
index 0000000..206d17b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/seckillItem/seckillItem.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../button/index",
+ "i-img": "../img/index",
+ "i-router-link": "../router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/seckillItem/seckillItem.wxml b/eaterplanet_ecommerce/components/seckillItem/seckillItem.wxml
new file mode 100644
index 0000000..d2fea8a
--- /dev/null
+++ b/eaterplanet_ecommerce/components/seckillItem/seckillItem.wxml
@@ -0,0 +1,37 @@
+
+
diff --git a/eaterplanet_ecommerce/components/seckillItem/seckillItem.wxss b/eaterplanet_ecommerce/components/seckillItem/seckillItem.wxss
new file mode 100644
index 0000000..e956998
--- /dev/null
+++ b/eaterplanet_ecommerce/components/seckillItem/seckillItem.wxss
@@ -0,0 +1,153 @@
+.seckill-item {
+ position: relative;
+ display: flex;
+ padding: 20rpx 20rpx 30rpx;
+}
+
+.img {
+ width: 240rpx;
+ height: 240rpx;
+ border-radius: 10rpx;
+ overflow: hidden;
+}
+
+.img .img-class {
+ width: 240rpx;
+ height: 240rpx;
+}
+
+.seckill-item .item-right {
+ flex: 1;
+ width: 100%;
+ box-sizing: border-box;
+ margin-left: 20rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.seckill-item .title {
+ color: #333;
+ font-size: 30rpx;
+ height: 40rpx;
+ line-height: 40rpx;
+ width: 350rpx;
+ margin-bottom: 12rpx;
+ font-weight: bold;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.seckill-item .item-right .desc {
+ font-size: 26rpx;
+ line-height: 32rpx;
+ color: #999;
+ width: 400rpx;
+ height: 32rpx;
+ margin-bottom: 12rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.seckill-item .spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ overflow: hidden;
+ margin-bottom: 10rpx;
+}
+
+.seckill-item .spu-price .sale-price {
+ color: #ff5344;
+ margin-right: 12rpx;
+}
+
+.seckill-item .spu-price .sale-price .span {
+ font-size: 46rpx;
+ line-height: 42rpx;
+ margin: 0;
+ font-weight: bold;
+}
+
+.seckill-item .spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+ margin-right: 30rpx;
+}
+
+.seckill-item .add-cart {
+ height: 52rpx;
+ line-height: 52rpx;
+ padding: 0 20rpx;
+ margin: 0;
+ position: absolute;
+ right: 20rpx;
+ bottom: 30rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 26rpx;
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ color: #fff;
+ font-size: 24rpx;
+}
+
+.seckill-item .add-cart.disabled {
+ background: #ccc;
+}
+
+.progress-box {
+ display: flex;
+ color: #999;
+ font-size: 22rpx;
+ margin-top: auto;
+ margin-bottom: 20rpx;
+}
+
+.progress-wrap {
+ width: 160rpx;
+ margin-right: 10rpx;
+}
+
+.flex {
+ flex-direction: column;
+ color: #666;
+ font-size: 24rpx;
+}
+
+.flex .progress-wrap {
+ width: 100%;
+ margin-right: 0;
+ margin-bottom: 10rpx;
+}
+
+.seckill-item .mask {
+ background: rgba(255, 255, 255, 0.5);
+ width: 240rpx;
+ height: 240rpx;
+ position: absolute;
+ left: 20rpx;
+ top: 20rpx;
+}
+
+.seckill-item .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 140rpx;
+ top: 112rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.seckill-item .act-end.act-out {
+ left: 140rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/skeleton/getSystemInfo.js b/eaterplanet_ecommerce/components/skeleton/getSystemInfo.js
new file mode 100644
index 0000000..c872996
--- /dev/null
+++ b/eaterplanet_ecommerce/components/skeleton/getSystemInfo.js
@@ -0,0 +1,35 @@
+/**
+ * 获取系统信息
+ */
+class SystemInfo {
+ static fetchAllInfo() {
+ const menuButton = wx.getMenuButtonBoundingClientRect()
+ const systemInfo = wx.getSystemInfoSync()
+
+ const statusBarHeight = systemInfo.statusBarHeight
+ const headerHeight = (menuButton.top - systemInfo.statusBarHeight) * 2 + menuButton.height
+
+ let data = {
+ source: {
+ menu: menuButton,
+ system: systemInfo
+ },
+ statusBarHeight: statusBarHeight,
+ headerHeight: headerHeight,
+ headerRight: systemInfo.windowWidth - menuButton.left
+ }
+
+ wx.setStorageSync('SystemInfo', data)
+ return data
+ }
+
+ static getInfo() {
+ let storageInfoSync = wx.getStorageSync('SystemInfo')
+ if (!storageInfoSync) {
+ storageInfoSync = this.fetchAllInfo()
+ }
+ return storageInfoSync
+ }
+}
+
+export default SystemInfo
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/skeleton/skeleton.js b/eaterplanet_ecommerce/components/skeleton/skeleton.js
new file mode 100644
index 0000000..28d0768
--- /dev/null
+++ b/eaterplanet_ecommerce/components/skeleton/skeleton.js
@@ -0,0 +1,88 @@
+// components/skeleton.js
+import SystemInfo from 'getSystemInfo.js'
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+
+ },
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ height: 0, //卡片高度,用来做外部懒加载的占位
+ showSlot: true, //控制是否显示当前的slot内容
+ skeletonId: ''
+ },
+
+ created() {
+ //设置一个走setData的数据池
+ this.extData = {
+ listItemContainer: null,
+ }
+ },
+
+ detached() {
+ try {
+ this.extData.listItemContainer.disconnect()
+ } catch (error) {
+
+ }
+ this.extData = null
+ },
+
+ ready() {
+ this.setData({
+ skeletonId: this.randomString(8) //设置唯一标识
+ })
+
+ wx.nextTick(() => {
+ // 修改了监听是否显示内容的方法,改为前后showNum屏高度渲染
+ // 监听进入屏幕的范围relativeToViewport({top: xxx, bottom: xxx})
+ let info = SystemInfo.getInfo()
+ let { windowHeight = 667 } = info.source.system
+ let showNum = 3 //超过屏幕的数量,目前这个设置是上下2屏
+ try {
+ this.extData.listItemContainer = this.createIntersectionObserver()
+ this.extData.listItemContainer.relativeToViewport({ top: showNum * windowHeight, bottom: showNum * windowHeight })
+ .observe(`#list-item-${this.data.skeletonId}`, (res) => {
+ let { intersectionRatio } = res
+ if (intersectionRatio === 0) {
+ console.log('【卸载】', this.data.skeletonId, '超过预定范围,从页面卸载')
+ this.setData({
+ showSlot: false
+ })
+ } else {
+ console.log('【进入】', this.data.skeletonId, '达到预定范围,渲染进页面')
+ this.setData({
+ showSlot: true,
+ height: res.boundingClientRect.height
+ })
+ }
+ })
+ } catch (error) {
+ console.log(error)
+ }
+ })
+
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ /**
+ * 生成随机的字符串
+ */
+ randomString(len) {
+ len = len || 32;
+ var $chars = 'abcdefhijkmnprstwxyz2345678'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
+ var maxPos = $chars.length;
+ var pwd = '';
+ for (var i = 0; i < len; i++) {
+ pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
+ }
+ return pwd;
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/skeleton/skeleton.json b/eaterplanet_ecommerce/components/skeleton/skeleton.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/skeleton/skeleton.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/skeleton/skeleton.wxml b/eaterplanet_ecommerce/components/skeleton/skeleton.wxml
new file mode 100644
index 0000000..6e3efa7
--- /dev/null
+++ b/eaterplanet_ecommerce/components/skeleton/skeleton.wxml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/skeleton/skeleton.wxss b/eaterplanet_ecommerce/components/skeleton/skeleton.wxss
new file mode 100644
index 0000000..be6259b
--- /dev/null
+++ b/eaterplanet_ecommerce/components/skeleton/skeleton.wxss
@@ -0,0 +1 @@
+/* components/skeleton.wxss */
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/sku/index.js b/eaterplanet_ecommerce/components/sku/index.js
new file mode 100644
index 0000000..065e6fb
--- /dev/null
+++ b/eaterplanet_ecommerce/components/sku/index.js
@@ -0,0 +1,431 @@
+var a = require("../../utils/public"), app = getApp();
+var util = require('../../utils/util.js');
+
+Component({
+ properties: {
+ visible: {
+ type: Boolean,
+ value: false,
+ observer: function (t) {
+ t && this.setData({
+ value: 1,
+ loading: false
+ })
+ }
+ },
+ cur_sku_arr: {
+ type: Object,
+ value: {}
+ },
+ skuList: {
+ type: Object,
+ value: {}
+ },
+ sku_val: {
+ type: Number,
+ value: 1
+ },
+ sku: {
+ type: Array,
+ value: []
+ },
+ goodsid: {
+ type: Number,
+ value: 0
+ },
+ type: {
+ type: Number,
+ value: 0
+ },
+ buyType: {
+ type: String,
+ value: ''
+ },
+ soliId: {
+ type: Number,
+ value: 0
+ },
+ vipInfo: {
+ type: Object,
+ value: {
+ is_open_vipcard_buy: 0,
+ is_vip_card_member: 0,
+ is_member_level_buy: 0
+ }
+ },
+ skin: {
+ type: Object,
+ value: {
+ color: '#ff5344',
+ subColor: '#ed7b3a',
+ lighter: '#fff9f4'
+ }
+ }
+ },
+ focusFlag: false,
+ data: {
+ value: 1,
+ loading: false,
+ showLimitTip: false,
+ showLimitType: 0
+ },
+ methods: {
+ close: function () {
+ this.setData({showLimitTip: false})
+ this.triggerEvent("cancel");
+ },
+ selectSku: function (event) {
+ var that = this;
+ let str = event.currentTarget.dataset.type;
+ let obj = str.split("_");
+ let { sku, cur_sku_arr, skuList, sku_val } = this.data;
+ let temp = {
+ name: obj[3],
+ id: obj[2],
+ index: obj[0],
+ idx: obj[1]
+ };
+ sku.splice(obj[0], 1, temp);
+ var id = '';
+ for (let i = 0; i < sku.length; i++) {
+ if (i == sku.length - 1) {
+ id = id + sku[i]['id'];
+ } else {
+ id = id + sku[i]['id'] + "_";
+ }
+ }
+ cur_sku_arr = Object.assign(cur_sku_arr, skuList.sku_mu_list[id]);
+
+ let h = {};
+ h.noEougnStock = false;
+ sku_val = sku_val || 1;
+ let canBuyNum = cur_sku_arr.canBuyNum*1;
+ if(sku_val > canBuyNum) {
+ h.sku_val = canBuyNum==0?1:canBuyNum;
+ (canBuyNum>0) && wx.showToast({
+ title: `最多只能购买${cur_sku_arr.canBuyNum}件`,
+ icon: 'none'
+ })
+ }
+
+ let { car_quantity, goods_start_count } = this.data.cur_sku_arr;
+ if(car_quantity && car_quantity>=goods_start_count) goods_start_count=1;
+ // 库存小于起购数量 按钮变灰 数量变起购
+ if(canBuyNum0 && num > one_limit_count) {
+ wx.showToast({
+ title: `您本次只能购买${one_limit_count}份`,
+ icon: 'none'
+ })
+ num = one_limit_count;
+ showLimitTip = true;
+ showLimitType = 1;
+ } else if(oneday_limit_count>0 && num > oneday_limit_count) {
+ wx.showToast({
+ title: `您今天只能购买${oneday_limit_count}份`,
+ icon: 'none'
+ })
+ num = oneday_limit_count;
+ showLimitTip = true;
+ showLimitType = 2;
+ } else if(total_limit_count>0 && num > total_limit_count) {
+ wx.showToast({
+ title: `您最多只能购买${total_limit_count}份`,
+ icon: 'none'
+ })
+ num = total_limit_count;
+ showLimitTip = true;
+ showLimitType = 3;
+ }
+ } else if (types == 'decrease') {
+ let { car_quantity, goods_start_count } = this.data.cur_sku_arr;
+ if(car_quantity && car_quantity>=goods_start_count) goods_start_count=1;
+ if (sku_val > 1) {
+ num = sku_val - 1;
+ if(num 0) {
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ }
+
+ if (options.length > 0) {
+ let cur_sku_arr = options.sku_mu_list[id];
+ let max = cur_sku_arr['canBuyNum'];
+ if (num > max) {
+ num = num - 1;
+ wx.showToast({
+ title: `最多只能购买${max}件`,
+ icon: 'none'
+ })
+ }
+ } else {
+ let cur_sku_arr = this.data.cur_sku_arr;
+ if (num > cur_sku_arr['canBuyNum']) {
+ num = num - 1;
+ }
+ }
+ this.setData({
+ sku_val: num,
+ showLimitTip,
+ showLimitType
+ })
+ },
+
+ gocarfrom: function (e) {
+ var that = this;
+ wx.showLoading();
+ a.collectFormIds(e.detail.formId);
+ that.goOrder();
+ },
+
+ goOrder: function () {
+ let that = this;
+ let tdata = that.data;
+ if (tdata.can_car) tdata.can_car = false;
+
+ var token = wx.getStorageSync('token');
+ var community = wx.getStorageSync('community');
+ var community_id = community.communityId;
+
+ var goods_id = tdata.goodsid;
+ var quantity = tdata.sku_val;
+ var cur_sku_arr = tdata.cur_sku_arr;
+
+ var sku_str = '';
+ var is_just_addcar = 1;
+ if (cur_sku_arr && cur_sku_arr.option_item_ids) sku_str = cur_sku_arr.option_item_ids;
+
+ let buy_type = this.data.buyType ? this.data.buyType: 'dan';
+ if(buy_type=='integral') is_just_addcar = 0;
+
+ // 接龙
+ let soli_id = this.data.soliId || '';
+
+ let data = {
+ goods_id,
+ community_id,
+ quantity,
+ sku_str,
+ buy_type,
+ pin_id: 0,
+ is_just_addcar,
+ soli_id
+ }
+ util.addCart(data).then(res=>{
+ if(res.showVipModal==1) {
+ let { pop_vipmember_buyimage } = res.data;
+ wx.hideLoading();
+ that.triggerEvent("vipModal", { pop_vipmember_buyimage, showVipModal: true, visible: false });
+ } else if (res.data.code == 3 || res.data.code == 7) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ if (buy_type =='integral'){
+ if (res.data.code == 6) {
+ // 积分不足
+ var msg = res.data.msg;
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ //跳转结算页面
+ wx.navigateTo({
+ url: `/eaterplanet_ecommerce/pages/order/placeOrder?type=integral`,
+ })
+ }
+ } else {
+ if (res.data.code == 4) {
+ wx.showToast({
+ title: '您未登录',
+ duration: 2000,
+ success: () => {
+ that.setData({
+ needAuth: true
+ })
+ }
+ })
+ } else if (res.data.code == 6) {
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({
+ sku_val: max_quantity
+ })
+ var msg = res.data.msg;
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ if (is_just_addcar == 1) {
+ that.close();
+ wx.hideLoading();
+ // 接龙商品
+ if (buy_type == 'soitaire') {
+ let { goods_total_count, total } = res.data;
+ that.triggerEvent("changeCartNum", { goods_total_count, total, goods_id });
+ } else {
+ res.data.total && that.triggerEvent("changeCartNum", res.data.total);
+ }
+ wx.showToast({
+ title: "已加入购物车",
+ image: "../../images/addShopCart.png"
+ })
+ } else {
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/buy/index?type=' + tdata.order.buy_type
+ })
+ } else {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/buy/index?type=' + tdata.order.buy_type
+ })
+ }
+ }
+ }
+ }
+ }
+ })
+ },
+
+ // 输入框获得焦点
+ handleFocus: function () {
+ this.focusFlag = true;
+ },
+
+ handleBlur: function (t) {
+ let a = t.detail;
+ let val = parseInt(a.value);
+ if (val == '' || isNaN(val)) {
+ let { car_quantity, goods_start_count } = this.data.cur_sku_arr;
+ if(car_quantity && car_quantity>=goods_start_count){
+ goods_start_count=1;
+ } else {
+ wx.showToast({
+ title: `${goods_start_count}件起售`,
+ icon: 'none'
+ })
+ }
+ this.setData({ sku_val: goods_start_count })
+ }
+ },
+
+ // 监控输入框变化
+ changeNumber: function (t) {
+ let { cur_sku_arr, sku_val } = this.data;
+ let max = cur_sku_arr.stock * 1;
+ let a = t.detail;
+ this.focusFlag = false;
+ let showLimitTip = false;
+ let showLimitType = 0;
+ let { car_quantity, goods_start_count } = this.data.cur_sku_arr;
+ if(car_quantity && car_quantity>=goods_start_count) goods_start_count=1;
+ if (a) {
+ let val = parseInt(a.value);
+ val = val < 1 ? 1 : val;
+ // 限购
+ let {one_limit_count, total_limit_count, oneday_limit_count} = cur_sku_arr;
+ if(one_limit_count>0 && val > one_limit_count) {
+ wx.showToast({
+ title: `您本次只能购买${one_limit_count}份`,
+ icon: 'none'
+ })
+ sku_val = one_limit_count;
+ showLimitTip = true;
+ showLimitType = 1;
+ } else if(oneday_limit_count>0 && val > oneday_limit_count) {
+ wx.showToast({
+ title: `您今天只能购买${oneday_limit_count}份`,
+ icon: 'none'
+ })
+ sku_val = oneday_limit_count;
+ showLimitTip = true;
+ showLimitType = 2;
+ } else if(total_limit_count>0 && val > total_limit_count) {
+ wx.showToast({
+ title: `您最多只能购买${total_limit_count}份`,
+ icon: 'none'
+ })
+ sku_val = total_limit_count;
+ showLimitTip = true;
+ showLimitType = 3;
+ } else if (val > max) {
+ wx.showToast({
+ title: `最多只能购买${max}件`,
+ icon: 'none'
+ })
+ sku_val = max;
+ } else {
+ if(val
+
+
+
+
+
+
+ {{item.name}}
+
+ {{value.name}}
+
+
+
+ 数量
+
+
+
+
+
+
+
+
+
+
+ 每单限{{cur_sku_arr.one_limit_count}}份
+ 每人限购{{cur_sku_arr.total_limit_count}}份
+
+
+
+
+
+ 购物车总数已满或超出{{showLimitType==1?'每次':(showLimitType==2?'每天':'最多')}}购买数量
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/sku/index.wxss b/eaterplanet_ecommerce/components/sku/index.wxss
new file mode 100644
index 0000000..54d109f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/sku/index.wxss
@@ -0,0 +1,275 @@
+.sku-content {
+ position: fixed;
+ bottom: 0px;
+ z-index: 9999;
+}
+
+.sku-card {
+ width: 750rpx;
+ box-sizing: border-box;
+ border-radius: 30rpx 30rpx 0 0;
+ background: #fff;
+ overflow: hidden;
+ padding: 40rpx 40rpx 0 40rpx;
+}
+
+.sku-card .close {
+ position: absolute;
+ right: 28rpx;
+ top: 28rpx;
+ width: 40rpx;
+ height: 40rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.sku-card .close .image {
+ width: 26rpx;
+ height: 26rpx;
+}
+
+.sku-card .sku-header {
+ display: flex;
+ align-items: flex-start;
+ margin-bottom: 40rpx;
+}
+
+.sku-card .sku-header .sku-img {
+ width: 160rpx;
+ height: 160rpx;
+ border: 1rpx solid #e4e4e4;
+ margin-right: 30rpx;
+}
+
+/* .sku-card .sku-header .sku-img image {
+ border: none;
+} */
+
+.sku-card .sku-header .sku-desc {
+ display: flex;
+ flex-direction: column;
+}
+
+.sku-card .sku-header .sku-desc .sku-title {
+ width: 390rpx;
+ min-height: 60rpx;
+ margin-bottom: 16rpx;
+ color: #444;
+ font-weight: bold;
+ position: relative;
+}
+
+.sku-card .sku-header .sku-desc .sku-title .span {
+ position: absolute;
+ width: 390rpx;
+ height: 60rpx;
+ left: 0;
+ top: 0;
+ font-size: 26rpx;
+ line-height: 30rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ text-overflow: initial;
+ white-space: normal;
+}
+
+.sku-card .sku-header .sku-price {
+ display: flex;
+ align-items: flex-end;
+ margin-bottom: 12rpx;
+ font-size: 24rpx;
+ line-height: 24rpx;
+}
+
+.sku-card .sku-header .sku-price .sale-price {
+ color: #ff758c;
+ margin-right: 12rpx;
+ margin-bottom: -4rpx;
+}
+
+.sku-card .sku-header .sku-price .sale-price .span {
+ font-size: 56rpx;
+ line-height: 56rpx;
+ margin-left: 8rpx;
+ font-weight: bold;
+}
+
+.sku-card .sku-header .sku-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+ margin-right: 30rpx;
+}
+
+.sku-card .sku-header .sku-switch-on {
+ font-size: 24rpx;
+ color: #444;
+}
+
+.sku-card .sku-msg {
+ width: 670rpx;
+ margin: 0 auto 60rpx;
+ border-radius: 16rpx;
+ background: linear-gradient(to right, #fff7f0, #fff4ec);
+ display: flex;
+ align-items: flex-start;
+ padding: 20rpx;
+ color: #ca7e57;
+ box-sizing: border-box;
+}
+
+.sku-card .sku-msg .tag {
+ border-radius: 16rpx;
+ border: 1rpx solid #ffa49c;
+ font-size: 20rpx;
+ line-height: 28rpx;
+ font-weight: 500;
+ padding: 0 8rpx;
+ margin-right: 8rpx;
+ color: #4facfe;
+ white-space: nowrap;
+ vertical-align: middle;
+}
+
+.sku-card .sku-msg .sku-activity-msg {
+ color: #ca7e57;
+ font-size: 24rpx;
+ line-height: 32rpx;
+ width: 540rpx;
+ font-weight: 500;
+}
+
+.sku-card .sku-spec {
+ width: 670rpx;
+ margin: 0 auto 40rpx;
+ display: flex;
+ align-items: flex-start;
+}
+
+.sku-card .sku-spec .title {
+ font-size: 26rpx;
+ line-height: 50rpx;
+ margin-right: 8rpx;
+}
+
+.sku-card .sku-spec .spec-list {
+ width: 600rpx;
+ display: flex;
+ flex: 1;
+ flex-wrap: wrap;
+}
+
+.sku-card .sku-spec .spec-list .span {
+ position: relative;
+ height: 46rpx;
+ background: #f6f6f6;
+ border: 2rpx solid #f6f6f6;
+ text-align: center;
+ line-height: 46rpx;
+ font-size: 26rpx;
+ margin: 0 8rpx 20rpx 0;
+ color: #666;
+ border-radius: 46rpx;
+ padding: 0 30rpx;
+ display: block;
+ white-space: nowrap;
+}
+
+.sku-card .sku-spec .spec-list .on {
+ border-color: #ffa49c;
+ color: #4facfe;
+ background: #fff;
+}
+
+.sku-card .sku-spec .spec-list .disabled {
+ color: #ccc;
+}
+
+.sku-card .sku-num-content {
+ width: 670rpx;
+ margin: 0 auto 52rpx;
+ display: flex;
+ align-items: center;
+}
+
+.sku-card .sku-num-content .title {
+ width: 80rpx;
+ font-size: 26rpx;
+ line-height: 50rpx;
+}
+
+.sku-card .sku-num-content .msg {
+ width: 420rpx;
+ color: #aaa;
+ font-size: 26rpx;
+ line-height: 50rpx;
+ text-align: right;
+}
+
+.sku-card .sku-num-content .even-num {
+ width: 420rpx;
+ color: #4facfe;
+ font-size: 26rpx;
+ line-height: 50rpx;
+ white-space: nowrap;
+ text-align: right;
+}
+
+.sku-card .sku-confirm {
+ width: 750rpx;
+ background: linear-gradient(to right,#4facfe,#00f2fe);
+ line-height: 96rpx;
+ text-align: center;
+ color: #fff;
+ font-size: 30rpx;
+ margin: 0 0 0 -40rpx;
+ padding: 0;
+ border-radius: 0;
+ font-weight: bold;
+ padding-bottom: calc(env(safe-area-inset-bottom) - 30rpx);
+}
+
+.sku-card .sku-confirm::after{
+ border: 0;
+}
+
+.i-input-number {
+ color: #495060;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.i-input-number .num-btn {
+ width: 48rpx;
+ height: 48rpx;
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.icon-btn {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.i-input-number-minus {
+ border-right: none;
+ border-radius: 4rpx 0 0 4rpx;
+}
+
+.i-input-number-plus {
+ border-left: none;
+ border-radius: 0 4rpx 4rpx 0;
+}
+
+.i-input-number-text {
+ text-align: center;
+ height: 48rpx;
+ width: 66rpx;
+ font-size: 24rpx;
+ line-height: 48rpx;
+ color: #495060;
+ z-index: 0;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/spike/index.js b/eaterplanet_ecommerce/components/spike/index.js
new file mode 100644
index 0000000..df453bf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/spike/index.js
@@ -0,0 +1,112 @@
+var app = getApp();
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ refresh: {
+ type: Boolean,
+ value: false,
+ observer: function (t) {
+ let that = this;
+ if (t) this.setData({ pageNum: 1, noMore: false, list: [] }, () => { that.getData() })
+ }
+ },
+ clearTimer: {
+ type: Boolean,
+ value: false
+ },
+ skin: {
+ type: Object
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ disabled: false,
+ list: [],
+ pageNum: 1,
+ noMore: false,
+ rushEndTime: 0
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ getData: function () {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.load_spikebuy_goodslist',
+ token: token,
+ pageNum: that.data.pageNum,
+ head_id: cur_community.communityId
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let oldList = that.data.list;
+ let list = oldList.concat(res.data.list);
+ let is_show_spike_buy_time = res.data.is_show_spike_buy_time;
+ //取最大时间
+ let rushEndTime = that.getTime(list);
+ console.log(rushEndTime)
+ that.setData({ list, rushEndTime, is_show_spike_buy_time })
+ } else {
+ that.setData({ noMore: true })
+ }
+ }
+ })
+ },
+ getMore: function () {
+ if (this.data.noMore) return;
+ let that = this;
+ let pageNum = that.data.pageNum + 1;
+ console.log(pageNum)
+ this.setData({ pageNum },
+ () => {
+ that.getData();
+ })
+ },
+ openSku: function (e) {
+ let idx = e.currentTarget.dataset.idx;
+ this.setData({ disabled: false })
+ let spuItem = this.data.list[idx];
+ this.triggerEvent("openSku", {
+ actId: spuItem.actId,
+ skuList: spuItem.skuList,
+ promotionDTO: spuItem.promotionDTO || '',
+ is_take_vipcard: spuItem.is_take_vipcard,
+ is_mb_level_buy: spuItem.is_mb_level_buy,
+ allData: {
+ spuName: spuItem.spuName,
+ skuImage: spuItem.skuImage,
+ actPrice: spuItem.actPrice,
+ canBuyNum: spuItem.spuCanBuyNum,
+ stock: spuItem.spuCanBuyNum,
+ marketPrice: spuItem.marketPrice,
+ oneday_limit_count: spuItem.oneday_limit_count,
+ total_limit_count: spuItem.total_limit_count,
+ one_limit_count: spuItem.one_limit_count
+ }
+ })
+ },
+ getTime: function (list) {
+ let that = this;
+ let end_time = 0;
+ let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
+ e === 0 && list.map(function (t) {
+ t.end_time *= 1000;
+ end_time = (t.end_time > end_time) ? t.end_time : end_time;
+ })
+ return end_time;
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/spike/index.json b/eaterplanet_ecommerce/components/spike/index.json
new file mode 100644
index 0000000..e72b476
--- /dev/null
+++ b/eaterplanet_ecommerce/components/spike/index.json
@@ -0,0 +1,10 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../img/index",
+ "i-button": "../button/index",
+ "i-count-down": "../count-down/index",
+ "i-router-link": "../router-link/router-link",
+ "i-addcart": "../addCartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/spike/index.wxml b/eaterplanet_ecommerce/components/spike/index.wxml
new file mode 100644
index 0000000..ebdb1cd
--- /dev/null
+++ b/eaterplanet_ecommerce/components/spike/index.wxml
@@ -0,0 +1,27 @@
+
+
+
+ 限时秒杀
+
+ 仅剩
+
+
+
+
+
+
+ 已抢光
+ {{item.spuName}}
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/spike/index.wxss b/eaterplanet_ecommerce/components/spike/index.wxss
new file mode 100644
index 0000000..3e414b5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/spike/index.wxss
@@ -0,0 +1,36 @@
+@import "../new-comer/index.wxss";
+
+.new-comers-title {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.count-down {
+ height: 68rpx;
+ line-height: 68rpx;
+ color: #444;
+ font-size: 24rpx;
+ display: flex;
+ align-items: center;
+ flex: 1;
+ margin-right: 20rpx;
+}
+
+.count-down .item-time {
+ width: 34rpx;
+ height: 32rpx;
+ line-height: 32rpx;
+ color: #fff;
+ text-align: center;
+ background: #444;
+ border-radius: 4rpx;
+ padding: 0 2rpx;
+ font-weight: normal;
+}
+
+.count-down-left-text {
+ font-size: 24rpx;
+ margin-right: 10rpx;
+ font-weight: normal;
+}
diff --git a/eaterplanet_ecommerce/components/tabbar/index.js b/eaterplanet_ecommerce/components/tabbar/index.js
new file mode 100644
index 0000000..52fedc7
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tabbar/index.js
@@ -0,0 +1,214 @@
+var app = getApp();
+
+Component({
+ properties: {
+ currentIdx: {
+ type: Number,
+ value: 0,
+ observer: function (t) {
+ if (t) {
+ let tabbar = this.data.tabbar;
+ for (let i in tabbar.list) {
+ tabbar.list[i].selected = false;
+ (i == t) && (tabbar.list[i].selected = true);
+ }
+ this.setData({ tabbar })
+ }
+ }
+ },
+ cartNum: {
+ type: Number,
+ value: 0
+ },
+ tabbarRefresh: {
+ type: Boolean,
+ value: false,
+ observer: function (t) {
+ if (t) this.getTabbar();
+ }
+ },
+ needAuth: {
+ type: Boolean,
+ value: false
+ }
+ },
+
+ attached() {
+ let model = wx.getSystemInfoSync().model;
+ let screenHeight = wx.getSystemInfoSync().screenHeight;
+ let platform = wx.getSystemInfoSync().platform;
+ console.log(model,screenHeight,platform)
+ let isIpx = model.indexOf("iPhone X") > -1 || model.indexOf("iPhone 1") > -1;
+ let isAndroid8 = platform.indexOf("Android") > -1 && screenHeight >= 812;
+ isIpx && this.setData({ isIpx: true });
+ isAndroid8 && this.setData({ isAndroid8: true });
+ this.getTabbar();
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ isIpx: false,
+ tabbar: {
+ "color": "#707070",
+ "selectedColor": "#004986",
+ "list": [
+ {
+ "pagePath": "/eaterplanet_ecommerce/pages/index/index",
+ "text": "",
+ "iconPath": "",
+ "selectedIconPath": "",
+ "selected": true
+ },
+ {
+ "pagePath": "/eaterplanet_ecommerce/pages/type/index",
+ "text": "",
+ "iconPath": "",
+ "selectedIconPath": "",
+ "selected": false
+ },
+ {
+ "pagePath": "",
+ "text": "",
+ "iconPath": "",
+ "selectedIconPath": "",
+ "selected": false
+ },
+ {
+ "pagePath": "/eaterplanet_ecommerce/pages/order/shopCart",
+ "text": "",
+ "iconPath": "",
+ "selectedIconPath": "",
+ "selected": false
+ },
+ {
+ "pagePath": "/eaterplanet_ecommerce/pages/user/me",
+ "text": "",
+ "iconPath": "",
+ "selectedIconPath": "",
+ "selected": false
+ }
+ ]
+ },
+ open_tabbar_type: 0,
+ open_tabbar_out_weapp: 0,
+ cartNum: 0,
+ tabbar_out_appid: '',
+ tabbar_out_link: '',
+ tabbar_out_type: 0
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ getTabbar: function () {
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.get_tabbar'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ let tabbar = that.data.tabbar;
+ tabbar.list[0].text = list['t1'] || '首页';
+ tabbar.list[0].iconPath = list['i1'] || '/eaterplanet_ecommerce/images/icon-tab-index.png';
+ tabbar.list[0].selectedIconPath = list['s1'] || '/eaterplanet_ecommerce/images/icon-tab-index-active.png';
+ tabbar.list[1].text = list['t4'] || '分类';
+ tabbar.list[1].iconPath = list['i4'] || '/eaterplanet_ecommerce/images/icon-tab-type.png';
+ tabbar.list[1].selectedIconPath = list['s4'] || '/eaterplanet_ecommerce/images/icon-tab-type-active.png';
+ tabbar.list[2].text = list['t5'];
+ tabbar.list[2].iconPath = list['i5'];
+ tabbar.list[2].selectedIconPath = list['s5'];
+ tabbar.list[3].text = list['t2'] || '购物车';
+ tabbar.list[3].iconPath = list['i2'] || '/eaterplanet_ecommerce/images/icon-tab-shop.png';
+ tabbar.list[3].selectedIconPath = list['s2'] || '/eaterplanet_ecommerce/images/icon-tab-shop-active.png';
+ tabbar.list[4].text = list['t3'] || '我的';
+ tabbar.list[4].iconPath = list['i3'] || '/eaterplanet_ecommerce/images/icon-tab-me.png';
+ tabbar.list[4].selectedIconPath = list['s3'] || '/eaterplanet_ecommerce/images/icon-tab-me-active.png';
+
+ let open_tabbar_type = res.data.open_tabbar_type || 0;
+ let open_tabbar_out_weapp = res.data.open_tabbar_out_weapp || 0;
+ let tabbar_out_appid = res.data.tabbar_out_appid;
+ let tabbar_out_link = res.data.tabbar_out_link;
+ let tabbar_out_type = res.data.tabbar_out_type;
+ tabbar.selectedColor = res.data.wepro_tabbar_selectedColor || '#004986';
+ tabbar.backgroundColor = res.data.wepro_tabbar_bgColor || '#ffffff';
+ // wcache.put('open_tabbar_type', open_tabbar_type, 600);
+
+ // wcache.put('tabList', tabbar, 600);
+ that.setData({ tabbar, open_tabbar_type, open_tabbar_out_weapp, tabbar_out_appid, tabbar_out_link, tabbar_out_type });
+ } else {
+ that.setData({ hideTabbar: true })
+ }
+ }
+ })
+ },
+ goWeapp: function(){
+ // 跳转小程序
+ let appid = this.data.tabbar_out_appid;
+ let url = this.data.tabbar_out_link;
+ let type = this.data.tabbar_out_type;
+ if (type == 0) {
+ // 跳转webview
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url),
+ })
+ } else if (type == 1) {
+ let tabUrls = ['/eaterplanet_ecommerce/pages/index/index', '/eaterplanet_ecommerce/pages/order/shopCart', '/eaterplanet_ecommerce/pages/user/me', '/eaterplanet_ecommerce/pages/type/index'];
+ let redUrls = ['/eaterplanet_ecommerce/moduleA/solitaire/index', '/eaterplanet_ecommerce/moduleA/video/index', '/eaterplanet_ecommerce/moduleA/menu/index', '/eaterplanet_ecommerce/moduleA/pin/index', '/eaterplanet_ecommerce/moduleA/seckill/list'];
+ if (tabUrls.indexOf(url) != -1) {
+ wx.switchTab({ url })
+ } else if (redUrls.indexOf(url) != -1) {
+ if(url == '/eaterplanet_ecommerce/moduleA/solitaire/index'&&this.data.needAuth) {
+ this.triggerEvent('authModal', true);
+ } else {
+ wx.redirectTo({ url });
+ }
+ } else {
+ wx.navigateTo({ url })
+ }
+ } else if (type == 2) {
+ appid && wx.navigateToMiniProgram({
+ appId: appid,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ // 打开成功
+ console.log(res)
+ }
+ })
+ } else if (type == 3) {
+ let url = '/eaterplanet_ecommerce/moduleA/pin/index';
+ wx.redirectTo({ url })
+ } else if (type == 4) {
+ let url = '/eaterplanet_ecommerce/moduleA/menu/index';
+ wx.redirectTo({ url })
+ } else if (type == 5) {
+ let url = '/eaterplanet_ecommerce/moduleA/video/index';
+ wx.redirectTo({ url })
+ } else if (type == 6) {
+ if(this.data.needAuth) {
+ this.triggerEvent('authModal', true)
+ } else {
+ let url = '/eaterplanet_ecommerce/moduleA/solitaire/index';
+ wx.redirectTo({ url })
+ }
+ } else if (type == 7) {
+ let url = '/eaterplanet_ecommerce/moduleB/live/index';
+ wx.redirectTo({ url })
+ } else if(type == 8) {
+ let url = '/eaterplanet_ecommerce/moduleB/generalmall/index';
+ wx.redirectTo({ url })
+ } else if(type == 9) {
+ let url = '/eaterplanet_ecommerce/moduleB/presale/index';
+ wx.redirectTo({ url })
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/tabbar/index.json b/eaterplanet_ecommerce/components/tabbar/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tabbar/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/tabbar/index.wxml b/eaterplanet_ecommerce/components/tabbar/index.wxml
new file mode 100644
index 0000000..b491c48
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tabbar/index.wxml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ {{cartNum}}
+
+ {{item.text}}
+
+
+
+
+
+ {{item.text}}
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/tabbar/index.wxss b/eaterplanet_ecommerce/components/tabbar/index.wxss
new file mode 100644
index 0000000..a645fd7
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tabbar/index.wxss
@@ -0,0 +1,82 @@
+.tabbar_outbox {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ z-index: 899;
+
+}
+
+.tabbar_box {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
+ width: 750rpx;
+ height: 108rpx;
+ box-shadow: 0rpx 10rpx 20rpx 5rpx #4571a1ac;
+ background-color: #ffffffd9;
+ backdrop-filter: blur(40rpx);
+
+}
+.isIpx{
+ width: 730rpx!important;
+ height: 98rpx!important;
+ box-shadow: 0rpx 10rpx 20rpx 5rpx #4571a1ac;
+ margin: 10rpx;
+ border-radius: 30rpx 30rpx 80rpx 80rpx;
+ padding-bottom: calc(env(safe-area-inset-bottom) - 30rpx);
+ padding-top: 15rpx;
+}
+.isAndroid8{
+ width: 730rpx!important;
+ height: 98rpx!important;
+ box-shadow: 0rpx 10rpx 20rpx 5rpx #4571a1ac;
+ margin: 10rpx;
+ border-radius: 30rpx 30rpx 75rpx 75rpx;
+ padding-bottom: 18rpx;
+ padding-top: 15rpx;
+}
+.tabbar_box.iphoneX-height {
+ padding-bottom: 48rpx;
+}
+
+.tabbar_box.pb20 {
+ margin-bottom: 40rpx;
+}
+
+.tabbar_nav {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ font-size: 20rpx;
+ height: 100%;
+ position: relative;
+ color: #222e3d;
+}
+
+.tabbar_icon {
+ position:relative;
+ width: 56rpx;
+ height: 56rpx;
+}
+
+.tabbar_icon .cart-num {
+ position: absolute;
+ right: -16rpx;
+ top: -4rpx;
+ width: 36rpx;
+ height: 36rpx;
+ background: #ff758c;
+ border-radius: 36rpx;
+ color: #fff;
+ font-size: 22rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.tabbar_icon .img {
+ width: 56rpx;
+ height: 56rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/tabs/index.js b/eaterplanet_ecommerce/components/tabs/index.js
new file mode 100644
index 0000000..926257e
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tabs/index.js
@@ -0,0 +1,113 @@
+var t = require("../../utils/index");
+
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ lineBgColor: {
+ type: String
+ },
+ fontColor: {
+ type: String
+ },
+ tabs: {
+ type: Array,
+ value: []
+ },
+ activeIndex: {
+ type: Number,
+ value: 0,
+ observer: function (e) {
+ if(-1 === this.properties.activeIndex) {
+ this.resetIndicator();
+ } else {
+ this.executeAnimcation(e)
+ }
+ }
+ }
+ },
+ data: {
+ out_link: "",
+ indicatorAnamationData: {},
+ scrollLeft: 0
+ },
+ ready: function () {
+ this.tabsWidth = [], this.tabsLeft = [], this.screenWidth = wx.getSystemInfoSync().screenWidth,
+ this.setData({
+ fontColor: this.data.fontColor ? this.data.fontColor : "#fff!important"
+ }), this.data.lineColor && this.setData({
+ lineBgColor: this.data.lineBgColor
+ });
+ },
+ methods: {
+ handleTabItemTap: function (t) {
+ var e = t.target.dataset.index, a = t.target.dataset.id;
+ e !== this.data.activeIndex && (this.setData({
+ activeIndex: e
+ }), this.triggerEvent("activeIndexChange", {a,e}));
+ },
+ goLink: function () {
+ wx.switchTab({
+ url: "/eaterplanet_ecommerce/pages/type/index",
+ });
+ },
+ executeAnimcation: function (t) {
+ var e = this;
+ this.getLeftAndWidth(t).then(function (a) {
+ var i = e.generateAnimationData(a.left, a.width, a.firstTabLeft);
+ e.centerTheTab(t, a), e.setData({
+ indicatorAnamationData: i
+ });
+ });
+ },
+ centerTheTab: function (t, e) {
+ var a = e.width, i = (e.left, this.tabsWidth.slice(0, t).reduce(function (t, e) {
+ return t + e + 25;
+ }, 15));
+ this.setData({
+ scrollLeft: i - (this.screenWidth - a) / 2
+ });
+ },
+ getLeftAndWidth: function (e) {
+ var a = this;
+ return new Promise(function (i) {
+ (0, t.getRect)(a, ".tabs__nav", !0).then(function (t) {
+ a.tabsWidth = t.map(function (t) {
+ return t.width;
+ }), a.tabsLeft = t.map(function (t) {
+ return t.left;
+ }), i({
+ width: a.tabsWidth[e],
+ left: a.tabsLeft[e],
+ firstTabLeft: a.tabsLeft[0]
+ });
+ });
+ });
+ },
+ generateAnimationData: function (t, e) {
+ var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i = wx.createAnimation({
+ duration: 200,
+ timingFunction: "ease"
+ });
+ return [{
+ width: e,
+ left: t - a
+ }].forEach(function (t) {
+ var e = t.width, a = t.left;
+ i.translateX(a).width(e).step();
+ }), i.export();
+ },
+ resetIndicator: function () {
+ let tabs = this.data.tabs || [];
+ let initWidth = 28;
+ if (tabs.length) initWidth = (tabs[0].name && tabs[0].name.length*14);
+ var t = wx.createAnimation({
+ duration: 200,
+ timingFunction: "ease"
+ });
+ t.translateX(0).width(initWidth).step(), this.setData({
+ scrollLeft: 0,
+ indicatorAnamationData: t.export()
+ });
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/tabs/index.json b/eaterplanet_ecommerce/components/tabs/index.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tabs/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/tabs/index.wxml b/eaterplanet_ecommerce/components/tabs/index.wxml
new file mode 100644
index 0000000..cfdf025
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tabs/index.wxml
@@ -0,0 +1,9 @@
+
+
+
+ {{tabItem.name}}
+
+
+
+ 分类
+
diff --git a/eaterplanet_ecommerce/components/tabs/index.wxss b/eaterplanet_ecommerce/components/tabs/index.wxss
new file mode 100644
index 0000000..5f512b3
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tabs/index.wxss
@@ -0,0 +1,89 @@
+.tabs {
+ position: relative;
+ padding-top: 10rpx;
+ padding-left: 0rpx;
+ padding-right:0rpx;
+ padding-bottom: -5rpx;
+ margin-right: 140rpx;
+ display: flex;
+
+
+
+}
+
+.tabs__nav {
+ position: relative;
+ padding-bottom: 16rpx;
+ padding-right: 16rpx;
+ margin-right: 50rpx;
+ font-size: 28rpx;
+ font-weight: bold;
+ line-height: 58rpx;
+ flex-shrink: 0;
+ transition: all 0.6s ease;
+ color: #fff;
+ padding-top: 10rpx;
+}
+
+.tabs__nav.active {
+ font-weight: bold;
+ font-size: 35rpx;
+ color: #42add5;
+}
+
+.tabs__nav:first-child {
+ margin-left: 20rpx;
+}
+
+.tabs__navs__wrap {
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+}
+
+.tabs__navs__wrap .activeIndicator {
+ width: 80rpx!important;
+ height: 6rpx;
+ margin-left: 20rpx;
+ margin-right: 20rpx;
+ position: absolute;
+ vertical-align:baseline ;
+ bottom: 10rpx;
+ left: 0rpx;
+ /**border-radius: 24rpx;**/
+ background: linear-gradient(to right,#fff,#4d9ee9)!;
+ /**box-shadow: 0rpx 4rpx 4rpx 0rpx rgba(0, 26, 255, 0.39);**/
+ transition: all 1s ease-in-out;
+}
+
+.gototype {
+ position: relative;
+ padding-bottom: 16rpx;
+display: flex;
+ flex-shrink: 0;
+ color: #fff!important;
+ padding-top: 10rpx;
+ font-size: 28rpx;
+ font-weight: bold;
+ line-height: 58rpx;
+
+ height: 100%;
+ padding-left:10rpx;
+padding-right:0rpx;
+margin-right: 0rpx;
+
+ box-shadow: -12rpx 0rpx 10rpx -10rpx rgba(27, 27, 27, 0.39);
+}
+.gototype .image{
+ position: relative;
+ margin-right: 0rpx;
+margin: 12rpx 10rpx 0rpx 10rpx;
+ width:36rpx;
+ height: 36rpx;
+background-repeat: no-repeat;
+ background-size: 100%;
+background-image: url(data:image/png;base64,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);
+
+
+}
diff --git a/eaterplanet_ecommerce/components/time-range/index.js b/eaterplanet_ecommerce/components/time-range/index.js
new file mode 100644
index 0000000..019d08f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/time-range/index.js
@@ -0,0 +1,146 @@
+let minutes = [];
+for (let i = 0; i <= 59; i++) {
+ if (i < 10) {
+ i = '0' + i;
+ }
+ minutes.push(i);
+}
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ show: {
+ type: Boolean,
+ value: false
+ },
+ beginTime: {
+ type: String,
+ value: ""
+ },
+ isOne: {
+ type: Boolean,
+ value: false
+ },
+ endTime: {
+ type: String,
+ default: ""
+ },
+ remark: {
+ type: Object,
+ default: ""
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ value: '', //默认结束开始时间
+ hoursList: ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'],
+ minutes,
+ second: minutes
+ },
+
+ attached() {
+ let { beginTime, endTime } = this.data;
+ let value = "";
+ if(beginTime||endTime) {
+ let beginArr = beginTime.split(':');
+ let endArr = endTime.split(':');
+ value = [
+ beginArr[0]*1,
+ beginArr[1]*1,
+ beginArr[2]*1,
+ 0,
+ endArr[0]*1,
+ endArr[1]*1,
+ endArr[2]*1,
+ ];
+ } else {
+ let timestamp = Date.parse(new Date());
+ let myDate = new Date();
+ let nextDate = new Date(timestamp+1000);
+ value = [
+ myDate.getHours(),
+ myDate.getMinutes(),
+ myDate.getSeconds(),
+ 0,
+ nextDate.getHours(),
+ nextDate.getMinutes(),
+ nextDate.getSeconds()
+ ];
+ }
+ this.setData({ value })
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ confirm() {
+ let { value, hoursList } = this.data;
+ let time = hoursList[value[0]*1] + ':' + minutes[value[1]*1] + ':' + minutes[value[2]*1] + '~' + hoursList[value[4]*1] + ':' + minutes[value[5]*1] + ':' + minutes[value[6]*1];
+ if(this.data.isOne) {
+ time = hoursList[value[0]*1] + ':' + minutes[value[1]*1] + ':' + minutes[value[2]*1];
+ }
+ this.triggerEvent('confrim', { time, remark: this.data.remark });
+ },
+ cancel() {
+ let { value, hoursList } = this.data;
+ let time = hoursList[value[0]*1] + ':' + minutes[value[1]*1] + ':' + minutes[value[2]*1] + '~' + hoursList[value[4]*1] + ':' + minutes[value[5]*1] + ':' + minutes[value[6]*1];
+ if(this.data.isOne) {
+ time = hoursList[value[0]*1] + ':' + minutes[value[1]*1] + ':' + minutes[value[2]*1];
+ }
+ this.triggerEvent('cancel', { time, remark: this.data.remark });
+ },
+ getime(e) {
+ let val = e.detail.value;
+ let sh = this.data.hoursList[val[0]];
+ let sm = this.data.minutes[val[1]];
+ let ss = this.data.minutes[val[2]];
+ let eh = this.data.hoursList[val[4]];
+ let em = this.data.minutes[val[5]];
+ let es = this.data.minutes[val[6]];
+ // 比较前后时间
+ if(!this.data.isOne) {
+ if (sh * 1 > eh * 1) {
+ sh = eh;
+ sm = 0;
+ ss = 0;
+ es = 1;
+ } else if (sh * 1 == eh * 1) {
+ if (sm * 1 > em * 1) {
+ sm = em;
+ } else if (sm * 1 == em * 1) {
+ if (ss * 1 >= es * 1) {
+ if (es > 0) {
+ ss = es - 1;
+ } else {
+ if (sm > 0) {
+ sm = sm * 1 - 1;
+ ss = 0;
+ } else {
+ if (sh > 0) {
+ sh = sh * 1 - 1;
+ sm = 0;
+ ss = 0;
+ } else {
+ sh = 0;
+ sm = 0;
+ ss = 0;
+ es = 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ this.setData({
+ value: [sh, sm, ss, '0', eh, em, es]
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/time-range/index.json b/eaterplanet_ecommerce/components/time-range/index.json
new file mode 100644
index 0000000..979d4f5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/time-range/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-modal": "../modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/time-range/index.wxml b/eaterplanet_ecommerce/components/time-range/index.wxml
new file mode 100644
index 0000000..ec02b9c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/time-range/index.wxml
@@ -0,0 +1,39 @@
+
+
+
+ 取消
+ 确定
+
+
+
+
+ {{ item }}
+
+
+
+ {{ item }}
+
+
+
+ {{ item }}
+
+
+
+ 至
+
+
+
+ {{ item }}
+
+
+
+ {{ item }}
+
+
+
+ {{ item }}
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/time-range/index.wxss b/eaterplanet_ecommerce/components/time-range/index.wxss
new file mode 100644
index 0000000..08fed57
--- /dev/null
+++ b/eaterplanet_ecommerce/components/time-range/index.wxss
@@ -0,0 +1,8 @@
+.time1{width:100%;margin:0 auto;background-color:#fff;color:#000;height:450rpx}.time1 .top{width:690rpx;margin:0 auto;height:100rpx;line-height:100rpx}.time1 .top text{font-weight:700}.time1 .top text:nth-child(1){font-size:28rpx;color:#999}.time1 .top text:nth-child(2){font-size:28rpx;color:#0a84ff}.time1 .tip12{width:100%;height:100rpx}.time1 .tip12 view{width:50%;text-align:center;line-height:100rpx;font-size:40rpx;color:#000}.time1 .hours{font-size:30rpx;font-weight:700;color:#000}.time1 .minutes{font-size:30rpx;font-weight:700;color:#000}.picker{width:100%;height:300rpx}
+.i-flex {
+ display: flex;
+}
+.i-flex-spb {
+ justify-content: space-between;
+ align-items: center;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/timePicker/timePicker.js b/eaterplanet_ecommerce/components/timePicker/timePicker.js
new file mode 100644
index 0000000..5e792de
--- /dev/null
+++ b/eaterplanet_ecommerce/components/timePicker/timePicker.js
@@ -0,0 +1,572 @@
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ pickerShow: {
+ type: Boolean,
+ observer: function (val) { //弹出动画
+ // console.log(this.data);
+ if (val) {
+ let animation = wx.createAnimation({
+ duration: 500,
+ timingFunction: "ease"
+ });
+ let animationOpacity = wx.createAnimation({
+ duration: 500,
+ timingFunction: "ease"
+ });
+ setTimeout(() => {
+ animation.bottom(0).step();
+ animationOpacity.opacity(0.7).step();
+ this.setData({
+ animationOpacity: animationOpacity.export(),
+ animationData: animation.export()
+ })
+ }, 0);
+ } else {
+ let animation = wx.createAnimation({
+ duration: 100,
+ timingFunction: "ease"
+ });
+ let animationOpacity = wx.createAnimation({
+ duration: 500,
+ timingFunction: "ease"
+ });
+ animation.bottom(-320).step();
+ animationOpacity.opacity(0).step();
+ this.setData({
+ animationOpacity: animationOpacity.export(),
+ animationData: animation.export()
+ });
+ }
+
+ // 在picker滚动未停止前点确定,会使startValue数组各项归零,发生错误,这里判断并重新初始化
+ // 微信新增了picker滚动的回调函数,已进行兼容
+ if (this.data.startValue && this.data.endValue) {
+ let s = 0,
+ e = 0;
+ let conf = this.data.config;
+
+ this.data.startValue.map(val => {
+ if (val == 0) {
+ s++
+ }
+ })
+ this.data.endValue.map(val => {
+ if (val == 0) {
+ e++;
+ }
+ });
+ let tmp = {
+ hour: 4,
+ minute: 5,
+ second: 6
+ }
+ let n = tmp[conf.column];
+ if (s >= n || e >= n) {
+ this.initPick();
+ this.setData({
+ startValue: this.data.startValue,
+ endValue: this.data.endValue,
+ });
+ }
+ }
+
+
+ }
+ },
+ config: Object
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ // pickerShow:true
+ // limitStartTime: new Date().getTime()-1000*60*60*24*30,
+ // limitEndTime: new Date().getTime(),
+ // yearStart:2000,
+ // yearEnd:2100
+ },
+ detached: function () {
+ console.log("dele");
+ },
+ attached: function () {},
+ ready: function () {
+ this.readConfig();
+ this.initPick(this.data.config || null);
+ this.setData({
+ startValue: this.data.startValue,
+ endValue: this.data.endValue,
+ });
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ //读取配置项
+ readConfig() {
+ let limitEndTime = new Date().getTime();
+ let limitStartTime = new Date().getTime() - 1000 * 60 * 60 * 24 * 30;
+ if (this.data.config) {
+ let conf = this.data.config;
+ if (typeof conf.dateLimit == "number") {
+ limitStartTime = new Date().getTime() - 1000 * 60 * 60 * 24 * conf.dateLimit;
+ }
+ if (conf.limitStartTime) {
+ limitStartTime = new Date(conf.limitStartTime.replace(/-/g, '/')).getTime();
+ }
+ if (conf.limitEndTime) {
+ limitEndTime = new Date(conf.limitEndTime.replace(/-/g, '/')).getTime();
+ }
+ this.setData({
+ yearStart: conf.yearStart || 2000,
+ yearEnd: conf.yearEnd || 2100,
+ endDate: conf.endDate || false,
+ dateLimit: conf.dateLimit || false,
+ hourColumn: conf.column == "hour" ||
+ conf.column == "minute" ||
+ conf.column == "second",
+ minColumn: conf.column == "minute" || conf.column == "second",
+ secColumn: conf.column == "second"
+ });
+ }
+
+ let limitStartTimeArr = formatTime(limitStartTime);
+ let limitEndTimeArr = formatTime(limitEndTime);
+
+ this.setData({
+ limitStartTime,
+ limitStartTimeArr,
+ limitEndTime,
+ limitEndTimeArr
+ });
+ },
+ preventD: function () {
+
+ },
+ //滚动开始
+ handlePickStart: function (e) {
+ this.setData({
+ isPicking: true
+ })
+ },
+ //滚动结束
+ handlePickEnd: function (e) {
+ this.setData({
+ isPicking: false
+ })
+ },
+ onConfirm: function () {
+ //滚动未结束时不能确认
+ if (this.data.isPicking) {
+ return
+ }
+ let startTime = new Date(this.data.startPickTime.replace(/-/g, "/"));
+ let endTime = new Date(this.data.endPickTime.replace(/-/g, "/"));
+ if (startTime <= endTime || !this.data.endDate) {
+ this.setData({
+ startTime,
+ endTime
+ });
+ let startArr = formatTime(startTime).arr;
+ let endArr = formatTime(endTime).arr;
+ let format0 = function (num) {
+ return num < 10 ? '0' + num : num
+ }
+
+ let startTimeBack =
+ startArr[0] +
+ "-" +
+ format0(startArr[1]) +
+ "-" +
+ format0(startArr[2]) +
+ " " +
+ (this.data.hourColumn ? format0(startArr[3]) : "00") +
+ ":" +
+ (this.data.minColumn ? format0(startArr[4]) : "00") +
+ ":" +
+ (this.data.secColumn ? format0(startArr[5]) : "00");
+
+ let endTimeBack =
+ endArr[0] +
+ "-" +
+ format0(endArr[1]) +
+ "-" +
+ format0(endArr[2]) +
+ " " +
+ (this.data.hourColumn ? format0(endArr[3]) : "00") +
+ ":" +
+ (this.data.minColumn ? format0(endArr[4]) : "00") +
+ ":" +
+ (this.data.secColumn ? format0(endArr[5]) : "00");
+
+ let time = {
+ startTime: startTimeBack,
+ endTime: endTimeBack
+ };
+
+ //触发自定义事件
+ this.triggerEvent("setPickerTime", time);
+ this.triggerEvent("hidePicker", {});
+ } else {
+ wx.showToast({
+ icon: "none",
+ title: "时间不合理"
+ });
+ }
+ },
+ hideModal: function () {
+ this.triggerEvent("hidePicker", {});
+ },
+ changeStartDateTime: function (e) {
+ let val = e.detail.value;
+ this.compareTime(val, "start");
+ },
+
+ changeEndDateTime: function (e) {
+ let val = e.detail.value;
+ this.compareTime(val, "end");
+ },
+ //比较时间是否在范围内
+ compareTime(val, type) {
+ let h = val[3] ? this.data.HourList[val[3]] : "00";
+ let m = val[4] ? this.data.MinuteList[val[4]] : "00";
+ let s = val[5] ? this.data.SecondList[val[5]] : "00";
+ let time =
+ this.data.YearList[val[0]] +
+ "-" +
+ this.data.MonthList[val[1]] +
+ "-" +
+ this.data.DayList[val[2]] +
+ " " +
+ h +
+ ":" +
+ m +
+ ":" +
+ s;
+
+ let start = this.data.limitStartTime;
+ let end = this.data.limitEndTime;
+ let timeNum = new Date(time.replace(/-/g, '/')).getTime();
+ let year, month, day, hour, min, sec, limitDate;
+ let tempArr = []
+ if (!this.data.dateLimit) {
+ limitDate = [
+ this.data.YearList[val[0]],
+ this.data.MonthList[val[1]],
+ this.data.DayList[val[2]],
+ this.data.HourList[val[3]],
+ this.data.MinuteList[val[4]],
+ this.data.SecondList[val[5]]
+ ]
+ } else if (type == "start" && timeNum > new Date(this.data.endPickTime.replace(/-/g, '/')) && this.data.config.endDate) {
+ limitDate = formatTime(this.data.endPickTime).arr;
+
+ } else if (type == "end" && timeNum < new Date(this.data.startPickTime.replace(/-/g, '/'))) {
+ limitDate = formatTime(this.data.startPickTime).arr;
+
+ } else if (timeNum < start) {
+ limitDate = this.data.limitStartTimeArr.arr;
+
+ } else if (timeNum > end) {
+ limitDate = this.data.limitEndTimeArr.arr;
+
+ } else {
+ limitDate = [
+ this.data.YearList[val[0]],
+ this.data.MonthList[val[1]],
+ this.data.DayList[val[2]],
+ this.data.HourList[val[3]],
+ this.data.MinuteList[val[4]],
+ this.data.SecondList[val[5]]
+ ]
+
+ }
+
+ year = limitDate[0];
+ month = limitDate[1];
+ day = limitDate[2];
+ hour = limitDate[3];
+ min = limitDate[4];
+ sec = limitDate[5];
+
+ if (type == "start") {
+ this.setStartDate(year, month, day, hour, min, sec);
+ } else if (type == "end") {
+ //20210528 S
+ let monthday = this.getDays(year, month);
+ if(day == monthday) {
+ if(month<11) {
+ month += 1;
+ day = 1;
+ } else {
+ year += 1;
+ month = 1;
+ day = 1;
+ }
+ } else {
+ day += 1;
+ }
+ //20210528 E
+ this.setEndDate(year, month, day, hour, min, sec);
+ }
+ },
+ getDays: function (year, month) {
+ let daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+ if (month === 2) {
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0 ?
+ 29 :
+ 28;
+ } else {
+ return daysInMonth[month - 1];
+ }
+ },
+ initPick: function (initData) {
+ const date = initData.initStartTime ? new Date(initData.initStartTime.replace(/-/g, '/')) : new Date();
+ const endDate = initData.initEndTime ? new Date(initData.initEndTime.replace(/-/g, '/')) : new Date();
+ // const startDate = new Date(date.getTime() - 1000 * 60 * 60 * 24);
+ const startDate = date;
+ const startYear = date.getFullYear();
+ const startMonth = date.getMonth() + 1;
+ const startDay = date.getDate();
+ const startHour = date.getHours();
+ const startMinute = date.getMinutes();
+ const startSecond = date.getSeconds();
+
+ const endYear = endDate.getFullYear();
+ const endMonth = endDate.getMonth() + 1;
+ const endDay = endDate.getDate() + 1;
+ const endHour = endDate.getHours();
+ const endMinute = endDate.getMinutes();
+ const endSecond = endDate.getSeconds();
+
+ let YearList = [];
+ let MonthList = [];
+ let DayList = [];
+ let HourList = [];
+ let MinuteList = [];
+ let SecondList = [];
+
+ //设置年份列表
+ for (let i = this.data.yearStart; i <= this.data.yearEnd; i++) {
+ YearList.push(i);
+ }
+
+ // 设置月份列表
+ for (let i = 1; i <= 12; i++) {
+ MonthList.push(i);
+ }
+ // 设置日期列表
+ for (let i = 1; i <= 31; i++) {
+ DayList.push(i);
+ }
+ // 设置时列表
+ for (let i = 0; i <= 23; i++) {
+ if (0 <= i && i < 10) {
+ i = "0" + i;
+ }
+ HourList.push(i);
+ }
+ // 分|秒
+ for (let i = 0; i <= 59; i++) {
+ if (0 <= i && i < 10) {
+ i = "0" + i;
+ }
+ MinuteList.push(i);
+ SecondList.push(i);
+ }
+
+ this.setData({
+ YearList,
+ MonthList,
+ DayList,
+ HourList,
+ MinuteList,
+ SecondList
+ });
+
+ this.setStartDate(startYear, startMonth, startDay, startHour, startMinute, startSecond);
+ this.setEndDate(endYear, endMonth, endDay, endHour, endMinute, endSecond);
+
+ //!!!
+ // setTimeout(() => {
+ // this.setStartDate(nowYear, nowMonth, nowDay, nowHour, nowMinute)
+ // this.setEndDate(nowYear, nowMonth, nowDay, nowHour, nowMinute)
+ // }, 0);
+ },
+ setPickerDateArr(type, year, month, day, hour, minute, second) {
+ let yearIdx = 0;
+ let monthIdx = 0;
+ let dayIdx = 0;
+ let hourIdx = 0;
+ let minuteIdx = 0;
+ let secondIdx = 0;
+
+ this.data.YearList.map((v, idx) => {
+ if (parseInt(v) === year) {
+ yearIdx = idx;
+ }
+ });
+
+ this.data.MonthList.map((v, idx) => {
+ if (parseInt(v) === month) {
+ monthIdx = idx;
+ }
+ });
+
+ // 重新设置日期列表
+ let DayList = [];
+ for (let i = 1; i <= this.getDays(year, month); i++) {
+ DayList.push(i);
+ }
+
+ DayList.map((v, idx) => {
+ if (parseInt(v) === day) {
+ dayIdx = idx;
+ }
+ });
+ if (type == "start") {
+ this.setData({
+ startDayList: DayList
+ });
+ } else if (type == "end") {
+ this.setData({
+ endDayList: DayList
+ });
+ }
+
+ this.data.HourList.map((v, idx) => {
+ if (parseInt(v) === parseInt(hour)) {
+ hourIdx = idx;
+ }
+ });
+
+ this.data.MinuteList.map((v, idx) => {
+ if (parseInt(v) === parseInt(minute)) {
+ minuteIdx = idx;
+ }
+ });
+ this.data.SecondList.map((v, idx) => {
+ if (parseInt(v) === parseInt(second)) {
+ secondIdx = idx;
+ }
+ });
+
+ return {
+ yearIdx,
+ monthIdx,
+ dayIdx,
+ hourIdx,
+ minuteIdx,
+ secondIdx
+ };
+ },
+ setStartDate: function (year, month, day, hour, minute, second) {
+ let pickerDateArr = this.setPickerDateArr(
+ "start",
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second
+ );
+ this.setData({
+ startYearList: this.data.YearList,
+ startMonthList: this.data.MonthList,
+ // startDayList: this.data.DayList,
+ startHourList: this.data.HourList,
+ startMinuteList: this.data.MinuteList,
+ startSecondList: this.data.SecondList,
+ startValue: [
+ pickerDateArr.yearIdx,
+ pickerDateArr.monthIdx,
+ pickerDateArr.dayIdx,
+ pickerDateArr.hourIdx,
+ pickerDateArr.minuteIdx,
+ pickerDateArr.secondIdx
+ ],
+ startPickTime: this.data.YearList[pickerDateArr.yearIdx] +
+ "-" +
+ this.data.MonthList[pickerDateArr.monthIdx] +
+ "-" +
+ this.data.DayList[pickerDateArr.dayIdx] +
+ " " +
+ this.data.HourList[pickerDateArr.hourIdx] +
+ ":" +
+ this.data.MinuteList[pickerDateArr.minuteIdx] +
+ ":" +
+ this.data.SecondList[pickerDateArr.secondIdx]
+ });
+ },
+ setEndDate: function (year, month, day, hour, minute, second) {
+ let pickerDateArr = this.setPickerDateArr(
+ "end",
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second
+ );
+
+ this.setData({
+ endYearList: this.data.YearList,
+ endMonthList: this.data.MonthList,
+ // endDayList: this.data.DayList,
+ endHourList: this.data.HourList,
+ endMinuteList: this.data.MinuteList,
+ endSecondList: this.data.SecondList,
+ endValue: [
+ pickerDateArr.yearIdx,
+ pickerDateArr.monthIdx,
+ pickerDateArr.dayIdx,
+ pickerDateArr.hourIdx,
+ pickerDateArr.minuteIdx,
+ pickerDateArr.secondIdx
+ ],
+ endPickTime: this.data.YearList[pickerDateArr.yearIdx] +
+ "-" +
+ this.data.MonthList[pickerDateArr.monthIdx] +
+ "-" +
+ this.data.DayList[pickerDateArr.dayIdx] +
+ " " +
+ this.data.HourList[pickerDateArr.hourIdx] +
+ ":" +
+ this.data.MinuteList[pickerDateArr.minuteIdx] +
+ ":" +
+ this.data.SecondList[pickerDateArr.secondIdx]
+ });
+ },
+ }
+});
+
+
+function formatTime(date) {
+
+ if (typeof date == 'string' || 'number') {
+ try {
+ date = date.replace(/-/g, '/') //兼容ios
+ } catch (error) {}
+ date = new Date(date)
+ }
+
+ const year = date.getFullYear()
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ const hour = date.getHours()
+ const minute = date.getMinutes()
+ const second = date.getSeconds()
+
+ return {
+ str: [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':'),
+ arr: [year, month, day, hour, minute, second]
+ }
+}
+
+function formatNumber(n) {
+ n = n.toString()
+ return n[1] ? n : '0' + n
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/timePicker/timePicker.json b/eaterplanet_ecommerce/components/timePicker/timePicker.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/timePicker/timePicker.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/timePicker/timePicker.wxml b/eaterplanet_ecommerce/components/timePicker/timePicker.wxml
new file mode 100644
index 0000000..7efe5b8
--- /dev/null
+++ b/eaterplanet_ecommerce/components/timePicker/timePicker.wxml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ 取消
+ 确定
+
+
+
+
+
+ {{item}}年
+
+
+ {{item}}月
+
+
+ {{item}}日
+
+
+ {{item}}时
+
+
+ {{item}}分
+
+
+ {{item}}秒
+
+
+
+
+
+ 至
+
+
+ {{item}}年
+
+
+ {{item}}月
+
+
+ {{item}}日
+
+
+ {{item}}时
+
+
+ {{item}}分
+
+
+ {{item}}秒
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/timePicker/timePicker.wxss b/eaterplanet_ecommerce/components/timePicker/timePicker.wxss
new file mode 100644
index 0000000..e3884cf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/timePicker/timePicker.wxss
@@ -0,0 +1,88 @@
+/* components/timePicker/timePicker.wxss */
+
+.picker-item{
+ line-height: 50px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+/* 自定义时间 */
+.picker-container {
+ display: flex;
+ flex-direction: column;
+ /* justify-content: center; */
+ align-items: center;
+
+ width: 100%;
+ overflow: hidden;
+ position: fixed;
+ bottom: -320px;
+ left: 0;
+ /* height: 0; */
+ transition: height 0.5s;
+ z-index: 2000;
+ background: white;
+ border-top: 1px solid #EFEFF4;
+}
+.sensorType-screen{
+ width: 100vw;
+ /* height:400rpx; */
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background: #000;
+ opacity: 0;
+ overflow: hidden;
+ z-index: 1999;
+ color: #fff;
+}
+.sensorTypePicker{
+ width: 690rpx;
+ height: 120px;
+ /* padding: 45px 0; */
+}
+.picker-item{
+ line-height: 50px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 16px;
+ /* overflow: hidden; */
+}
+.box{
+ padding: 0 10px;
+}
+
+/* 至 */
+.to{
+ width:100%;
+ display: flex;
+ justify-content: center;align-items: center;
+ color:rgb(138,138,138);
+ /* font-size:30rpx; */
+}
+
+/* 确定 */
+.sure{
+ width:100%;
+ height:45px;
+ border-top: 1px solid #EFEFF4;
+ display: flex;justify-content: center;align-items: center;
+ color: rgb(36,123,255);
+ font-size:16px;
+}
+
+.btn-box{
+ width: 100%;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ border-bottom: 1px solid #eee;
+}
+.pick_btn{
+ padding: 7px 15px;
+ color: #ccc;
+}
diff --git a/eaterplanet_ecommerce/components/topic/topic.js b/eaterplanet_ecommerce/components/topic/topic.js
new file mode 100644
index 0000000..6e04924
--- /dev/null
+++ b/eaterplanet_ecommerce/components/topic/topic.js
@@ -0,0 +1,97 @@
+var app = getApp();
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ refresh: {
+ type: Boolean,
+ value: false,
+ observer: function (t) {
+ if (t) this.setData({ list: [] }), this.getData();
+ }
+ },
+ showPos: {
+ type: Number,
+ value: 0
+ },
+ diyInfo: {
+ type: Object,
+ value: {
+ specialId: ""
+ }
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ disabled: false,
+ list: [],
+ placeholdeImg: app.globalData.placeholdeImg
+ },
+
+ attached() {
+ this.getData();
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ getData: function () {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ let params = {};
+ if(this.data.diyInfo&&this.data.diyInfo.specialId) {
+ params.id = this.data.diyInfo.specialId;
+ }
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'marketing.get_special_list',
+ token: token,
+ head_id: cur_community.communityId,
+ ...params
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ that.setData({ list })
+ }
+ }
+ })
+ },
+ goSpecial: function(e){
+ let id = e.currentTarget.dataset.id;
+ id && wx.navigateTo({
+ url: `/eaterplanet_ecommerce/moduleA/special/index?id=${id}`,
+ })
+ },
+ openSku: function (e) {
+ let idx = e.currentTarget.dataset.idx;
+ let gidx = e.currentTarget.dataset.gidx;
+ this.setData({ disabled: false })
+ let spuItem = this.data.list[idx].list[gidx];
+ this.triggerEvent("openSku", {
+ actId: spuItem.actId,
+ skuList: spuItem.skuList,
+ promotionDTO: spuItem.promotionDTO || '',
+ is_take_vipcard: spuItem.is_take_vipcard,
+ is_mb_level_buy: spuItem.is_mb_level_buy,
+ allData: {
+ spuName: spuItem.spuName,
+ skuImage: spuItem.skuImage,
+ actPrice: spuItem.actPrice,
+ canBuyNum: spuItem.spuCanBuyNum,
+ stock: spuItem.spuCanBuyNum,
+ marketPrice: spuItem.marketPrice
+ }
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/topic/topic.json b/eaterplanet_ecommerce/components/topic/topic.json
new file mode 100644
index 0000000..af994ed
--- /dev/null
+++ b/eaterplanet_ecommerce/components/topic/topic.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../img/index",
+ "i-button": "../button/index",
+ "i-router-link": "../router-link/router-link",
+ "i-addcart": "../addCartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/topic/topic.wxml b/eaterplanet_ecommerce/components/topic/topic.wxml
new file mode 100644
index 0000000..9691280
--- /dev/null
+++ b/eaterplanet_ecommerce/components/topic/topic.wxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+ 已抢光
+ {{item.spuName}}
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/components/topic/topic.wxss b/eaterplanet_ecommerce/components/topic/topic.wxss
new file mode 100644
index 0000000..87980cc
--- /dev/null
+++ b/eaterplanet_ecommerce/components/topic/topic.wxss
@@ -0,0 +1,28 @@
+@import '../new-comer/index.wxss';
+
+.topic {
+ margin: 20rpx;
+ background: #fff;
+ border-radius: 10rpx;
+ overflow: hidden;
+}
+
+.topic-img {
+ width: 100%;
+ vertical-align: top;
+ border-radius: 10rpx 10rpx 0 0;
+}
+
+.blank10 {
+ height: 20rpx;
+ background-color: #f8f8f8;
+}
+
+.onlyThree .new-comers-item {
+ width: 226rpx!important;
+}
+
+.onlyThree .new-comers-item .new-img {
+ width: 186rpx!important;
+ height: 186rpx!important;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/tworow/index.js b/eaterplanet_ecommerce/components/tworow/index.js
new file mode 100644
index 0000000..14a267c
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tworow/index.js
@@ -0,0 +1,5 @@
+var goodsBehavior = require('../behavior/goods.js');
+
+Component({
+ behaviors: [goodsBehavior]
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/tworow/index.json b/eaterplanet_ecommerce/components/tworow/index.json
new file mode 100644
index 0000000..095de47
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tworow/index.json
@@ -0,0 +1,11 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../img/index",
+ "i-button": "../button/index",
+ "i-router-link": "../router-link/router-link",
+ "i-input-number": "../input-number/index",
+ "i-vip-price": "../vipPrice/vipPrice",
+ "i-addcart": "../addCartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/tworow/index.wxml b/eaterplanet_ecommerce/components/tworow/index.wxml
new file mode 100644
index 0000000..f3449d9
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tworow/index.wxml
@@ -0,0 +1,53 @@
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/tworow/index.wxss b/eaterplanet_ecommerce/components/tworow/index.wxss
new file mode 100644
index 0000000..adaef5d
--- /dev/null
+++ b/eaterplanet_ecommerce/components/tworow/index.wxss
@@ -0,0 +1,216 @@
+.icon-shop {
+ position: absolute!important;
+ right: -20rpx;
+ bottom: -40rpx;
+}
+
+.icon-shop .img {
+ width: 54rpx;
+ height: 54rpx;
+}
+
+.mask {
+ width: 340rpx;
+ height: 340rpx;
+ position: absolute;
+ left: 0;
+ top: 0rpx;
+ border-radius: 20rpx 20rpx 0 0;
+ background: rgba(255, 255, 255, 0.5);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.mask .toast {
+ width: 196rpx;
+ height: 60rpx;
+ background: rgba(0, 0, 0, 0.5);
+ border-radius: 10rpx;
+ text-align: center;
+ line-height: 60rpx;
+ color: #fff;
+ font-weight: bold;
+ font-size: 28rpx;
+}
+
+.spu-img {
+ width: 240rpx;
+ height: 240rpx;
+ border-radius: 10rpx;
+}
+
+.comming-spu-content {
+ width: 340rpx;
+ height: 524rpx;
+ border-radius: 20rpx;
+
+ box-sizing: border-box;
+ padding: 0rpx 0rpx 26rpx 0rpx;
+
+ position: relative;
+}
+
+.comming-spu-content .spu-img-content {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 340rpx;
+ height: 340rpx;
+ margin: 0 auto 34rpx;
+ overflow: hidden;
+ border-radius: 20rpx 20rpx 0rpx 0rpx;
+}
+
+.comming-spu-content .spu-name {
+ font-size: 28rpx;
+ line-height: 28rpx;
+ height: 36rpx;
+ color: #444;
+ margin-bottom: 0;
+ font-weight: 500;
+ position: relative;
+ margin: 0 20rpx;
+}
+
+.comming-spu-content .spu-name .span {
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ position: absolute;
+ left: 0;
+ top: -4rpx;
+ line-height: 36rpx;
+}
+
+.comming-spu-content .spu-desc {
+ color: #ffab20;
+ font-size: 24rpx;
+ line-height: 34rpx;
+ min-height: 34rpx;
+ margin-bottom: 14rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ margin: 0 20rpx;
+}
+
+.comming-spu-content .spu-price {
+ /* display: flex;
+ align-items: flex-end; */
+ font-size: 28rpx;
+ margin: 0 20rpx;
+}
+
+.comming-spu-content .spu-price .sale-price {
+ font-family: 'DIN';
+ color: #ff758c;
+ font-weight: bold;
+ margin-right: 8rpx;
+}
+
+.comming-spu-content .spu-price .sale-price .span {
+ font-size: 48rpx;
+ line-height: 40rpx;
+ margin-left: 4rpx;
+ font-weight: 500;
+}
+
+.comming-spu-content .spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+ font-family: 'DIN';
+ font-size: 20rpx;
+}
+
+.imgbox {
+ position: relative;
+}
+
+.comming-spu-content .item-tag {
+ position: absolute;
+ left: -1rpx;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.comming-spu-content .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.comming-spu-content .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.comming-spu-content .spu-active {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ z-index: 9;
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: flex-start;
+}
+
+.comming-spu-content .spu-active .tag {
+ background: linear-gradient(to right, #ff5041, #ff994b);
+ border-radius: 0 14rpx 14rpx 0;
+ padding: 0 12rpx;
+ height: 30rpx;
+ font-size: 22rpx;
+ line-height: 30rpx;
+ color: #fff;
+ display: inline-block;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ max-width: 180rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.comming-spu-content .spu-active .tag-green {
+ background: linear-gradient(to left, #46c8d0, #29ba9a);
+}
+
+.spu-play {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ width: 100rpx;
+ height: 100rpx;
+ margin-top: -50rpx;
+ margin-left: -50rpx;
+}
+
+.spu-play .img {
+ width: 100%;
+ height: 100%;
+}
+
+.iptnum {
+ position: absolute;
+ right: 20rpx;
+ bottom: 20rpx;
+}
diff --git a/eaterplanet_ecommerce/components/vipModal/index.js b/eaterplanet_ecommerce/components/vipModal/index.js
new file mode 100644
index 0000000..4fd5f9e
--- /dev/null
+++ b/eaterplanet_ecommerce/components/vipModal/index.js
@@ -0,0 +1,32 @@
+// eaterplanet_ecommerce/components/vipModal/index.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ visible: {
+ type: Boolean,
+ value: false
+ },
+ imgUrl: {
+ type: String,
+ value: ''
+ }
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ goUrl: function(){
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/moduleA/vip/upgrade',
+ })
+ },
+ closeModal: function() {
+ this.setData({
+ visible: false
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/components/vipModal/index.json b/eaterplanet_ecommerce/components/vipModal/index.json
new file mode 100644
index 0000000..979d4f5
--- /dev/null
+++ b/eaterplanet_ecommerce/components/vipModal/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-modal": "../modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/vipModal/index.wxml b/eaterplanet_ecommerce/components/vipModal/index.wxml
new file mode 100644
index 0000000..9791c1f
--- /dev/null
+++ b/eaterplanet_ecommerce/components/vipModal/index.wxml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/vipModal/index.wxss b/eaterplanet_ecommerce/components/vipModal/index.wxss
new file mode 100644
index 0000000..d26d092
--- /dev/null
+++ b/eaterplanet_ecommerce/components/vipModal/index.wxss
@@ -0,0 +1,15 @@
+@import "/icon.wxss";
+
+.img {
+ width: 640rpx;
+}
+
+.close {
+ color: #fff;
+ text-align: center;
+ margin-top: 20rpx;
+}
+
+.close .iconfont {
+ font-size: 60rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/vipPrice/vipPrice.js b/eaterplanet_ecommerce/components/vipPrice/vipPrice.js
new file mode 100644
index 0000000..1865c57
--- /dev/null
+++ b/eaterplanet_ecommerce/components/vipPrice/vipPrice.js
@@ -0,0 +1,23 @@
+// eaterplanet_ecommerce/components/vipPrice.js
+Component({
+ properties: {
+ price: {
+ type: null,
+ value: '0',
+ observer: function(t){
+ let prePrice = t;
+ if(Object.prototype.toString.call(t) === '[object Array]') {
+ prePrice = t.join('.');
+ }
+ this.setData({ prePrice })
+ }
+ },
+ type: {
+ type: String,
+ value: '0' // 1等级折扣
+ }
+ },
+ data: {
+ prePrice: 0
+ }
+})
diff --git a/eaterplanet_ecommerce/components/vipPrice/vipPrice.json b/eaterplanet_ecommerce/components/vipPrice/vipPrice.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/components/vipPrice/vipPrice.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/vipPrice/vipPrice.wxml b/eaterplanet_ecommerce/components/vipPrice/vipPrice.wxml
new file mode 100644
index 0000000..a8ab6d1
--- /dev/null
+++ b/eaterplanet_ecommerce/components/vipPrice/vipPrice.wxml
@@ -0,0 +1,2 @@
+会员价:¥{{prePrice}}
+等级折扣价:¥{{prePrice}}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/components/vipPrice/vipPrice.wxss b/eaterplanet_ecommerce/components/vipPrice/vipPrice.wxss
new file mode 100644
index 0000000..7655071
--- /dev/null
+++ b/eaterplanet_ecommerce/components/vipPrice/vipPrice.wxss
@@ -0,0 +1,14 @@
+.vipprice {
+ background: linear-gradient(to right,#ffeea2,#ffe689);
+ font-family: DIN;
+ color: #964c00;
+ font-size: 20rpx;
+ padding: 2rpx 8rpx;
+ border-radius: 6rpx;
+ margin-right: 10rpx;
+}
+
+.level {
+ background: linear-gradient(to right, #fd634f, #fd7967);
+ color: #fff;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/apply.js b/eaterplanet_ecommerce/distributionCenter/pages/apply.js
new file mode 100644
index 0000000..a75bd79
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/apply.js
@@ -0,0 +1,280 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+Page({
+ mixins: [require('../../mixin/commonMixin.js')],
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ pickerIndex: 0,
+ formArr: [],
+ status: 0
+ },
+ canSub: true,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ this.getMemberInfo();
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ that.getMemberInfo();
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ that.setData({
+ needAuth: false
+ })
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ })
+ },
+
+ getMemberInfo: function() {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ token && app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.get_user_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let commiss_diy_name = res.data.commiss_diy_name || '分销';
+ wx.setNavigationBarTitle({
+ title: `会员${commiss_diy_name}`,
+ })
+ //未开启分销
+ if (res.data.commiss_level == 0) {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ return;
+ }
+ //状态判断
+ let userInfo = res.data.data;
+ let status = 0; //未填写 1 已填写未审核 2 已审核
+ let { commiss_become_condition, commiss_biaodan_need } = res.data;
+ if (commiss_biaodan_need==1){
+ if (userInfo.is_writecommiss_form==1) {
+ status = 1;
+ //已填写
+ if (userInfo.comsiss_flag == 1) {
+ userInfo.comsiss_state == 0 ? status = 1 : status = 2;
+ }
+ } else if (userInfo.comsiss_flag == 1&&userInfo.comsiss_state == 1) {
+ status = 2;
+ }
+ } else {
+ status = 1
+ }
+ let formArr = [];
+ let commiss_diy_form = res.data.commiss_diy_form;
+ if (commiss_diy_form && commiss_diy_form.length > 0) {
+ commiss_diy_form.forEach((item)=>{
+ let value = '';
+ if (item.type == 'text' || item.type == 'textarea'){
+ value = item.value;
+ } else if(item.type == 'select') {
+ value = item.value[0].value || '';
+ }
+ let formObj = {type: item.type, name: item.title, value, index: 0};
+ formArr.push(formObj);
+ })
+ }
+ that.setData({
+ commiss_become_condition,
+ commiss_diy_form,
+ userInfo,
+ status,
+ formArr,
+ commiss_diy_name
+ })
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 输入框获得焦点
+ */
+ iptFocus: function(t) {
+ let name = t.currentTarget.dataset.name;
+ this.setData({
+ currentFocus: name
+ })
+ },
+
+ /**
+ * 输入框失去焦点
+ */
+ iptBlur: function() {
+ this.setData({
+ currentFocus: ''
+ })
+ },
+
+ bindPickerChange(e) {
+ console.log('picker发送选择改变,携带值为', e.detail.value)
+ let formArr = this.data.formArr;
+ let name = e.currentTarget.dataset.name;
+ let index = e.currentTarget.dataset.idx;
+ let pickIdx = e.detail.value;
+ let commiss_diy_form = this.data.commiss_diy_form;
+ let formObj = { type: 'select', name: commiss_diy_form[index].title, value: commiss_diy_form[index].value[pickIdx].value || '', index: pickIdx };
+ formArr.splice(index, 1, formObj)
+ this.setData({ formArr });
+ },
+
+ radioChange(e) {
+ let formArr = this.data.formArr;
+ let index = e.currentTarget.dataset.idx;
+ let value = e.detail.value;
+ let commiss_diy_form = this.data.commiss_diy_form;
+ let formObj = { type: 'radio', name: commiss_diy_form[index].title, value };
+ formArr.splice(index, 1, formObj)
+ this.setData({ formArr });
+ console.log('radio发生change事件,携带value值为:', e.detail.value)
+ },
+
+ checkboxChange(e) {
+ let formArr = this.data.formArr;
+ let index = e.currentTarget.dataset.idx;
+ let value = e.detail.value;
+ let commiss_diy_form = this.data.commiss_diy_form;
+ let formObj = { type: 'checkbox', name: commiss_diy_form[index].title, value };
+ formArr.splice(index, 1, formObj)
+ this.setData({ formArr });
+ console.log('checkbox发生change事件,携带value值为:', e.detail.value)
+ },
+
+ authModal: function(){
+ if(this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ formSubmit: function(e){
+ if (!this.authModal() || !this.canSub) return;
+ const params = e.detail.value;
+ let formArr = this.data.formArr;
+ let commiss_diy_form = this.data.commiss_diy_form;
+
+ Object.keys(params).forEach((item)=>{
+ let iptArr = item.split('-');
+ let iptIdx = iptArr[1];
+ let formObj = { type: commiss_diy_form[iptIdx].type, name: commiss_diy_form[iptIdx].title, value: params[item].replace(/^\s*|\s*$/g, "") }
+ formArr.splice(iptIdx, 1, formObj)
+ this.setData({ formArr });
+ })
+ console.log(formArr);
+ for (var i = 0; i < formArr.length; i++) {
+ let item = formArr[i];
+ if (item.value == '') {
+ let tip = '选择';
+ if (item.type == 'text' || item.type == 'textarea') {
+ tip = '输入';
+ }
+ wx.showToast({
+ title: '请' + tip + item.name,
+ icon: 'none'
+ })
+ return false;
+ }
+ }
+ // [{ type: input, name: '姓名', value ='123'}]
+ var token = wx.getStorageSync('token');
+ this.canSub = false;
+ wx.showLoading({ title: '提交中' })
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'distribution.sub_distribut_form',
+ token,
+ data: formArr
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let status = 1;
+ if(that.data.commiss_become_condition==0) status = 3;
+ that.setData({ status })
+ } else {
+ that.canSub = true;
+ wx.showToast({
+ title: '提交失败,请重试。',
+ icon: 'none'
+ })
+ }
+ }
+ })
+
+ },
+
+ goLink: function(e) {
+ let url = e.currentTarget.dataset.url;
+ let type = '';
+ if (url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1) {
+ type = 'switch'
+ }
+
+ switch (type) {
+ case "switch":
+ wx.switchTab({
+ url
+ });
+ break;
+ default:
+ wx.navigateTo({
+ url
+ });
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/apply.json b/eaterplanet_ecommerce/distributionCenter/pages/apply.json
new file mode 100644
index 0000000..f96ad1f
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/apply.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "会员分销",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/apply.wxml b/eaterplanet_ecommerce/distributionCenter/pages/apply.wxml
new file mode 100644
index 0000000..dfc3ac9
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/apply.wxml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+ 恭喜您申请成功!
+ 平台将尽快审核!
+
+
+
+
+ 您已经是{{commiss_diy_name}}会员
+
+
+
+
+ 恭喜您申请成功!
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/apply.wxss b/eaterplanet_ecommerce/distributionCenter/pages/apply.wxss
new file mode 100644
index 0000000..cc443a4
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/apply.wxss
@@ -0,0 +1,166 @@
+.status {
+ padding: 360rpx 30rpx 0;
+ text-align: center;
+}
+
+.p {
+ font-size: 32rpx;
+ margin-bottom: 20rpx;
+}
+
+.status-btn {
+ margin-top: 60rpx;
+ background-color: #4facfe!important;
+
+}
+
+.gcs-box {
+ padding-bottom: 100rpx;
+ background: #fff;
+}
+
+.gcs-box .card {
+ position: relative;
+}
+
+.card-header {
+ display: flex;
+ padding: 30rpx;
+ box-shadow: 0 0 40rpx rgba(0, 0, 0, 0.1);
+}
+
+.card-header .title {
+ flex: 1;
+ color: #4facfe;
+ font-size: 30rpx;
+ font-weight: bold;
+}
+
+.bot-line {
+ width: 100%;
+ height: 1rpx;
+ border-bottom: 1rpx solid #f5f5f5;
+ transition: 200ms all ease-in-out;
+}
+
+.bot-line.focus {
+ border-bottom: 2rpx solid #4facfe;
+}
+
+.info-item {
+ display: flex;
+ align-items: center;
+ /* justify-content: center;
+ min-height: 102rpx; */
+ font-size: 30rpx;
+ width: 100%;
+ box-sizing: border-box;
+ padding: 30rpx 0;
+}
+
+.info-item.textarea-item {
+ align-items: flex-start;
+}
+
+.info-item .item-title {
+ color: #333;
+ margin-right: 30rpx;
+ min-width: 60rpx;
+}
+
+.info-item .item-content {
+ color: #000;
+ flex: 1;
+}
+
+.info-item .item-content textarea {
+ width: 100%;
+}
+
+.card-body {
+ padding: 30rpx 36rpx 0;
+}
+
+.edit-btn button {
+ background-color: #4facfe;
+ text-align: center;
+ line-height: 90rpx;
+ margin: 80rpx 36rpx;
+ color: #fff;
+ border-radius: 6rpx;
+ font-size: 38rpx;
+ font-weight: bold;
+}
+
+.edit-btn button::after {
+ border: 0;
+}
+
+textarea {
+ min-height: 1.1rem;
+}
+
+.radio-group .radio {
+ margin-right: 20rpx;
+}
+
+.radio-group .radio text, .checkbox text {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.checkbox {
+ margin-right: 20rpx;
+}
+
+radio {
+ width: 38rpx;
+}
+
+radio .wx-radio-input {
+ border-radius: 50%;
+ width: 28rpx;
+ height: 28rpx;
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before {
+ border-radius: 50%;
+ width: 44rpx;
+ height: 44rpx;
+ line-height: 44rpx;
+ text-align: center;
+ font-size: 28rpx;
+ color: #fff;
+ background: #2facff;
+ border-color: #2facff;
+}
+
+/* 未选中的 背景样式 */
+checkbox .wx-checkbox-input {
+ display: inline-block;
+ width: 40rpx;
+ height: 40rpx;
+}
+
+checkbox .wx-checkbox-input.wx-checkbox-input-checked {
+ background: #2facff;
+ border-color: #2facff;
+}
+
+checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
+ border-radius: 50%;
+ width: 46rpx;
+ height: 46rpx;
+ line-height: 46rpx;
+ text-align: center;
+ font-size: 28rpx;
+ color: #fff;
+ background: transparent;
+ transform: translate(-50%, -50%) scale(1);
+ -webkit-transform: translate(-50%, -50%) scale(1);
+}
+
+.status-img {
+ width: 160rpx;
+ margin-bottom: 20rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/details.js b/eaterplanet_ecommerce/distributionCenter/pages/details.js
new file mode 100644
index 0000000..fbb0a88
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/details.js
@@ -0,0 +1,84 @@
+// eaterplanet_ecommerce/pages/distribution/details.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [{},{}],
+ isHideLoadMore: true,
+ tip: '正在加载'
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/details.json b/eaterplanet_ecommerce/distributionCenter/pages/details.json
new file mode 100644
index 0000000..471b1a7
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/details.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "推广明细",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "component-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/details.wxml b/eaterplanet_ecommerce/distributionCenter/pages/details.wxml
new file mode 100644
index 0000000..d914705
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/details.wxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ 推广订单收益
+ 2019-01-06 12:26:36
+
+ +0.3
+
+
+
+ 暂无明细
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/details.wxss b/eaterplanet_ecommerce/distributionCenter/pages/details.wxss
new file mode 100644
index 0000000..e4f6b01
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/details.wxss
@@ -0,0 +1,37 @@
+.list {
+ background: #fff;
+}
+
+.list-item {
+ position: relative;
+ padding: 20rpx 30rpx;
+}
+
+.list-item::after {
+ content: '';
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ transform: scaleY(.5);
+ border-bottom: 1px solid #c8c7cc;
+}
+
+.list-item .list-item-r {
+ font-size: 30rpx;
+ color: #4facfe;
+ font-weight: bold;
+}
+
+.list-item .time {
+ color: #999;
+ font-size: 24rpx;
+}
+
+.none-list {
+ text-align: center;
+ background: #fff;
+ height: 116rpx;
+ line-height: 116rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/excharge.js b/eaterplanet_ecommerce/distributionCenter/pages/excharge.js
new file mode 100644
index 0000000..9cf98a9
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/excharge.js
@@ -0,0 +1,400 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+ mixins: [require('../../mixin/commonMixin.js')],
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ type: 1,
+ items: [{
+ name: '1',
+ value: '系统余额',
+ show: true,
+ checked: false
+ },
+ {
+ name: '2',
+ value: '微信零钱',
+ show: true,
+ checked: false
+ },
+ {
+ name: '3',
+ value: '支付宝',
+ show: true,
+ checked: false
+ },
+ {
+ name: '4',
+ value: '银行卡',
+ show: true,
+ checked: false
+ }
+ ],
+ info: [],
+ tixian_money: '',
+ final_money: 0
+ },
+ canTixian: true,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ wx.showLoading();
+ this.getData();
+ },
+
+ onShow: function() {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ that.setData({
+ needAuth: false
+ })
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ wx.showLoading();
+ that.getData();
+ })
+ },
+
+ getData: function() {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ //Todo
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'distribution.get_commission_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let commiss_tixian_publish = res.data.data.commiss_tixian_publish;
+ let items = that.data.items;
+ let rdata = res.data.data;
+ if (rdata.commiss_tixianway_yuer == 0) items[0].show = false;
+ if (rdata.commiss_tixianway_weixin == 0) items[1].show = false;
+ if (rdata.commiss_tixianway_alipay == 0) items[2].show = false;
+ if (rdata.commiss_tixianway_bank == 0) items[3].show = false;
+
+ let type = that.data.type;
+ for (let i = 0; i < items.length; i++) {
+ if (items[i].show) {
+ items[i].checked = true;
+ type = items[i].name;
+ break
+ }
+ }
+
+ let { is_need_subscript, need_subscript_template } = res.data;
+
+ that.setData({
+ info: res.data.data,
+ items,
+ type,
+ is_need_subscript,
+ need_subscript_template,
+ commiss_tixian_publish
+ })
+ } else {
+ wx.showModal({
+ title: '提示',
+ content: res.data.msg,
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+ formSubmit: function(event) {
+ let that = this;
+ let is_need_subscript = this.data.is_need_subscript;
+ if(is_need_subscript==1) {
+ //弹出订阅消息
+ this.subscriptionNotice().then(()=>{
+ that.resSubmit(event);
+ }).catch(()=>{
+ that.resSubmit(event);
+ });
+ } else {
+ that.resSubmit(event);
+ }
+ },
+
+ resSubmit: function(e) {
+ const params = e.detail.value;
+ let isNull = 0;
+ let type = this.data.type;
+ let errortip = [{}, {}, {
+ bankusername: '微信真实姓名'
+ }, {
+ bankusername: '支付宝真实姓名',
+ bankaccount: '支付宝账户'
+ }, {
+ bankname: '银行卡名称',
+ bankusername: '持卡人姓名',
+ bankaccount: '银行卡账户'
+ }];
+ for (let item in params) {
+ params[item] = params[item].replace(/(^\s*)|(\s*$)/g, "");
+ if (!params[item]) {
+ const itemTip = errortip[type][item];
+ wx.showToast({
+ title: '请输入' + (itemTip || '正确的表单内容'),
+ icon: 'none'
+ })
+ isNull = 1;
+ break;
+ }
+ if (item == 'money' && params[item] * 1 <= 0) {
+ wx.showToast({
+ title: '请输入正确的金额',
+ icon: 'none'
+ })
+ return;
+ }
+ }
+
+ if (isNull == 1) return;
+ params.type = type;
+
+ let tdata = this.data;
+ let tixian_money = parseFloat(tdata.tixian_money);
+ let max_tixian_money = tdata.info.money;
+ let community_min_money = parseFloat(tdata.info.commiss_min_tixian_money);
+
+ if (tixian_money == '' || community_min_money > tixian_money) {
+ wx.showToast({
+ title: '最小提现' + community_min_money + '元',
+ icon: "none",
+ })
+ return false;
+ }
+
+ if (tixian_money > max_tixian_money) {
+ wx.showToast({
+ title: '本次最大可提现' + max_tixian_money + '元',
+ icon: "none",
+ })
+ let fee = tdata.info.commiss_tixian_bili;
+ let final_money = (max_tixian_money * (100 - fee) / 100).toFixed(2);
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money
+ })
+ return false;
+ }
+
+ if (!this.canTixian) return;
+ this.canTixian = false;
+
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'distribution.tixian_sub',
+ token: token,
+ ...params
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ wx.showToast({
+ title: '已提交申请',
+ icon: 'none',
+ duration: 2000,
+ success: function(){
+ that.setData({
+ canPay: false,
+ tixian_money: '',
+ final_money: 0
+ })
+ that.getData();
+ }
+ })
+ } else {
+ wx.showToast({
+ title: res.data.msg ? res.data.msg : '提交失败,请重试',
+ icon: 'none'
+ })
+ }
+ that.canTixian = true;
+ }
+ })
+ },
+
+ /**
+ * 订阅消息
+ */
+ subscriptionNotice: function() {
+ let that = this;
+ return new Promise((resolve, reject)=>{
+ let obj = that.data.need_subscript_template;
+ let tmplIds = Object.keys(obj).map(key => obj[key]); // 订阅消息模版id
+ if (wx.requestSubscribeMessage) {
+ tmplIds.length && wx.requestSubscribeMessage({
+ tmplIds: tmplIds,
+ success(res) {
+ let is_need_subscript = 1;
+ let acceptId = [];
+ tmplIds.forEach(item=>{
+ if (res[item] == 'accept') {
+ //用户同意了订阅,添加进数据库
+ acceptId.push(item);
+ } else {
+ //用户拒绝了订阅或当前游戏被禁用订阅消息
+ is_need_subscript = 0;
+ }
+ })
+
+ if(acceptId.length) {
+ that.addAccept(acceptId);
+ }
+ that.setData({ is_need_subscript })
+ resolve();
+ },
+ fail(err) {
+ console.log(err)
+ reject();
+ }
+ })
+ } else {
+ // 兼容处理
+ reject();
+ }
+ })
+ },
+
+ // 用户点击订阅添加到数据库
+ addAccept: function (acceptId) {
+ let token = wx.getStorageSync('token');
+ let type = acceptId.join(',');
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.collect_subscriptmsg',
+ token,
+ type
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function () {}
+ })
+ },
+
+ /**
+ * 获得焦点
+ */
+ bindIptFocus: function() {
+ this.setData({
+ onFocus: true
+ })
+ },
+
+ /**
+ * 失去焦点
+ */
+ bindIptBlur: function() {
+ this.setData({
+ onFocus: false
+ })
+ },
+
+ radioChange(e) {
+ this.setData({
+ type: e.detail.value
+ })
+ },
+
+ bindTixianMoneyInput: function(t) {
+ let max_val = this.data.info.money;
+ var value = t.detail.value;
+ if (!(/^(\d?)+(\.\d{0,2})?$/.test(value))) {
+ value = value.substring(0, value.length - 1);
+ value = parseFloat(value);
+ }
+
+ if (value > max_val) {
+ wx.showToast({
+ title: '本次最大可提现' + max_val + '元',
+ icon: "none",
+ })
+ }
+ let fee = this.data.info.commiss_tixian_bili;
+ let val = parseFloat(value) > 0 ? parseFloat(value) : 0;
+ let final_money = (val * (100 - fee) / 100).toFixed(2);
+
+ let canPay = false;
+ value ? canPay = true : canPay = false;
+
+ this.setData({
+ tixian_money: value,
+ final_money: final_money,
+ canPay
+ })
+ return value;
+ },
+
+ getAll: function() {
+ const tdata = this.data;
+ var max_tixian_money = tdata.info.money * 1;
+ let fee = tdata.info.commiss_tixian_bili;
+ let final_money = (max_tixian_money * (100 - fee) / 100).toFixed(2);
+
+ let canPay = false;
+ max_tixian_money ? canPay = true : canPay = false;
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money,
+ canPay
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/excharge.json b/eaterplanet_ecommerce/distributionCenter/pages/excharge.json
new file mode 100644
index 0000000..9b72cdd
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/excharge.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "提现",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/excharge.wxml b/eaterplanet_ecommerce/distributionCenter/pages/excharge.wxml
new file mode 100644
index 0000000..39fc67c
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/excharge.wxml
@@ -0,0 +1,59 @@
+
+
+
+
+ {{info.money}}
+ 可提现金额(元)
+
+ 提现记录
+
+
+
+ 提现规则:
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/excharge.wxss b/eaterplanet_ecommerce/distributionCenter/pages/excharge.wxss
new file mode 100644
index 0000000..4849b5f
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/excharge.wxss
@@ -0,0 +1 @@
+@import "/eaterplanet_ecommerce/resource/css/excharge.wxss";
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.js b/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.js
new file mode 100644
index 0000000..957e043
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.js
@@ -0,0 +1,120 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ loadText: '加载中',
+ loadMore: false,
+ noData: false,
+ state: ['提现中', '提现成功', '提现失败']
+ },
+ page: 1,
+ noMore: false,
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ this.getData();
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ that.getData();
+ })
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ getData: function() {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'distribution.tixian_record',
+ token: token,
+ page: this.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list })
+ } else {
+ // 无数据
+ if (that.page == 1) that.setData({ noData: true })
+ that.noMore = true;
+ that.setData({ loadMore: false })
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ wx.showModal({
+ title: '提示',
+ content: '您还未登录',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ this.noMore || (this.setData({ loadMore: true }), this.getData());
+ }
+})
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.json b/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.json
new file mode 100644
index 0000000..f2a60e0
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "提现记录",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.wxml b/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.wxml
new file mode 100644
index 0000000..11517cb
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.wxml
@@ -0,0 +1,22 @@
+
+
+
+
+ 申请时间
+ 状态
+ 金额(元)
+
+
+
+ {{item.addtime}}
+ {{state[item.state]}}
+ {{item.money}}
+
+
+
+
+
+ 暂无任何明细记录
+
+
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.wxss b/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.wxss
new file mode 100644
index 0000000..0d4a5e2
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/exchargeRecord.wxss
@@ -0,0 +1,63 @@
+
+.title {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ display: flex;
+ align-items: center;
+ background-color: #fff;
+ color: #333;
+ line-height: 80rpx;
+ font-size: 28rpx;
+ text-align: center;
+ box-shadow: 1px 2px 3px rgba(0, 0, 0, .3);
+ font-weight: bold;
+}
+
+.time {
+ flex: 3;
+}
+
+.status {
+ flex: 1;
+}
+
+.money {
+ flex: 2;
+}
+
+.list {
+ padding-top: 80rpx;
+ text-align: center;
+ background-color: #fff;
+ font-size: 24rpx;
+}
+
+.list-item {
+ position: relative;
+ display: flex;
+ align-items: center;
+ line-height: 76rpx;
+ border-bottom: 1rpx solid #efefef;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-top: 200rpx;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/fans.js b/eaterplanet_ecommerce/distributionCenter/pages/fans.js
new file mode 100644
index 0000000..81ae60d
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/fans.js
@@ -0,0 +1,172 @@
+var page = 1;
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ queryData: {
+ createTime: null,
+ communityId: null,
+ order: [],
+ page: page,
+ pageSize: 20
+ },
+ searchKey: "",
+ containerHeight: 0,
+ showLoadMore: false,
+ no_order: 0,
+ page: 1,
+ hide_tip: true,
+ order: [],
+ tip: '正在加载'
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var sysInfo = wx.getSystemInfoSync();
+ this.setData({
+ containerHeight: sysInfo.windowHeight - Math.round(sysInfo.windowWidth / 375 * 125)
+ });
+ page = 1;
+ this.data.queryData.communityId = app.globalData.disUserInfo.communityId;
+ this.data.queryData.createTime = null;
+
+ this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ var is_show_on = this.data.is_show_on;
+ if (is_show_on > 0) {
+ this.setData({
+ page: 1,
+ order: []
+ })
+ this.getData();
+ } else {
+ this.setData({
+ is_show_on: is_show_on + 1
+ })
+ }
+ },
+
+ /**
+ * 获取数据
+ */
+ getData: function () {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+
+ this.setData({
+ isHideLoadMore: true
+ })
+
+ this.data.no_order = 1
+ let that = this;
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'distribution.get_member_fanslist',
+ keyword: that.data.searchKey,
+ token: token,
+ page: that.data.page
+ },
+ dataType: 'json',
+ success: function (res) {
+
+ if (res.data.code == 0) {
+ let rushList = that.data.order.concat(res.data.data);
+ that.setData({
+ order: rushList,
+ hide_tip: true,
+ no_order: 0
+ });
+ wx.hideLoading();
+ } else {
+ that.setData({
+ isHideLoadMore: true
+ })
+ wx.hideLoading();
+ return false;
+ }
+
+ }
+ })
+
+ },
+
+ /**
+ * 监控输入框
+ */
+ bindSearchChange: function (e) {
+ this.setData({
+ searchKey: e.detail.value
+ });
+ },
+
+ /**
+ * 搜索
+ */
+ searchByKey: function () {
+ page = 1;
+ this.setData({
+ order: [],
+ no_order: 0,
+ page: 1
+ });
+ this.data.queryData.memberNickName = this.data.searchKey;
+ this.getData();
+ },
+
+ /**
+ * 取消
+ */
+ cancel: function () {
+ page = 1;
+ this.setData({
+ searchKey: "",
+ order: []
+ });
+ this.data.queryData.memberNickName = null;
+ this.getData();
+ },
+
+ /**
+ * 获取更多
+ */
+ getMore: function () {
+ if (this.data.no_order == 1) return false;
+ this.data.page += 1;
+ this.getData();
+ this.setData({
+ isHideLoadMore: false
+ })
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/fans.json b/eaterplanet_ecommerce/distributionCenter/pages/fans.json
new file mode 100644
index 0000000..19de877
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/fans.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "我的粉丝",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "component-img": "../../components/image/index",
+ "component-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/fans.wxml b/eaterplanet_ecommerce/distributionCenter/pages/fans.wxml
new file mode 100644
index 0000000..e0856ed
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/fans.wxml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.username}}
+
+
+
+ {{item.create_time}}
+
+
+
+
+
+
+ 暂无粉丝
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/fans.wxss b/eaterplanet_ecommerce/distributionCenter/pages/fans.wxss
new file mode 100644
index 0000000..66eacfd
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/fans.wxss
@@ -0,0 +1,146 @@
+.search {
+ background: #fff;
+ padding: 20rpx 30rpx;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ position: relative;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+}
+
+.search .icon-search {
+ position: absolute;
+ left: 54rpx;
+}
+
+.search input {
+ flex: 1;
+ padding-left: 68rpx;
+ /* width: 520rpx; */
+ height: 56rpx;
+ background: #f8f8f8;
+ border-radius: 28rpx;
+ color: #999;
+ box-sizing: border-box;
+ line-height: 40rpx;
+}
+
+.search text {
+ color: #4facfe;
+ margin-left: 28rpx;
+}
+
+.date {
+ padding: 0 30rpx;
+ background: #fff;
+ height: 90rpx;
+ line-height: 90rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+ color: #9b9b9b;
+}
+
+.date .date-value {
+ margin-left: 12rpx;
+ color: #4facfe;
+}
+
+.date .icon-date {
+ height: 36rpx;
+ width: 36rpx;
+ float: right;
+ margin: 6rpx 0 0 0;
+}
+
+.date .icon-date image {
+ height: 36rpx;
+ width: 36rpx;
+}
+
+.date .icon-clear {
+ height: 32rpx;
+ float: right;
+ color: #4facfe;
+ margin: 0 28rpx 0 0;
+ font-size: 24rpx;
+}
+
+.list-content {
+ width: 100%;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+}
+
+.list-header, .list-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0 30rpx;
+}
+
+.list-header {
+ height: 84rpx;
+}
+
+.list-item {
+ background: #fff;
+ height: 116rpx;
+ margin-bottom: 2rpx;
+}
+
+.list-item .item-left {
+ display: flex;
+ align-items: center;
+}
+
+.list-item .item-left text {
+ margin-left: 12rpx;
+ font-size: 28rpx;
+ width: 400rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.list-item .item-left .phone {
+ margin-left: 12rpx;
+ display: flex;
+ align-items: center;
+}
+
+.list-item .item-left .icon-phone {
+ width: 28rpx;
+ height: 32rpx;
+ margin-left: 10rpx;
+}
+
+.list-item .item-right {
+ height: 100%;
+ display: flex;
+ align-items: center;
+ text-align: right;
+}
+
+.list-item .item-right .text {
+ font-size: 26rpx;
+ margin-right: 18rpx;
+}
+
+.list-item .item-right .rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+}
+
+.navigator-hover {
+ background-color: rgba(0, 0, 0, 0);
+}
+
+.none-member {
+ text-align: center;
+ background: #fff;
+ height: 116rpx;
+ line-height: 116rpx;
+}
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.js b/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.js
new file mode 100644
index 0000000..dee7e7d
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.js
@@ -0,0 +1,177 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ currentTab: 0,
+ pageSize: 10,
+ navList: [{
+ name: "全部",
+ status: "-1"
+ }, {
+ name: "待结算",
+ status: "0"
+ }, {
+ name: "已结算",
+ status: "1"
+ }, {
+ name: "已失效",
+ status: "2"
+ }],
+ list: [],
+ loadText: "加载中...",
+ info: {},
+ noData: 0,
+ loadMore: true,
+ stateArr: ["待结算", "已结算", "已失效"]
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ wx.setNavigationBarTitle({
+ title: '推广收益',
+ })
+ this.getInfo();
+ this.getData();
+ },
+
+ getInfo: function () {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'distribution.get_commission_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ // Todo
+ that.setData({ info: res.data.data })
+ } else {
+ wx.showModal({
+ title: '提示',
+ content: res.data.msg,
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+ getData: function(){
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let currentTab = this.data.currentTab;
+ let state = this.data.navList[currentTab].status;
+
+ wx.showLoading();
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'distribution.listorder_list',
+ token: token,
+ state: state,
+ page: this.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 6) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list, ...h })
+ } else {
+ // 无数据
+ if (that.page == 1) that.setData({ noData: 1 })
+ that.setData({ loadMore: false, noMore: false, loadText: "没有更多记录了~" })
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ getCurrentList: function () {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ this.setData({
+ isHideLoadMore: false
+ })
+ },
+
+ onReachBottom: function () {
+ this.getCurrentList();
+ },
+
+ bindChange: function (t) {
+ this.page = 1;
+ this.setData({
+ // currentTab: 1 * t.detail.current,
+ currentTab: t,
+ list: [],
+ noData: 0,
+ loadMore: true,
+ loadText: "加载中..."
+ }, () => {
+ console.log('我变啦');
+ this.getData();
+ });
+ },
+
+ /**
+ * 切换导航
+ */
+ switchNav: function (e) {
+ const that = this;
+ if (this.data.currentTab === 1 * e.target.dataset.current) return false;
+ let currentTab = 1 * e.target.dataset.current;
+ this.setData({
+ currentTab
+ },()=>{
+ that.bindChange(currentTab)
+ });
+ },
+
+ handleTipDialog: function(){
+ this.setData({
+ showTipDialog: !this.data.showTipDialog
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.json b/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.json
new file mode 100644
index 0000000..ae01e48
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "推广收益",
+ "navigationBarBackgroundColor": "#4facfe",
+ "navigationBarTextStyle": "white",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index",
+ "i-dialog": "../../components/dialog/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.wxml b/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.wxml
new file mode 100644
index 0000000..6f5d3ec
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.wxml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+ 推荐二维码
+
+
+ 可提现(元)
+ {{info.money}}
+ 提现
+
+
+
+
+ 订单数
+ {{info.order_count}}
+
+
+
+ 粉丝数量
+
+ {{info.member_count}}
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+ 还没有记录 快去分享吧~
+
+
+
+
+ 订单编号:{{item.order_num_alias}}
+ {{stateArr[item.state]}}
+
+
+
+
+
+ {{item.name}}
+
+
+ ¥{{item.price}} x {{item.quantity}} {{item.option_str}}
+
+
+
+
+ 会员名称
+ {{item.uname}}
+
+
+ 粉丝等级
+ {{item.level}}
+
+
+ 下单时间
+ {{item.addtime}}
+
+
+ 订单状态
+ {{item.status_name}}
+
+
+ 预估佣金变化
+ {{item.money}}
+
+
+ 预估佣金
+ {{item.money}}
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.wxss b/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.wxss
new file mode 100644
index 0000000..687a404
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/goodsDetails.wxss
@@ -0,0 +1,267 @@
+.zr {
+ background: #fff;
+ width: 100%;
+ position: relative;
+ overflow: hidden;
+ padding-bottom: 30rpx;
+ margin-bottom: 20rpx;
+}
+
+.top_box {
+ color: #333;
+ font-size: 24rpx;
+ line-height: 1;
+}
+
+.total {
+ text-align: center;
+ padding-bottom: 40rpx;
+}
+
+.total-money {
+ font-weight: bold;
+ font-size: 58rpx;
+ margin-top: 15rpx;
+ padding-left: 80rpx;
+}
+
+.three {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.three-item {
+ position: relative;
+ flex: 1;
+ text-align: center;
+}
+
+.three-item::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 1rpx;
+ border-left: 1rpx solid #4facfe;
+}
+
+.three-item:first-child::before {
+ content: none;
+}
+
+.three-title {
+ color: #999;
+ font-size: 24rpx;
+}
+
+.three-money {
+ margin-top: 15rpx;
+ font-size: 28rpx;
+ font-weight: bold;
+}
+
+.rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+ margin-left: 8rpx;
+}
+
+.qrcode {
+ display: inline-block;
+ width: 80rpx;
+ font-size: 22rpx;
+ text-align: center;
+ padding: 8rpx 0;
+ border-radius: 5rpx;
+ background: #4facfe;
+ color: #fff;
+ vertical-align: middle;
+}
+
+.nav {
+ position: sticky;
+ position: -webkit-sticky;
+ top: 0;
+ transition: top 0.3s;
+ z-index: 10;
+ background: #fff;
+ height: 92rpx;
+ border-bottom: 2rpx solid #f2f2f2;
+ padding: 0 60rpx;
+ width: unset;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.nav .orderList_item {
+ margin-bottom: 4rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+ color: #666;
+ position: relative;
+ height: 96rpx;
+ line-height: 96rpx;
+}
+
+.nav .on {
+ position: relative;
+ color: #4facfe;
+ border-bottom: 4rpx solid #4facfe;
+}
+
+.nav .on::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border-bottom: 2rpx solid #4facfe;
+}
+
+.noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.noRecordCon .noRecordImg {
+ width: 132rpx;
+ height: 138rpx;
+ margin-top: 30%;
+}
+
+.noRecordCon .noRefundImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 50%;
+}
+
+.noRecordCon .noRecord {
+ padding-top: 32rpx;
+ font-size: 30rpx;
+ font-family: PingFangSC-Light;
+ font-weight: 300;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.noRecordCon .goIndex {
+ width: 164rpx;
+ height: 60rpx;
+ background: #4facfe;
+ border-radius: 30rpx;
+ font-size: 28rpx;
+ color: #fff;
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.list-item {
+ padding: 30rpx;
+ background-color: #fff;
+ margin-bottom: 20rpx;
+ font-size: 26rpx;
+}
+
+.item-head {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ border-bottom: 1rpx solid #ececec;
+ padding-bottom: 20rpx;
+}
+
+.item-head .status {
+ color: #4facfe;
+}
+
+.list-item .line {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ line-height: 2;
+}
+
+.line-tit {
+ color: #999;
+}
+
+.top_box_head {
+ padding: 30rpx;
+}
+
+.tx-btn {
+ color: #4facfe;
+}
+
+.goodsInfo {
+ padding: 0 !important;
+}
+
+.goodsInfo .identity {
+ left: 0 !important;
+}
+
+.spu {
+ padding: 30rpx 30rpx 20rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.spu .goodsImg {
+ width: 140rpx;
+ height: 140rpx;
+}
+
+.spu .detail {
+ margin-left: 20rpx;
+ font-size: 24rpx;
+ color: #aaa;
+}
+
+.spu .detail .spuName {
+ color: #444;
+ font-size: 28rpx;
+ font-weight: 500;
+ overflow: hidden;
+}
+
+.spu .detail .tips {
+ line-height: 1;
+ width: 530rpx;
+ margin-top: 16rpx;
+ position: relative;
+}
+
+.spu .detail .tips .last {
+ float: right;
+}
+
+.spu .detail .tips .price {
+ color: #ff758c;
+ font-size: 32rpx;
+}
+
+.rightArrow {
+ font-size: 24rpx;
+}
+
+.dialogText {
+ box-sizing: border-box;
+ padding: 20rpx;
+ height: 140rpx!important;
+ text-align: justify;
+}
+
+.dialogBtn {
+ font-size: 30rpx!important;
+ height: 68rpx!important;
+ line-height: 68rpx!important;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/me.js b/eaterplanet_ecommerce/distributionCenter/pages/me.js
new file mode 100644
index 0000000..0645203
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/me.js
@@ -0,0 +1,160 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+ mixins: [require('../../mixin/commonMixin.js')],
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ info: [],
+ member_info: {
+ username: '',
+ member_id: 1,
+ avatar: "../../images/head-bitmap.png"
+ },
+ info: {
+ total_money: 0,
+ share_name: '无'
+ }
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let commiss_diy_name = wx.getStorageSync('commiss_diy_name') || '分销';
+ wx.setNavigationBarTitle({
+ title: `${commiss_diy_name}中心`,
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ that.setData({
+ needAuth: false
+ })
+ that.getUser();
+ that.getData();
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ that.getUser();
+ that.getData();
+ })
+ },
+
+ getData: function () {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'distribution.get_commission_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let parent_info = res.data.parent_info;
+ that.setData({ info: res.data.data, parent_info })
+ } else {
+ wx.showModal({
+ title: '提示',
+ content: res.data.msg,
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+ getUser: function(){
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.get_user_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ // let commiss_diy_name = res.data.commiss_diy_name || '分销';
+ // wx.setNavigationBarTitle({
+ // title: `${commiss_diy_name}中心`,
+ // })
+ that.setData({ member_info: res.data.data })
+ } else {
+ //is_login
+ that.setData({ needAuth: true })
+ wx.setStorage({
+ key: "member_id",
+ data: null
+ })
+ }
+ }
+ })
+ },
+
+ goLink: function (event) {
+ if (!this.authModal()) return;
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+})
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/me.json b/eaterplanet_ecommerce/distributionCenter/pages/me.json
new file mode 100644
index 0000000..7523c02
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/me.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar/index",
+ "i-new-auth": "../../components/new-auth/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/me.wxml b/eaterplanet_ecommerce/distributionCenter/pages/me.wxml
new file mode 100644
index 0000000..47bc96b
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/me.wxml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ {{member_info.username}}
+ ID:{{member_info.member_id}}
+
+ 直属上级:{{parent_info.username||'无'}}
+ 直属上级:无
+
+
+
+
+ {{info.money}}
+ 可提现金额(元)
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/me.wxss b/eaterplanet_ecommerce/distributionCenter/pages/me.wxss
new file mode 100644
index 0000000..63b4ade
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/me.wxss
@@ -0,0 +1,72 @@
+.wrap {
+ background-color: #fff;
+}
+
+.user-info {
+ padding: 30rpx;
+}
+
+.user-info .avatar {
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 20rpx;
+ border-radius: 50%;
+}
+
+.nickname {
+ font-size: 32rpx;
+ font-weight: bold;
+ color: #000;
+}
+
+.userid, invote {
+ font-size: 26rpx;
+ margin-top: 10rpx;
+}
+
+.money {
+ padding: 20rpx 30rpx;
+}
+
+.bor-bottom {
+ position: relative;
+}
+
+.bor-bottom::after {
+ content: '';
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ transform: scaleY(.5);
+ border-bottom: 1rpx solid #efefef;
+}
+
+.item-main {
+ padding: 32rpx 40rpx;
+}
+
+.item-title {
+ height: 40rpx;
+ width: 400rpx;
+ color: #444;
+ font-size: 28rpx;
+ display: flex;
+ align-items: center;
+}
+
+.icon-right {
+ width: 12rpx;
+ height: 22rpx;
+}
+
+.recharge-money {
+ color: #4facfe;
+ font-size: 50rpx;
+}
+
+.recharge-tip {
+ color: #999;
+ font-size: 24rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/member.js b/eaterplanet_ecommerce/distributionCenter/pages/member.js
new file mode 100644
index 0000000..897efd0
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/member.js
@@ -0,0 +1,174 @@
+var page = 1;
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ queryData: {
+ createTime: null,
+ communityId: null,
+ order: [],
+ page: page,
+ pageSize: 20
+ },
+ searchKey: "",
+ containerHeight: 0,
+ showLoadMore: false,
+ no_order: 0,
+ page: 1,
+ hide_tip: true,
+ order: [],
+ tip: '正在加载',
+ levelName: ['', '1级粉丝', '2级粉丝', '3级粉丝']
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var sysInfo = wx.getSystemInfoSync();
+ this.setData({
+ containerHeight: sysInfo.windowHeight - Math.round(sysInfo.windowWidth / 375 * 125)
+ });
+ page = 1;
+ this.data.queryData.communityId = app.globalData.disUserInfo.communityId;
+ this.data.queryData.createTime = null;
+ wx.setNavigationBarTitle({
+ title: '我的粉丝',
+ })
+ this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ var is_show_on = this.data.is_show_on;
+ if (is_show_on > 0) {
+ this.setData({
+ page: 1,
+ order: []
+ })
+ this.getData();
+ } else {
+ this.setData({
+ is_show_on: is_show_on + 1
+ })
+ }
+ },
+
+ /**
+ * 获取数据
+ */
+ getData: function () {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+
+ this.setData({
+ isHideLoadMore: true
+ })
+
+ this.data.no_order = 1
+ let that = this;
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'distribution.get_head_child_headlist',
+ keyword: that.data.searchKey,
+ token: token,
+ page: that.data.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let rushList = that.data.order.concat(res.data.data);
+ that.setData({
+ order: rushList,
+ hide_tip: true,
+ no_order: 0
+ });
+ wx.hideLoading();
+ } else {
+ that.setData({
+ isHideLoadMore: true
+ })
+ wx.hideLoading();
+ return false;
+ }
+
+ }
+ })
+
+ },
+
+ /**
+ * 监控输入框
+ */
+ bindSearchChange: function (e) {
+ this.setData({
+ searchKey: e.detail.value
+ });
+ },
+
+ /**
+ * 搜索
+ */
+ searchByKey: function () {
+ page = 1;
+ this.setData({
+ order: [],
+ no_order: 0,
+ page: 1
+ });
+ this.data.queryData.memberNickName = this.data.searchKey;
+ this.getData();
+ },
+
+ /**
+ * 取消
+ */
+ cancel: function () {
+ page = 1;
+ this.setData({
+ searchKey: "",
+ order: []
+ });
+ this.data.queryData.memberNickName = null;
+ this.getData();
+ },
+
+ /**
+ * 获取更多
+ */
+ getMore: function () {
+ if (this.data.no_order == 1) return false;
+ this.data.page += 1;
+ this.getData();
+ this.setData({
+ isHideLoadMore: false
+ })
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/member.json b/eaterplanet_ecommerce/distributionCenter/pages/member.json
new file mode 100644
index 0000000..d3fd5c1
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/member.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "component-img": "../../components/image/index",
+ "component-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/member.wxml b/eaterplanet_ecommerce/distributionCenter/pages/member.wxml
new file mode 100644
index 0000000..4d5aa8e
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/member.wxml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.username}}
+ {{levelName[item.child_level]}}
+
+
+
+ {{item.create_time}}
+
+
+
+
+
+
+ 暂无粉丝
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/member.wxss b/eaterplanet_ecommerce/distributionCenter/pages/member.wxss
new file mode 100644
index 0000000..e687f6c
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/member.wxss
@@ -0,0 +1,151 @@
+.search {
+ background: #fff;
+ padding: 20rpx 30rpx;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ position: relative;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+}
+
+.search .icon-search {
+ position: absolute;
+ left: 54rpx;
+}
+
+.search input {
+ flex: 1;
+ padding-left: 68rpx;
+ /* width: 520rpx; */
+ height: 56rpx;
+ background: #f8f8f8;
+ border-radius: 28rpx;
+ color: #999;
+ box-sizing: border-box;
+ line-height: 40rpx;
+}
+
+.search text {
+ color: #4facfe;
+ margin-left: 28rpx;
+}
+
+.date {
+ padding: 0 30rpx;
+ background: #fff;
+ height: 90rpx;
+ line-height: 90rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+ color: #9b9b9b;
+}
+
+.date .date-value {
+ margin-left: 12rpx;
+ color: #4facfe;
+}
+
+.date .icon-date {
+ height: 36rpx;
+ width: 36rpx;
+ float: right;
+ margin: 6rpx 0 0 0;
+}
+
+.date .icon-date image {
+ height: 36rpx;
+ width: 36rpx;
+}
+
+.date .icon-clear {
+ height: 32rpx;
+ float: right;
+ color: #4facfe;
+ margin: 0 28rpx 0 0;
+ font-size: 24rpx;
+}
+
+.list-content {
+ width: 100%;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+}
+
+.list-header, .list-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0 30rpx;
+}
+
+.list-header {
+ height: 84rpx;
+}
+
+.list-item {
+ background: #fff;
+ height: 116rpx;
+ margin-bottom: 2rpx;
+}
+
+.list-item .item-left {
+ display: flex;
+ align-items: center;
+}
+
+.list-item .item-left text {
+ margin-left: 12rpx;
+ font-size: 28rpx;
+ width: 400rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.list-item .item-left .phone {
+ margin-left: 12rpx;
+ display: flex;
+ align-items: center;
+}
+
+.list-item .item-left .icon-phone {
+ width: 28rpx;
+ height: 32rpx;
+ margin-left: 10rpx;
+}
+
+.list-item .item-right {
+ height: 100%;
+ display: flex;
+ align-items: center;
+ text-align: right;
+}
+
+.list-item .item-right .text {
+ font-size: 26rpx;
+ margin-right: 18rpx;
+}
+
+.list-item .item-right .rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+}
+
+.list-item .level {
+ margin-left: 5px;
+ color: #999;
+}
+
+.navigator-hover {
+ background-color: rgba(0, 0, 0, 0);
+}
+
+.none-member {
+ text-align: center;
+ background: #fff;
+ height: 116rpx;
+ line-height: 116rpx;
+}
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.js b/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.js
new file mode 100644
index 0000000..4b3676a
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.js
@@ -0,0 +1,125 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+ member_id: 0,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this;
+ let member_id = options.memberId || 0;
+ if (!member_id) {
+ wx.showToast({
+ title: '参数错误',
+ icon: 'none'
+ })
+ setTimeout(()=>{
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/member',
+ })
+ }, 1000)
+ return;
+ }
+ this.member_id = member_id;
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ wx.showModal({
+ title: '提示',
+ content: '您还未登录',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ } else {
+ that.getData();
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ that.getData();
+ })
+ },
+
+ getData: function(){
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'distribution.get_parent_agent_info_bymemberid',
+ token: token,
+ member_id: that.member_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ console.log(res.data.data)
+ that.setData({
+ info: res.data.data
+ })
+ }else{
+ wx.showModal({
+ title: '提示',
+ content: res.data.msg,
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.json b/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.json
new file mode 100644
index 0000000..5c8a929
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "个人信息",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.wxml b/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.wxml
new file mode 100644
index 0000000..cfa167e
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.wxml
@@ -0,0 +1,23 @@
+
+
+
+
+ 上级姓名
+ {{info.parent_username}}
+
+
+ 上级电话
+ {{info.parent_telephone}}
+
+
+ 推荐人姓名
+ {{info.share_username}}
+
+
+ 推荐人电话
+ {{info.share_telephone}}
+
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.wxss b/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.wxss
new file mode 100644
index 0000000..a76ecd6
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/memberInfo.wxss
@@ -0,0 +1,39 @@
+.wrap {
+ padding: 30rpx;
+ background-color: #fff;
+}
+
+.cell {
+ position: relative;
+ margin-bottom: 30rpx;
+ padding-bottom: 10rpx;
+}
+
+.cell::after {
+ content: '';
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ transform: scaleY(.5);
+ border-bottom: 1px solid #c8c7cc;
+}
+
+.cell-title {
+ color: #000;
+ margin-bottom: 20rpx;
+ font-weight: bold;
+ font-size: 24rpx;
+}
+
+.cell .img {
+ width: 120rpx;
+ height: 120rpx;
+ border-radius: 5px;
+}
+
+.cell-content {
+ font-size: 34rpx;
+ color: #666;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/recruit.js b/eaterplanet_ecommerce/distributionCenter/pages/recruit.js
new file mode 100644
index 0000000..502e590
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/recruit.js
@@ -0,0 +1,261 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ attached: function() {
+ var e = wx.getSystemInfoSync().model;
+ (-1 < e.indexOf("iPhone X") || -1 < e.indexOf("unknown= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ status.setNavBgColor();
+ status.setGroupInfo().then((groupInfo) => {
+ let commiss_diy_name = groupInfo && groupInfo.commiss_diy_name || '分销';
+ wx.setNavigationBarTitle({
+ title: `会员${commiss_diy_name}`,
+ })
+ });
+ this.get_instruct();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ that.setData({
+ needAuth: false
+ })
+ that.getData();
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ })
+ },
+
+ get_instruct: function() {
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'distribution.get_instruct'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let article = res.data.content || '';
+ that.setData({article})
+ }
+ }
+ })
+ },
+
+ getData: function() {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.get_user_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let member_info = res.data.data;
+ let { comsiss_flag, comsiss_state } = member_info;
+ let {
+ commiss_level,
+ commiss_sharemember_need,
+ commiss_biaodan_need,
+ commiss_share_member_update,
+ share_member_count,
+ commiss_become_condition
+ } = res.data;
+
+ let commiss_diy_name = res.data.commiss_diy_name || '分销';
+ wx.setNavigationBarTitle({
+ title: `会员${commiss_diy_name}`,
+ })
+
+ let params = {};
+ let formStatus = 0; //未填写 1 已填写未审核 2 已审核
+ let need_num_update = 0; //还差多少人升级
+ //开启分销
+ if (commiss_level > 0) {
+ //分销会员状态
+ let comsissStatus = 0; // 1已成为分销会员 2需要分享未达人数 3需要分享已达人数 4需要表单 5等待审核 6不需要审核
+ let canApply = false; //可申请
+ if (comsiss_flag == 1 && comsiss_state == 1){
+ comsissStatus = 1;
+ } else {
+ //需要分享
+ if (commiss_sharemember_need==1){
+ need_num_update = commiss_share_member_update * 1 - share_member_count * 1;
+ comsissStatus = 2;
+ if (need_num_update <= 0) {
+ comsissStatus = 3;
+ canApply = true;
+ }
+ } else {
+ canApply = true;
+ }
+ }
+
+ params = {
+ formStatus,
+ need_num_update,
+ comsissStatus,
+ canApply
+ };
+ }
+
+ that.setData({
+ ...params,
+ commiss_diy_name: res.data.commiss_diy_name || '分销'
+ });
+ } else {
+ //is_login
+ that.setData({
+ needAuth: true
+ })
+ wx.setStorage({
+ key: "member_id",
+ data: null
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ let that = this;
+ this.setData({
+ needAuth: false
+ },()=>{
+ that.get_instruct();
+ that.getData();
+ })
+ },
+
+ subCommis: function() {
+ if (!this.authModal()) return;
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'distribution.sub_commission_info',
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ if (res.data.msg == "申请成功,平台将尽快审核"){
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/apply',
+ })
+ } else {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/me',
+ })
+ }
+ } else {
+ if (res.data.msg=="请先登录"){
+ that.setData({ needAuth: true })
+ return;
+ }
+ if (res.data.msg == "您未填写表单!") {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/apply',
+ })
+ return;
+ }
+ wx.showToast({
+ title: res.data.msg ? res.data.msg:'申请失败,请重试!',
+ icon: 'none'
+ })
+ }
+ }
+ })
+ },
+
+ goNext: function (e) {
+ if (!this.authModal()) return;
+ let status = 0;
+ let member_info = this.data.member_info || {};
+ let comsiss_flag = member_info.comsiss_flag || 0;
+ let comsiss_state = member_info.comsiss_state || 0;
+ if (comsiss_flag == 1) {
+ comsiss_state == 0 ? status = 1 : status = 2;
+ }
+ let type = e.currentTarget.dataset.type;
+ if (type == 'share') {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/share',
+ })
+ } else if (type == 'commiss') {
+ if (this.data.comsissStatus == 1) {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/me',
+ })
+ } else if (status == 2) {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/me',
+ })
+ } else {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/recruit',
+ })
+ }
+ } else if (type == 'form') {
+ if (status == 2) {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/me',
+ })
+ } else {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/distributionCenter/pages/apply',
+ })
+ }
+ }
+ }
+
+})
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/recruit.json b/eaterplanet_ecommerce/distributionCenter/pages/recruit.json
new file mode 100644
index 0000000..64b61c6
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/recruit.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "会员分销",
+ "navigationBarTextStyle": "white",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/recruit.wxml b/eaterplanet_ecommerce/distributionCenter/pages/recruit.wxml
new file mode 100644
index 0000000..579baa6
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/recruit.wxml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+ 再分享{{need_num_update}}位新粉丝可升级为{{commiss_diy_name}}
+
+
+ 立即分享>
+
+
+
+ 进入{{commiss_diy_name}}
+
+
+ 点击申请
+
+ 点击申请
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/recruit.wxss b/eaterplanet_ecommerce/distributionCenter/pages/recruit.wxss
new file mode 100644
index 0000000..be819a1
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/recruit.wxss
@@ -0,0 +1,48 @@
+.section {
+ background: #fff;
+ margin-bottom: 20rpx;
+ padding: 0 10rpx 150rpx;
+}
+
+.wxParse-img {
+ width: 100%;
+ vertical-align: top;
+}
+
+.wxParse-inline {
+ padding: 8rpx 0;
+}
+
+.fixed-bottom {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+
+.apply-btn {
+ height: 96rpx;
+ background: #4facfe;
+ color: #fff;
+ font-size: 30rpx;
+ line-height: 96rpx;
+ text-align: center;
+ display: block;
+}
+
+.apply-btn.disabled {
+ background: #ccc;
+}
+
+.tip {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 15rpx 20rpx;
+ background: #fff;
+ box-shadow: 0 -2px 3px -1px #ccc;
+}
+
+.tip .btn,.tot {
+ color: #4facfe;
+}
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/share.js b/eaterplanet_ecommerce/distributionCenter/pages/share.js
new file mode 100644
index 0000000..db67f2f
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/share.js
@@ -0,0 +1,225 @@
+var util = require('../../utils/util.js');
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ poster: '',
+ imageSize: {
+ imageWidth: "100%",
+ imageHeight: 600
+ },
+ is_share_html: true,
+ member_info: {}
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let that = this;
+ wx.setNavigationBarTitle({
+ title: '我的二维码'
+ })
+ util.check_login_new().then((res) => {
+ if (!res) {
+ wx.showModal({
+ title: '提示',
+ content: '您还未登录',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ } else {
+ that.getMemberInfo();
+ that.getData();
+ }
+ })
+ },
+
+ onLoad: function(e) {
+ var t = this;
+ util.check_login_new().then(function(e) {
+ e ? (t.getMemberInfo(), t.getData()) : wx.showModal({
+ title: "提示",
+ content: "您还未登录",
+ showCancel: !1,
+ success: function(e) {
+ e.confirm && wx.switchTab({
+ url: "/eaterplanet_ecommerce/pages/user/me"
+ });
+ }
+ });
+ });
+ },
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ that.getMemberInfo();
+ that.getData();
+ })
+ },
+
+ /**
+ * 图片信息
+ */
+ imageLoad: function (e) {
+ var imageSize = util.imageUtil(e)
+ this.setData({
+ imageSize
+ })
+ },
+
+ getMemberInfo: function () {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'user.get_user_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let member_info = res.data.data;
+ //开启分销
+ if (res.data.commiss_level > 0) {
+ //还差多少人升级
+ let commiss_share_member_update = res.data.commiss_share_member_update * 1;
+ let share_member_count = res.data.share_member_count * 1;
+ let need_num_update = res.data.commiss_share_member_update * 1 - res.data.share_member_count * 1;
+ let commiss_diy_name = res.data.commiss_diy_name || '分销';
+ // wx.setNavigationBarTitle({
+ // title: '会员' + commiss_diy_name,
+ // })
+
+ that.setData({
+ member_info,
+ commiss_level: res.data.commiss_level,
+ commiss_sharemember_need: res.data.commiss_sharemember_need,
+ commiss_share_member_update,
+ share_member_count,
+ need_num_update,
+ commiss_diy_name
+ });
+ } else {
+ wx.showModal({
+ title: '提示',
+ content: '未开启分销',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ } else {
+ //is_login
+ that.setData({
+ is_login: false
+ })
+ wx.setStorage({
+ key: "member_id",
+ data: null
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ getData: function(){
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'distribution.get_haibao',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ that.setData({ poster: res.data.commiss_qrcode })
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ }
+ })
+ },
+
+ toggleShare: function(){
+ let is_share_html = this.data.is_share_html;
+ this.setData({ is_share_html: !is_share_html })
+ },
+
+ prevImg: function(e){
+ let image_path = e.currentTarget.dataset.src;
+ wx.previewImage({
+ current: image_path, // 当前显示图片的http链接
+ urls: [image_path] // 需要预览的图片http链接列表
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ this.setData({ is_share_html: true })
+ var community = wx.getStorageSync('community');
+ var community_id = community.communityId;
+ var member_id = wx.getStorageSync('member_id');
+ console.log(community_id, member_id);
+ return {
+ title: '',
+ path: "eaterplanet_ecommerce/pages/index/index?community_id=" + community_id + '&share_id=' + member_id,
+ imageUrl: '',
+ success: function () { },
+ fail: function () { }
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/share.json b/eaterplanet_ecommerce/distributionCenter/pages/share.json
new file mode 100644
index 0000000..06c2522
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/share.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "",
+ "navigationBarTextStyle": "white",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-fixed-bottom": "../../components/fixed-bottom/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/share.wxml b/eaterplanet_ecommerce/distributionCenter/pages/share.wxml
new file mode 100644
index 0000000..3306ca7
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/share.wxml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 分享
+
+
+
+
+
+
+
+
+ 海报
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/distributionCenter/pages/share.wxss b/eaterplanet_ecommerce/distributionCenter/pages/share.wxss
new file mode 100644
index 0000000..b66eaf8
--- /dev/null
+++ b/eaterplanet_ecommerce/distributionCenter/pages/share.wxss
@@ -0,0 +1,178 @@
+.wrap {
+ padding-bottom: 250rpx;
+}
+
+.swipe {
+ width: 100%;
+}
+
+.swiper-content {
+ height: auto;
+}
+
+.banner-img {
+ width: 100%;
+}
+
+.share-foot {
+ padding: 20rpx 30rpx;
+ text-align: center;
+ box-shadow: 0 0 5rpx rgba(0, 0, 0, .3);
+}
+
+.share-tip {
+ font-size: 32rpx;
+ color: #000;
+ font-weight: bold;
+ margin-bottom: 20rpx;
+}
+
+.tot {
+ color: #4facfe;
+}
+
+.foot-btn button {
+ background-color: #4facfe;
+}
+
+button.primary-btn {
+ background-color: #00f2fe;
+ color: #fff;
+ margin-left: 40rpx;
+}
+
+/*分享begin*/
+
+.ui-mask {
+ position: fixed;
+ display: block;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 999;
+ background: rgba(0, 0, 0, 0.6);
+}
+
+.model-services {
+ width: 100%;
+ position: fixed;
+ background-color: #fff;
+ bottom: 0;
+ z-index: 1000;
+ color: #333;
+ -webkit-transition: all 0.3s;
+ transition: all 0.3s;
+ -webkit-transform: translate(0, 100%);
+ transform: translate(0, 100%);
+}
+
+.model-services.show {
+ -webkit-transform: translate(0);
+ transform: translate(0);
+}
+
+.model-services .model-services-title {
+ font-size: 36rpx;
+ text-align: center;
+ height: 80rpx;
+ line-height: 80rpx;
+ border-bottom: 1px solid #f2f5f8;
+}
+
+.model-services .model-services-content {
+ padding: 40rpx;
+}
+
+.model-services .model-services-content .service-item {
+ margin-bottom: 20rpx;
+ width: 50%;
+ float: left;
+ text-align: center;
+}
+
+.model-services .model-services-content .service-icon {
+ font-size: 80rpx;
+ color: #4facfe;
+}
+
+.service-name {
+ padding-left: 10rpx;
+}
+
+.cube-text {
+ position: relative;
+ width: 100%;
+ height: 32rpx;
+ line-height: 32rpx;
+ color: #777;
+ margin-top: 5rpx;
+ font-size: 24rpx;
+}
+
+.none_btn {
+ border: none;
+ line-height: 1.1;
+ padding: 0px;
+}
+
+button[plain] {
+ border: none;
+}
+
+.share-modal {
+ position: fixed;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.6);
+ z-index: 101;
+ transition: all 400ms ease-in;
+}
+
+.share-modal-content {
+ position: relative;
+ width: 70%;
+ top: 50%;
+ left: 15%;
+ transform: translateY(-50%);
+ z-index: 110;
+}
+
+.share-modal-img {
+ width: 100%;
+ height: 956rpx;
+ background: #f7f7f7;
+}
+
+.share-modal-img image {
+ width: 100%;
+}
+
+.share-modal-btn-list {
+ display: flex;
+ margin-top: 30rpx;
+}
+
+.share-modal-btn-item {
+ text-align: center;
+ flex: 1;
+}
+
+.share-modal .btn-icon {
+ width: 70rpx;
+ margin: 0 auto;
+}
+
+.share-modal .btn-text {
+ position: relative;
+ width: 100%;
+ height: 32rpx;
+ line-height: 32rpx;
+ color: #fff;
+ margin-top: 5rpx;
+ font-size: 24rpx;
+}
+
+/*分享end*/
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/cartModal.js b/eaterplanet_ecommerce/moduleA/components/cartModal.js
new file mode 100644
index 0000000..005738b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/cartModal.js
@@ -0,0 +1,165 @@
+var app = getApp();
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ show: {
+ type: Boolean,
+ value: false
+ },
+ carts: {
+ type: Object || Array,
+ value: {}
+ },
+ soliId: {
+ type: Number,
+ value: 0
+ },
+ stitle: {
+ type: String,
+ value: '已选商品'
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ token: '',
+ community: ''
+ },
+
+ attached: function(){
+ var token = wx.getStorageSync('token');
+ var community = wx.getStorageSync('community');
+ this.setData({
+ token,
+ community
+ })
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ changeNumber: function(e){
+ let that = this;
+ let cartId = e.currentTarget.dataset.cartid; //购物车商家索引
+ let gidx = e.currentTarget.dataset.gidx; //商品索引
+ let num = e.detail.value; //改变后数量
+ if (num==0) {
+ this.cofirm_del(cartId, gidx);
+ } else {
+ let carts = that.data.carts;
+ let lastGoodsNum = carts[cartId].shopcarts[gidx].goodsnum; //记录上次数量
+ carts[cartId].shopcarts[gidx].goodsnum = num;
+ this.setData({ carts },()=>{
+ that.go_record().then(() => {
+ that.triggerEvent('changeCart', carts);
+ }).catch(() => {
+ carts[cartId].shopcarts[gidx].goodsnum = lastGoodsNum;
+ that.setData({ carts })
+ });
+ })
+ }
+ },
+ handleModal: function(){
+ console.log('关闭购物车弹窗')
+ this.triggerEvent('hideModal');
+ },
+ /**
+ * 确认删除提示框
+ */
+ cofirm_del: function (parentid, index) {
+ let that = this;
+ wx.showModal({
+ title: '提示',
+ content: '确定删除这件商品吗?',
+ confirmColor: '#FF0000',
+ success: function (res) {
+ if (res.confirm) {
+ let carts = that.data.carts;
+ let goodsItem = carts[parentid].shopcarts[index];
+ let del_car_keys = goodsItem.key;
+ carts[parentid].shopcarts.splice(index, 1);
+ that.setData({ carts })
+ that.del_car_goods(del_car_keys);
+ } else {
+ console.log('取消删除')
+ }
+ }
+ })
+ },
+
+ /**
+ * 删除商品
+ */
+ del_car_goods: function (carkey) {
+ var that = this;
+ console.log('del_car_goods:开始');
+ let { token, community } = this.data;
+ let community_id = community.communityId;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'car.del_car_goods',
+ carkey,
+ community_id,
+ token
+ },
+ method: 'POST',
+ dataType: 'json',
+ success: function (msg) {
+ if (msg.data.code == 0) {
+ that.triggerEvent('changeCart', that.data.carts);
+ }
+ }
+ })
+ },
+
+ //记录购物车状态值,为了下次进来还是和上次一样
+ go_record: function () {
+ var that = this;
+ return new Promise(function (resolve, reject) {
+ let { carts, token, community, soliId } = that.data;
+ var keys_arr = [];
+ var all_keys_arr = [];
+ let community_id = community.communityId;
+ for (var i in carts) {
+ for (var j in carts[i]['shopcarts']) {
+ keys_arr.push(carts[i]['shopcarts'][j]['key']);
+ all_keys_arr.push(carts[i]['shopcarts'][j]['key'] + '_' + carts[i]['shopcarts'][j]['goodsnum']);
+ }
+ }
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'car.checkout_flushall',
+ token,
+ car_key: keys_arr,
+ community_id,
+ all_keys_arr,
+ buy_type: 'soitaire',
+ soli_id: soliId
+ },
+ method: 'POST',
+ dataType: 'json',
+ success: function (msg) {
+ if (msg.data.code == 0) {
+ resolve();
+ } else {
+ wx.showToast({
+ title: msg.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ reject();
+ }
+ }
+ })
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/components/cartModal.json b/eaterplanet_ecommerce/moduleA/components/cartModal.json
new file mode 100644
index 0000000..c218cf8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/cartModal.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-input-number": "../../components/input-number/index",
+ "i-modal": "../../components/modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/cartModal.wxml b/eaterplanet_ecommerce/moduleA/components/cartModal.wxml
new file mode 100644
index 0000000..41d5fec
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/cartModal.wxml
@@ -0,0 +1,31 @@
+
+
+
+ {{stitle}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+ {{item.goodstype}}
+ ¥{{item.currntprice}}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/cartModal.wxss b/eaterplanet_ecommerce/moduleA/components/cartModal.wxss
new file mode 100644
index 0000000..16deb54
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/cartModal.wxss
@@ -0,0 +1,18 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+
+.cart .list .item {
+ position: relative;
+ padding: 30rpx 30rpx 30rpx 0;
+ margin-left: 30rpx;
+ align-items: center;
+}
+
+.cart .list .item .img {
+ width: 120rpx;
+ height: 120rpx;
+}
+
+.zmodal {
+ z-index: 799!important;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/img-box/img-box.js b/eaterplanet_ecommerce/moduleA/components/img-box/img-box.js
new file mode 100644
index 0000000..900ebd1
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/img-box/img-box.js
@@ -0,0 +1,60 @@
+var app = getApp();
+
+Component({
+ properties: {
+ item: {
+ type: Object
+ }
+ },
+ methods: {
+ agree: function() {
+ let that = this;
+ let item = this.data.item;
+ let token = wx.getStorageSync('token');
+
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'recipe.fav_recipe_do',
+ token: token,
+ id: item.id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if(res.data.code == 0) {
+ //成功
+ wx.showToast({
+ title: '已喜欢~',
+ icon: 'none'
+ })
+ item.fav_count = res.data.fav_count;
+ item.has_fav = 1;
+ that.setData({ item })
+ } else if (res.data.code == 1) {
+ //未登录
+ that.triggerEvent('needAuth');
+ } else if (res.data.code == 2) {
+ //取消收藏
+ item.fav_count = res.data.fav_count;
+ item.has_fav = 0;
+ that.setData({ item })
+ wx.showToast({
+ title: '取消喜欢~',
+ icon: 'none'
+ })
+ }
+ }
+ })
+ },
+ goDetails: function(e){
+ let id = e.currentTarget.dataset.id || '';
+ let url = `/eaterplanet_ecommerce/moduleA/menu/details?id=${id}`
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ id && wx.redirectTo({ url })
+ } else {
+ id && wx.navigateTo({ url })
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/components/img-box/img-box.json b/eaterplanet_ecommerce/moduleA/components/img-box/img-box.json
new file mode 100644
index 0000000..7a23245
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/img-box/img-box.json
@@ -0,0 +1,4 @@
+{
+ "component": true
+}
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/img-box/img-box.wxml b/eaterplanet_ecommerce/moduleA/components/img-box/img-box.wxml
new file mode 100644
index 0000000..9a72683
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/img-box/img-box.wxml
@@ -0,0 +1,14 @@
+
+
+
+
+ {{item.recipe_name}}
+
+
+ {{item.username}}
+
+ {{item.fav_count}}
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/img-box/img-box.wxss b/eaterplanet_ecommerce/moduleA/components/img-box/img-box.wxss
new file mode 100644
index 0000000..abddae8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/img-box/img-box.wxss
@@ -0,0 +1,75 @@
+@import "../../../../icon.wxss";
+
+.img-box {
+ position: relative;
+ width: 100%;
+ margin-bottom: 20rpx;
+ background: #fff;
+ border-radius: 10rpx;
+ overflow: hidden;
+ box-shadow: 0 0 3px #ccc;
+}
+
+.img-box .img {
+ display: block;
+ width: 100%;
+ border-radius: 10rpx 10rpx 0 0;
+ overflow: hidden;
+}
+
+.img-box .play {
+ position: absolute;
+ font-size: 42rpx;
+ right: 10rpx;
+ top: 10rpx;
+ color: rgba(0, 0, 0, .6);
+ z-index: 10;
+}
+
+.img-box .title {
+ font-size: 28rpx;
+ font-weight: bold;
+ line-height: 1.4;
+ margin-bottom: 15rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ word-break: break-all;
+}
+
+.img-box .cont {
+ padding: 20rpx;
+}
+
+.img-box .user {
+ display: flex;
+ align-items: center;
+ color: #666;
+ font-size: 22rpx;
+}
+
+.img-box .user .avatar {
+ width: 40rpx;
+ height: 40rpx;
+ border-radius: 50%;
+ margin-right: 10rpx;
+}
+
+.img-box .user .nickname {
+ max-width: 130rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.img-box .user .iconfont {
+ margin-right: 5rpx;
+ color: rgb(186, 194, 202);
+ font-size: 34rpx;
+ transition: all 200ms ease-in;
+}
+
+.img-box .user .iconfont.active {
+ color: #ff758c;
+}
diff --git a/eaterplanet_ecommerce/moduleA/components/masonry/masonry.js b/eaterplanet_ecommerce/moduleA/components/masonry/masonry.js
new file mode 100644
index 0000000..db0b90d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/masonry/masonry.js
@@ -0,0 +1,165 @@
+/**
+ * 瀑布流组件
+ */
+Component({
+ properties: {
+ intervalWidth: {
+ type: String,
+ value: "20rpx"
+ }
+ },
+ data: {
+ items: [],
+ stopMasonry: false
+ },
+ methods: {
+ /**
+ * 批量添加元素
+ *
+ * @param {Array} items - 新增的元素数组
+ */
+ append(items) {
+ if (Object.prototype.toString.call(items) !=='[object Array]') {
+ console.error("[masonry]参数类型错误,渲染失败");
+ return false;
+ }
+
+ this.setData({
+ stopMasonry: false
+ })
+
+ return this._refresh(items);
+ },
+
+ /**
+ * 批量删除瀑布流中的元素
+ *
+ * @param {Number} start - 开始下标
+ * @param {Number} end - 结束下标
+ */
+ delete(start, end) {
+ const { items } = this.data;
+ if (start < end && start < items.length - 1) {
+ let len = end- start;
+ let newItems = items.splice(start, len);
+ this._refresh(newItems)
+ } else {
+ console.error("[masonry]初始下标异常,删除失败!");
+ }
+ },
+
+ /**
+ * 更新数组中的某个元素
+ *
+ * @param {Object} newItem - 修改后的元素
+ * @param {Number} index - 需要更新的数组下标
+ */
+ updateItem(newItem, index) {
+ const { items } = this.data;
+ if (index <= items.length - 1) {
+ this.setData({
+ items: [
+ ...items.slice(0, index),
+ Object.assign(items[index], newItem),
+ ...items.slice(index + 1)
+ ]
+ })
+ } else {
+ console.error("[masonry]下标越界,修改失败!");
+ }
+ },
+
+ /**
+ * 删除瀑布流中的某个元素
+ *
+ * @param {Number} index - 数组下标
+ */
+ deleteItem(index) {
+ const { items } = this.data;
+ if (index <= items.length - 1) {
+ let newItems = items.splice(index, 1);
+ this._refresh(newItems)
+ } else {
+ console.error("[masonry]下标越界,删除失败!");
+ }
+ },
+
+ /**
+ * 刷新瀑布流
+ *
+ * @param {Array} items - 参与渲染的元素数组
+ */
+ start(items) {
+ if (Object.prototype.toString.call(items) !=='[object Array]') {
+ console.error("[masonry]参数类型错误,渲染失败");
+ return false;
+ }
+
+ this.setData({
+ items: [],
+ stopMasonry: false
+ })
+
+ return this._refresh(items);
+ },
+
+ /**
+ * 停止渲染瀑布流
+ */
+ stop() {
+ this.setData({
+ stopMasonry: true,
+ items: []
+ })
+ },
+
+ /**
+ * 刷新瀑布流
+ *
+ * @param {Array} items - 参与渲染的元素数组
+ */
+ _refresh(items) {
+ const query = wx.createSelectorQuery().in(this)
+ this.columnNodes = query.selectAll('#left-col-inner, #right-col-inner')
+
+ return new Promise((resolve, reject) => {
+ this._render(items, 0, () => {
+ resolve()
+ })
+ })
+ },
+
+ /**
+ * 渲染函数
+ *
+ * @param {Array} items - 正在渲染的数组
+ * @param {Number} i - 当前渲染元素的下标
+ * @param {Function} onComplete - 完成后的回调函数
+ */
+ _render (items, i, onComplete) {
+ if (items.length > i && !this.data.stopMasonry) {
+ this.columnNodes.boundingClientRect().exec(arr => {
+ const item = items[i]
+ const rects = arr[0]
+ const leftColHeight = rects[0].height
+ const rightColHeight = rects[1].height
+
+ this.setData({
+ items: [...this.data.items, {
+ ...item,
+ columnPosition: leftColHeight <= rightColHeight ? 'left' : 'right'
+ }]
+ }, () => {
+ this._render(items, ++i, onComplete)
+ })
+ })
+ } else {
+ onComplete && onComplete()
+ }
+ },
+
+ needAuth: function () {
+ this.triggerEvent('needAuth');
+ }
+ }
+});
diff --git a/eaterplanet_ecommerce/moduleA/components/masonry/masonry.json b/eaterplanet_ecommerce/moduleA/components/masonry/masonry.json
new file mode 100644
index 0000000..d0edcae
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/masonry/masonry.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "componentGenerics": {
+ "masonry-item": true
+ }
+}
diff --git a/eaterplanet_ecommerce/moduleA/components/masonry/masonry.wxml b/eaterplanet_ecommerce/moduleA/components/masonry/masonry.wxml
new file mode 100644
index 0000000..d04cb71
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/masonry/masonry.wxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/components/masonry/masonry.wxss b/eaterplanet_ecommerce/moduleA/components/masonry/masonry.wxss
new file mode 100644
index 0000000..34537a9
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/masonry/masonry.wxss
@@ -0,0 +1,13 @@
+.masonry-list {
+ width: 100%;
+ display: flex;
+ box-sizing: border-box;
+ padding: 20rpx;
+}
+
+.masonry-list-left, .masonry-list-right {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ width: 0;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.js b/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.js
new file mode 100644
index 0000000..23cf626
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.js
@@ -0,0 +1,220 @@
+var t = require("../../utils/public");
+var app = getApp();
+var status = require('../../utils/index.js');
+var util = require('../../utils/util.js');
+
+Component({
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ spuId: "",
+ skuId: "",
+ spuImage: "",
+ spuName: "",
+ endTime: 0,
+ beginTime: "",
+ actPrice: ["", ""],
+ marketPrice: ["", ""],
+ spuCanBuyNum: "",
+ soldNum: "",
+ actId: "",
+ limitMemberNum: "",
+ limitOrderNum: "",
+ serverTime: "",
+ isLimit: false,
+ skuList: [],
+ spuDescribe: "",
+ is_take_fullreduction: 0,
+ bigImg: '',
+ car_count: 0
+ }
+ },
+ isPast: {
+ type: Boolean,
+ value: false
+ },
+ actEnd: {
+ type: Boolean,
+ value: false
+ },
+ reduction: {
+ type: Object,
+ value: {
+ full_money: '',
+ full_reducemoney: '',
+ is_open_fullreduction: 0
+ }
+ },
+ isShowListCount: {
+ type: Number,
+ value: 0
+ },
+ changeCarCount: {
+ type: Boolean,
+ value: false,
+ observer: function (t) {
+ if (t) this.setData({ number: this.data.spuItem.car_count || 0 });
+ }
+ },
+ needAuth: {
+ type: Boolean,
+ value: false
+ },
+ is_open_vipcard_buy: {
+ type: Number,
+ value: 0
+ }
+ },
+ attached() {
+ this.setData({ placeholdeImg: app.globalData.placeholdeImg })
+ },
+ data: {
+ disabled: false,
+ placeholdeImg: '',
+ number: 0
+ },
+ ready: function () {
+ this.setData({
+ number: this.data.spuItem.car_count || 0
+ });
+ },
+ methods: {
+ openSku: function () {
+ if (this.data.needAuth) {
+ this.triggerEvent("authModal", true);
+ return;
+ }
+ this.setData({
+ stopClick: true,
+ disabled: false
+ })
+ if (this.data.spuItem.skuList.length === void 0) {
+ this.triggerEvent("openSku", {
+ actId: this.data.spuItem.actId,
+ skuList: this.data.spuItem.skuList,
+ promotionDTO: this.data.spuItem.promotionDTO,
+ allData: {
+ spuName: this.data.spuItem.spuName,
+ skuImage: this.data.spuItem.skuImage,
+ actPrice: this.data.spuItem.actPrice,
+ canBuyNum: this.data.spuItem.spuCanBuyNum,
+ stock: this.data.spuItem.spuCanBuyNum,
+ marketPrice: this.data.spuItem.marketPrice
+ }
+ });
+ } else {
+ this.addCart({ value: 1, type: "plus" });
+ }
+ },
+ countDownEnd: function () {
+ this.setData({
+ actEnd: true
+ });
+ },
+ submit2: function (e) {
+ (0, t.collectFormIds)(e.detail.formId);
+ },
+ changeNumber: function (t) {
+ var e = t.detail;
+ e && this.addCart(e);
+ },
+ outOfMax: function (t) {
+ var e = t.detail, canBuyNum = this.data.spuItem.spuCanBuyNum;
+ if (this.data.number >= canBuyNum) {
+ wx.showToast({
+ title: "不能购买更多啦",
+ icon: "none"
+ })
+ }
+ },
+ addCart: function (t) {
+ // {value: 2, type: "plus/minus"}
+ var token = wx.getStorageSync('token');
+ var community = wx.getStorageSync('community');
+ var goods_id = this.data.spuItem.actId;
+ var community_id = community.communityId;
+ let that = this;
+ if (t.type == 'plus') {
+ let data = {
+ goods_id,
+ community_id,
+ quantity: 1,
+ sku_str: '',
+ buy_type: 'dan',
+ pin_id: 0,
+ is_just_addcar: 1
+ }
+ util.addCart(data).then(res=>{
+ if(res.showVipModal==1) {
+ let { pop_vipmember_buyimage } = res.data;
+ that.triggerEvent("vipModal", { pop_vipmember_buyimage, showVipModal: true, visible: false });
+ } else {
+ if (res.data.code == 3) {
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({ number: max_quantity })
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 4) {
+ that.setData({ needAuth: true })
+ that.triggerEvent("authModal", true);
+ } else if (res.data.code == 6 || res.data.code == 7) {
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({ number: max_quantity })
+ var msg = res.data.msg;
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ that.triggerEvent("changeCartNum", res.data.total);
+ that.setData({ number: res.data.cur_count })
+ wx.showToast({
+ title: "已加入购物车",
+ image: "../../images/addShopCart.png"
+ })
+ status.indexListCarCount(goods_id, res.data.cur_count);
+ }
+ }
+ })
+ } else {
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'car.reduce_car_goods',
+ token: token,
+ goods_id: goods_id,
+ community_id: community_id,
+ quantity: 1,
+ sku_str: '',
+ buy_type: 'dan',
+ pin_id: 0,
+ is_just_addcar: 1
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function (res) {
+ if (res.data.code == 3) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 4) {
+ that.setData({ needAuth: true })
+ that.triggerEvent("authModal", true);
+ } else {
+ that.triggerEvent("changeCartNum", res.data.total);
+ that.setData({ number: res.data.cur_count })
+ status.indexListCarCount(goods_id, res.data.cur_count);
+ }
+ }
+ })
+ }
+ }
+ }
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.json b/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.json
new file mode 100644
index 0000000..d16f037
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.json
@@ -0,0 +1,11 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../../components/button/index",
+ "i-img": "../../components/img/index",
+ "i-router-link": "../../components/router-link/router-link",
+ "i-input-number": "../../components/input-number/index",
+ "i-vip-price": "../../components/vipPrice/vipPrice",
+ "i-addcart": "../../components/addCartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.wxml b/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.wxml
new file mode 100644
index 0000000..820f414
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.wxml
@@ -0,0 +1,44 @@
+
+
diff --git a/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.wxss b/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.wxss
new file mode 100644
index 0000000..616c6e7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/menuGoodsItem.wxss
@@ -0,0 +1,147 @@
+.spu {
+ position: relative;
+ width: 580rpx;
+ box-sizing: border-box;
+ display: block;
+ border: .1rpx solid #eee;
+ border-radius: 10rpx;
+ margin-left: 20rpx;
+ padding: 20rpx 10rpx;
+}
+
+.spu .spu-content {
+ display: flex;
+}
+
+.spu .img-class {
+ width: 160rpx;
+ height: 160rpx;
+ border-radius: 10rpx;
+ image-rendering: crisp-edges;
+ margin-right: 20rpx;
+ overflow: hidden;
+}
+
+.spu-title {
+ font-size: 30rpx;
+ font-weight: bold;
+ color: #333;
+}
+
+.spu-desc {
+ font-size: 26rpx;
+ color: #666;
+}
+
+.item-bottom {
+ flex: 1;
+ width: 0;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.spu .spu-content .item-bottom .spu-price {
+ font-family: DIN;
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ overflow: hidden;
+ margin-bottom: 10rpx;
+ margin-top: 10rpx;
+}
+
+.spu .spu-content .item-bottom .spu-price .sale-price {
+ color: #ff758c;
+ margin-right: 12rpx;
+}
+
+.spu .spu-content .item-bottom .spu-price .sale-price .span {
+ font-size: 46rpx;
+ line-height: 42rpx;
+ margin: 0;
+ font-weight: bold;
+}
+
+.spu .spu-content .item-bottom .spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+ margin-right: 20rpx;
+}
+
+.spu .spu-content .add-cart {
+ width: 68rpx;
+ height: 68rpx;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ right: 20rpx;
+ bottom: 20rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.spu .spu-content .add-cart .img {
+ width: 54rpx;
+ height: 54rpx;
+ display: block;
+}
+
+.spu .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 30rpx;
+ top: 60rpx;
+ padding: 0 12rpx;
+}
+
+.spu-play {
+ position: absolute;
+ left: 55rpx;
+ top: 50%;
+ width: 60rpx;
+ height: 60rpx;
+ margin-top: -30rpx;
+}
+
+.spu-play .img {
+ width: 100%;
+ height: 100%;
+}
+
+.col-input-number {
+ position: absolute;
+ right: 20rpx;
+ bottom: 20rpx;
+}
+
+.col-input-number .input-number-view {
+ width: 40rpx !important;
+ height: 40rpx !important;
+}
+
+.col-input-number .input-number-img{
+ width: 40rpx !important;
+ height: 40rpx !important;
+}
+
+.col-input-number .input-number-input {
+ height: 40rpx !important;
+ width: 60rpx !important;
+ font-size: 26rpx;
+ line-height: 40rpx !important;
+}
+
+.text-overflow1 {
+ overflow: hidden;
+ text-overflow:ellipsis;
+ white-space: nowrap;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/pinGoods.js b/eaterplanet_ecommerce/moduleA/components/pinGoods.js
new file mode 100644
index 0000000..43d0fa6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/pinGoods.js
@@ -0,0 +1,63 @@
+let app = getApp();
+Component({
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ actId: "",
+ skuId: "",
+ spuImage: "",
+ spuName: "",
+ endTime: 0,
+ beginTime: "",
+ actPrice: ["", ""],
+ marketPrice: ["", ""],
+ spuCanBuyNum: "",
+ soldNum: "",
+ actId: "",
+ limitMemberNum: "",
+ limitOrderNum: "",
+ serverTime: "",
+ isLimit: false,
+ skuList: [],
+ spuDescribe: "",
+ is_take_fullreduction: 0,
+ bigImg: '',
+ car_count: 0
+ }
+ },
+ isPast: {
+ type: Boolean,
+ value: false
+ },
+ actEnd: {
+ type: Boolean,
+ value: false
+ },
+ reduction: {
+ type: Object,
+ value: {
+ full_money: '',
+ full_reducemoney: '',
+ is_open_fullreduction: 0
+ }
+ },
+ skin: Object,
+ goods_sale_unit: String
+ },
+ attached() {
+ this.setData({ placeholdeImg: app.globalData.placeholdeImg })
+ },
+ data: {
+ disabled: false,
+ placeholdeImg: ''
+ },
+ methods: {
+ goLink: function () {
+ let id = this.data.spuItem.actId;
+ id && wx.navigateTo({
+ url: `/eaterplanet_ecommerce/moduleA/pin/goodsDetail?&id=${id}`,
+ })
+ }
+ }
+});
diff --git a/eaterplanet_ecommerce/moduleA/components/pinGoods.json b/eaterplanet_ecommerce/moduleA/components/pinGoods.json
new file mode 100644
index 0000000..0d19635
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/pinGoods.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../../components/button/index",
+ "i-img": "../../components/img/index",
+ "i-router-link": "../../components/router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/pinGoods.wxml b/eaterplanet_ecommerce/moduleA/components/pinGoods.wxml
new file mode 100644
index 0000000..131c3c2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/pinGoods.wxml
@@ -0,0 +1,41 @@
+
+
+
+
+ {{spuItem.label_info.tagcontent}}
+
+
+
+
+ 满{{reduction.full_money}}减{{reduction.full_reducemoney}}
+ 限购
+
+
+
+
+
+ {{spuItem.spuName}}
+
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+ ¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}
+
+
+ {{spuItem.pin_count}}人团 已拼{{spuItem.soldNum}}{{goods_sale_unit}}
+
+
+
+
+ 已抢光
+
+
+ 已结束
+
+ 去开团
+
+
+ 已抢光
+ 已结束
+
diff --git a/eaterplanet_ecommerce/moduleA/components/pinGoods.wxss b/eaterplanet_ecommerce/moduleA/components/pinGoods.wxss
new file mode 100644
index 0000000..6e38fc2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/pinGoods.wxss
@@ -0,0 +1,174 @@
+.spu-content {
+ width: 350rpx;
+ height: 506rpx;
+ border-radius: 20rpx;
+ background: #fff;
+ box-sizing: border-box;
+ padding: 30rpx 25rpx;
+ box-shadow: 0 0 40rpx rgba(0, 0, 0, 0.05);
+ position: relative;
+ margin-bottom: 10rpx;
+}
+
+.spu-img {
+ width: 300rpx;
+ height: 300rpx;
+ border-radius: 10rpx;
+}
+
+.spu-content .spu-title {
+ font-size: 28rpx;
+ line-height: 36rpx;
+ height: 36rpx;
+ color: #444;
+ margin-bottom: 16rpx;
+ font-weight: 500;
+ position: relative;
+ margin-top: 16rpx;
+}
+
+.spu-content .spu-title .span {
+ display: block;
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu-content .spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 20rpx;
+}
+
+.spu-content .spu-price .sale-price {
+ color: #ff758c;
+ margin-right: 8rpx;
+}
+
+.spu-content .spu-price .sale-price .span {
+ font-size: 40rpx;
+ line-height: 40rpx;
+ margin-left: 4rpx;
+ font-weight: 500;
+}
+
+.spu-content .spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+}
+
+.spu-content .spu-count {
+ display: flex;
+ align-items: flex-end;
+ font-size: 20rpx;
+ color: #999;
+ margin-top: 10rpx;
+}
+
+.spu-content .add-cart,.spu .spu-content .add-cart-disabled {
+ width: 100rpx;
+ height: 50rpx;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ right: 20rpx;
+ bottom: 25rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: linear-gradient(100deg,#4facfe 0%,#00f2fe 100%);
+ color: #fff;
+ border-radius: 25rpx;
+ font-size: 26rpx;
+ font-weight: bold;
+}
+
+.spu-content .add-cart-disabled {
+ background: #ccc;
+}
+
+.spu-content .pin-tag {
+ display: inline-block;
+ font-size: 20rpx;
+ padding: 4rpx 6rpx;
+ margin-right: 10rpx;
+ border: 0.1rpx solid #4facfe;
+ line-height: 1;
+ vertical-align: middle;
+ color: #ff5344;
+ border-radius: 4rpx;
+}
+
+.spu-play {
+ position: absolute;
+ left: 50%;
+ top: 95rpx;
+ width: 100rpx;
+ height: 100rpx;
+ margin-left: -50rpx;
+}
+
+.spu-play .img {
+ width: 100%;
+ height: 100%;
+}
+
+.mask {
+ background: rgba(255, 255, 255, 0.5);
+ width: 300rpx;
+ height: 240rpx;
+ position: absolute;
+ left: 25rpx;
+ top: 30rpx;
+}
+
+.act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 120rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+/* 标签 */
+.spu-content .item-tag {
+ position: absolute;
+ left: -1rpx;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.spu-content .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.spu-content .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.js b/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.js
new file mode 100644
index 0000000..5101118
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.js
@@ -0,0 +1,55 @@
+// eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.js
+Component({
+ externalClasses: ["i-class", "i-class-identity"],
+ properties: {
+ isOrder: {
+ type: Boolean,
+ value: false
+ },
+ goodsInfo: {
+ type: Object,
+ value: {
+ danprice: "0.00",
+ goods_images: "",
+ name: "",
+ pin_count: "2",
+ pinprice: "0.00",
+ productprice: "0.00",
+ seller_count: 0,
+ subtitle: "",
+ me_is_head: 1
+ },
+ observer: function (m) {
+ let price = 0;
+ price = ((m && m.price) && (m.price*1).toFixed(2)) || 0;
+ this.setData({ price })
+ }
+ },
+ me_is_head: {
+ type: Boolean,
+ value: false
+ },
+ skin: {
+ type: Object
+ }
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ goDetail: function(){
+ let { isOrder, goodsInfo } = this.data;
+ let goods_id = goodsInfo.goods_id || '';
+ if (goods_id && !isOrder) {
+ var pages_all = getCurrentPages();
+ var url = `/eaterplanet_ecommerce/moduleA/pin/goodsDetail?id=${goods_id}`;
+ if (pages_all.length > 3) {
+ wx.redirectTo({ url })
+ } else {
+ wx.navigateTo({ url })
+ }
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.json b/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.json
new file mode 100644
index 0000000..d8200c2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../../components/img/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.wxml b/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.wxml
new file mode 100644
index 0000000..b109bd7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.wxml
@@ -0,0 +1,15 @@
+
+
+ 我是{{(goodsInfo.me_is_head==1||me_is_head)?'团长':'团员'}}
+
+ {{goodsInfo.name}}
+
+ ¥{{price}} x{{goodsInfo.quantity}} {{goodsInfo.need_count||goodsInfo.pin_count}}人拼团
+ ¥{{goodsInfo.orign_price}}
+
+
+ {{goodsInfo.pin_count}}人拼团
+ ¥{{goodsInfo.pinprice}} ¥{{goodsInfo.danprice}}
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.wxss b/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.wxss
new file mode 100644
index 0000000..8611aa8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/pinGoodsInfo.wxss
@@ -0,0 +1,79 @@
+.goodsBox {
+ position: relative;
+ display: flex;
+ align-items: center;
+ padding: 30rpx;
+ margin-bottom: 10rpx;
+ background-color: #fff;
+}
+
+.goodsImg {
+ width: 185rpx;
+ height: 185rpx;
+ border-radius: 5px;
+ margin-right: 20rpx;
+}
+
+.goodsInfo {
+ flex: 1;
+}
+
+.goodsInfo .title {
+ color: #333;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ margin-bottom: 20rpx;
+}
+
+.goodsInfo .price {
+ font-size: 24rpx;
+ color: #ff5344;
+ font-weight: bold;
+ margin-top: 20rpx;
+}
+
+.goodsInfo .price .big {
+ font-size: 32rpx;
+ margin-left: 2px;
+}
+
+.goodsInfo .tag,
+.identity {
+ color: #fff;
+ font-weight: normal;
+ background-color: #ff5344;
+ padding: 2rpx 15rpx 2rpx 10rpx;
+ border-radius: 0 20rpx 20rpx 0;
+ line-height: 1;
+ font-size: 20rpx;
+}
+
+.goodsInfo .marked-price {
+ font-size: 24rpx;
+ color: #999;
+ margin-top: 10rpx;
+ text-decoration: line-through;
+ font-weight: normal;
+ margin-left: 6rpx;
+}
+
+.goodsInfo .price .num {
+ font-weight: normal;
+ color: #999;
+}
+
+.goodsInfo .price .tag {
+ margin-left: 20rpx;
+}
+
+.identity {
+ position: absolute;
+ left: 30rpx;
+ top: 50rpx;
+ padding: 4rpx 10rpx 4rpx 8rpx;
+ width: 45rpx;
+ line-height: 1.1;
+ border-radius: 0 40rpx 40rpx 0;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/rushBig.js b/eaterplanet_ecommerce/moduleA/components/rushBig.js
new file mode 100644
index 0000000..955ebc4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/rushBig.js
@@ -0,0 +1,65 @@
+var app = getApp();
+Component({
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ actId: "",
+ skuId: "",
+ spuImage: "",
+ spuName: "",
+ endTime: 0,
+ beginTime: "",
+ actPrice: ["", ""],
+ marketPrice: ["", ""],
+ spuCanBuyNum: "",
+ soldNum: "",
+ actId: "",
+ limitMemberNum: "",
+ limitOrderNum: "",
+ serverTime: "",
+ isLimit: false,
+ skuList: [],
+ spuDescribe: "",
+ is_take_fullreduction: 0,
+ bigImg: '',
+ car_count: 0
+ }
+ },
+ isPast: {
+ type: Boolean,
+ value: false
+ },
+ actEnd: {
+ type: Boolean,
+ value: false
+ },
+ reduction: {
+ type: Object,
+ value: {
+ full_money: '',
+ full_reducemoney: '',
+ is_open_fullreduction: 0
+ }
+ },
+ skin: {
+ type: Object
+ },
+ goods_sale_unit: String
+ },
+ attached() {
+ this.setData({ placeholdeImg: app.globalData.placeholdeImg })
+ },
+ data: {
+ disabled: false,
+ placeholdeImg: ''
+ },
+ methods: {
+ goLink: function() {
+ let id = this.data.spuItem.actId;
+ id && wx.navigateTo({
+ url: `/eaterplanet_ecommerce/moduleA/pin/goodsDetail?&id=${id}`,
+ })
+ }
+ }
+});
diff --git a/eaterplanet_ecommerce/moduleA/components/rushBig.json b/eaterplanet_ecommerce/moduleA/components/rushBig.json
new file mode 100644
index 0000000..0d19635
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/rushBig.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../../components/button/index",
+ "i-img": "../../components/img/index",
+ "i-router-link": "../../components/router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/rushBig.wxml b/eaterplanet_ecommerce/moduleA/components/rushBig.wxml
new file mode 100644
index 0000000..5442f9f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/rushBig.wxml
@@ -0,0 +1,45 @@
+
+
+
+
+ {{spuItem.label_info.tagcontent}}
+
+
+
+
+ 满{{reduction.full_money}}减{{reduction.full_reducemoney}}
+ 限购
+
+
+
+
+
+
+ {{spuItem.spuName}}
+
+
+ {{spuItem.spuDescribe}}
+
+
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+ ¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}
+ {{spuItem.pin_count}}人团
+
+ 已拼{{spuItem.soldNum}}{{goods_sale_unit}}
+
+
+
+ 去开团
+
+
+ 去开团
+
+ 去开团
+
+
+ 已抢光
+ 已结束
+
diff --git a/eaterplanet_ecommerce/moduleA/components/rushBig.wxss b/eaterplanet_ecommerce/moduleA/components/rushBig.wxss
new file mode 100644
index 0000000..a37de5e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/rushBig.wxss
@@ -0,0 +1,275 @@
+.img-class {
+ width: 710rpx;
+ height: 400rpx;
+ border-radius: 10rpx 10rpx 0 0;
+ image-rendering: crisp-edges;
+}
+
+.mask {
+ background: rgba(255, 255, 255, 0.5);
+ width: 710rpx;
+ height: 400rpx;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+
+.act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 170rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.spu-content {
+ background: #fff;
+ width: 710rpx;
+ border-radius: 20rpx;
+ overflow: hidden;
+ position: relative;
+ box-shadow: 0 0 40rpx rgba(0, 0, 0, 0.05);
+ margin: 20rpx auto 20rpx;
+ display: flex;
+ flex-direction: column;
+ box-sizing: border-box;
+}
+
+.spu-content.disabled {
+ opacity: 0.6;
+}
+
+.spu-content .item-top {
+ width: 100%;
+ height: 400rpx;
+ position: relative;
+}
+
+.spu-content .item-bottom {
+ box-sizing: border-box;
+ padding: 20rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.spu-content .item-bottom .spu-title {
+ color: #222;
+ font-size: 30rpx;
+ height: 32rpx;
+ width: 100%;
+ margin-bottom: 12rpx;
+ margin-top: 10rpx;
+ font-weight: 500;
+ position: relative;
+}
+
+.spu-content .item-bottom .spu-title .span {
+ width: 100%;
+ height: 40rpx;
+ position: absolute;
+ left: 0;
+ top: -4rpx;
+ line-height: 40rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu-content .item-bottom .spu-tag {
+ padding-left: 196rpx;
+ margin-bottom: 20rpx;
+ display: flex;
+ height: 28rpx;
+}
+
+.spu-content .item-bottom .spu-desc {
+ font-size: 26rpx;
+ line-height: 26rpx;
+ color: #999;
+ position: relative;
+ width: 100%;
+ height: 26rpx;
+ margin-bottom: 12rpx;
+}
+
+.spu-content .item-bottom .spu-desc .em {
+ width: 100%;
+ height: 32rpx;
+ position: absolute;
+ left: 0;
+ top: -2rpx;
+ line-height: 32rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu-content .item-bottom .spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ overflow: hidden;
+ margin-bottom: 10rpx;
+ margin-top: 10rpx;
+}
+
+.spu-content .item-bottom .spu-price .sale-price {
+ color: #ff758c;
+ margin-right: 12rpx;
+}
+
+.spu-content .item-bottom .spu-price .sale-price .span {
+ font-size: 46rpx;
+ line-height: 42rpx;
+ margin: 0;
+ font-weight: bold;
+}
+
+.spu-content .item-bottom .spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+ margin-right: 20rpx;
+}
+
+.spu-content .item-bottom .spu-count {
+ font-size: 24rpx;
+ line-height: 24rpx;
+ color: #999;
+}
+
+.spu-content .add-cart,.spu-content .add-cart-disabled {
+ width: 160rpx;
+ height: 60rpx;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ right: 28rpx;
+ bottom: 20rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #4facfe;
+ color: #fff;
+ border-radius: 30rpx;
+}
+
+.spu-content .add-cart-disabled {
+ background: #ccc;
+}
+
+.spu-content .item-top .spu-active {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ z-index: 9;
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: flex-start;
+}
+
+.spu-content .item-top .spu-active .tag {
+ background: linear-gradient(to right,#4facfe, #00f2fe);
+ border-radius: 0 25rpx 25rpx 0;
+ padding: 0 15rpx;
+ height: 50rpx;
+ font-size: 26rpx;
+ line-height: 50rpx;
+ color: #fff;
+ display: inline-block;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ max-width: 220rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu-content .item-top .spu-active .tag-green {
+ background: linear-gradient(to left,#4facfe, #00f2fe);
+}
+
+.spu-content .spu-content .time-tip {
+ position: absolute;
+ background: #4facfe;
+ left: 0;
+ bottom: 0;
+ width: 250rpx;
+ height: 40rpx;
+ border-radius: 0 8rpx 0 0;
+}
+
+.spu-content .spu-content .time-tip.notip {
+ display: none;
+}
+
+/* 标签 */
+.spu-content .item-tag {
+ position: absolute;
+ left: 22rpx;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.spu-content .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.spu-content .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.spu-play {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ width: 160rpx;
+ height: 160rpx;
+ margin-top: -80rpx;
+ margin-left: -80rpx;
+}
+
+.spu-play .img {
+ width: 100%;
+ height: 100%;
+}
+
+.pin-tag {
+ display: inline-block;
+ font-size: 22rpx;
+ padding: 4rpx 6rpx;
+ margin-right: 10rpx;
+ border: 0.1rpx solid #ff758c;
+ line-height: 1;
+ vertical-align: middle;
+ color: #ff758c;
+ border-radius: 4rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/rushNormal.js b/eaterplanet_ecommerce/moduleA/components/rushNormal.js
new file mode 100644
index 0000000..0beab95
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/rushNormal.js
@@ -0,0 +1,65 @@
+var app = getApp();
+Component({
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ actId: "",
+ skuId: "",
+ spuImage: "",
+ spuName: "",
+ endTime: 0,
+ beginTime: "",
+ actPrice: ["", ""],
+ marketPrice: ["", ""],
+ spuCanBuyNum: "",
+ soldNum: "",
+ actId: "",
+ limitMemberNum: "",
+ limitOrderNum: "",
+ serverTime: "",
+ isLimit: false,
+ skuList: [],
+ spuDescribe: "",
+ is_take_fullreduction: 0,
+ bigImg: '',
+ car_count: 0
+ }
+ },
+ isPast: {
+ type: Boolean,
+ value: false
+ },
+ actEnd: {
+ type: Boolean,
+ value: false
+ },
+ reduction: {
+ type: Object,
+ value: {
+ full_money: '',
+ full_reducemoney: '',
+ is_open_fullreduction: 0
+ }
+ },
+ skin: {
+ type: Object
+ },
+ goods_sale_unit: String
+ },
+ attached() {
+ this.setData({ placeholdeImg: app.globalData.placeholdeImg })
+ },
+ data: {
+ disabled: false,
+ placeholdeImg: ''
+ },
+ methods: {
+ goLink: function () {
+ let id = this.data.spuItem.actId;
+ id && wx.navigateTo({
+ url: `/eaterplanet_ecommerce/moduleA/pin/goodsDetail?&id=${id}`,
+ })
+ }
+ }
+});
diff --git a/eaterplanet_ecommerce/moduleA/components/rushNormal.json b/eaterplanet_ecommerce/moduleA/components/rushNormal.json
new file mode 100644
index 0000000..0d19635
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/rushNormal.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../../components/button/index",
+ "i-img": "../../components/img/index",
+ "i-router-link": "../../components/router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/rushNormal.wxml b/eaterplanet_ecommerce/moduleA/components/rushNormal.wxml
new file mode 100644
index 0000000..25fbb7a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/rushNormal.wxml
@@ -0,0 +1,45 @@
+
+
+
+
+ {{spuItem.label_info.tagcontent}}
+
+
+
+
+ 满{{reduction.full_money}}减{{reduction.full_reducemoney}}
+ 限购
+
+
+
+
+
+
+ {{spuItem.spuName}}
+
+
+ {{spuItem.spuDescribe}}
+
+
+ ¥{{spuItem.danPrice}}
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+ {{spuItem.pin_count}}人团
+
+ 已拼{{spuItem.soldNum}}{{goods_sale_unit}}
+
+
+
+ 已抢光
+
+
+ 已结束
+
+ 去开团
+
+
+ 已抢光
+ 已结束
+
diff --git a/eaterplanet_ecommerce/moduleA/components/rushNormal.wxss b/eaterplanet_ecommerce/moduleA/components/rushNormal.wxss
new file mode 100644
index 0000000..b697b84
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/rushNormal.wxss
@@ -0,0 +1,272 @@
+.img-class {
+ width: 200rpx;
+ height: 200rpx;
+ border-radius: 10rpx 10rpx 0 0;
+ image-rendering: crisp-edges;
+}
+
+.mask {
+ background: rgba(255, 255, 255, 0.5);
+ width: 200rpx;
+ height: 200rpx;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+
+.act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 170rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.spu-content {
+ width: 690rpx;
+ overflow: hidden;
+ position: relative;
+ margin: 0 auto;
+ display: flex;
+ box-sizing: border-box;
+ padding: 30rpx 0;
+ border-bottom: 0.1rpx solid #e5e5e5;
+}
+
+.spu-content.disabled {
+ opacity: 0.6;
+}
+
+.spu-content .item-top {
+ position: relative;
+}
+
+.spu-content .item-bottom {
+ flex: 1;
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ margin-left: 20rpx;
+}
+
+.spu-content .item-bottom .spu-title {
+ color: #222;
+ font-size: 30rpx;
+ height: 32rpx;
+ width: 100%;
+ margin-bottom: 12rpx;
+ margin-top: 10rpx;
+ font-weight: 500;
+ position: relative;
+}
+
+.spu-content .item-bottom .spu-title .span {
+ width: 100%;
+ height: 40rpx;
+ position: absolute;
+ left: 0;
+ top: -4rpx;
+ line-height: 40rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu-content .item-bottom .spu-tag {
+ padding-left: 196rpx;
+ margin-bottom: 20rpx;
+ display: flex;
+ height: 28rpx;
+}
+
+.spu-content .item-bottom .spu-desc {
+ font-size: 26rpx;
+ line-height: 26rpx;
+ color: #999;
+ position: relative;
+ width: 100%;
+ height: 26rpx;
+ margin-bottom: 12rpx;
+}
+
+.spu-content .item-bottom .spu-desc .em {
+ width: 100%;
+ height: 32rpx;
+ position: absolute;
+ left: 0;
+ top: -2rpx;
+ line-height: 32rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu-content .item-bottom .spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ overflow: hidden;
+ margin-bottom: 10rpx;
+ margin-top: 10rpx;
+}
+
+.spu-content .item-bottom .spu-price .sale-price {
+ color: #ff758c;
+ margin-right: 12rpx;
+}
+
+.spu-content .item-bottom .spu-price .sale-price .span {
+ font-size: 36rpx;
+ line-height: 36rpx;
+ margin: 0;
+ font-weight: bold;
+}
+
+.spu-content .item-bottom .market-price {
+ text-decoration: line-through;
+ color: #999;
+ font-size: 22rpx;
+}
+
+.spu-content .item-bottom .spu-count {
+ font-size: 24rpx;
+ line-height: 22rpx;
+ color: #999;
+}
+
+.spu-content .add-cart,.spu .spu-content .add-cart-disabled {
+ width: 160rpx;
+ height: 60rpx;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ right: 0;
+ bottom: 30rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #4facfe;
+ color: #fff;
+ border-radius: 30rpx;
+}
+
+.spu-content .add-cart-disabled {
+ background: #ccc;
+}
+
+.spu-content .item-top .spu-active {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ z-index: 9;
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: flex-start;
+}
+
+.spu-content .item-top .spu-active .tag {
+ background: linear-gradient(to right,#4facfe 0%,#00f2fe);
+ border-radius: 0 25rpx 25rpx 0;
+ padding: 0 15rpx;
+ height: 50rpx;
+ font-size: 26rpx;
+ line-height: 50rpx;
+ color: #fff;
+ display: inline-block;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ max-width: 220rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu-content .item-top .spu-active .tag-green {
+ background: linear-gradient(to left,#4facfe 0%,#00f2fe);
+}
+
+.spu-content .spu-content .time-tip {
+ position: absolute;
+ background: #4facfe;
+ left: 0;
+ bottom: 0;
+ width: 250rpx;
+ height: 40rpx;
+ border-radius: 0 8rpx 0 0;
+}
+
+.spu-content .spu-content .time-tip.notip {
+ display: none;
+}
+
+/* 标签 */
+.spu-content .item-tag {
+ position: absolute;
+ left: 22rpx;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.spu-content .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.spu-content .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.spu-play {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ width: 160rpx;
+ height: 160rpx;
+ margin-top: -80rpx;
+ margin-left: -80rpx;
+}
+
+.spu-play .img {
+ width: 100%;
+ height: 100%;
+}
+
+.pin-tag {
+ display: inline-block;
+ font-size: 22rpx;
+ padding: 4rpx 6rpx;
+ margin-right: 10rpx;
+ border: 0.1rpx solid #4facfe;
+ line-height: 1;
+ vertical-align: middle;
+ color: #4facfe;
+ border-radius: 4rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.js b/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.js
new file mode 100644
index 0000000..7c7c4dd
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.js
@@ -0,0 +1,92 @@
+var util = require('../../../utils/util.js');
+
+Component({
+ externalClasses: ["i-class"],
+ properties: {
+ item: {
+ type: Object,
+ value: {}
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ disabled: false
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ openSku: function () {
+ this.setData({ disabled: false })
+ let spuItem = this.data.item;
+ if (spuItem.skuList.length === void 0) {
+ this.triggerEvent("openSku", {
+ actId: spuItem.actId,
+ skuList: spuItem.skuList,
+ promotionDTO: spuItem.promotionDTO || '',
+ allData: {
+ spuName: spuItem.spuName,
+ skuImage: spuItem.skuImage,
+ actPrice: spuItem.actPrice,
+ canBuyNum: spuItem.spuCanBuyNum,
+ stock: spuItem.spuCanBuyNum,
+ marketPrice: spuItem.marketPrice
+ }
+ })
+ } else {
+ this.addCart({ value: 1, type: "plus" });
+ }
+ },
+ addCart: function (t) {
+ wx.showLoading();
+ var community = wx.getStorageSync('community');
+ let spuItem = this.data.item;
+ var goods_id = spuItem.actId;
+ var community_id = community.communityId;
+ if (t.type == 'plus') {
+ let data = {
+ goods_id,
+ community_id,
+ quantity: 1,
+ sku_str: '',
+ buy_type: 'dan',
+ pin_id: 0,
+ is_just_addcar: 1,
+ buy_type: 'integral'
+ }
+ util.addCart(data).then(res=>{
+ wx.hideLoading();
+ if(res.showVipModal==1) {
+ let { pop_vipmember_buyimage } = res.data;
+ that.triggerEvent("vipModal", { pop_vipmember_buyimage, showVipModal: true, visible: false });
+ } else {
+ if (res.data.code == 3 || res.data.code == 7) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 6) {
+ // 积分不足
+ var msg = res.data.msg;
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ //跳转结算页面
+ wx.navigateTo({
+ url: `/eaterplanet_ecommerce/pages/order/placeOrder?type=integral`,
+ })
+ }
+ }
+ })
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.json b/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.json
new file mode 100644
index 0000000..6b71cd5
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../../../components/img/index",
+ "i-button": "../../../components/button/index",
+ "i-router-link": "../../../components/router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.wxml b/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.wxml
new file mode 100644
index 0000000..0356fb3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.wxml
@@ -0,0 +1,15 @@
+
+
+
+ 已抢光
+ {{item.spuName}}
+
+ {{item.actPrice[0]}}积分
+
+ 已抢光
+
+
+ 立即兑换
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.wxss b/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.wxss
new file mode 100644
index 0000000..515c596
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/score-guess-like/index.wxss
@@ -0,0 +1,93 @@
+.like {
+ margin-bottom: 100rpx;
+}
+
+.like-title {
+ font-size: 30rpx;
+ text-align: center;
+ font-weight: bold;
+ color: #666;
+ margin-bottom: 20rpx;
+}
+
+.like-list {
+ position: relative;
+ padding: 20rpx;
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ z-index: 0;
+}
+
+.new-comers-item {
+ background-color: #fff;
+ width: 345rpx;
+ box-sizing: border-box;
+ padding: 30rpx;
+ border-radius: 10px;
+ font-size: 28rpx;
+ margin-bottom: 20rpx;
+}
+
+.new-comers-item .new-img {
+ width: 285rpx;
+ height: 285rpx;
+ margin-bottom: 20rpx;
+}
+
+.new-comers-item .title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.new-comers-item .new-bot {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 10rpx;
+}
+
+.new-comers-item .add-cart {
+ width: 140rpx;
+ height: 44rpx;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ right: 20rpx;
+ bottom: 30rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #ff5344;
+ color: #fff;
+ border-radius: 30rpx;
+ font-size: 24rpx;
+}
+
+.new-comers-item .add-cart.disabled {
+ background: #ccc;
+}
+
+.new-comers-item .price {
+ color: #ff758c;
+}
+
+.new-comers-item {
+ position: relative;
+}
+
+.new-comers-item .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 120rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
diff --git a/eaterplanet_ecommerce/moduleA/components/solitaireGood.js b/eaterplanet_ecommerce/moduleA/components/solitaireGood.js
new file mode 100644
index 0000000..d8529ab
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/solitaireGood.js
@@ -0,0 +1,228 @@
+var app = getApp();
+var status = require('../../utils/index.js');
+var util = require('../../utils/util.js');
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ skuList: []
+ },
+ observer: function (t) {
+ let skuList = t.skuList || [];
+ let specs = 0;
+ if (Object.prototype.toString.call(skuList) === '[object Array]') {
+ if (skuList.length) specs = 1;
+ } else {
+ if (Object.keys(skuList).length) specs = 1;
+ }
+ this.setData({ specs, number: t.goods_total_count || 0 })
+ }
+ },
+ idx: {
+ type: Number,
+ value: -1
+ },
+ type: {
+ type: Number,
+ value: 0
+ },
+ hasIpt: {
+ type: Boolean,
+ value: true
+ },
+ state: {
+ type: Boolean,
+ value: false
+ },
+ needAuth: {
+ type: Boolean,
+ value: false
+ },
+ soliId: {
+ type: Number,
+ value: 0
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ number: 0,
+ placeholdeImg: app.globalData.placeholdeImg,
+ specs: 0 // 0单规格 1多规格
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ handleSelect: function(){
+ this.triggerEvent("onSelect", this.data.spuItem);
+ },
+ handleDelete: function(){
+ this.triggerEvent("onSelect", this.data.idx);
+ },
+ showTip: function(){
+ let that = this;
+ wx.showToast({
+ title: '多规格商品只能去购物车删除',
+ icon: 'none',
+ complete: () => {
+ that.triggerEvent("showCart");
+ }
+ })
+ },
+ openSku: function () {
+ if (this.data.needAuth) {
+ this.triggerEvent("authModal", true);
+ return;
+ }
+ this.setData({
+ stopClick: true,
+ disabled: false
+ })
+ if (this.data.spuItem.skuList.length === void 0) {
+ console.log('多规格')
+ this.triggerEvent("openSku", {
+ actId: this.data.spuItem.actId,
+ skuList: this.data.spuItem.skuList,
+ promotionDTO: this.data.spuItem.promotionDTO,
+ is_take_vipcard: this.data.spuItem.is_take_vipcard,
+ is_mb_level_buy: this.data.spuItem.is_mb_level_buy,
+ allData: {
+ spuName: this.data.spuItem.spuName,
+ skuImage: this.data.spuItem.skuImage,
+ actPrice: this.data.spuItem.actPrice,
+ canBuyNum: this.data.spuItem.spuCanBuyNum,
+ stock: this.data.spuItem.spuCanBuyNum,
+ marketPrice: this.data.spuItem.marketPrice
+ }
+ });
+ } else {
+ this.addCart({ value: 1, type: "plus" });
+ }
+ },
+ changeNumber: function (t) {
+ var e = t.detail;
+ e && this.addCart(e);
+ },
+ outOfMax: function (t) {
+ var e = t.detail, canBuyNum = this.data.spuItem.spuCanBuyNum;
+ if (this.data.number >= canBuyNum) {
+ wx.showToast({
+ title: "不能购买更多啦",
+ icon: "none"
+ })
+ }
+ },
+ addCart: function (t) {
+ // {value: 2, type: "plus/minus"}
+ let token = wx.getStorageSync('token');
+ let community = wx.getStorageSync('community');
+ let goods_id = this.data.spuItem.actId;
+ let soli_id = this.data.soliId;
+ let community_id = community.communityId;
+ let that = this;
+ if (t.type == 'plus') {
+ let quantity = 1
+ if(t.value==1&&this.data.spuItem.goods_start_count>1) {
+ quantity = this.data.spuItem.goods_start_count;
+ }
+ let data = {
+ goods_id: goods_id,
+ community_id: community_id,
+ quantity,
+ sku_str: '',
+ buy_type: 'soitaire',
+ pin_id: 0,
+ is_just_addcar: 1,
+ soli_id
+ }
+ util.addCart(data).then(res=>{
+ if(res.showVipModal==1) {
+ let { pop_vipmember_buyimage } = res.data;
+ that.triggerEvent("vipModal", { pop_vipmember_buyimage, showVipModal: true, visible: false });
+ } else {
+ if (res.data.code == 3) {
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({ number: that.data.number })
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 4) {
+ that.setData({ needAuth: true })
+ that.triggerEvent("authModal", true);
+ } else if (res.data.code == 6 || res.data.code == 7) {
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({ number: that.data.number })
+ var msg = res.data.msg;
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ let { goods_total_count, total, cur_count } = res.data;
+ that.setData({ number: cur_count })
+ wx.showToast({
+ title: "已加入购物车",
+ image: "../../images/addShopCart.png"
+ })
+ that.triggerEvent("changeCartNum", { goods_total_count, total, goods_id });
+ }
+ }
+ })
+ } else {
+ console.log(t)
+ let quantity = 1
+ if(t.value>=1&&this.data.spuItem.goods_start_count==(t.value+1)) {
+ quantity = this.data.spuItem.goods_start_count;
+ }
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'car.reduce_car_goods',
+ token: token,
+ goods_id: goods_id,
+ community_id: community_id,
+ quantity,
+ sku_str: '',
+ buy_type: 'soitaire',
+ pin_id: 0,
+ is_just_addcar: 1,
+ soli_id
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function (res) {
+ if (res.data.code == 3) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 4) {
+ if (that.data.needAuth) {
+ that.setData({ needAuth: true })
+ that.triggerEvent("authModal", true);
+ return;
+ }
+ } else {
+ let { goods_total_count, total, cur_count } = res.data;
+ that.setData({ number: cur_count })
+ that.triggerEvent("changeCartNum", { goods_total_count, total, goods_id });
+ }
+ }
+ })
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/components/solitaireGood.json b/eaterplanet_ecommerce/moduleA/components/solitaireGood.json
new file mode 100644
index 0000000..4fb5525
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/solitaireGood.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-img": "../../components/img/index",
+ "i-input-number": "../../components/input-number/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/solitaireGood.wxml b/eaterplanet_ecommerce/moduleA/components/solitaireGood.wxml
new file mode 100644
index 0000000..8ccdb8f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/solitaireGood.wxml
@@ -0,0 +1,134 @@
+
+
+
+
+ 已抢光
+ 已结束
+
+
+
+ {{spuItem.spuName}}
+
+
+ {{spuItem.spuDescribe}}
+
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+ ¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}
+
+
+
+ 已售{{spuItem.soldNum}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{number|0}}
+
+
+
+
+
+
+
+
+ 选购
+ 选购
+
+
+
+
+
+
+
+
+
+
+
+
+ {{spuItem.name}}
+
+
+ {{spuItem.option_str}} x{{spuItem.quantity}}
+
+
+
+ ¥{{spuItem.price}}
+
+ ¥{{spuItem.orign_price}}
+
+
+
+ 已售{{spuItem.soldNum}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{number|0}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 已抢光
+ 已结束
+
+
+
+ {{spuItem.goodsname}}
+
+
+ {{spuItem.subtitle}}
+
+
+
+ ¥{{spuItem.price}}
+
+ ¥{{spuItem.productprice}}
+
+
+
+ 选择
+ 删除
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/solitaireGood.wxss b/eaterplanet_ecommerce/moduleA/components/solitaireGood.wxss
new file mode 100644
index 0000000..cfcd321
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/solitaireGood.wxss
@@ -0,0 +1,179 @@
+.spu {
+ display: flex;
+}
+
+.img-class {
+ width: 160rpx;
+ height: 160rpx;
+ border-radius: 10rpx;
+ overflow: hidden;
+}
+
+.item-m {
+ display: flex;
+ flex-direction: column;
+ flex: 2;
+ margin-left: 20rpx;
+ width: 0;
+}
+
+.item-r {
+ display: flex;
+ flex-direction: column;
+ margin-left: 15rpx;
+ align-items: flex-end;
+ justify-content: center;
+}
+
+.spu-title {
+ color: #333;
+ font-size: 30rpx;
+ height: 32rpx;
+ margin-bottom: 12rpx;
+ margin-top: 10rpx;
+ font-weight: bold;
+ position: relative;
+}
+
+.spu-title .span {
+ width: 100%;
+ height: 40rpx;
+ position: absolute;
+ left: 0;
+ top: -4rpx;
+ line-height: 40rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ margin: 0;
+}
+
+.spu-desc {
+ font-size: 26rpx;
+ line-height: 26rpx;
+ color: #999;
+ position: relative;
+ height: 26rpx;
+ margin-bottom: 12rpx;
+}
+
+.spu-desc .em {
+ display: block;
+ width: 100%;
+ height: 32rpx;
+ position: absolute;
+ left: 0;
+ top: -2rpx;
+ line-height: 32rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu-price {
+ font-size: 26rpx;
+ line-height: 26rpx;
+ overflow: hidden;
+ margin-top: auto;
+}
+
+.spu-price .sale-price {
+ color: #ff5344;
+ margin-right: 12rpx;
+}
+
+.spu-price .sale-price .span {
+ font-size: 40rpx;
+ line-height: 42rpx;
+ margin: 0;
+ font-weight: bold;
+}
+
+.spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+ margin-top: 10rpx;
+}
+
+.btn {
+ display: inline-block;
+ color: #fff;
+ border-radius: 8rpx;
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ padding: 8rpx 30rpx;
+ font-size: 24rpx;
+}
+
+.count {
+ width: 100%;
+ font-size: 28rpx;
+ color: #999;
+ text-align: right;
+}
+
+.addBtn .img {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.input-number-text {
+ font-size: 26rpx!important;
+}
+
+.i-flex-center {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.cartNum {
+ position: relative;
+ text-align: center;
+ height: 48rpx;
+ width: 66rpx;
+ font-size: 26rpx;
+ line-height: 48rpx;
+ z-index: 0;
+}
+
+.optBtn {
+ display: inline-block;
+ color: #fff;
+ border-radius: 30rpx;
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ padding: 8rpx 30rpx;
+ font-size: 24rpx;
+ font-weight: bold;
+}
+
+.optBtn.disabled {
+ background: #ccc;
+}
+
+.thumb {
+ position: relative;
+}
+
+.spu .mask {
+ background: rgba(255, 255, 255, 0.5);
+ width: 160rpx;
+ height: 160rpx;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+
+.spu .act-end {
+ position: absolute;
+ height: 50rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 24rpx;
+ text-align: center;
+ line-height: 50rpx;
+ left: 50%;
+ top: 50%;
+ width: 100rpx;
+ transform: translate(-50%, -50%);
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/solitaireHead.js b/eaterplanet_ecommerce/moduleA/components/solitaireHead.js
new file mode 100644
index 0000000..f65e13e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/solitaireHead.js
@@ -0,0 +1,45 @@
+var status = require('../../utils/index.js');
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ community: {
+ type: Object,
+ value: {
+ "head_id": 0,
+ "community_name": "团长",
+ "head_name": "社区",
+ "avatar": ""
+ }
+ },
+ showShare: {
+ type: Boolean,
+ value: false
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ }
+ },
+
+ attached() {
+ let that = this;
+ status.setGroupInfo().then((groupInfo) => {
+ that.setData({ groupInfo })
+ });
+ },
+
+ methods: {
+ shareQuan: function(){
+ this.triggerEvent('share');
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/components/solitaireHead.json b/eaterplanet_ecommerce/moduleA/components/solitaireHead.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/solitaireHead.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/solitaireHead.wxml b/eaterplanet_ecommerce/moduleA/components/solitaireHead.wxml
new file mode 100644
index 0000000..c24869f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/solitaireHead.wxml
@@ -0,0 +1,14 @@
+
+
+
+ {{community.head_name}}
+
+ 绑定{{groupInfo.group_name}}:{{community.community_name}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/components/solitaireHead.wxss b/eaterplanet_ecommerce/moduleA/components/solitaireHead.wxss
new file mode 100644
index 0000000..aa5f7c4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/components/solitaireHead.wxss
@@ -0,0 +1,39 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+
+.headinfo {
+ position: relative;
+ padding: 30rpx;
+}
+
+.headinfo .avatar {
+ width: 100rpx;
+ height: 100rpx;
+ border-radius: 50%;
+ margin-right: 20rpx;
+}
+
+.headinfo .share {
+ position: absolute;
+ top: 30rpx;
+ right: 30rpx;
+}
+
+.headinfo .share .iconfont {
+ font-size: 50rpx;
+ margin-left: 30rpx;
+ color: rgb(233, 169, 68);
+}
+
+.headinfo .share .btn {
+ display: inline-block;
+ line-height: inherit;
+ background: transparent;
+ width: auto;
+ padding: 0;
+ font-size: 0;
+}
+
+.headinfo .share .btn::after {
+ content: none;
+}
diff --git a/eaterplanet_ecommerce/moduleA/coupon/getCoupon.js b/eaterplanet_ecommerce/moduleA/coupon/getCoupon.js
new file mode 100644
index 0000000..3d01356
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/coupon/getCoupon.js
@@ -0,0 +1,99 @@
+var app = getApp();
+var status = require('../../utils/index.js');
+
+Page({
+ data: {
+ list: []
+ },
+ coupon_id: '',
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+ status.setNavBgColor();
+ let coupon_id = options.id || '';
+ this.coupon_id = coupon_id;
+ },
+
+ onShow: function () {
+ this.getData();
+ },
+
+ getData: function () {
+ let coupon_id = this.coupon_id;
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('user.collect_voucher', {
+ token,
+ coupon_id,
+ }).then(res => {
+ let list = res.list;
+ this.setData({ list })
+ })
+ .catch(err => {})
+ },
+
+ receiveCoupon: function (event) {
+ let idx = event.currentTarget.dataset.idx;
+ var token = wx.getStorageSync('token');
+ var list = this.data.list;
+ var that = this;
+
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: { controller: 'goods.getQuan', token, quan_id: list[idx].id },
+ dataType: 'json',
+ success: function (msg) {
+ //1 被抢光了 2 已领过 3 领取成功
+ if (msg.data.code == 0) {
+ wx.showToast({
+ title: msg.data.msg || '被抢光了',
+ icon: 'none'
+ })
+ } else if (msg.data.code == 1) {
+ list[idx].is_nomore = 1;
+ list[idx].is_use = 1;
+ that.setData({ list })
+ wx.showToast({
+ title: '被抢光了',
+ icon: 'none'
+ })
+ } else if (msg.data.code == 2) {
+ wx.showToast({
+ title: '已领取',
+ icon: 'none'
+ })
+ that.getData();
+ }
+ else if (msg.data.code == 4) {
+ wx.showToast({
+ title: '新人专享',
+ icon: 'none'
+ })
+ }
+ else if (msg.data.code == 3) {
+ that.getData();
+ wx.showToast({
+ title: '领取成功',
+ })
+ } else if (msg.data.code == 4) {
+ // 未登录
+ app.util.message('请先登录', '/eaterplanet_ecommerce/pages/user/me', 'error');
+ }
+ }
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/coupon/getCoupon.json b/eaterplanet_ecommerce/moduleA/coupon/getCoupon.json
new file mode 100644
index 0000000..74a7858
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/coupon/getCoupon.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "领券中心",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-empty": "../../components/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/coupon/getCoupon.wxml b/eaterplanet_ecommerce/moduleA/coupon/getCoupon.wxml
new file mode 100644
index 0000000..f08368f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/coupon/getCoupon.wxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+ 暂无记录~
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/coupon/getCoupon.wxss b/eaterplanet_ecommerce/moduleA/coupon/getCoupon.wxss
new file mode 100644
index 0000000..bb734f8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/coupon/getCoupon.wxss
@@ -0,0 +1,150 @@
+
+/* 新优惠券 */
+.list {
+ padding: 10rpx 30rpx 20rpx;
+}
+
+/* 新优惠券 */
+
+.coupon {
+ background-color: #fefefe;
+ position: relative;
+ padding: 0 20rpx;
+ border-radius: 6rpx;
+ margin-top: 24rpx;
+}
+
+.coupon:before, .coupon:after {
+ content: '';
+ position: absolute;
+ width: 20rpx;
+ height: 40rpx;
+ background: #f6f6f6;
+ top: 70rpx;
+ z-index: 1;
+}
+
+.coupon:before {
+ border-radius: 0 40rpx 40rpx 0;
+ left: 0;
+}
+
+.coupon:after {
+ border-radius: 40rpx 0 0 40rpx;
+ right: 0;
+}
+
+.coupon .header {
+ display: flex;
+ padding: 15rpx 0;
+ border-bottom: 2rpx dashed #dbdbdb;
+ height: 140rpx;
+}
+
+.coupon .footer {
+ color: #747474;
+ font-size: 24rpx;
+ padding: 22rpx 0 20rpx 35rpx;
+}
+
+.coupon .price {
+ color: #333;
+ width: 175rpx;
+ text-align: center;
+ border-right: 2rpx dashed #dbdbdb;
+}
+
+.coupon .price .reduce-price {
+ color: #000;
+ font-size: 38rpx;
+ font-weight: bold;
+ padding-top: 30rpx;
+}
+
+.coupon .price .reduce-price text {
+ font-size: 24rpx;
+}
+
+.coupon .price .reduce-desc {
+ font-size: 20rpx;
+ margin-top: 10rpx;
+}
+
+.coupon .info {
+ padding-left: 30rpx;
+ flex: 1;
+}
+
+.coupon .info .reduce-title {
+ color: #000;
+ font-size: 28rpx;
+ font-weight: bold;
+ padding-top: 20rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+
+.coupon .info .reduce-type {
+ color: #fff;
+ font-weight: normal;
+ font-size: 20rpx;
+ background: #4facfe;
+ padding: 2rpx 8rpx;
+ border-radius: 4rpx;
+}
+
+.coupon .status {
+ width: 130rpx;
+ text-align: center;
+}
+
+.coupon .status image {
+ width: 90rpx;
+ height: 90rpx;
+ margin-top: 20rpx;
+}
+
+.coupon.used,
+.coupon.expired {
+ background: #fafafa;
+}
+
+.coupon.used .price,
+.coupon.expired .price {
+ color: #949494;
+}
+
+.coupon.used .reduce-price,
+.coupon.expired .reduce-price,
+.coupon.used .reduce-title,
+.coupon.expired .reduce-title {
+ color: #7a7a7a;
+}
+
+.coupon.used .reduce-type,
+.coupon.expired .reduce-type {
+ background: #b7ddff;
+}
+
+.coupon.used .footer,
+.coupon.expired .footer {
+ color: #b6b6b6;
+}
+
+.reduce-area {
+ font-size: 24rpx;
+ color: #666;
+ margin-top: 10rpx;
+}
+
+.go-shop {
+ border: 1rpx solid #4facfe;
+ border-radius: 30rpx;
+ color: #4facfe;
+ font-size: 24rpx;
+ margin-top: 60rpx;
+ margin-right: 12rpx;
+ line-height: 38rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/editUser/index.js b/eaterplanet_ecommerce/moduleA/editUser/index.js
new file mode 100644
index 0000000..1b726bf
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/editUser/index.js
@@ -0,0 +1,115 @@
+import WxValidate from '../../utils/WxValidate.js';
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ realname: "",
+ telephone: ""
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+ this.initValidate();
+ },
+
+ getData: function() {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('user.get_realname_tel', { token }).then(res => {
+ this.setData({
+ realname: res.data.realname,
+ telephone: res.data.telephone
+ })
+ }).catch(err => {
+ app.util.message(err.message || '请先登录', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ //报错
+ showModal(error) {
+ wx.showModal({
+ content: error.msg,
+ showCancel: false,
+ })
+ },
+
+ //资料验证函数
+ initValidate() {
+ const rules = {
+ realname: {
+ minlength: 1
+ },
+ telephone: {
+ tel: true
+ }
+ }
+ const messages = {
+ realname: {
+ minlength: '请输入正确的姓名'
+ },
+ telephone: {
+ tel: '请填写正确的手机号'
+ }
+ }
+ this.WxValidate = new WxValidate(rules, messages)
+ },
+
+ /**
+ * 资料修改表单提交
+ */
+ formSubmit(e) {
+ const params = e.detail.value;
+ //校验表单
+ if (!this.WxValidate.checkForm(params)) {
+ const error = this.WxValidate.errorList[0];
+ this.showModal(error);
+ return false;
+ }
+ this.setData({
+ btnLoading: true
+ })
+ let token = wx.getStorageSync('token');
+ params.token = token;
+ app.util.ProReq('user.update_realname_tel', params).then(res => {
+ this.setData({ btnLoading: false });
+ wx.showModal({
+ title: "提示",
+ content: res.message || '更改成功',
+ showCancel: false
+ })
+ }).catch(err => {
+ this.setData({
+ btnLoading: false
+ })
+ app.util.message(err.msg || '提交失败,请重试', '', 'error');
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/editUser/index.json b/eaterplanet_ecommerce/moduleA/editUser/index.json
new file mode 100644
index 0000000..14cd9e4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/editUser/index.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "修改资料",
+ "navigationBarBackgroundColor": "#F8F8F8",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/editUser/index.wxml b/eaterplanet_ecommerce/moduleA/editUser/index.wxml
new file mode 100644
index 0000000..667a4e0
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/editUser/index.wxml
@@ -0,0 +1,21 @@
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/editUser/index.wxss b/eaterplanet_ecommerce/moduleA/editUser/index.wxss
new file mode 100644
index 0000000..887d344
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/editUser/index.wxss
@@ -0,0 +1,20 @@
+.ipt {
+ width: 100%;
+}
+
+.ipt-hold {
+ color: #969799;
+}
+
+.edit-btn button {
+ background-color: #4facfe;
+ font-size: 28rpx;
+ line-height: 100rpx;
+ border-radius: 0;
+ font-weight: bold;
+ color: #fff;
+}
+
+.edit-btn button::after {
+ border: 0;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.js b/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.js
new file mode 100644
index 0000000..becf018
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.js
@@ -0,0 +1,72 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ qrcode: ''
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ if (!util.check_login()) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ this.get_hx_qrcode();
+ },
+
+ get_hx_qrcode: function () {
+ var that = this;
+ var token = wx.getStorageSync('token');
+ wx.showLoading();
+
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.get_community_bind_member_qrcode',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ console.log(res)
+ if (res.data.code == 0) {
+ console.log(res)
+ that.setData({ qrcode: res.data.qrcode })
+ } else {
+ // todo
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.json b/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.json
new file mode 100644
index 0000000..9a79ff7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "添加核销人员",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.wxml
new file mode 100644
index 0000000..62ebb11
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.wxml
@@ -0,0 +1,10 @@
+
+
+
+ 邀请员工扫码,完成添加
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.wxss
new file mode 100644
index 0000000..6e27b04
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao.wxss
@@ -0,0 +1,27 @@
+.top {
+ background-color: #fff;
+}
+
+.tip {
+ font-size: 26rpx;
+ color: #000;
+ text-align: center;
+ padding: 30rpx 0;
+}
+
+.qrcode {
+ text-align: center;
+ padding-top: 10rpx;
+ padding-bottom: 30rpx;
+}
+
+.qrcode image {
+ width: 300rpx;
+ height: 300rpx;
+}
+
+.qrcode .name {
+ font-size: 24rpx;
+ margin-top: 20rpx;
+ color: #666;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/apply.js b/eaterplanet_ecommerce/moduleA/groupCenter/apply.js
new file mode 100644
index 0000000..30a9617
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/apply.js
@@ -0,0 +1,473 @@
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+var locat = require('../../utils/Location.js');
+var app = getApp()
+var clearTime = null;
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ pass: -2,
+ canSubmit: false,
+ region: ['选择地址', '', ''],
+ addr_detail: '',
+ lon_lat: '',
+ focus_mobile: false,
+ showCountDown: true,
+ timeStamp: 60,
+ apply_complete: false,
+ wechat: '',
+ needAuth: false,
+ member_info: {
+ is_head: 0
+ },
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ }
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ community_id: '',
+ cansub: true,
+
+ bindRegionChange: function(e) {
+ this.setData({
+ region: e.detail.value.replace(/^\s*|\s*$/g, "")
+ })
+ },
+
+ inputAddress: function(e) {
+ this.setData({
+ addr_detail: e.detail.value.replace(/^\s*|\s*$/g, "")
+ })
+ },
+
+ inputCommunity: function(e) {
+ this.setData({
+ community_name: e.detail.value.replace(/^\s*|\s*$/g, "")
+ })
+ },
+
+ inputMobile: function(e) {
+ this.setData({
+ mobile_detail: e.detail.value.replace(/^\s*|\s*$/g, "")
+ })
+ },
+
+ inputRealName: function(e) {
+ this.setData({
+ head_name: e.detail.value.replace(/^\s*|\s*$/g, "")
+ })
+ },
+
+ inputWechat: function(e) {
+ this.setData({
+ wechat: e.detail.value.replace(/^\s*|\s*$/g, "")
+ })
+ },
+
+ chose_location: function() {
+ var that = this;
+ wx.chooseLocation({
+ success: function(e) {
+ var lon_lat = e.longitude + ',' + e.latitude;
+ var path = e.address;
+ var s_region = that.data.region;
+ var dol_path = '';
+
+ var str = path;
+ var patt = new RegExp("(.*?省)(.*?市)(.*?区)", "g");
+ var result = patt.exec(str);
+ if (result == null) {
+ patt = new RegExp("(.*?省)(.*?市)(.*?市)", "g");
+ result = patt.exec(str);
+ if (result == null) {
+ patt = new RegExp("(.*?省)(.*?市)(.*县)", "g");
+ result = patt.exec(str);
+ if (result != null) {
+ s_region[0] = result[1];
+ s_region[1] = result[2];
+ s_region[2] = result[3];
+ dol_path = path.replace(result[0], '');
+ }
+ } else {
+ s_region[0] = result[1];
+ s_region[1] = result[2];
+ s_region[2] = result[3];
+ dol_path = path.replace(result[0], '');
+ }
+ } else {
+ s_region[0] = result[1];
+ s_region[1] = result[2];
+ s_region[2] = result[3];
+ dol_path = path.replace(result[0], '');
+ }
+ var filename = dol_path + e.name;
+ let addr_detail = filename;
+
+ let address_component = '';
+ locat.getGpsLocation(e.latitude, e.longitude).then((res) => {
+ console.log(res)
+ address_component = res;
+ if (address_component) {
+ s_region[0] = address_component.province;
+ s_region[1] = address_component.city;
+ s_region[2] = address_component.district;
+ s_region[3] = address_component.town;
+ addr_detail = filename || address_component.street;
+ }
+ that.setData({
+ region: s_region,
+ lon_lat: lon_lat,
+ addr_detail
+ })
+ });
+
+ if (s_region[0] == '省') {
+ wx.showToast({
+ title: '请重新选择省市区',
+ icon: 'none',
+ })
+ }
+ },
+ fail: function(e) {
+ console.log('地址获取失败', e)
+ }
+ })
+ },
+
+ /**
+ * 订阅消息
+ */
+ subscriptionNotice: function() {
+ console.log('subscriptionNotice')
+ let that = this;
+ return new Promise((resolve, reject)=>{
+ let obj = that.data.need_subscript_template;
+ let tmplIds = Object.keys(obj).map(key => obj[key]); // 订阅消息模版id
+ if (wx.requestSubscribeMessage) {
+ tmplIds.length && wx.requestSubscribeMessage({
+ tmplIds: tmplIds,
+ success(res) {
+ let is_need_subscript = 1;
+ let acceptId = [];
+ tmplIds.forEach(item=>{
+ if (res[item] == 'accept') {
+ //用户同意了订阅,添加进数据库
+ acceptId.push(item);
+ } else {
+ //用户拒绝了订阅或当前游戏被禁用订阅消息
+ is_need_subscript = 0;
+ }
+ })
+
+ if(acceptId.length) {
+ that.addAccept(acceptId);
+ }
+ that.setData({ is_need_subscript })
+ resolve();
+ },
+ fail() {
+ reject();
+ }
+ })
+ } else {
+ // 兼容处理
+ reject();
+ }
+ })
+ },
+
+ // 用户点击订阅添加到数据库
+ addAccept: function (acceptId) {
+ let token = wx.getStorageSync('token');
+ let type = acceptId.join(',');
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.collect_subscriptmsg',
+ token,
+ type
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function () {}
+ })
+ },
+
+ submit: function() {
+ if (!this.authModal()) return;
+
+ let that = this;
+ var token = wx.getStorageSync('token');
+ var province_name = this.data.region[0];
+ var city_name = this.data.region[1];
+ var area_name = this.data.region[2];
+ let country_name = this.data.region[3] || '';
+ var addr_detail = this.data.addr_detail;
+ var community_name = this.data.community_name;
+ var mobile = this.data.mobile_detail;
+ var lon_lat = this.data.lon_lat;
+ var head_name = this.data.head_name;
+ var wechat = this.data.wechat;
+ let member_info = this.data.member_info;
+
+ if (head_name == '' || head_name === void 0) {
+ wx.showToast({
+ title: '请填写姓名',
+ icon: 'none'
+ })
+ return false;
+ }
+
+ if (mobile == '' || !(/^1(3|4|5|6|7|8|9)\d{9}$/.test(mobile))) {
+ this.setData({
+ focus_mobile: true
+ })
+ wx.showToast({
+ title: '手机号码有误',
+ icon: 'none'
+ })
+ return false;
+ }
+
+ if (wechat == '' || wechat === void 0) {
+ wx.showToast({
+ title: '请填写' + (member_info.wechat_div?member_info.wechat_div:'微信号'),
+ icon: 'none'
+ })
+ return false;
+ }
+
+ if (community_name == '' || community_name === void 0) {
+ wx.showToast({
+ title: '请填写小区名称',
+ icon: 'none'
+ })
+ return false;
+ }
+
+ if (province_name == '省' && city_name == '市' && area_name == '区') {
+ wx.showToast({
+ title: '请选择地区',
+ icon: 'none'
+ })
+ return false;
+ }
+
+ if (lon_lat == '' || lon_lat === void 0) {
+ wx.showToast({
+ title: '请选择地图位置',
+ icon: 'none'
+ })
+ return false;
+ }
+
+ if (addr_detail == '' || addr_detail === void 0) {
+ wx.showToast({
+ title: '请填写详细地址',
+ icon: 'none'
+ })
+ return false;
+ }
+
+ var s_data = {
+ province_name,
+ city_name,
+ area_name,
+ lon_lat,
+ addr_detail,
+ community_name,
+ mobile,
+ head_name,
+ wechat,
+ controller: 'community.sub_community_head',
+ token: token,
+ community_id: this.community_id,
+ country_name
+ };
+
+ let is_need_subscript = this.data.is_need_subscript;
+ if(is_need_subscript==1) {
+ //弹出订阅消息
+ this.subscriptionNotice().then(()=>{
+ that.preSubmit(s_data);
+ }).catch(()=>{
+ that.preSubmit(s_data);
+ });
+ } else {
+ that.preSubmit(s_data);
+ }
+ },
+
+ preSubmit: function(s_data) {
+ if(!this.cansub) return;
+ this.cansub = false;
+ var that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: s_data,
+ method: 'post',
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ wx.showToast({
+ title: '提交成功,等待审核',
+ icon: 'none',
+ duration: 2000
+ })
+ that.setData({
+ apply_complete: true
+ })
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ that.cansub = true;
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ let that = this;
+ status.setNavBgColor();
+ status.setGroupInfo().then((groupInfo) => {
+ let owner_name = groupInfo && groupInfo.owner_name || '团长';
+ that.setData({ groupInfo })
+ wx.setNavigationBarTitle({
+ title: `${owner_name}申请`,
+ })
+ });
+
+ var scene = decodeURIComponent(options.scene);
+ if (scene != 'undefined') {
+ this.community_id = scene;
+ }
+ this.getUserInfo();
+ this.checkSubscript();
+ },
+
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ that.setData({ needAuth: false });
+ } else {
+ that.setData({ needAuth: true });
+ }
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ that.getUserInfo();
+ })
+ },
+
+ getUserInfo: function() {
+ let that = this;
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'user.get_user_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ let member_info = res.data.data || { is_head: 0 };
+ if(member_info.is_head==1){
+ app.util.message('您已通过审核', '/eaterplanet_ecommerce/moduleA/groupCenter/index', 'error');
+ }
+ that.setData({
+ member_info
+ });
+ } else {
+ //is_login
+ that.setData({
+ needAuth: true
+ })
+ }
+ }
+ })
+ },
+
+ applyAgain: function() {
+ var member_info = this.data.member_info;
+ member_info.is_head = 0;
+
+ this.setData({
+ member_info: member_info
+ });
+ },
+
+ countDown: function() {
+ var that = this;
+ clearInterval(clearTime),
+ clearTime = setInterval(function() {
+ var ts = that.data.timeStamp,
+ ct = that.data.showCountDown;
+ ts > 0 ? ts-- : (ct = true, clearInterval(clearTime), ts = 60),
+ that.setData({
+ showCountDown: ct,
+ timeStamp: ts
+ });
+ }, 1000);
+ },
+
+ checkSubscript: function() {
+ let that = this;
+ var token = wx.getStorageSync('token');
+ token && app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'community.check_head_subscriptapply',
+ token: token
+ },
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ let { is_need_subscript,need_subscript_template } = res.data;
+ that.setData({
+ is_need_subscript,
+ need_subscript_template
+ });
+ }
+ }
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/apply.json b/eaterplanet_ecommerce/moduleA/groupCenter/apply.json
new file mode 100644
index 0000000..8c7ab35
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/apply.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/apply.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/apply.wxml
new file mode 100644
index 0000000..1050b62
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/apply.wxml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+ 申请通过
+ 恭喜您,您的申请已通过
+
+
+
+
+ 申请未通过
+ 很抱歉,您的申请未通过
+ 再次申请
+
+
+
+ 申请审核中
+ 您的申请在处理中,请等待结果…
+ 返回首页
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/apply.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/apply.wxss
new file mode 100644
index 0000000..bf20c52
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/apply.wxss
@@ -0,0 +1,166 @@
+.header {
+ background: #4facfe;
+ height: 160rpx;
+ color: #fff;
+ font-size: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.form-group {
+ padding: 12rpx 56rpx 0;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.form-group .form-item {
+ width: 640rpx;
+ display: flex;
+ align-items: center;
+ border-bottom: 2rpx solid #e4e4e4;
+ font-size: 30rpx;
+ transition: all 0.3s;
+ position: relative;
+}
+
+.form-group .form-item:last-child {
+ border: none;
+}
+
+.form-group .form-item.error {
+ border-color: #4facfe;
+}
+
+.form-group .form-item .form-item-control {
+ width: 160rpx;
+ height: 100rpx;
+ display: flex;
+ align-items: center;
+}
+
+.form-group .form-item .form-item-input {
+ flex: 1;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+
+.weui-cell__hd {
+ position:relative;
+ font-size:28rpx;
+ text-align:left;
+}
+
+.weui-pos {
+ width: 40rpx;
+ height: 50rpx;
+ background: url(https://wxapp.ch871.com/Common/image/order_checkout_icon.png) no-repeat;
+ background-position: 0rpx 0;
+ background-size: 132rpx 142rpx;
+}
+
+.form-group .form-item .form-item-input .picker {
+ height: 100rpx;
+ line-height: 100rpx;
+}
+
+.form-group .form-item .captcha {
+ color: #666;
+ border-left: 4rpx solid #ddd;
+ padding-left: 20rpx;
+ width: 160rpx;
+ height: 100%;
+ text-align: center;
+}
+
+.form-group .form-item .placeholder {
+ color: #ccc;
+}
+
+.form-group .form-item .input-placeholder {
+ color: #ccc;
+}
+
+.form-group .form-item .submit {
+ width: 640rpx;
+ height: 94rpx;
+ margin-top: 46rpx;
+ border-radius: 94rpx;
+ font-size: 36rpx;
+ background: #4facfe;
+ color: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.form-group .form-item .submit.disabled {
+ background: #dcdcdc;
+}
+
+.apply-pass {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ background: #fff;
+ position: fixed;
+ left: 0;
+ top: 0;
+ z-index: 9;
+}
+
+.apply-pass image {
+ width: 156rpx;
+ height: 156rpx;
+ padding-top: 150rpx;
+ margin-bottom: 28rpx;
+}
+
+.apply-pass .applyPassImg {
+ width: 186rpx;
+ height: 186rpx;
+ font-size: 230rpx;
+ color: #4facfe;
+ margin-bottom: 40rpx;
+ margin-top: 106rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.apply-pass .h1 {
+ font-size: 32rpx;
+ margin-bottom: 20rpx;
+ color: #555;
+}
+
+.apply-pass .p {
+ font-size: 28rpx;
+ color: #999;
+ margin-bottom: 30rpx;
+}
+
+.apply-pass .link-btn {
+ width: 310rpx;
+ height: 98rpx;
+ border-radius: 20rpx;
+ background: #4facfe;
+ color: #fff;
+ font-size: 32rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-weight: bold;
+}
+
+.icon-right {
+ position: absolute;
+ right: 10rpx;
+ top: 50%;
+ width: 18rpx;
+ height: 28rpx;
+ margin-top: -12rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.js b/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.js
new file mode 100644
index 0000000..ad73b39
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.js
@@ -0,0 +1,130 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ community_id: '',
+ name: '',
+ mobile: '',
+ is_login: true
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ util.check_login() ? this.setData({ is_login: true }) : this.setData({ is_login: false });
+ var scene = decodeURIComponent(options.scene);
+ if (scene != 'undefined') {
+ let community_id = scene;
+ this.setData({ community_id })
+ } else {
+ wx.showModal({
+ title: '提示',
+ content: '无效二维码,请重新获取!',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ }
+ }
+ })
+ }
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ this.setData({ is_login: true })
+ },
+
+ bindInfo: function(){
+ var that = this;
+ var token = wx.getStorageSync('token');
+
+ let name = this.data.name;
+ let mobile = this.data.mobile;
+ let community_id = this.data.community_id;
+
+ if (name == '') {
+ wx.showToast({
+ title: '请输入姓名!',
+ icon: 'none'
+ })
+ return false;
+ }
+ if (mobile == '' || !(/^1(3|4|5|6|7|8|9)\d{9}$/.test(mobile))) {
+ wx.showToast({
+ title: '手机号码有误',
+ icon: 'none'
+ })
+ return false;
+ }
+ wx.showLoading();
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.bind_community_member_do',
+ token: token,
+ community_id: community_id,
+ name,
+ mobile
+ },
+ dataType: 'json',
+ success: function (res) {
+ if(res.data.code==0) {
+ wx.showToast({
+ title: '绑定成功',
+ icon: 'none'
+ },()=>{
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ })
+ }
+ }
+ })
+ },
+
+ getName: function(e){
+ console.log(e)
+ let name = e.detail.value;
+ this.setData({ name })
+ },
+
+ getMobile: function (e) {
+ console.log(e)
+ let mobile = e.detail.value;
+ this.setData({ mobile })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.json b/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.json
new file mode 100644
index 0000000..0bafbaa
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "员工信息",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-auth": "../../components/auth/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.wxml
new file mode 100644
index 0000000..35957ee
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.wxml
@@ -0,0 +1,21 @@
+
+
+
+ 邀请你成为会员
+
+
+ 你的姓名
+
+
+
+
+ 联系电话
+
+
+
+
+ 提交
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.wxss
new file mode 100644
index 0000000..116985e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/bind_member_hexiao.wxss
@@ -0,0 +1,42 @@
+.content {
+ background-color: #fff;
+}
+
+.tip {
+ color: #000;
+ font-size: 36rpx;
+ font-weight: bold;
+ text-align: center;
+ padding: 30rpx 0 120rpx;
+}
+
+.form {
+ padding: 20rpx;
+}
+
+.form-group {
+ display: flex;
+ align-content: center;
+ align-items: center;
+ line-height: 80rpx;
+ border-top: 1rpx solid #ececec;
+ font-size: 28rpx;
+}
+
+.form-group .label {
+ color: #000;
+ margin-right: 20rpx;
+}
+
+.form-btn {
+ border-top: 1rpx solid #ececec;
+}
+
+.sub-btn {
+ color: #fff;
+ line-height: 80rpx;
+ background-color: #4facfe;
+ border-radius: 10rpx;
+ text-align: center;
+ margin-top: 50rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.js b/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.js
new file mode 100644
index 0000000..651ae66
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.js
@@ -0,0 +1,149 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ recordList: [{
+ memberHeadPic: "../../images/head-bitmap.png",
+ receiverName: "名字",
+ orderNum: "111",
+ createTime: "2018-09-12"
+ }],
+ refundList: [{
+ userAvatar: "",
+ orderUserName: "吃货星球",
+ returnOrderCount: "222",
+ createTime: "2018-09-12"
+ }],
+ currentTab: 0,
+ navList: [{
+ name: "购买记录",
+ status: "0"
+ }, {
+ name: "退单记录",
+ status: "1"
+ }],
+ LoadingComplete: !1,
+ loadText: "没有更多了~",
+ groupOrderStatus: "",
+ containerHeight: 0,
+ scrollTop: 0
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ recordList: this.data.recordList.map(function (t) {
+ return t.isHide = false, t;
+ }),
+ groupOrderNo: options.groupOrderNo,
+ skuId: options.skuId,
+ containerHeight: app.globalData.systemInfo.windowHeight - Math.round(app.globalData.systemInfo.windowHeight / 375 * 10),
+ groupOrderStatus: options.groupOrderStatus
+ }), this.getList(this.data.currentTab);
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 监控切换
+ */
+ bindChange: function (t) {
+ this.setData({
+ currentTab: 1 * t.detail.current
+ }), this.getList(this.data.currentTab);
+ },
+
+ /**
+ * 获取数据
+ */
+ getList: function (currentTab) {
+ var a = this;
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ })
+ if ( 0 === currentTab ){
+ console.log(222)
+ wx.hideLoading()
+ }
+ },
+
+ /**
+ * 导航切换
+ */
+ switchNav: function (t) {
+ if (this.data.currentTab === 1 * t.currentTarget.dataset.current) return !1;
+ this.setData({
+ currentTab: 1 * t.currentTarget.dataset.current
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.json b/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.json
new file mode 100644
index 0000000..b597dfd
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "购买记录",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.wxml
new file mode 100644
index 0000000..47fd437
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.wxml
@@ -0,0 +1,59 @@
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+ 暂时还没有记录~
+
+
+
+
+
+
+
+ {{item.receiverName}}买了
+ {{item.orderNum}} 份
+
+ {{item.createTime}}
+
+
+
+
+
+
+
+
+
+
+
+ 暂时还没有记录~
+
+
+
+
+
+
+
+ {{item.orderUserName}}退了
+ {{item.returnOrderCount}} 份
+
+ {{item.createTime}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.wxss
new file mode 100644
index 0000000..d0ccd6d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/buyHistory.wxss
@@ -0,0 +1,240 @@
+.nav {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 10;
+ background: #fff;
+ height: 92rpx;
+ border-top: 2rpx solid #f2f2f2;
+ border-bottom: 2rpx solid #f2f2f2;
+ padding: 0 60rpx;
+ width: unset;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.nav .orderList_item {
+ margin-bottom: 4rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+ color: #666;
+ position: relative;
+ height: 96rpx;
+ line-height: 96rpx;
+}
+
+.nav .orderList_item .line {
+ position: absolute;
+ bottom: 0;
+ height: 6rpx;
+ width: 100%;
+ background: linear-gradient(90deg,#4facfe 0%,#00f2fe 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255,89,0,0.25);
+ border-radius: 24rpx;
+}
+
+.nav .on {
+ color: #4facfe;
+}
+
+.swiper-box {
+ width: 100%;
+ margin-top: 90rpx;
+}
+
+.swiper-box .order-scroll-view {
+ width: 750rpx;
+ height: 100%;
+}
+
+.swiper-box .noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.swiper-box .noRecordCon .noRecordImg {
+ width: 132rpx;
+ height: 138rpx;
+ margin-top: 50%;
+}
+
+.swiper-box .noRecordCon .noRefundImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 50%;
+}
+
+.swiper-box .noRecordCon .noRecord {
+ padding-top: 32rpx;
+ font-size: 30rpx;
+ font-family: PingFangSC-Light;
+ font-weight: 300;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.swiper-box .noRecordCon .goIndex {
+ width: 164rpx;
+ height: 60rpx;
+ background: #4facfe;
+ border-radius: 30rpx;
+ font-size: 28rpx;
+ color: #fff;
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.swiper-box .item {
+ width: 710rpx;
+ height: 266rpx;
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.05);
+ border-radius: 20rpx;
+ margin: 20rpx auto 0;
+ background: #fff;
+}
+
+.swiper-box .item:last-of-type {
+ margin: 20rpx auto;
+}
+
+.refresh {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+ border: 1rpx solid #999;
+ position: fixed;
+ right: 50rpx;
+ bottom: 200rpx;
+ font-size: 20rpx;
+ color: #fff;
+ background: #000;
+ opacity: 0.5;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.refresh image {
+ width: 32rpx;
+ height: 32rpx;
+ margin-bottom: 4rpx;
+}
+
+.buyRecord {
+ width: 100%;
+}
+
+.buyRecord .nav {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 10;
+ background: #fff;
+ height: 80rpx;
+ line-height: 80rpx;
+ border-top: 1rpx solid #f2f2f2;
+ border-bottom: 1rpx solid #f2f2f2;
+ padding: 0 130rpx;
+ font-weight: 500;
+ width: unset;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.buyRecord .nav .on {
+ color: #4facfe;
+}
+
+.buyRecord .nav .orderList_item {
+ height: 80rpx;
+ line-height: 80rpx;
+ margin-bottom: 4rpx;
+}
+
+.buyRecord .nav .line {
+ background: linear-gradient(90deg,#4facfe 0%,#00f2fe 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(229,185,131,0.5);
+ border-radius: 24rpx;
+}
+
+.buyRecord .noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.buyRecord .noRecordCon .noRecordImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 328rpx;
+}
+
+.buyRecord .noRecordCon .noRecord {
+ padding-top: 18rpx;
+ font-size: 28rpx;
+ color: #999;
+}
+
+.buyRecord .record {
+ margin: 20rpx;
+ background: #fff;
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.05);
+ border-radius: 20rpx;
+ position: relative;
+ overflow: hidden;
+}
+
+.buyRecord .record .recordList {
+ background: #fff;
+ padding: 24rpx 30rpx;
+ font-size: 28rpx;
+ color: #333;
+ border-bottom: 1rpx solid #efefef;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.buyRecord .record .recordList:last-of-type {
+ border: none;
+}
+
+.buyRecord .record .recordList .buyer {
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ font-size: 28rpx;
+}
+
+.buyRecord .record .recordList .buyer .memAvatarUrl {
+ width: 72rpx;
+ height: 72rpx;
+ border-radius: 36rpx;
+}
+
+.buyRecord .record .recordList .buyer .receiverName {
+ color: #666;
+ margin-left: 20rpx;
+}
+
+.buyRecord .record .recordList .buyer .receiverName .buyNum {
+ color: #4facfe;
+ width: 70rpx;
+}
+
+.buyRecord .record .recordList .buyer span:last-of-type {
+ margin-left: 20rpx;
+ color: #aaa;
+ font-size: 22rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/cashList.js b/eaterplanet_ecommerce/moduleA/groupCenter/cashList.js
new file mode 100644
index 0000000..417e138
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/cashList.js
@@ -0,0 +1,151 @@
+var app = getApp();
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ loadText: "正在加载",
+ LoadingComplete: true,
+ no_order: 0,
+ page: 1,
+ hide_tip: true,
+ order: [],
+ tip: '正在加载',
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.setData({
+ page:1,
+ no_order:0,
+ order:[],
+ })
+ this.getData();
+ },
+ /**
+ * 获取数据
+ */
+ getData: function () {
+
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+
+ this.setData({
+ isHideLoadMore: true
+ })
+
+ this.data.no_order = 1
+ let that = this;
+ var token = wx.getStorageSync('token');
+
+
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.cashlist',
+ token: token,
+ page: that.data.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ console.log(that.data.page);
+ let rushList = that.data.order.concat(res.data.data);
+
+ that.setData({
+ order: rushList,
+ hide_tip: true,
+ 'no_order': 0
+ });
+ wx.hideLoading();
+ } else {
+ that.setData({
+ LoadingComplete:true,
+ isHideLoadMore: true
+ })
+ wx.hideLoading();
+ return false;
+ }
+
+ }
+ })
+
+
+ },
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (this.data.no_order == 1) return false;
+ this.data.page += 1;
+ this.getData();
+
+ this.setData({
+ isHideLoadMore: false
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/cashList.json b/eaterplanet_ecommerce/moduleA/groupCenter/cashList.json
new file mode 100644
index 0000000..35359dc
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/cashList.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "提现记录",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/cashList.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/cashList.wxml
new file mode 100644
index 0000000..8430e98
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/cashList.wxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+ 提现单号({{item.id}})
+
+
+
+
+ 提现状态:
+ 成功
+ 审核中
+ 拒绝
+
+
+ 提现金额:
+ ¥{{item.money}}
+
+
+ 申请日期:
+ {{item.addtime}}
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/cashList.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/cashList.wxss
new file mode 100644
index 0000000..426dd03
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/cashList.wxss
@@ -0,0 +1,14 @@
+.list-item {
+ background: #fff;
+ border-radius: 10rpx;
+ padding: 24rpx 20rpx;
+ margin: 20rpx 20rpx;
+ line-height: 2;
+ font-size: 24rpx;
+}
+
+.list-item .title {
+ border-bottom: 2rpx solid #f2f2f2;
+ font-size: 28rpx;
+ margin-bottom: 5px;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/closure.js b/eaterplanet_ecommerce/moduleA/groupCenter/closure.js
new file mode 100644
index 0000000..5ab7a3b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/closure.js
@@ -0,0 +1,84 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: []
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ if(!util.check_login()){
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ this.getList();
+ },
+
+ getList: function(){
+ wx.showLoading();
+ var that = this;
+ var token = wx.getStorageSync('token');
+
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.get_community_hexiao_memberlist',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ console.log(res)
+ if(res.data.code==0){
+ that.setData({ list: res.data.member_list })
+ } else {
+ console.log(res.data.log)
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ goQrcode: function(){
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/moduleA/groupCenter/addHexiao'
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/closure.json b/eaterplanet_ecommerce/moduleA/groupCenter/closure.json
new file mode 100644
index 0000000..b04d1fc
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/closure.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "核销管理",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/closure.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/closure.wxml
new file mode 100644
index 0000000..bc85cf3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/closure.wxml
@@ -0,0 +1,16 @@
+
+
+
+ +添加核销人员
+
+
+
+ {{item.username}}
+ 已核销订单:{{item.member_record_count}}
+
+
+
+ 暂时没有核销人员
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/closure.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/closure.wxss
new file mode 100644
index 0000000..6a5f16a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/closure.wxss
@@ -0,0 +1,65 @@
+
+.list {
+ padding: 30rpx;
+ background-color: #fff;
+}
+
+.list .item {
+ display: flex;
+ justify-content: space-between;
+ line-height: 100rpx;
+ border-bottom: 2rpx solid #ececec;
+}
+
+.list .item .avatar {
+ width: 50rpx;
+ height: 50rpx;
+ border-radius: 50%;
+ vertical-align: middle;
+ margin-right: 10rpx;
+}
+
+.list .item text {
+ display: inline-block;
+ line-height: 50rpx;
+}
+
+.list .item .num {
+ font-weight: bold;
+ color: #4facfe;
+}
+
+.add-btn {
+ text-align: center;
+ padding: 10rpx 0;
+ background-color: #fff;
+}
+
+.add-btn .btn {
+ border-bottom: 1px solid #ececec;
+ border-top: 1px solid #ececec;
+ border-radius: 5px;
+ margin: 30rpx;
+ padding: 30rpx 0;
+ color: #000;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin: 100rpx 0;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.js b/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.js
new file mode 100644
index 0000000..e5a76f3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.js
@@ -0,0 +1,248 @@
+var page = 1;
+var app = getApp();
+var timeFormat = require("../../utils/timeFormat");
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isCalling: false,
+ queryData: {
+ createTime: null,
+ communityId: null,
+ order: [],
+ page: page,
+ pageSize: 20
+ },
+ maxDate: (0, timeFormat.formatYMD)(new Date()),
+ searchKey: "",
+ date: "",
+ containerHeight: 0,
+ showLoadMore: false,
+ no_order: 0,
+ page: 1,
+ hide_tip: true,
+ order: [],
+ tip: '正在加载',
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ var sysInfo = wx.getSystemInfoSync();
+ this.setData({
+ containerHeight: sysInfo.windowHeight - Math.round(sysInfo.windowWidth / 375 * 125)
+ });
+ page = 1;
+ this.data.queryData.communityId = app.globalData.disUserInfo.communityId;
+ this.data.queryData.createTime = null;
+
+ this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ var is_show_on = this.data.is_show_on;
+ if (is_show_on > 0) {
+ this.setData({
+ page: 1,
+ order: []
+ })
+ this.getData();
+ } else {
+ this.setData({
+ is_show_on: is_show_on + 1
+ })
+ }
+
+ },
+
+ /**
+ * 获取数据
+ */
+ getData: function() {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+
+ this.setData({
+ isHideLoadMore: true
+ })
+
+ this.data.no_order = 1
+ let that = this;
+ var token = wx.getStorageSync('token');
+ //currentTab
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.get_community_member_orderlist',
+ date: that.data.date,
+ searchKey: that.data.searchKey,
+ token: token,
+ page: that.data.page
+ },
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ let close_community_delivery_orders = res.data.close_community_delivery_orders || 0;
+ let rushList = that.data.order.concat(res.data.data);
+
+ that.setData({
+ order: rushList,
+ hide_tip: true,
+ no_order: 0,
+ close_community_delivery_orders
+ });
+ wx.hideLoading();
+ } else {
+ that.setData({
+ isHideLoadMore: true
+ })
+ wx.hideLoading();
+ return false;
+ }
+
+ }
+ })
+
+ },
+
+ /**
+ * 获取时间
+ */
+ getTodayMs: function() {
+ var t = new Date();
+ return t.setHours(0), t.setMinutes(0), t.setSeconds(0), t.setMilliseconds(0), Date.parse(t);
+ },
+
+ /**
+ * 监控输入框
+ */
+ bindSearchChange: function(e) {
+ this.setData({
+ searchKey: e.detail.value
+ });
+ },
+
+ /**
+ * 搜索
+ */
+ searchByKey: function() {
+ page = 1;
+ this.setData({
+ order: [],
+ no_order: 0,
+ page: 1
+ });
+ this.data.queryData.memberNickName = this.data.searchKey;
+ this.getData();
+ },
+
+ /**
+ * 取消
+ */
+ cancel: function() {
+ page = 1;
+ this.setData({
+ searchKey: "",
+ order: []
+ });
+ this.data.queryData.memberNickName = null;
+ this.getData();
+ },
+
+ /**
+ * 监控日期
+ */
+ bindDateChange: function(e) {
+ page = 1;
+ this.setData({
+ date: e.detail.value,
+ order: [],
+ no_order: 0,
+ page: 1
+ });
+ this.data.queryData.createTime = new Date(e.detail.value).getTime() - 28800000;
+ this.getData();
+ },
+
+ /**
+ * 清除日期
+ */
+ clearDate: function() {
+ page = 1;
+ this.setData({
+ date: "",
+ order: [],
+ no_order: 0,
+ page: 1
+ });
+ this.data.queryData.createTime = null;
+ this.getData();
+ },
+
+ /**
+ * 拨打电话
+ */
+ callTelphone: function(e) {
+ var that = this;
+ var phoneNumber = e.currentTarget.dataset.phone;
+ if (phoneNumber!="未下单"){
+ this.data.isCalling || (this.data.isCalling = true, wx.makePhoneCall({
+ phoneNumber: phoneNumber,
+ complete: function() {
+ that.data.isCalling = false;
+ }
+ }));
+ }
+ },
+
+ /**
+ * 获取更多
+ */
+ getMore: function() {
+ if (this.data.no_order == 1) return false;
+ this.data.page += 1;
+ this.getData();
+
+ this.setData({
+ isHideLoadMore: false
+ })
+ },
+
+ goLink: function (e) {
+ let close_community_delivery_orders = this.data.close_community_delivery_orders;
+ if (close_community_delivery_orders!=1) {
+ var pages_all = getCurrentPages();
+ var url = e.currentTarget.dataset.link;
+ if (pages_all.length > 3) {
+ wx.redirectTo({ url })
+ } else {
+ wx.navigateTo({ url })
+ }
+ }
+ },
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.json b/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.json
new file mode 100644
index 0000000..690e20c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "社区用户",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "component-img": "../../components/image/index",
+ "component-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.wxml
new file mode 100644
index 0000000..e41ddff
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.wxml
@@ -0,0 +1,49 @@
+
+
+
+
+
+ 搜索
+ 取消
+
+
+
+
+
+
+
+
+
+ {{item.username}}
+
+ {{item.shipping_name}}
+
+ {{item.mobile}}
+
+
+
+ {{item.mobile}}
+
+
+
+
+
+ {{item.order_count}}个
+
+
+
+
+
+
+ 暂无社区用户
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.wxss
new file mode 100644
index 0000000..9d2cf1a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/communityMembers.wxss
@@ -0,0 +1,147 @@
+.search {
+ background: #fff;
+ padding: 20rpx 30rpx;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ position: relative;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+}
+
+.search .icon-search {
+ position: absolute;
+}
+
+.search .icon-search {
+ left: 54rpx;
+}
+
+.search input {
+ padding-left: 68rpx;
+ width: 520rpx;
+ height: 56rpx;
+ background: #f8f8f8;
+ border-radius: 28rpx;
+ color: #999;
+ box-sizing: border-box;
+ line-height: 40rpx;
+}
+
+.search text {
+ color: #4facfe;
+ margin-left: 28rpx;
+}
+
+.date {
+ padding: 0 30rpx;
+ background: #fff;
+ height: 90rpx;
+ line-height: 90rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+ color: #9b9b9b;
+}
+
+.date .date-value {
+ margin-left: 12rpx;
+ color: #4facfe;
+}
+
+.date .icon-date {
+ height: 36rpx;
+ width: 36rpx;
+ float: right;
+ margin: 6rpx 0 0 0;
+}
+
+.date .icon-date image {
+ height: 36rpx;
+ width: 36rpx;
+}
+
+.date .icon-clear {
+ height: 32rpx;
+ float: right;
+ color: #4facfe;
+ margin: 0 28rpx 0 0;
+ font-size: 24rpx;
+}
+
+.list-content {
+ width: 100%;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+}
+
+.list-header, .list-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0 30rpx;
+}
+
+.list-header {
+ height: 84rpx;
+}
+
+.list-item {
+ background: #fff;
+ height: 116rpx;
+ margin-bottom: 2rpx;
+}
+
+.list-item .item-left {
+ display: flex;
+ align-items: center;
+}
+
+.list-item .item-left text {
+ margin-left: 12rpx;
+ font-size: 28rpx;
+ width: 400rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.list-item .item-left .phone {
+ margin-left: 12rpx;
+ display: flex;
+ align-items: center;
+}
+
+.list-item .item-left .icon-phone {
+ width: 28rpx;
+ height: 32rpx;
+ margin-left: 10rpx;
+}
+
+.list-item .item-right {
+ height: 100%;
+ display: flex;
+ align-items: center;
+}
+
+.list-item .item-right .text {
+ font-size: 26rpx;
+ margin-right: 18rpx;
+}
+
+.list-item .item-right .rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+}
+
+.navigator-hover {
+ background-color: rgba(0, 0, 0, 0);
+}
+
+.none-member {
+ text-align: center;
+ background: #fff;
+ height: 116rpx;
+ line-height: 116rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.js b/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.js
new file mode 100644
index 0000000..c592962
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.js
@@ -0,0 +1,173 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ loadText: "正在加载",
+ LoadingComplete: true,
+ currentTab: 1,
+ no_order: 0,
+ page: 1,
+ hide_tip: true,
+ order: [],
+ tip: '正在加载',
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var s_type = options.type;
+ this.setData({
+ currentTab: s_type
+ })
+ this.getData();
+ },
+ getData: function () {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+ this.setData({
+ isHideLoadMore: true
+ })
+
+ this.data.no_order = 1
+ let that = this;
+
+ var chooseDate = this.data.chooseDate;
+ var token = wx.getStorageSync('token');
+
+ var currentTab = this.data.currentTab;
+
+ var order_status = 1;
+
+ if (currentTab == 1) {
+ order_status = 1;
+ } else if (currentTab == 2) {
+ order_status = 2;
+ }
+
+ //currentTab
+
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.headorderlist',
+ token: token,
+ page: that.data.page,
+ order_status: order_status
+ },
+ method: 'post',
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ console.log(that.data.page);
+ let rushList = that.data.order.concat(res.data.data);
+
+ that.setData({
+ order: rushList,
+ hide_tip: true,
+ 'no_order': 0
+ });
+ wx.hideLoading();
+ } else {
+ that.setData({
+ isHideLoadMore: true
+ })
+ wx.hideLoading();
+ return false;
+ }
+
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 导航切换
+ */
+ switchTab: function(e){
+ let currentTab = e.currentTarget.dataset.type || 1;
+ this.setData({
+ currentTab: currentTab,
+ page:1,
+ order:[]
+ })
+
+ this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (this.data.no_order == 1) return false;
+ this.data.page += 1;
+ this.getData();
+
+ this.setData({
+ isHideLoadMore: false
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.json b/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.json
new file mode 100644
index 0000000..e3fa0ae
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "订单明细",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.wxml
new file mode 100644
index 0000000..6ad9e34
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.wxml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ 待确认收入
+
+
+ 可提现金额
+
+
+
+
+
+
+ 订单单号({{item.order_num_alias}})
+
+
+
+
+ 订单标题:
+ {{item.name}}
+
+
+ 订单金额:
+ ¥{{item.total}}
+
+
+ 佣金金额:
+ ¥{{item.money}}
+
+
+ 下单日期:
+ {{item.addtime}}
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.wxss
new file mode 100644
index 0000000..f8aabab
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/detailsList.wxss
@@ -0,0 +1,60 @@
+.nav-bar {
+ width: 100%;
+ position: fixed;
+ left: 0;
+ top: 0;
+ z-index: 10;
+}
+
+.nav-bar .nav-bar-inner {
+ display: flex;
+ justify-content: space-between;
+ background-color: white;
+}
+
+.nav-bar .nav-bar-item {
+ flex: 1;
+ text-align: center;
+}
+
+.nav-bar .nav-bar-item .nav-bar-item-inner {
+ position: relative;
+ display: inline-block;
+ word-break: keep-all;
+ font-size: 28rpx;
+ font-weight: 500;
+ color: #666;
+ padding: 20rpx 0;
+}
+
+.nav-bar .current.nav-bar-item .nav-bar-item-inner::after {
+ content: "";
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 3px;
+ background: linear-gradient(90deg,#4facfe 0%,#00f2fe 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255,89,0,0.25);
+ border-radius: 24rpx;
+ transition: all 400ms ease-in;
+}
+
+.cash-list {
+ margin-top: 100rpx;
+}
+
+.list-item {
+ background: #fff;
+ border-radius: 10rpx;
+ padding: 24rpx 20rpx;
+ margin: 20rpx 20rpx;
+ line-height: 2;
+ font-size: 24rpx;
+}
+
+.list-item .title {
+ border-bottom: 2rpx solid #f2f2f2;
+ font-size: 28rpx;
+ margin-bottom: 5px;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.js b/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.js
new file mode 100644
index 0000000..ba49a06
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.js
@@ -0,0 +1,74 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.json b/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.json
new file mode 100644
index 0000000..64fed5c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "分销说明",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.wxml
new file mode 100644
index 0000000..b89d93d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.wxml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.wxss
new file mode 100644
index 0000000..634db4d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/distributionInstruct.wxss
@@ -0,0 +1,57 @@
+page {
+ height: 100%;
+}
+
+.instruction {
+ width: 100%;
+ background: #f36e4f;
+}
+
+.instruction image {
+ display: block;
+}
+
+.instruction .headImg {
+ width: 100%;
+ height: 540rpx;
+}
+
+.instruction .content {
+ padding: 0 30rpx 40rpx;
+}
+
+.instruction .content .imgOne, .instruction .content .imgTwo,
+.instruction .content .imgThree, .instruction .content .imgFour,
+.instruction .content .imgFive, .instruction .content .imgSix,
+.instruction .content .imgSeven, .instruction .content .imgEight {
+ width: 100%;
+ height: 908rpx;
+}
+
+.instruction .content .imgTwo {
+ height: 712rpx;
+}
+
+.instruction .content .imgThree {
+ height: 1128rpx;
+}
+
+.instruction .content .imgFour {
+ height: 824rpx;
+}
+
+.instruction .content .imgFive {
+ height: 866rpx;
+}
+
+.instruction .content .imgSix {
+ height: 954rpx;
+}
+
+.instruction .content .imgSeven {
+ height: 878rpx;
+}
+
+.instruction .content .imgEight {
+ height: 1140rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.js b/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.js
new file mode 100644
index 0000000..a63bf77
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.js
@@ -0,0 +1,291 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ currentTab: 0,
+ pageSize: 10,
+ navList: [{
+ name: "全部",
+ status: "0"
+ }, {
+ name: "待确认",
+ status: "1"
+ }, {
+ name: "已确认",
+ status: "2"
+ },
+ {
+ name: "无效",
+ status: "3"
+ }
+ ],
+ distributionList: [],
+ loadText: "没有更多记录了~",
+ containerHeight: 0,
+ chooseDate: "",
+ chooseDateTime: "",
+ data: "",
+ estimate: "",
+ permoney: 0,
+ communnityId: "",
+ loadText: "",
+ disUserId: "",
+ no_order: 0,
+ page: 1,
+ hide_tip: true,
+ order: [],
+ tip: '正在加载',
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ var sysInfo = wx.getSystemInfoSync();
+ this.setData({
+ containerHeight: sysInfo.windowHeight - Math.round(sysInfo.windowHeight / 375 * 55)
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ var dayTime = new Date(),
+ year = dayTime.getFullYear(),
+ mon = dayTime.getMonth() + 1,
+ dateTime = Date.parse(dayTime);
+ this.setData({
+ page: 1,
+ order: [],
+ chooseDate: year + "年" + mon + "月",
+ chooseDateTime: dateTime
+ }), this.getData();
+
+ this.get_month_money();
+ },
+
+ get_month_money: function() {
+ var chooseDate = this.data.chooseDate;
+ var that = this;
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'order.order_commission',
+ token: token,
+ chooseDate: chooseDate
+ },
+ method: 'post',
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ that.setData({
+ permoney: res.data.money
+ })
+ } else {
+ that.setData({
+ permoney: 0
+ })
+ }
+ }
+ })
+
+ },
+ /**
+ * 获取数据
+ */
+ getData: function() {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+ this.setData({
+ isHideLoadMore: true
+ })
+
+ this.data.no_order = 1
+ let that = this;
+ var chooseDate = this.data.chooseDate;
+ var token = wx.getStorageSync('token');
+ var currentTab = this.data.currentTab;
+
+ var order_status = -1;
+ if (currentTab == 0) {
+ order_status = -1;
+ } else if (currentTab == 1) {
+ order_status = 22;
+ } else if (currentTab == 2) {
+ order_status = 6;
+ } else if (currentTab == 3) {
+ order_status = 357;
+ }
+
+ //currentTab
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'order.orderlist',
+ is_tuanz: 1,
+ token: token,
+ chooseDate: chooseDate,
+ page: that.data.page,
+ order_status: order_status
+ },
+ method: 'post',
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ console.log(that.data.page);
+ let data = res.data.data;
+ let rushList = that.data.order.concat(data);
+ that.setData({
+ order: rushList,
+ hide_tip: true,
+ 'no_order': 0
+ });
+ wx.hideLoading();
+ } else {
+ that.setData({
+ isHideLoadMore: true
+ })
+ wx.hideLoading();
+ return false;
+ }
+
+ }
+ })
+ },
+
+ /**
+ * 刷新
+ */
+ refresh: function() {
+ this.setData({
+ page: 1,
+ order: [],
+ }, ()=>{
+ this.getData();
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function() {
+
+ },
+
+ bindChange: function(t) {
+ this.setData({
+ currentTab: 1 * t.detail.current
+ });
+ this.setData({
+ order: [],
+ page: 1,
+ no_order: 0
+ }, () => {
+ console.log('我变啦');
+ this.getData();
+ })
+ },
+
+ /**
+ * 切换导航
+ */
+ switchNav: function(e) {
+ if (this.data.currentTab === 1 * e.target.dataset.current) return false;
+ this.setData({
+ currentTab: 1 * e.target.dataset.current
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+ this.getData();
+ },
+
+ /**
+ * 监控日期改变
+ */
+ bindDateChange: function(t) {
+ console.log("picker发送选择改变,携带值为", t.detail.value), this.setData({
+ date: t.detail.value
+ });
+ var a = this.data.date.split("-"),
+ e = Date.parse(this.data.date);
+ this.setData({
+ chooseDate: a[0] + "年" + a[1] + "月",
+ chooseDateTime: e,
+ order: [],
+ page: 1,
+ no_order: 0
+ }), this.getData();
+ this.get_month_money();
+ },
+ getCurrentList: function() {
+ console.log(this.data.no_order);
+ if (this.data.no_order == 1) return false;
+ this.data.page += 1;
+ this.getData();
+
+ this.setData({
+ isHideLoadMore: false
+ })
+ },
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ console.log(this.data.no_order);
+ if (this.data.no_order == 1) return false;
+ this.data.page += 1;
+ this.getData();
+
+ this.setData({
+ isHideLoadMore: false
+ })
+ },
+
+ handleTipDialog: function(){
+ this.setData({
+ showTipDialog: !this.data.showTipDialog
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.json b/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.json
new file mode 100644
index 0000000..701a45e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "分销记录",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "component-load-more": "../../components/load-more/index",
+ "i-dialog": "../../components/dialog/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.wxml
new file mode 100644
index 0000000..965c8d6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.wxml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+ {{chooseDate}}
+
+
+
+
+
+ 预计佣金:¥{{permoney}}
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+ 还没有记录 快去分享吧~
+
+
+
+
+ {{item.order_num_alias}}
+ {{item.status_name}}
+
+
+
+
+
+ {{goods.name}}
+ 团单金额 ¥{{goods.total}} |
+ 预估佣金 ¥{{goods.commision}}
+
+
+ 佣金变化:¥{{goods.del_commision}}
+
+
+
+
+
+
+
+ 已退款
+
+ 退款金额:¥{{goods.refund_info.ref_money}}
+ {{goods.refund_info.real_refund_quantity}}个 申请中
+ {{goods.refund_info.real_refund_quantity}}个 退款成功
+ {{goods.refund_info.real_refund_quantity}}个 退款失败
+
+
+
+
+ 配送收入: ¥{{item.shipping_fare}}
+ 合计佣金: ¥{{item.total_commision}}(含配送)
+
+
+ 合计佣金: ¥{{item.total_commision}}
+
+
+
+
+
+
+
+
+
+
+ 刷新
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.wxss
new file mode 100644
index 0000000..e38f2e7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/distributionList.wxss
@@ -0,0 +1,280 @@
+.nav {
+ position: relative;
+ left: 0;
+ right: 0;
+ z-index: 10;
+ background: #fff;
+ height: 92rpx;
+ border-top: 2rpx solid #f2f2f2;
+ border-bottom: 2rpx solid #f2f2f2;
+ padding: 0 60rpx;
+ width: unset;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.nav .orderList_item {
+ margin-bottom: 4rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+ color: #666;
+ position: relative;
+ height: 96rpx;
+ line-height: 96rpx;
+}
+
+.nav .orderList_item .line {
+ position: absolute;
+ bottom: 0;
+ height: 6rpx;
+ width: 100%;
+ background: linear-gradient(90deg,#4facfe 0%,#00f2fe 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255,89,0,0.25);
+ border-radius: 24rpx;
+}
+
+.nav .on {
+ color: #4facfe;
+}
+
+.swiper-box {
+ width: 100%;
+ margin-top: 90rpx;
+}
+
+.swiper-box .order-scroll-view {
+ width: 750rpx;
+ height: 100%;
+}
+
+.swiper-box .noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.swiper-box .noRecordCon .noRecordImg {
+ width: 132rpx;
+ height: 138rpx;
+ margin-top: 50%;
+}
+
+.swiper-box .noRecordCon .noRefundImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 50%;
+}
+
+.swiper-box .noRecordCon .noRecord {
+ padding-top: 32rpx;
+ font-size: 30rpx;
+ font-family: PingFangSC-Light;
+ font-weight: 300;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.swiper-box .noRecordCon .goIndex {
+ width: 164rpx;
+ height: 60rpx;
+ background: #4facfe;
+ border-radius: 30rpx;
+ font-size: 28rpx;
+ color: #fff;
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.swiper-box .item {
+ width: 710rpx;
+ /**height: 266rpx;**/
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.05);
+ border-radius: 20rpx;
+ margin: 20rpx auto 0;
+ background: #fff;
+}
+
+.swiper-box .item:last-of-type {
+ margin: 20rpx auto;
+}
+
+.refresh {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+ border: 2rpx solid #999;
+ box-shadow: 2rpx 2rpx 4rpx #999;
+ position: fixed;
+ right: 50rpx;
+ bottom: 200rpx;
+ font-size: 20rpx;
+ color: #666;
+ background: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.refresh .refreshImg {
+ font-size: 32rpx;
+ color: #000;
+ margin-bottom: 4rpx;
+}
+
+swiper-item {
+ height: auto;
+}
+
+.section {
+
+ width: 690rpx;
+
+ display: flex;
+ font-size: 28rpx;
+ color: #666;
+ padding: 20rpx 30rpx;
+ background-color: #fff;
+}
+
+.section .groupDay {
+ width: 36rpx;
+ height: 36rpx;
+}
+
+.section .picker {
+ margin-left: 20rpx;
+ display: flex;
+ flex: 1;
+}
+
+.section .picker .choose-day .iconfont {
+ font-size: 12rpx;
+ margin-left: 6rpx;
+ vertical-align: middle;
+ color: #999;
+}
+
+.distributionList {
+ width: 100%;
+ position: fixed;
+}
+
+.distributionList .nav {
+ top: 80rpx;
+}
+
+.distributionList .on {
+ color: #4facfe;
+ border-bottom: 4rpx solid #4facfe;
+ margin: 0;
+}
+
+.distributionList .swiper-box {
+ margin-top: 170rpx;
+}
+
+.item {
+ background: #fff;
+ overflow: hidden;
+ border-top-left-radius: 20rpx;
+ border-top-right-radius: 20rpx;
+}
+
+.distributionNum {
+ height: 80rpx;
+ font-size: 26rpx;
+ color: #333;
+ padding: 0 30rpx;
+ border-top-left-radius: 20rpx;
+ border-top-right-radius: 20rpx;
+ border-bottom: 2rpx solid #e4e4e4;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.distributionNum .distributionTime {
+ font-size: 24rpx;
+ color: #666;
+}
+
+.distributionNum .statusName {
+ font-size: 26rpx;
+ color: #4facfe;
+}
+
+.spu {
+ padding: 20rpx 30rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.spu .goodsImg {
+ height: 120rpx;
+ margin-right: 30rpx;
+}
+
+.spu .detail {
+ font-size: 28rpx;
+ color: #333;
+}
+
+.spu .detail .goodsName {
+ color: #333;
+ font-size: 28rpx;
+ line-height: 40rpx;
+ height: 80rpx;
+ width: 540rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ text-overflow: initial;
+ white-space: normal;
+}
+
+.spu .detail .commission {
+ font-size: 24rpx;
+ color: #999;
+ line-height: 40rpx;
+}
+
+.distributionCommision {
+ border-top: 2rpx solid #e4e4e4;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ height: 80rpx;
+ font-size: 26rpx;
+ color: #777;
+ padding: 0 30rpx;
+}
+
+.distributionCommision text {
+ margin-left: 30rpx;
+}
+
+.dialogText {
+ box-sizing: border-box;
+ padding: 20rpx;
+ height: 140rpx!important;
+ text-align: justify;
+}
+
+.dialogBtn {
+ font-size: 30rpx!important;
+ height: 68rpx!important;
+ line-height: 68rpx!important;
+}
+
+.tips .tag {
+ font-size: 20rpx;
+ padding: 4rpx 8rpx;
+ border-radius: 5rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.js b/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.js
new file mode 100644
index 0000000..e2f0eef
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.js
@@ -0,0 +1,326 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ tixian_money: '',
+ final_money: 0,
+ sxfee: 0,
+ type: 1,
+ items: [
+ { name: '1', value: '系统余额', show: true, checked: false },
+ { name: '2', value: '微信零钱', show: true, checked: false },
+ { name: '3', value: '支付宝', show: true, checked: false },
+ { name: '4', value: '银行卡', show: true, checked: false }
+ ]
+ },
+ canTixian: true,
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'community.get_community_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ let rdata = res.data;
+
+ let items = that.data.items;
+ let community_info = rdata.community_info;
+ if (community_info.head_commiss_tixianway_yuer == 0) items[0].show = false;
+ if (community_info.head_commiss_tixianway_weixin == 0) items[1].show = false;
+ if (community_info.head_commiss_tixianway_alipay == 0) items[2].show = false;
+ if (community_info.head_commiss_tixianway_bank == 0) items[3].show = false;
+
+ let type = that.data.type;
+ for (let i = 0; i < items.length; i++){
+ if(items[i].show){
+ items[i].checked = true;
+ type = items[i].name;
+ break
+ }
+ }
+
+ let head_commiss_tixian_publish = rdata.head_commiss_tixian_publish;
+ let hasTixianPublish = head_commiss_tixian_publish!='';
+ let { is_need_subscript, need_subscript_template } = res.data;
+
+ that.setData({
+ head_commiss_tixian_publish,
+ member_info: rdata.member_info,
+ community_info: rdata.community_info,
+ commission_info: rdata.commission_info,
+ community_tixian_fee: rdata.community_tixian_fee,
+ community_min_money: rdata.community_min_money,
+ items,
+ type,
+ hasTixianPublish,
+ is_need_subscript,
+ need_subscript_template
+ });
+
+ } else {
+ //is_login
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+
+ }
+ }
+ })
+ },
+
+ bindTixianMoneyInput: function(t) {
+ let max_val = this.data.commission_info.money;
+ var value = t.detail.value;
+ if (value > max_val) {
+ wx.showToast({
+ title: '本次最大可提现' + max_val + '元',
+ icon: "none",
+ })
+ }
+ let fee = this.data.community_tixian_fee;
+ let final_money = (value * (100 - fee) / 100).toFixed(2);
+ let sxfee = (value - final_money).toFixed(2);
+
+ this.setData({
+ tixian_money: value,
+ final_money: final_money,
+ sxfee
+ })
+ },
+
+ getAll: function() {
+ var max_tixian_money = this.data.commission_info.money;
+ let fee = this.data.community_tixian_fee;
+ let final_money = (max_tixian_money * (100 - fee) / 100).toFixed(2);
+ let sxfee = (max_tixian_money - final_money).toFixed(2);
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money,
+ sxfee
+ })
+ },
+
+ /**
+ * 提交
+ */
+ resSubmit: function(e) {
+ const params = e.detail.value;
+ let isNull = 0;
+ let type = this.data.type;
+ let errortip = [{}, {}, {
+ bankusername: '微信真实姓名'
+ }, {
+ bankusername: '支付宝真实姓名',
+ bankaccount: '支付宝账户'
+ }, {
+ bankname: '银行卡名称',
+ bankusername: '持卡人姓名',
+ bankaccount: '银行卡账户'
+ }];
+
+ for (let item in params) {
+ params[item] = params[item].replace(/(^\s*)|(\s*$)/g, "");
+ if (!params[item]) {
+ const itemTip = errortip[type][item];
+ wx.showToast({
+ title: '请输入' + (itemTip || '正确的表单内容'),
+ icon: 'none'
+ })
+ isNull = 1;
+ break;
+ }
+ if (item == 'money' && params[item] * 1 <= 0) {
+ wx.showToast({
+ title: '请输入正确的金额',
+ icon: 'none'
+ })
+ return;
+ }
+ }
+ console.log(isNull)
+ if (isNull == 1) return;
+ params.type = type;
+ console.log(params);
+
+ let tdata = this.data;
+ let tixian_money = parseFloat(tdata.tixian_money);
+ let max_tixian_money = tdata.commission_info.money;
+ let community_min_money = parseFloat(tdata.community_min_money);
+
+ if (tixian_money == '' || community_min_money > tixian_money) {
+ wx.showToast({
+ title: '最小提现' + community_min_money + '元',
+ icon: "none",
+ })
+ return false;
+ }
+
+ if (tixian_money > max_tixian_money) {
+ wx.showToast({
+ title: '本次最大可提现' + max_tixian_money + '元',
+ icon: "none",
+ })
+ let fee = tdata.community_tixian_fee;
+ let final_money = (max_tixian_money * (100 - fee) / 100).toFixed(2);
+ let sxfee = (max_tixian_money - final_money).toFixed(2);
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money,
+ sxfee
+ })
+ return false;
+ }
+
+ if (!this.canTixian) return;
+ this.canTixian = false;
+ var token = wx.getStorageSync('token');
+ var that = this;
+
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'community.tixian_community_info',
+ token: token,
+ ...params
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ wx.showToast({
+ title: "提现成功,等待审核",
+ icon: "none",
+ duration: 2000,
+ mask: true,
+ success: function () {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/moduleA/groupCenter/cashList',
+ })
+ }
+ });
+ } else {
+ wx.showToast({
+ title: "提现失败",
+ icon: "none",
+ duration: 2000,
+ mask: true
+ });
+ }
+ setTimeout(()=>{
+ that.canTixian = true;
+ }, 500);
+ }
+ })
+ },
+
+ formSubmit: function(event) {
+ let that = this;
+ let is_need_subscript = this.data.is_need_subscript;
+ if(is_need_subscript==1) {
+ //弹出订阅消息
+ this.subscriptionNotice().then(()=>{
+ that.resSubmit(event);
+ }).catch(()=>{
+ that.resSubmit(event);
+ });
+ } else {
+ that.resSubmit(event);
+ }
+ },
+
+ /**
+ * 订阅消息
+ */
+ subscriptionNotice: function() {
+ let that = this;
+ return new Promise((resolve, reject)=>{
+ let obj = that.data.need_subscript_template;
+ let tmplIds = Object.keys(obj).map(key => obj[key]); // 订阅消息模版id
+ if (wx.requestSubscribeMessage) {
+ tmplIds.length && wx.requestSubscribeMessage({
+ tmplIds: tmplIds,
+ success(res) {
+ let is_need_subscript = 1;
+ let acceptId = [];
+ tmplIds.forEach(item=>{
+ if (res[item] == 'accept') {
+ //用户同意了订阅,添加进数据库
+ acceptId.push(item);
+ } else {
+ //用户拒绝了订阅或当前游戏被禁用订阅消息
+ is_need_subscript = 0;
+ }
+ })
+
+ if(acceptId.length) {
+ that.addAccept(acceptId);
+ }
+ that.setData({ is_need_subscript })
+ resolve();
+ },
+ fail(err) {
+ console.log(err)
+ reject();
+ }
+ })
+ } else {
+ // 兼容处理
+ reject();
+ }
+ })
+ },
+
+ // 用户点击订阅添加到数据库
+ addAccept: function (acceptId) {
+ let token = wx.getStorageSync('token');
+ let type = acceptId.join(',');
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.collect_subscriptmsg',
+ token,
+ type
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function () {}
+ })
+ },
+
+ /**
+ * 切换类型
+ */
+ radioChange(e) {
+ this.setData({ type: e.detail.value })
+ }
+
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.json b/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.json
new file mode 100644
index 0000000..11d1f23
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "申请提现",
+ "navigationBarBackgroundColor": "#4facfe",
+ "navigationBarTextStyle": "white",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.wxml
new file mode 100644
index 0000000..f0da725
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.wxml
@@ -0,0 +1,61 @@
+
+
+
+
+ 提现规则:
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.wxss
new file mode 100644
index 0000000..7983f81
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/editInfo.wxss
@@ -0,0 +1,139 @@
+view {
+ box-sizing: border-box;
+}
+
+.edit-info {
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+}
+
+.edit-info .main {
+ font-size: 28rpx;
+}
+
+.edit-info .main .li {
+ height: 88rpx;
+ border-bottom: 2rpx solid #efefef;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ color: #333;
+ padding: 0 30rpx;
+ background-color: #fff;
+}
+
+.edit-info .main .li .left {
+ width: 160rpx;
+}
+
+.edit-info .main .li .right {
+ flex:1;
+ align-items: center;
+}
+
+.edit-info .main .li input {
+ text-align: right;
+}
+
+.edit-info .main .li .placeholder-text {
+ color: #999;
+}
+
+.edit-info .btn-submit {
+ margin: 40rpx 20rpx;
+ width: 710rpx;
+ height: 88rpx;
+ border-radius: 8rpx;
+ background: #4facfe;
+ font-size: 30rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+ color: white;
+ text-align: center;
+ line-height: 88rpx;
+}
+
+.edit-info .btn-submit::after {
+ border: none;
+}
+
+.edit-info .btn-submit-disabled {
+ background: #dcdcdc;
+}
+
+.li-tip {
+ display: flex;
+ padding: 10rpx 30rpx 24rpx;
+ color: #999;
+}
+
+.li-tip .left {
+ flex: 1;
+}
+
+.get-all {
+ color: #4facfe;
+}
+
+.type-wrap {
+ padding: 30rpx;
+ background-color: #fff;
+}
+
+.radio {
+ position: relative;
+ margin-right: 20rpx;
+ width: 38rpx;
+}
+
+.radio text {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+radio {
+ width: 38rpx;
+}
+
+radio .wx-radio-input {
+ border-radius: 50%;
+ width: 24rpx;
+ height: 24rpx;
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before {
+ border-radius: 50%;
+ width: 44rpx;
+ height: 44rpx;
+ line-height: 44rpx;
+ text-align: center;
+ font-size: 28rpx;
+ color: #fff;
+ background: #4facfe;
+ border-color: #4facfe;
+}
+
+.form-box {
+ margin-top: 30rpx;
+}
+
+.form-group {
+ margin-bottom: 20rpx;
+}
+
+.form-ipt {
+ border: 1rpx solid #e5e5e5;
+ padding: 0 10rpx;
+}
+
+.desc {
+ padding: 0 30rpx;
+ line-height: 1.6;
+ font-size: 26rpx;
+ color: #666;
+}
+
+.desc .h2 {
+ font-size: 30rpx;
+ margin-bottom: 10rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.js b/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.js
new file mode 100644
index 0000000..8a2f60c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.js
@@ -0,0 +1,125 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isIpx: false,
+ goods: [{
+ name: '',
+ image: '',
+ status_name: '上架',
+ checked: false
+ }],
+ checkedAll: false,
+ checkedCount: 0
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ if (!util.check_login()) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ app.globalData.isIpx && this.setData({
+ isIpx: true
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+
+ },
+
+ /**
+ * 勾选
+ */
+ checkboxChange: function(e) {
+ var type = e.currentTarget.dataset.type,
+ idx = e.currentTarget.dataset.index,
+ goods = this.data.goods,
+ checkedAll = this.data.checkedAll;
+
+
+ if ("all" === type) {
+ let ck = 0;
+ if (checkedAll) {
+ goods.forEach(function(item) {
+ item.checked = 0;
+ })
+ } else {
+ goods.forEach(function (item) {
+ item.checked = 1;
+ })
+ ck = goods.length;
+ }
+ this.setData({
+ checkedCount: ck,
+ goods: goods,
+ checkedAll: !checkedAll
+ })
+ } else if ("item" === type) {
+ goods.forEach(function (item, t) {
+ if (idx == t) {
+ if (item.checked) {
+ item.checked = 0
+ } else {
+ item.checked = 1
+ }
+ }
+ })
+
+ var ck = 0;
+ goods.forEach(function (item) {
+ if (item.checked) {
+ ck++;
+ }
+ })
+
+ this.setData({
+ checkedCount: ck,
+ goods: goods,
+ checkedAll: ck == goods.length ? true : false
+ })
+ }
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.json b/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.json
new file mode 100644
index 0000000..6adb743
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "商品管理",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "component-img": "../../components/image/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.wxml
new file mode 100644
index 0000000..3fb235e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.wxml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+ {{item.status_name}}
+
+
+
+
+ 暂无数据
+
+
+
+
+
+
+
+
+ 合计:
+ {{checkedCount}}条
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.wxss
new file mode 100644
index 0000000..d8a3ffa
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/goodsManage.wxss
@@ -0,0 +1,202 @@
+.pb80 {
+ padding-bottom: 160rpx;
+}
+
+.no-list {
+ text-align: center;
+ width: 100%;
+ height: 100rpx;
+ line-height: 100rpx;
+ background: #fff;
+}
+
+.check-box {
+ box-sizing: border-box;
+ width: 50rpx;
+ height: 50rpx;
+ display: flex;
+ justify-content: center;
+}
+
+.check-box .checkbox-checked {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.check-box .checkbox-disabled {
+ width: 48rpx;
+ height: 48rpx;
+ margin-top: 2rpx;
+}
+
+.check-box-content {
+ width: 84rpx;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.order-item {
+ border-bottom: 1rpx solid #e5e5e5;
+}
+
+.order-item .order-title {
+ display: flex;
+ align-items: center;
+ background: #fff;
+ height: 188rpx;
+}
+
+.order-item .order-title .order-status {
+ color: #4facfe;
+ font-size: 28rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+}
+
+.order-item .goods-item {
+ display: flex;
+ align-items: center;
+ background: #fff;
+ height: 188rpx;
+ position: relative;
+}
+
+.goods-item .goods-img {
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 30rpx;
+}
+
+.order-item .goods-item .goods-detail {
+ width: 492rpx;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ flex-direction: column;
+}
+
+.order-item .goods-item .goods-detail .goods-title {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ text-overflow: initial;
+ white-space: normal;
+ font-size: 28rpx;
+ height: 80rpx;
+ margin-bottom: 12rpx;
+}
+
+.order-item .goods-item .goods-detail .goods-desc {
+ color: #999;
+ font-size: 26rpx;
+ width: 360rpx;
+}
+
+.order-item .goods-item .goods-sign-btn {
+ height: 52rpx;
+ padding: 0 24rpx;
+ border: 2rpx solid #4facfe;
+ border-radius: 52rpx;
+ text-align: center;
+ line-height: 52rpx;
+ color: #4facfe;
+ position: absolute;
+ right: 24rpx;
+ bottom: 20rpx;
+}
+
+.order-item .goods-item .goods-sign-btn.goods-sign-btn-disabled {
+ border-color: #ccc;
+ color: #ccc;
+}
+
+/* 底部 */
+.bottom-bar {
+ width: 100%;
+ height: 104rpx;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ background: #fff;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ z-index: 9;
+}
+
+.bottom-bar .check-box-content {
+ width: 140rpx;
+}
+
+.bottom-bar .check-box-content .check-box {
+ margin-right: 20rpx;
+}
+
+.bottom-bar .flex {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+}
+
+.bottom-bar .total {
+ margin-right: 20rpx;
+ text-align: right;
+}
+
+.bottom-bar .total span {
+ color: #4facfe;
+}
+
+.bottom-bar .btn {
+ flex: 3;
+ padding: 0 40rpx;
+ height: 80rpx;
+ border-radius: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ color: #fff;
+ font-size: 30rpx;
+ margin-right: 20rpx;
+ background: #4facfe;
+ white-space: nowrap;
+}
+
+.bottom-bar .btn.gray {
+ background: #ff758c;
+}
+
+.bottom-bar .btn.btn-disabled {
+ flex: 1;
+ padding: 0 40rpx;
+ background: #e3e3e3;
+}
+
+.check-box {
+ box-sizing: border-box;
+ width: 50rpx;
+ height: 50rpx;
+ display: flex;
+ justify-content: center;
+}
+
+.check-box .checkbox-checked {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.check-box .checkbox-disabled {
+ width: 48rpx;
+ height: 48rpx;
+ margin-top: 2rpx;
+}
+
+.check-box-content {
+ width: 84rpx;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.js b/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.js
new file mode 100644
index 0000000..4a017f0
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.js
@@ -0,0 +1,196 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ order: {},
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长',
+ localtown_modifypickingname: '包装费'
+ }
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let that = this;
+ status.setGroupInfo().then((groupInfo) => {
+ that.setData({ groupInfo })
+ });
+
+ let is_share = options.is_share || 0;
+
+ this.setData({
+ orderId: options.groupOrderId,
+ is_share:is_share
+ });
+
+ if (util.check_login()) {
+ this.setData({ needAuth: false })
+ } else {
+ this.setData({ needAuth: true });
+ }
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+ this.getData();
+ },
+
+ authSuccess: function () {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, ()=>{
+ that.getData();
+ })
+ },
+
+ /**
+ * 获取数据
+ */
+ getData: function(){
+ var that = this;
+ var token = wx.getStorageSync('token');
+
+ if (this.data.orderId){
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'order.order_head_info',
+ token: token,
+ is_share:this.data.is_share,
+ id: this.data.orderId
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let order = res.data.data;
+ let commision = 0;
+
+ //计算合计佣金和结算状态
+ let is_statements_state = 0;
+ let statements_end_date = '';
+ let head_shipping_fare = 0; // 配送费
+ order && order.order_goods_list && order.order_goods_list.forEach(function (item) {
+ commision += parseFloat(item.commision);
+ head_shipping_fare += parseFloat(item.head_shipping_fare);
+ if(item.is_statements_state==1) {
+ is_statements_state = 1;
+ statements_end_date = item.statements_end_date;
+ }
+ })
+ let { open_aftersale, open_aftersale_time } = res.data;
+ that.setData({
+ order: res.data.data,
+ commision: commision.toFixed(2),
+ is_statements_state,
+ statements_end_date,
+ head_shipping_fare,
+ open_aftersale,
+ open_aftersale_time
+ });
+ that.caclGoodsTot(res.data.data);
+ }
+ }
+ })
+ } else {
+ wx.showModal({
+ title: '提示',
+ content: '订单不存在',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/moduleA/groupCenter/groupList',
+ })
+ }
+ }
+ })
+ }
+ },
+
+ caclGoodsTot: function(order){
+ if(order && order.order_goods_list) {
+ let order_goods_list = order.order_goods_list;
+ let goodsTot = 0;
+ Object.keys(order_goods_list).forEach(k=>{
+ if(order_goods_list[k].is_vipcard_buy==1 || order_goods_list[k].is_level_buy) {
+ goodsTot += order_goods_list[k].total;
+ } else {
+ goodsTot += order_goods_list[k].real_total;
+ }
+ })
+ this.setData({ goodsTot: goodsTot.toFixed(2) })
+ }
+ },
+
+ /**
+ * 状态判断
+ */
+ swithState: function (e) {
+ switch (e) {
+ case "-1":
+ break;
+ case "0":
+ this.setData({
+ orderStatusName: "待成团"
+ });
+ break;
+ case "1":
+ this.setData({
+ orderStatusName: "待配送"
+ });
+ break;
+ case "2":
+ this.setData({
+ orderStatusName: "待收货"
+ });
+ break;
+ case "3":
+ this.setData({
+ orderStatusName: "待提货"
+ });
+ break;
+ case "4":
+ this.setData({
+ orderStatusName: "已完成"
+ });
+ break;
+ case "6":
+ this.setData({
+ orderStatusName: "待采购"
+ });
+ }
+ },
+
+ handleTipDialog: function(){
+ this.setData({
+ showTipDialog: !this.data.showTipDialog
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.json b/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.json
new file mode 100644
index 0000000..81d9fa3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.json
@@ -0,0 +1,16 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "团单详情",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-auth": "../../components/auth/index",
+ "i-img": "../../components/img/index",
+ "i-goods-info": "../../components/goodsInfo/index",
+ "i-order-info-express": "../../components/order/orderInfoExpress",
+ "i-orderComment": "../../components/orderComment/index",
+ "i-order-info": "../../components/orderInfo/index",
+ "i-modal": "../../components/modal/index",
+ "i-cashon_delivery": "../../components/cashon_delivery/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.wxml
new file mode 100644
index 0000000..e3700f4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.wxml
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 商品详情(共计{{order.goods_count?order.goods_count:0}}件商品)
+ {{order.order_status_info.name}}
+
+
+
+
+
+
+ {{goodsInfo.name}}
+
+
+
+
+ 规格:{{goodsInfo.option_str}} 数量:{{goodsInfo.quantity}}
+
+
+
+ ¥{{goodsInfo.price}}
+
+
+
+
+
+ 商品金额: ¥{{goodsInfo.old_total}}
+ 退款金额: ¥{{goodsInfo.has_refund_money}}
+
+ {{goodsInfo.refund_info.real_refund_quantity}}个 申请中
+ {{goodsInfo.refund_info.real_refund_quantity}}个 退款成功
+ {{goodsInfo.refund_info.real_refund_quantity}}个 退款失败
+
+
+
+
+ 有效金额: ¥{{goodsInfo.order_jishu}}
+ 佣金比例: {{goodsInfo.fen_bili+'%'}}
+ 佣金固定金额: {{goodsInfo.fen_gumoney}}
+
+
+
+
+
+ 货到付款
+
+
+
+ 团长配送费:¥{{head_shipping_fare}} (归团长收入)
+
+
+ 实际佣金:¥{{commision}}
+
+ ({{is_statements_state==1?'已结算':'待结算'}} {{statements_end_date}})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 佣金计算规则
+
+ 佣金结算前:有效金额=商品金额-退款金额
+ 佣金结算后:有效金额=商品金额
+
+ 佣金固定金额:
+ 实际佣金(有效金额-退款金额)/有效金额*佣金固定金额
+
+
+ 商品配送费:
+ 商品配送费收入=有效金额/订单总金额*总配送费
+
+
+
+ 商品配送费:
+
+ 1. 商品配送费收入=有效金额/订单总金额*总配送费
+ 2. 退商品配送费=退款金额/有效金额*配送费
+
+
+
+ 配送费结算时间:
+ 从确认收货或核销后开始,直到售后期{{open_aftersale_time||0}}天结束,系统自动结算
+
+
+
+ 佣金结算时间:
+ 从确认收货或核销后开始,直到售后期{{open_aftersale_time||0}}天结束,系统自动结算
+
+ 最终可得佣金以实际计算结果为准
+
+ 知道了
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.wxss
new file mode 100644
index 0000000..884fe2e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail.wxss
@@ -0,0 +1,269 @@
+.groupDetail {
+ width: 100%;
+ overflow: hidden;
+}
+
+.groupDetail .orderStatus {
+ height: 200rpx;
+ background: #4facfe;
+ padding-left: 60rpx;
+ padding-right: 120rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupDetail .orderStatus .orderStatusName {
+ font-size: 34rpx;
+ color: #fff;
+}
+
+.groupDetail .orderStatus .toBeGroupImg {
+ width: 126rpx;
+ height: 126rpx;
+}
+
+.groupDetail .orderStatus .forShippingImg {
+ width: 126rpx;
+ height: 126rpx;
+}
+
+.groupDetail .orderStatus .toSignImg {
+ width: 126rpx;
+ height: 126rpx;
+}
+
+.groupDetail .orderStatus .toPickUpImg {
+ width: 126rpx;
+ height: 126rpx;
+}
+
+.groupDetail .orderStatus .successfulDealImg {
+ width: 126rpx;
+ height: 126rpx;
+}
+
+.groupDetail .orderStatus .purchaseImg {
+ width: 122rpx;
+ height: 108rpx;
+}
+
+.groupDetail .goodsDetail {
+ background: #fff;
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.05);
+ border-radius: 20rpx;
+ margin: 20rpx 20rpx;
+}
+
+.groupDetail .goodsDetail .title {
+ height: 80rpx;
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+ font-size: 28rpx;
+ color: #444;
+ border-bottom: 1rpx solid #efefef;
+ font-weight: 500;
+}
+
+.groupDetail .goodsDetail .title span:first-of-type {
+ flex: 1;
+}
+
+.groupDetail .goodsDetail .title span:last-of-type {
+ color: #be965a;
+}
+
+.groupDetail .goodsDetail .title .black {
+ color: #aaa !important;
+}
+
+.groupDetail .goodsDetail .goodsList {
+ padding: 30rpx;
+ /* border-bottom: 1rpx solid #efefef; */
+ display: flex;
+ justify-content: flex-start;
+}
+
+.groupDetail .goodsDetail .goodsList .goodsImg {
+ width: 120rpx;
+ margin-right: 20rpx;
+}
+
+.groupDetail .goodsDetail .goodsList .goodsImg .img-class {
+ width: 120rpx;
+ height: 120rpx;
+}
+
+.groupDetail .goodsDetail .goodsList .goos-item {
+ width: 510rpx;
+ line-height: 40rpx;
+}
+
+.groupDetail .goodsDetail .goodsList .goos-item .goodsTitle {
+ font-size: 28rpx;
+ color: #444;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 1;
+ overflow: hidden;
+ text-overflow: initial;
+ white-space: normal;
+}
+
+.groupDetail .goodsDetail .goodsList .goos-item .attribute {
+ font-size: 24rpx;
+ line-height: 42rpx;
+ color: #999;
+ display: flex;
+}
+
+.groupDetail .goodsDetail .goodsList .goos-item .attribute span:first-of-type {
+ flex: 1;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 1;
+ overflow: hidden;
+ text-overflow: initial;
+ white-space: normal;
+}
+
+.groupDetail .goodsDetail .goodsList .goos-item .attribute .checkRecord {
+ display: inline-block;
+}
+
+.groupDetail .goodsDetail .goodsList .goos-item .attribute .checkRecord .checkRecordList {
+ width: 144rpx;
+ height: 48rpx;
+ border: 1rpx solid #b6b6b6;
+ border-radius: 24rpx;
+ font-size: 26rpx;
+ color: #333;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.groupDetail .goodsDetail .goodsList .goos-item .time {
+ color: #aaa;
+ font-size: 24rpx;
+ line-height: 28rpx;
+ position: relative;
+ width: 400rpx;
+}
+
+.groupDetail .goodsDetail .goodsList .goos-item .time .last {
+ position: absolute;
+ left: 190rpx;
+}
+
+.groupDetail .goodsDetail .end {
+ padding: 0 30rpx;
+ font-size: 28rpx;
+ height: 90rpx;
+ line-height: 90rpx;
+ color: #444;
+ font-weight: 500;
+}
+
+.groupDetail .goodsDetail .end span:first-of-type {
+ float: right;
+}
+
+.groupDetail .goodsDetail .end span:first-of-type text {
+ color: #4facfe;
+}
+
+.groupDetail .goodsDetail .end span:last-of-type {
+ float: right;
+ margin-right: 20rpx;
+}
+
+.groupDetail .total {
+ padding: 24rpx 20rpx;
+ background: #fff;
+ margin-bottom: 20rpx;
+ font-size: 26rpx;
+ display: flex;
+ justify-content: space-between;
+ flex-direction: column;
+}
+
+.groupDetail .total .totalList {
+ font-size: 24rpx;
+ color: #999;
+ margin-bottom: 10rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupDetail .total .totalList:last-child {
+ margin: 0;
+}
+
+.groupDetail .total .totalList .mark {
+ font-size: 28rpx;
+ color: #333;
+}
+
+.groupDetail .total .totalList .realPayPrice {
+ font-size: 28rpx;
+ color: #ff758c;
+}
+
+.groupDetail .orderInfor {
+ background: #fff;
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0,0,0,0.05);
+ border-radius: 20rpx;
+ margin: 0rpx 20rpx;
+}
+
+.groupDetail .orderInfor .for-title {
+ height: 80rpx;
+ padding: 0 30rpx;
+ display: flex;
+ font-weight: 500;
+ align-items: center;
+ font-size: 28rpx;
+ color: #444;
+ border-bottom: 1rpx solid #efefef;
+}
+
+.groupDetail .orderInfor .for-content {
+ font-size: 24rpx;
+ color: #444;
+ display: flex;
+ flex-direction: column;
+ line-height: 46rpx;
+ margin-bottom: 20rpx;
+ padding: 30rpx;
+}
+
+.groupDetail .orderInfor .for-content view {
+ display: flex;
+ align-items: center;
+}
+
+.groupDetail .orderInfor .for-content view span {
+ flex: 1;
+ color: #aaa;
+}
+
+.price-text {
+ margin-top: 4rpx;
+ font-size: 28rpx;
+ font-weight: 600;
+ color: #4facfe;
+}
+
+.orderComment {
+ margin: 0 20rpx;
+}
+
+.tips .tag {
+ font-size: 20rpx;
+ padding: 4rpx 8rpx;
+ border-radius: 5rpx;
+ margin-left: 10rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/groupList.js b/eaterplanet_ecommerce/moduleA/groupCenter/groupList.js
new file mode 100644
index 0000000..5134015
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/groupList.js
@@ -0,0 +1,288 @@
+var app = getApp();
+var status = require('../../utils/index.js');
+
+Page({
+ data: {
+ currentTab: 0,
+ pageSize: 10,
+ navList: [{
+ name: "全部",
+ id: "0"
+ }, {
+ name: "待配送",
+ id: "1"
+ },
+ {
+ name: "待签收",
+ id: "2"
+ },
+ {
+ name: "待提货",
+ id: "3"
+ }, {
+ name: "已完成",
+ id: "4"
+ }
+ ],
+ loadText: "",
+ disUserId: "",
+ no_order: 0,
+ page: 1,
+ hide_tip: true,
+ order: [],
+ tip: '正在加载',
+ searchfield: [
+ {
+ field: 'ordersn',
+ name: '订单号'
+ },
+ {
+ field: 'member',
+ name: '会员昵称'
+ },
+ {
+ field: 'address',
+ name: '配送联系人'
+ },
+ {
+ field: 'mobile',
+ name: '下单手机号'
+ },
+ {
+ field: 'location',
+ name: '配送地址'
+ },
+ {
+ field: 'goodstitle',
+ name: '商品标题'
+ }
+ ],
+ fieldIdx: 0,
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ }
+ },
+ searchOBj: {},
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let that = this;
+ status.setGroupInfo().then((groupInfo) => {
+ that.setData({ groupInfo })
+ });
+ var currentTab = 0;
+ if (options != undefined) {
+ currentTab = options.tab;
+ }
+ this.setData({
+ currentTab: currentTab
+ });
+ this.getData(currentTab);
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ // todo
+ },
+
+ bindFiledChange: function (e) {
+ this.setData({
+ fieldIdx: e.detail.value
+ })
+ },
+
+ searchByKey: function (e) {
+ let that = this;
+ let { searchfield, fieldIdx } = this.data;
+ let field = searchfield[fieldIdx].field;
+ let keyword = e.detail.value || '';
+ this.searchOBj = { keyword, searchfield: field };
+ this.setData({
+ page: 1,
+ order: []
+ },()=>{
+ that.getData();
+ });
+ },
+
+ callPhone: function(e){
+ var that = this;
+ var phoneNumber = e.currentTarget.dataset.phone;
+ phoneNumber && wx.makePhoneCall({
+ phoneNumber: phoneNumber
+ });
+ },
+
+ /**
+ * 导航切换
+ */
+ switchNav: function (t) {
+ if (this.data.currentTab === 1 * t.currentTarget.dataset.id) return false;
+ this.setData({
+ currentTab: 1 * t.currentTarget.dataset.id,
+ page: 1,
+ order: []
+ });
+ this.getData();
+ },
+
+ /**
+ * 获取数据
+ */
+ getData: function () {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+ this.setData({
+ isHideLoadMore: true
+ })
+
+ this.data.no_order = 1
+ let that = this;
+ var token = wx.getStorageSync('token');
+
+ var currentTab = this.data.currentTab;
+ var order_status = -1;
+ if (currentTab == 1) {
+ order_status = 1;
+ } else if (currentTab == 2) {
+ order_status = 14;
+ } else if (currentTab == 3) {
+ order_status = 4;
+ } else if (currentTab == 4) {
+ order_status = 6;
+ }
+
+ //currentTab
+
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'order.orderlist',
+ is_tuanz: 1,
+ token: token,
+ page: that.data.page,
+ order_status: order_status,
+ ...this.searchOBj
+ },
+ dataType: 'json',
+ success: function (res) {
+ let { open_aftersale, open_aftersale_time } = res.data;
+ let h = { open_aftersale, open_aftersale_time };
+ if (res.data.code == 0) {
+ console.log(that.data.page);
+ let data = res.data.data;
+ let rushList = that.data.order.concat(data);
+
+ that.setData({
+ order: rushList,
+ hide_tip: true,
+ no_order: 0,
+ ...h
+ });
+ wx.hideLoading();
+ } else {
+ that.setData({
+ isHideLoadMore: true,
+ ...h
+ })
+ wx.hideLoading();
+ return false;
+ }
+
+ }
+ })
+ },
+
+ sign_one: function (e) {
+ var that = this;
+ var order_id = e.currentTarget.dataset.order_id;
+ var token = wx.getStorageSync('token');
+ wx.showModal({
+ title: '提示',
+ content: '确认提货',
+ confirmColor: '#F75451',
+ success(res) {
+ if (res.confirm) {
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'order.sign_dan_order',
+ token: token,
+ order_id: order_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.showToast({
+ title: '签收成功',
+ duration: 1000
+ })
+
+ var order = that.data.order;
+ var new_order = [];
+ for (var i in order) {
+ if (order[i].order_id != order_id) {
+ new_order.push(order[i]);
+ }
+ }
+ that.setData({
+ order: new_order
+ })
+ }
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 跳转订单详情
+ */
+ goOrderDetail: function (t) {
+ var a = t.currentTarget.dataset.order_id;
+ wx.navigateTo({
+ url: "/eaterplanet_ecommerce/moduleA/groupCenter/groupDetail?groupOrderId=" + a
+ });
+ },
+
+ onReachBottom: function () {
+ if (this.data.no_order == 1) return false;
+ this.data.page += 1;
+ this.getData();
+
+ this.setData({
+ isHideLoadMore: false
+ })
+
+ },
+
+ handleTipDialog: function(e){
+ let fen_type = e.currentTarget.dataset.type || 0;
+ this.setData({
+ showTipDialog: !this.data.showTipDialog,
+ fen_type
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/groupList.json b/eaterplanet_ecommerce/moduleA/groupCenter/groupList.json
new file mode 100644
index 0000000..fb02a72
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/groupList.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "我的团单",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index",
+ "i-modal": "../../components/modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/groupList.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/groupList.wxml
new file mode 100644
index 0000000..be7eeb4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/groupList.wxml
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+ {{searchfield[fieldIdx].name}}
+
+
+
+
+
+
+
+
+
+
+
+ 您还没有相关的订单~
+
+ 去购物
+
+
+
+
+
+
+ 团单日期:{{item.createTime}}
+ {{item.status_name}}
+
+
+
+
+
+ {{goods.name}}
+ 货到付款
+
+
+ 商品数量:{{goods.quantity}}
+ 规格:{{goods.option_str}}
+
+
+ 商品金额:¥{{goods.total}}
+
+
+ 有效金额: ¥{{goods.order_jishu}}
+ 佣金固定金额: {{goods.fen_gumoney}}
+ 佣金比例: {{goods.fen_bili+'%'}}
+
+
+ 团长配送费: ¥{{goods.head_shipping_fare||0.00}}
+
+ 实际佣金: ¥{{goods.commision}}
+
+
+
+
+
+ 已退款
+
+ 退款金额:¥{{goods.refund_info.ref_money}}
+ {{goods.refund_info.real_refund_quantity}}个 申请中
+ {{goods.refund_info.real_refund_quantity}}个 退款成功
+ {{goods.refund_info.real_refund_quantity}}个 退款失败
+
+
+
+
+
+
+
+ {{item.shipping_name}}
+
+
+ 确认签收
+ 查看详情
+
+
+
+
+
+
+
+
+
+
+ 佣金计算规则
+
+ 佣金结算前:有效金额=商品金额-退款金额
+ 佣金结算后:有效金额=商品金额
+
+ 佣金固定金额:
+ 实际佣金(有效金额-退款金额)/有效金额*佣金固定金额
+
+
+ 商品配送费:
+ 商品配送费收入=有效金额/订单总金额*总配送费
+
+
+
+ 商品配送费:
+
+ 1. 商品配送费收入=有效金额/订单总金额*总配送费
+ 2. 退商品配送费=退款金额/有效金额*配送费
+
+
+
+ 配送费结算时间:
+ 从确认收货或核销后开始,直到售后期{{open_aftersale_time||0}}天结束,系统自动结算
+
+
+
+ 佣金结算时间:
+ 从确认收货或核销后开始,直到售后期{{open_aftersale_time||0}}天结束,系统自动结算
+
+ 最终可得佣金以实际计算结果为准
+
+ 知道了
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/groupList.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/groupList.wxss
new file mode 100644
index 0000000..2b3429a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/groupList.wxss
@@ -0,0 +1,398 @@
+.fixed-top {
+ width: 100%;
+ position: relative;
+ left: 0;
+ top: 0;
+ z-index: 10;
+}
+
+.nav-bar .nav-bar-inner {
+ display: flex;
+ justify-content: space-between;
+ padding: 0 60rpx;
+ background-color: #fff;
+}
+
+.nav-bar .nav-bar-item {
+ position: relative;
+ word-break: keep-all;
+ font-size: 28rpx;
+ font-weight: 500;
+ color: #666;
+ padding: 20rpx 0;
+}
+
+.nav-bar .current.nav-bar-item::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ height: 3px;
+ background: linear-gradient(90deg,#4facfe 0%,#00f2fe 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255,89,0,0.25);
+ border-radius: 24rpx;
+}
+
+.content-list {
+ background-color: #f6f6f6;
+ padding-top: 100rpx;
+ height: 100%;
+}
+
+.order-scroll-view {
+ width: 750rpx;
+ height: 100%;
+}
+
+.noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.noRecordCon .noRecordImg {
+ width: 132rpx;
+ height: 138rpx;
+ margin-top: 50%;
+}
+
+.noRecordCon .noRefundImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 50%;
+}
+
+.noRecordCon .noRecord {
+ padding-top: 32rpx;
+ font-size: 30rpx;
+ font-family: PingFangSC-Light;
+ font-weight: 300;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.noRecordCon .goIndex {
+ width: 164rpx;
+ height: 60rpx;
+ background: #4facfe;
+ border-radius: 30rpx;
+ font-size: 28rpx;
+ color: #fff;
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.refresh {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+ border: 1rpx solid #999;
+ position: fixed;
+ right: 50rpx;
+ bottom: 200rpx;
+ font-size: 20rpx;
+ color: #fff;
+ background: #000;
+ opacity: 0.5;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.refresh image {
+ width: 32rpx;
+ height: 32rpx;
+ margin-bottom: 4rpx;
+}
+
+.groupList {
+ width: 100%;
+}
+
+.groupList .nav {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 10;
+ background: #fff;
+ height: 90rpx;
+ border-top: 1rpx solid #f2f2f2;
+ border-bottom: 1rpx solid #f2f2f2;
+ padding: 0 100rpx;
+ width: unset;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupList .nav .on {
+ color: #be965a;
+}
+
+.groupList .nav .line {
+ background: linear-gradient(90deg,#4facfe 0%,#00f2fe 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(229,185,131,0.5);
+ border-radius: 24rpx;
+}
+
+.groupList .noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.groupList .noRecordCon .noRecordImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 200rpx;
+}
+
+.groupList .noRecordCon .noRefundImg {
+ width: 158rpx;
+ height: 140rpx;
+ margin-top: 200rpx;
+}
+
+.groupList .noRecordCon .noRecord {
+ padding-top: 18rpx;
+ font-size: 28rpx;
+ color: #999;
+}
+
+.groupList .noRecordCon .goIndex {
+ width: 164rpx;
+ height: 60rpx;
+ background: linear-gradient(90deg,#4facfe 0%,#00f2fe 100%);
+ border-radius: 30rpx;
+ font-size: 28rpx;
+ color: #fff;
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.groupList .item {
+ margin-bottom: 20rpx;
+ overflow: hidden;
+}
+
+.song_button{
+ position: relative;
+ /* height:60rpx; */
+ padding: 20rpx 30rpx;
+ display: flex;
+ justify-content: space-between;
+ border-top: 1rpx solid #efefef;
+}
+
+.goods-sign-btn {
+ display: inline-block;
+ height: 52rpx;
+ padding: 0 24rpx;
+ border: 2rpx solid #4facfe;
+ border-radius: 52rpx;
+ text-align: center;
+ line-height: 52rpx;
+ color: #4facfe;
+}
+
+.goods-sign-btn.gray {
+ color: #666;
+ border: 2rpx solid #efefef;
+ margin-left: 14rpx;
+}
+
+.goods-sign-btn image {
+ width: 24rpx;
+ height: 24rpx;
+}
+
+swiper-item {
+ height: auto;
+}
+
+
+/** 订单列表begin **/
+.item {
+ background: #fff;
+ overflow: hidden;
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.05);
+ border-radius: 20rpx;
+ margin: 0rpx 20rpx;
+}
+
+.orderNum {
+ height: 80rpx;
+ font-size: 26rpx;
+ color: #333;
+ padding: 0 30rpx;
+ border-bottom: 1rpx solid #efefef;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.orderNum .statusName {
+ color: #be965a;
+ font-weight: 500;
+}
+
+.orderNum .black {
+ color: #aaa;
+}
+
+.spu {
+ padding: 30rpx 30rpx 20rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.spu .goodsImg {
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 20rpx;
+}
+
+.spu .goodsImg .img-class {
+ width: 120rpx;
+ height: 120rpx;
+}
+
+.spu .detail {
+ margin-left: 20rpx;
+ font-size: 24rpx;
+ color: #aaa;
+}
+
+.spu .detail .spuName {
+ color: #444;
+ font-size: 28rpx;
+ font-weight: 500;
+ overflow: hidden;
+}
+
+.spu .detail .tips {
+ line-height: 1;
+ width: 530rpx;
+ margin-top: 16rpx;
+ position: relative;
+}
+
+.spu .detail .tips .last {
+ float:right;
+}
+
+.spu .detail .tips .price {
+ color: #4facfe;
+ font-size: 32rpx;
+}
+
+.gold {
+ color: gold;
+}
+
+/**订单列表end ***/
+
+.commision-box {
+ display: flex;
+ flex-direction: row-reverse;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 26rpx;
+ color: #777;
+ margin-bottom: 30rpx;
+ padding-left: 140rpx;
+ padding-right: 30rpx;
+}
+
+/* 搜索 */
+.search-box {
+ background: #fff;
+ padding: 20rpx 30rpx;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ position: relative;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+}
+
+.filed {
+ width: 190rpx;
+ margin-right: 20rpx;
+ border: 1rpx solid #ececec;
+ box-sizing: border-box;
+ height: 56rpx;
+ line-height: 56rpx;
+ padding: 0 15rpx;
+ font-size: 24rpx;
+ border-radius: 6rpx;
+}
+
+.filed .picker {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.filed .iconfont {
+ font-size: 14rpx;
+ color: #ccc;
+}
+
+.search {
+ position: relative;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ flex: 1;
+}
+
+.search .icon-search {
+ position: absolute;
+ left: 20rpx;
+}
+
+.search input {
+ padding-left: 60rpx;
+ width: 100%;
+ height: 56rpx;
+ background: #f8f8f8;
+ border-radius: 6rpx;
+ color: #999;
+ box-sizing: border-box;
+ line-height: 40rpx;
+}
+
+.search text {
+ color: #ff673f;
+ margin-left: 28rpx;
+}
+
+.dialogText {
+ box-sizing: border-box;
+ padding: 20rpx;
+ height: 140rpx!important;
+ text-align: justify;
+}
+
+.dialogBtn {
+ font-size: 30rpx!important;
+ height: 68rpx!important;
+ line-height: 68rpx!important;
+}
+
+.tips .tag {
+ font-size: 20rpx;
+ padding: 4rpx 8rpx;
+ border-radius: 5rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.js b/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.js
new file mode 100644
index 0000000..84cd92b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.js
@@ -0,0 +1,137 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ distributeInfo: {},
+ list: [],
+ stateName: ["未结算", "已结算", "已取消"],
+ typeName: { commiss: "订单分佣", tuijian: "推荐下级奖励" },
+ noData: 0,
+ tip: '加载中',
+ isHideLoadMore: true
+ },
+ page: 1,
+ hasMore: true,
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let that = this;
+ let commiss_diy_name = wx.getStorageSync('commiss_diy_name') || '分销';
+ status.setGroupInfo().then((groupInfo) => {
+ let owner_name = groupInfo && groupInfo.owner_name || '团长';
+ wx.setNavigationBarTitle({
+ title: owner_name + commiss_diy_name,
+ })
+ that.setData({ groupInfo })
+ });
+ this.setData({ commiss_diy_name })
+
+ if (!util.check_login()) {
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ wx.showLoading();
+ this.getList();
+ },
+
+ getData(){
+ var token = wx.getStorageSync('token');
+ var that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'community.get_head_distribute_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ that.setData({
+ distributeInfo: res.data.data
+ })
+ } else {
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ },
+
+ getList() {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ if(!that.hasMore) { return; }
+ this.setData({ isHideLoadMore: false })
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'community.get_head_distribute_order',
+ token: token,
+ page: that.page,
+ type: '',
+ level: ''
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let oldList = that.data.list;
+ let list = oldList.concat(res.data.data);
+ that.setData({ list, isHideLoadMore: true })
+ } else {
+ if (that.data.list.length==0 && that.page==1) that.setData({ noData: 1 })
+ that.hasMore = false;
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.getData();
+ console.log(this.page)
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ this.page++;
+ this.getList();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.json b/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.json
new file mode 100644
index 0000000..5b6a5df
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "",
+ "navigationBarBackgroundColor": "#4facfe",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.wxml
new file mode 100644
index 0000000..26c839e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.wxml
@@ -0,0 +1,70 @@
+
+
+
+
+
+ 总收入
+ {{distributeInfo.total_money}}
+ 推荐二维码
+
+
+
+ 待结算
+ {{distributeInfo.wait_money}}
+
+
+ 已确认
+ {{distributeInfo.success_money}}
+
+
+ {{groupInfo.owner_name}}数量
+ {{distributeInfo.level_count1}}
+ {{distributeInfo.level_count2}}
+ {{distributeInfo.level_count3}}
+
+
+
+
+
+ 佣金明细
+
+
+
+ {{item.order_num_alias}}
+ {{stateName[item.state]}}
+
+
+
+ 类型
+ {{typeName[item.type]}}
+
+
+ {{commiss_diy_name}}等级
+ {{item.level}}级
+
+
+ 订单状态
+ {{item.order_status}}
+
+
+ 下级团长名称
+ {{item.child_head_name}}
+
+
+ 下级团长社区名称
+ {{item.community_name}}
+
+
+
+ {{item.addtime}}
+ 奖励金额: ¥{{item.money}}
+
+
+
+
+
+
+ 暂无任何明细记录
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.wxss
new file mode 100644
index 0000000..a7fe89f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/gruopInfo.wxss
@@ -0,0 +1,229 @@
+.zr {
+ background: #4facfe;
+ width: 100%;
+ height: 130px;
+ position: relative;
+ overflow: hidden;
+}
+
+.water {
+ position: absolute;
+ left: 0;
+ bottom: -10px;
+ height: 30px;
+ width: 100%;
+ z-index: 1;
+}
+
+.water-c {
+ position: relative;
+}
+
+.water-1 {
+ background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjYwMHB4IiBoZWlnaHQ9IjYwcHgiIHZpZXdCb3g9IjAgMCA2MDAgNjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCAzLjQgKDE1NTc1KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT53YXRlci0xPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9IuaIkSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc2tldGNoOnR5cGU9Ik1TUGFnZSI+CiAgICAgICAgPGcgaWQ9Ii0iIHNrZXRjaDp0eXBlPSJNU0FydGJvYXJkR3JvdXAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMjEuMDAwMDAwLCAtMTMzLjAwMDAwMCkiIGZpbGwtb3BhY2l0eT0iMC4zIiBmaWxsPSIjRkZGRkZGIj4KICAgICAgICAgICAgPGcgaWQ9IndhdGVyLTEiIHNrZXRjaDp0eXBlPSJNU0xheWVyR3JvdXAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyMS4wMDAwMDAsIDEzMy4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDcuNjk4NTczOTUgTDQuNjcwNzE5NjJlLTE1LDYwIEw2MDAsNjAgTDYwMCw3LjM1MjMwNDYxIEM2MDAsNy4zNTIzMDQ2MSA0MzIuNzIxMDUyLDI0LjEwNjUxMzggMjkwLjQ4NDA0LDcuMzU2NzQxODcgQzE0OC4yNDcwMjcsLTkuMzkzMDMwMDggMCw3LjY5ODU3Mzk1IDAsNy42OTg1NzM5NSBaIiBpZD0iUGF0aC0xIiBza2V0Y2g6dHlwZT0iTVNTaGFwZUdyb3VwIj48L3BhdGg+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==") repeat-x;
+ background-size: 600px;
+ -webkit-animation: wave-animation-1 3.5s infinite linear;
+ animation: wave-animation-1 3.5s infinite linear;
+}
+
+.water-2 {
+ top: 5px;
+ background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjYwMHB4IiBoZWlnaHQ9IjYwcHgiIHZpZXdCb3g9IjAgMCA2MDAgNjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCAzLjQgKDE1NTc1KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT53YXRlci0yPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9IuaIkSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc2tldGNoOnR5cGU9Ik1TUGFnZSI+CiAgICAgICAgPGcgaWQ9Ii0iIHNrZXRjaDp0eXBlPSJNU0FydGJvYXJkR3JvdXAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMjEuMDAwMDAwLCAtMjQ2LjAwMDAwMCkiIGZpbGw9IiNGRkZGRkYiPgogICAgICAgICAgICA8ZyBpZD0id2F0ZXItMiIgc2tldGNoOnR5cGU9Ik1TTGF5ZXJHcm91cCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTIxLjAwMDAwMCwgMjQ2LjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHBhdGggZD0iTTAsNy42OTg1NzM5NSBMNC42NzA3MTk2MmUtMTUsNjAgTDYwMCw2MCBMNjAwLDcuMzUyMzA0NjEgQzYwMCw3LjM1MjMwNDYxIDQzMi43MjEwNTIsMjQuMTA2NTEzOCAyOTAuNDg0MDQsNy4zNTY3NDE4NyBDMTQ4LjI0NzAyNywtOS4zOTMwMzAwOCAwLDcuNjk4NTczOTUgMCw3LjY5ODU3Mzk1IFoiIGlkPSJQYXRoLTIiIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDMwMC4wMDAwMDAsIDMwLjAwMDAwMCkgc2NhbGUoLTEsIDEpIHRyYW5zbGF0ZSgtMzAwLjAwMDAwMCwgLTMwLjAwMDAwMCkgIj48L3BhdGg+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==") repeat-x;
+ background-size: 600px;
+ -webkit-animation: wave-animation-2 6s infinite linear;
+ animation: wave-animation-2 6s infinite linear;
+}
+
+.water-1, .water-2 {
+ position: absolute;
+ width: 100%;
+ height: 60px;
+}
+
+.back-white {
+ background: #f6f6f6;
+}
+
+@keyframes wave-animation-1 {
+ 0% {
+ background-position: 0 top;
+ }
+
+ 100% {
+ background-position: 600px top;
+ }
+}
+
+@keyframes wave-animation-2 {
+ 0% {
+ background-position: 0 top;
+ }
+
+ 100% {
+ background-position: 600px top;
+ }
+}
+
+.top_box {
+ color: #fff;
+ font-size: 28rpx;
+ line-height: 1;
+}
+
+.total {
+ text-align: center;
+ padding-top: 10rpx;
+ padding-bottom: 40rpx;
+}
+
+.total-money {
+ font-weight: bold;
+ font-size: 50rpx;
+ margin-top: 18rpx;
+}
+
+.three {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.three-item {
+ position: relative;
+ flex: 1;
+ text-align: center;
+}
+
+.three-item::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 1rpx;
+ border-left: 1rpx solid #ffb193;
+}
+
+.three-item:first-child::before {
+ content: none;
+}
+
+.three-money {
+ margin-top: 15rpx;
+}
+
+.list {
+ position: relative;
+}
+
+.list-title {
+ position: relative;
+ font-size: 30rpx;
+ color: #333;
+ margin: 30rpx;
+ padding-left: 15rpx;
+}
+
+.list .list-item {
+ width: 710rpx;
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.05);
+ border-radius: 20rpx;
+ margin: 20rpx auto 0;
+ background: #fff;
+}
+
+.list .list-item:last-of-type {
+ margin: 20rpx auto;
+}
+
+.list-title::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 4rpx;
+ bottom: 4rpx;
+ border-left: 6rpx solid #4facfe;
+}
+
+.distributionNum {
+ height: 80rpx;
+ font-size: 26rpx;
+ color: #333;
+ padding: 0 30rpx;
+ border-top-left-radius: 20rpx;
+ border-top-right-radius: 20rpx;
+ border-bottom: 2rpx solid #e4e4e4;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.distributionNum .distributionTime {
+ font-size: 24rpx;
+ color: #666;
+}
+
+.distributionNum .statusName {
+ font-size: 26rpx;
+ color: #4facfe;
+}
+
+.distributionCommision {
+ border-top: 2rpx solid #e4e4e4;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 80rpx;
+ font-size: 26rpx;
+ color: #777;
+ padding: 0 30rpx;
+}
+
+.details {
+ padding: 10rpx 30rpx;
+ line-height: 1.6;
+ font-size: 24rpx;
+ color: #666;
+}
+
+.details-item {
+ display: flex;
+ justify-content: space-between;
+ align-content: center;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-top: 150rpx;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+ margin-left: 8rpx;
+}
+
+.qrcode {
+ position: absolute;
+ right: 30rpx;
+ font-size: 24rpx;
+ top: 20rpx;
+ border: 1rpx solid #fff;
+ padding: 5rpx 10rpx;
+ border-radius: 10rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/headlist.js b/eaterplanet_ecommerce/moduleA/groupCenter/headlist.js
new file mode 100644
index 0000000..055e46a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/headlist.js
@@ -0,0 +1,111 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ noData: 0,
+ tip: '加载中',
+ isHideLoadMore: true,
+ level: '',
+ groupInfo: {
+ owner_name: '团长'
+ }
+ },
+ page: 1,
+ hasMore: true,
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let level = options.level || '';
+ this.setData({ level });
+ let that = this;
+ status.setGroupInfo().then((groupInfo) => {
+ let owner_name = groupInfo && groupInfo.owner_name || '团长';
+ wx.setNavigationBarTitle({
+ title: `${owner_name}列表`,
+ })
+ that.setData({ groupInfo })
+ });
+ if (!util.check_login()) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ wx.showLoading();
+ this.getList();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ getList() {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ if (!that.hasMore) { return; }
+ this.setData({ isHideLoadMore: false })
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'community.get_head_child_headlist',
+ token: token,
+ page: that.page,
+ level: that.data.level
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let oldList = that.data.list;
+ let list = oldList.concat(res.data.data);
+ that.setData({ list, isHideLoadMore: true })
+ } else {
+ if (that.data.list.length == 0 && that.page == 1) that.setData({ noData: 1 })
+ that.hasMore = false;
+ }
+ }
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ this.page++;
+ this.getList();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/headlist.json b/eaterplanet_ecommerce/moduleA/groupCenter/headlist.json
new file mode 100644
index 0000000..c84de7d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/headlist.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "团长列表",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/headlist.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/headlist.wxml
new file mode 100644
index 0000000..99af75e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/headlist.wxml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+ {{item.username}}
+ {{item.level_name}}
+
+
+ {{item.community_name}}
+ {{item.head_name}}
+
+
+ {{item.apptime}}
+
+
+
+
+
+
+ 暂无下级{{owner_name}}
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/headlist.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/headlist.wxss
new file mode 100644
index 0000000..9a1231f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/headlist.wxss
@@ -0,0 +1,55 @@
+.list-item {
+ display: flex;
+ padding: 30rpx;
+ background-color: #fff;
+ font-size: 28rpx;
+ border-bottom: 1rpx solid #e5e5e5;
+}
+
+.list-item .left {
+ width: 80rpx;
+ margin-right: 20rpx;
+}
+
+.list-item .left image {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+}
+
+
+.list-item .right {
+ flex: 1;
+}
+
+.list-item .right .ll {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ line-height: 50rpx;
+}
+
+.time {
+ font-size: 26rpx;
+ color: #999;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-top: 150rpx;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/index.js b/eaterplanet_ecommerce/moduleA/groupCenter/index.js
new file mode 100644
index 0000000..565c899
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/index.js
@@ -0,0 +1,369 @@
+var app = getApp();
+var status = require('../../utils/index.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ waitSendNum: 0,
+ waitSignNum: 0,
+ waitPickNum: 0,
+ completeNum: 0,
+ disUserId: "",
+ communityName: "",
+ communityId: "",
+ distribution: "",
+ estimate: "",
+ lastMonth: "",
+ isShow: true,
+ currentTab: 0,
+ show_on_one:0,
+ dialogShow: 0,
+ effectValidOrderNum: 0,
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ },
+ showActionsheet: false,
+ shareActionsheet: [
+ { text: '发送给朋友', value: 1, share: true },
+ { text: '生成二维码', value: 2, type: 'warn' }
+ ]
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let that = this;
+ status.setGroupInfo().then((groupInfo) => {
+ let owner_name = groupInfo && groupInfo.owner_name || '团长';
+ wx.setNavigationBarTitle({
+ title: `${owner_name}中心`,
+ })
+ that.setData({ groupInfo })
+ });
+ this.loadPage();
+ },
+
+ loadPage: function () {
+ let that = this;
+ status.loadStatus().then(function () {
+ let appLoadStatus = app.globalData.appLoadStatus;
+ if (appLoadStatus == 0) {
+ //未登录
+ wx.redirectTo({
+ url: "/eaterplanet_ecommerce/pages/user/me"
+ })
+ } else if (appLoadStatus == 2) {
+ // wx.redirectTo({
+ // url: "/eaterplanet_ecommerce/pages/position/community"
+ // })
+ }
+ that.setData({
+ appLoadStatus: appLoadStatus,
+ community: app.globalData.community
+ })
+ });
+ this.load_community_data();
+ },
+ load_community_data:function(){
+ var token = wx.getStorageSync('token');
+ var that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'community.get_community_info',
+ 'token': token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let communityData = res.data;
+ let commission_info = communityData.commission_info;
+ commission_info.mix_total_money = commission_info.mix_total_money.toFixed(2);
+ let { head_today_pay_money, today_add_head_member, today_after_sale_order_count, today_invite_head_member,is_open_solitaire,is_show_community_ranking } = res.data;
+ that.setData({
+ member_info: communityData.member_info,
+ community_info: communityData.community_info,
+ commission_info: commission_info,
+ total_order_count: communityData.total_order_count || 0,
+ total_member_count: communityData.total_member_count || 0,
+ today_order_count: communityData.today_order_count || 0,
+ today_effect_order_count: communityData.today_effect_order_count || 0,
+ today_pay_order_count: communityData.today_pay_order_count || 0,
+ today_pre_total_money: communityData.today_pre_total_money || 0,
+ waitSendNum: communityData.wait_send_count || 0,
+ waitSignNum: communityData.wait_qianshou_count || 0,
+ waitPickNum: communityData.wait_tihuo_count || 0,
+ completeNum: communityData.has_success_count || 0,
+ open_community_addhexiaomember: communityData.open_community_addhexiaomember,
+ open_community_head_leve: communityData.open_community_head_leve,
+ head_today_pay_money,
+ today_add_head_member,
+ today_after_sale_order_count,
+ today_invite_head_member,
+ is_open_solitaire,
+ shop_index_share_title: communityData.shop_index_share_title,
+ shop_index_share_image: communityData.shop_index_share_image,
+ is_show_community_ranking: is_show_community_ranking || 0
+ });
+ } else {
+ //is_login
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 扫描
+ */
+ goScan: function(){
+ wx.scanCode({
+ success(res) {
+ console.log(res)
+ if (res.scanType == 'WX_CODE' && res.path != '')
+ {
+ wx.navigateTo({
+ url: "/" + res.path
+ });
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ var that = this;
+ var show_on_one = this.data.show_on_one;
+ let commiss_diy_name = wx.getStorageSync('commiss_diy_name') || '分销';
+ if (show_on_one > 0) {
+ this.load_community_data();
+ }
+ this.setData({
+ show_on_one: 1,
+ commiss_diy_name
+ })
+ },
+
+ /**
+ * 跳转订单
+ */
+ goOrder: function (e) {
+ let status = e.currentTarget.dataset.status;
+ wx.navigateTo({
+ url: "/eaterplanet_ecommerce/moduleA/groupCenter/groupList?tab=" + status
+ });
+ },
+
+ /**
+ * 跳转编辑
+ */
+ goEdit: function () {
+ wx.navigateTo({
+ url: "/eaterplanet_ecommerce/moduleA/groupCenter/setting?id=" + this.data.community_info.id
+ });
+ },
+
+ /**
+ * 导航切换
+ */
+ switchNav: function (e) {
+ if (this.data.currentTab === 1 * e.target.dataset.current) return false;
+ this.setData({
+ currentTab: 1 * e.target.dataset.current
+ });
+ },
+
+ /**
+ * 导航切换监控
+ */
+ bindChange: function (e) {
+ this.setData({
+ currentTab: 1 * e.detail.current
+ });
+ for (var i = 0; i < 4; i++) {
+ if (this.data.currentTab === i) {
+ this.setData({
+ effectEstimate: this.data.effectList[i].estimate,
+ effectSettle: this.data.effectList[i].settle,
+ effectValidOrderNum: this.data.effectList[i].validOrderNum
+ });
+ }
+ }
+ },
+
+ changeMycommunion: function () {
+ let community_info = this.data.community_info;
+ let community_id = community_info.id;
+ console.log(community_id)
+ var token = wx.getStorageSync('token');
+ let that = this;
+ community_id !== void 0 && app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.addhistory_community',
+ community_id: community_id,
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ console.log('s1')
+ that.getCommunityInfo().then(() => {
+ console.log('s2')
+ app.globalData.changedCommunity = true;
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ });
+ }
+ })
+ },
+
+ getCommunityInfo: function(){
+ return new Promise(function (resolve, reject) {
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.load_history_community',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let history_communities = res.data.list;
+ if (Object.keys(history_communities).length > 0 || history_communities.communityId != 0) {
+ wx.setStorageSync('community', history_communities);
+ app.globalData.community = history_communities;
+ resolve(history_communities);
+ } else {
+ resolve('');
+ }
+ }
+ }
+ })
+ })
+ },
+
+ handleShareActionsheet: function(){
+ // this.setData({ showActionsheet: true })
+ this.getShareCode();
+ },
+
+ closeQrcodeModal: function(){
+ this.setData({ showQrcodeModal: !this.data.showQrcodeModal })
+ },
+
+ getShareCode(){
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ var that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'community.community_index_shareqrcode',
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let qrcode = res.data.qrcode;
+ if(!qrcode) {
+ return wx.showToast({
+ title: '暂未生成二维码',
+ icon: 'none'
+ })
+ }
+ that.setData({ qrcode, showQrcodeModal: true })
+ }
+ }
+ })
+ },
+
+ btnClick(e){
+ let type = e.detail.value;
+ if(type==2) {
+ this.setData({showActionsheet: false})
+ this.getShareCode();
+ }
+ },
+
+ saveImgToThumb: function(){
+ let image_path = this.data.qrcode;
+ let that = this;
+ wx.getImageInfo({
+ src: image_path,
+ success: function(res) {
+ var real_path = res.path;
+ wx.saveImageToPhotosAlbum({
+ filePath: real_path,
+ success(res) {
+ wx.showToast({
+ title: '图片保存成功,可以分享了',
+ icon: 'none',
+ duration: 2000
+ })
+ that.setData({
+ showQrcodeModal: false
+ });
+ }
+ })
+ }
+ })
+ },
+
+ confirmMessage: function(){
+ this.setData({
+ dialogShow: !this.data.dialogShow
+ })
+ },
+
+ goLink: function(event){
+ let url = event.currentTarget.dataset.link;
+ url && wx.navigateTo({ url })
+ },
+
+ onShareAppMessage: function(res) {
+ this.setData({ is_share_html: true });
+ let community_info = this.data.community_info || '';
+ let { id, community_name } = community_info;
+ let shopname = wx.getStorageSync('shopname') || '';
+ this.setData({ showActionsheet: false });
+ let shop_index_share_title = this.data.shop_index_share_title || '';
+ let shop_index_share_image = this.data.shop_index_share_image || '';
+ let title = shop_index_share_title ? shop_index_share_title : (shopname + ' ' +community_name || '');
+ if(!id) return;
+ return {
+ title,
+ path: "eaterplanet_ecommerce/pages/index/index?community_id=" + id,
+ imageUrl: shop_index_share_image,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/index.json b/eaterplanet_ecommerce/moduleA/groupCenter/index.json
new file mode 100644
index 0000000..6f4cbcf
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/index.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "团长中心",
+ "navigationBarBackgroundColor": "#4facfe",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-modal": "../../components/modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/index.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/index.wxml
new file mode 100644
index 0000000..7bc8af7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/index.wxml
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+
+ {{community_info.head_name}}
+
+
+ 编辑
+
+
+
+ ID:{{community_info.re_id}}
+
+
+
+
+
+ 绑定{{groupInfo.group_name}}:{{community_info.community_name}}
+
+
+ {{groupInfo.owner_name}}等级:{{community_info.head_level_info.levelname}}(分佣比例:{{community_info.head_level_info.commission+'%'}})
+
+
+
+
+
+
+ {{groupInfo.owner_name}}概况
+
+ 打印二维码
+
+
+
+
+ {{commission_info.mix_total_money}}
+ 总收入(元)
+
+
+ {{total_order_count}}
+ 总订单
+
+
+ {{total_member_count}}
+ 会员数
+
+
+
+
+
+
+
+ 今日详情
+
+ {{groupInfo.owner_name}}排行
+
+
+
+
+ {{today_order_count}}
+
+ 订单总数(笔)
+
+
+
+ {{today_effect_order_count}}
+
+ 有效订单(笔)
+
+
+
+ {{today_pay_order_count}}
+
+ 付款人数
+
+
+
+ {{head_today_pay_money}}
+
+ 销售额(元)
+
+
+
+
+
+ {{today_add_head_member}}
+
+ 新增会员数
+
+
+
+ {{today_after_sale_order_count}}
+
+ 售后订单(笔)
+
+
+
+ {{today_pre_total_money}}
+
+ 预估收入
+
+
+
+ {{today_invite_head_member}}
+
+ 今日访客
+
+
+
+
+
+
+
+
+
+ 我的团单
+
+ 查看全部
+
+
+
+
+
+ {{waitSendNum}}
+
+ 待配送
+
+
+ {{waitSignNum}}
+
+ 待签收
+
+
+ {{waitPickNum}}
+
+ 待提货
+
+
+ {{completeNum}}
+
+ 已完成
+
+
+
+
+
+
+ {{groupInfo.group_name}}用户
+ 待核销
+
+
+
+
+ 接龙中心
+
+
+
+
+
+ 结算记录
+
+
+
+
+
+ 我的钱包
+
+
+
+
+
+ 结算记录
+
+
+
+
+
+ 配送单
+
+
+
+
+
+ 核销管理
+
+
+
+
+
+ {{groupInfo.owner_name}}{{commiss_diy_name}}
+
+
+
+
+
+
+
+
+
+ 总订单
+
+
+ 总订单包含{{groupInfo.group_name}}用户已取消订单、退款订单、部分退款订单
+
+
+
+
+
+
+
+
+
+
+
+
+ 打印二维码
+
+
+
+ 保存图片
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/index.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/index.wxss
new file mode 100644
index 0000000..f0f7717
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/index.wxss
@@ -0,0 +1,521 @@
+.groupCenter {
+ width: 100%;
+ position: relative;
+ overflow: hidden;
+}
+
+.groupCenter .basicInform {
+ width: 100%;
+ height: 226rpx;
+ background: #4facfe;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.groupCenter .basicInform .user-avatar {
+ width: 144rpx;
+ height: 144rpx;
+ margin: 10rpx 30rpx 0;
+ display: flex;
+ justify-content: center;
+}
+
+.groupCenter .basicInform .user-avatar .userAvatarUrl {
+ border-radius: 50%;
+ width: 140rpx;
+ height: 140rpx;
+ border: 2rpx solid rgba(255, 255, 255, 0.24);
+ overflow: hidden;
+ display: flex;
+}
+
+.groupCenter .basicInform .userInfo {
+ display: flex;
+ flex-direction: column;
+ padding-top: 10rpx;
+ width: 100%;
+}
+
+.groupCenter .basicInform .userInfo .user-name {
+ height: 40rpx;
+ line-height: 40rpx;
+ color: #fff;
+ font-size: 40rpx;
+}
+
+.groupCenter .basicInform .userInfo .user-name .edit-name {
+ float: right;
+ margin-top: 10rpx;
+ font-size: 24rpx;
+ line-height: 34rpx;
+ padding-right: 20rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupCenter .basicInform .userInfo .user-name .icon-edit {
+ margin-right: 10rpx;
+ font-size: 24rpx;
+}
+
+.groupCenter .basicInform .userInfo .userId,
+.groupCenter .basicInform .userInfo .address {
+ position: relative;
+ font-size: 26rpx;
+ color: #fff;
+ z-index: 1;
+ margin-top: 10rpx;
+}
+
+.groupCenter .basicInform .userInfo .address {
+ width: 520rpx;
+ line-height: 32rpx;
+}
+
+.groupCenter .basicInform .userInfo .address .iconfont {
+ font-size: 24rpx;
+}
+
+.groupCenter .distributionCon {
+ width: 100%;
+ margin-top: -30rpx;
+ z-index: 9;
+}
+
+.groupCenter .distributionCon .distribution {
+ background: #fff;
+ border-radius: 10rpx;
+ padding: 24rpx 0;
+ margin: 0 20rpx;
+}
+
+.groupCenter .distributionCon .distribution .myDistribution {
+ position: relative;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 30rpx;
+ color: #333;
+ font-weight: 500;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon {
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon .income {
+ width: 33.3%;
+ padding: 20rpx 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon .income:last-child {
+ border: none;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon .income .incomeTop {
+ font-size: 36rpx;
+ color: #4facfe;
+ margin-bottom: 16rpx;
+ font-weight: 500;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon .income .incomeBottom {
+ font-size: 24rpx;
+ color: #999;
+}
+
+.groupCenter .effectData {
+ width: 100%;
+ margin-top: 30rpx;
+}
+
+.groupCenter .effectData .nav {
+ z-index: 10;
+ background: #fff;
+ height: 90rpx;
+ border-bottom: 0.1rpx solid #f2f2f2;
+ padding: 0 60rpx;
+ width: unset;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupCenter .effectData .nav .orderList_item {
+ font-size: 30rpx;
+ color: #333;
+ padding: 22rpx 0;
+ margin-bottom: 4rpx;
+}
+
+.groupCenter .effectData .nav .on {
+ color: #4facfe;
+ border-bottom: 4rpx solid #4facfe;
+ margin: 0;
+}
+
+.groupCenter .effectData .swiper-box {
+ width: 100%;
+ height: 140rpx;
+}
+
+.groupCenter .effectData .swiper-box .item {
+ margin-bottom: 20rpx;
+ background: #fff;
+ overflow: hidden;
+}
+
+.groupCenter .effectData .swiper-box .item:last-child {
+ margin: 0;
+}
+
+.groupCenter .effectData .effect {
+ background: #fff;
+ border-radius: 10rpx;
+ padding: 24rpx 0;
+ margin: 0 20rpx;
+}
+
+.groupCenter .effectData .effect .myEffect {
+ position: relative;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 30rpx;
+ color: #333;
+ font-weight: 500;
+}
+
+.groupCenter .effectData .effect .incomeCon {
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.groupCenter .effectData .effect .incomeCon .income {
+ width: 33.3%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.groupCenter .effectData .effect .incomeCon .income:last-child {
+ border: none;
+}
+
+.groupCenter .effectData .effect .incomeCon .income .incomeTop {
+ font-size: 36rpx;
+ color: #333;
+ margin-bottom: 16rpx;
+ font-weight: 500;
+}
+
+.groupCenter .effectData .effect .incomeCon .income .incomeBottom {
+ font-size: 24rpx;
+ color: #999;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.groupCenter .effectData .effect .incomeCon .income .incomeBottom .distributionInstrIcon {
+ width: 28rpx;
+ height: 28rpx;
+ margin-right: 8rpx;
+}
+
+.groupCenter .groupCenterCon {
+ margin-top: 30rpx;
+}
+
+.groupCenter .groupCenterCon .order, .groupCenter .groupCenterCon .record {
+ border-radius: 10rpx;
+ background: #fff;
+ margin: 20rpx;
+}
+
+.groupCenter .groupCenterCon .order .myOrders,
+.groupCenter .groupCenterCon .record .myOrders {
+ height: 90rpx;
+ border-top-right-radius: 10rpx;
+ border-top-left-radius: 10rpx;
+ background: #fff;
+ border-bottom: 0.1rpx solid #e4e4e4;
+ padding: 0 30rpx;
+ font-size: 30rpx;
+ color: #333;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupCenter .groupCenterCon .order .myOrders .allGroupOrder,
+.groupCenter .groupCenterCon .record .myOrders .allGroupOrder {
+ font-size: 26rpx;
+ color: #999;
+}
+
+.groupCenter .groupCenterCon .order .myOrders .allGroupOrder .rightArrowImg,
+.groupCenter .groupCenterCon .record .myOrders .allGroupOrder .rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+ color: #a7a7a7;
+ margin-left: 14rpx;
+ margin-bottom: -2rpx;
+}
+
+.groupCenter .groupCenterCon .order .orderTab,
+.groupCenter .groupCenterCon .record .orderTab {
+ padding: 30rpx 52rpx;
+ background-color: #fff;
+ overflow: hidden;
+ border-radius: 10rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status,
+.groupCenter .groupCenterCon .record .orderTab .order_status {
+ position: relative;
+ color: #58595b;
+ font-size: 26rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .num,
+.groupCenter .groupCenterCon .record .orderTab .order_status .num {
+ width: 34rpx;
+ height: 34rpx;
+ background: #fff;
+ font-size: 22rpx;
+ color: #4facfe;
+
+ /* border: 2rpx solid #f1283b; */
+ border-radius: 50%;
+ position: absolute;
+ right: 0;
+ top: -14rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 2rpx solid #4facfe;
+ z-index: 1;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .distributionIcon,
+.groupCenter .groupCenterCon .record .orderTab .order_status .distributionIcon {
+ width: 60rpx;
+ height: 50rpx;
+ margin-bottom: 16rpx;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .receiveIcon,
+.groupCenter .groupCenterCon .record .orderTab .order_status .receiveIcon {
+ margin-bottom: 16rpx;
+ width: 54rpx;
+ height: 50rpx;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .completeIcon,
+.groupCenter .groupCenterCon .record .orderTab .order_status .completeIcon {
+ margin-bottom: 16rpx;
+ width: 50rpx;
+ height: 50rpx;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .needPickIcon,
+.groupCenter .groupCenterCon .record .orderTab .order_status .needPickIcon {
+ margin-bottom: 16rpx;
+ margin-left: 10rpx;
+ width: 58rpx;
+ height: 54rpx;
+}
+
+.groupCenter .groupCenterCon .record {
+ margin-top: 20rpx;
+}
+
+.groupCenter .groupCenterCon .record .recordList {
+ padding: 0 30rpx;
+ height: 100rpx;
+ line-height: 100rpx;
+ border-bottom: 0.1rpx solid #e4e4e4;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupCenter .groupCenterCon .record .recordList .recordListTit {
+ height: 100rpx;
+ font-size: 30rpx;
+ color: #333;
+}
+
+.groupCenter .groupCenterCon .record .recordList .rightText {
+ color: #999;
+}
+
+.groupCenter .groupCenterCon .record .recordList .rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+ color: #a7a7a7;
+ margin-left: 30rpx;
+}
+
+.groupCenter .groupCenterCon .record .borNone {
+ border: none;
+}
+
+.groupCenter .groupCenterCon .distributionInstr {
+ margin: 40rpx 0 68rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.groupCenter .groupCenterCon .distributionInstr .disInstr {
+ width: 244rpx;
+ height: 76rpx;
+ background: #fff;
+ border-radius: 38rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.groupCenter .groupCenterCon .distributionInstr .disInstr .distributionInstrIcon {
+ width: 28rpx;
+ height: 28rpx;
+ margin-right: 8rpx;
+}
+
+.hide-dialog {
+ height: 100%;
+ width: 100%;
+ bottom: 0;
+ left: 0;
+ z-index: 19;
+ background: rgba(0, 0, 0, 0.3);
+ position: fixed;
+}
+
+.dialog-tips {
+ width: 520rpx;
+ height: 412rpx;
+ border-radius: 24rpx;
+ top: 0rpx;
+ left: 0rpx;
+ right: 0rpx;
+ bottom: 0rpx;
+ margin: auto;
+ position: absolute;
+ background: #fff;
+ z-index: 20;
+}
+
+.dialog-tips .dialog-title {
+ padding: 30rpx 0;
+ font-size: 32rpx;
+ color: #333;
+ text-align: center;
+ font-weight: 500;
+}
+
+.dialog-tips .dialog-content {
+ font-size: 28rpx;
+ padding: 0 50rpx;
+ color: #999;
+}
+
+.dialog-tips .dialog-btn {
+ margin: 0 44rpx 0 44rpx;
+ bottom: 30rpx;
+ position: absolute;
+ text-align: center;
+ color: #fff;
+ background: #4facfe;
+ font-size: 32rpx;
+ height: 72rpx;
+ width: 432rpx;
+ line-height: 72rpx;
+ border-radius: 60rpx;
+}
+
+.scan-code {
+ position: absolute;
+ width: 120rpx;
+ height: 100rpx;
+ padding: 10rpx 40rpx 0 0;
+ right: 0;
+ top: 0;
+ z-index: 1000;
+ text-align: right;
+}
+
+.scan-code .icon-scan {
+ font-size: 70rpx;
+}
+
+.shareGroup {
+ position: absolute;
+ right: 30rpx;
+ bottom: 8rpx;
+}
+
+/* 推广码 */
+.coder-content {
+ position: relative;
+ height: 650rpx;
+ width: 630rpx;
+ background: #fff;
+ border-radius: 20rpx;
+ text-align: center;
+ font-family: PingFangSC-Medium;
+}
+
+.coder-content .t1 {
+ font-size: 36rpx;
+ font-weight: 500;
+ color: #444;
+ line-height: 36rpx;
+ margin-bottom: 50rpx;
+ margin-top: 60rpx;
+}
+
+.coder-content .t2 {
+ font-weight: 400;
+ margin-top: 28rpx;
+}
+
+.coder-content .icon-wrap {
+ height: 60rpx;
+ width: 60rpx;
+ position: absolute;
+ right: 10rpx;
+ top: 10rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.coder-content .icon-close {
+ height: 24rpx;
+ width: 24rpx;
+}
+
+.coder-content .code-img .img {
+ width: 380rpx;
+ height: 380rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/list.js b/eaterplanet_ecommerce/moduleA/groupCenter/list.js
new file mode 100644
index 0000000..7418eb6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/list.js
@@ -0,0 +1,243 @@
+var page = 1;
+var app= getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ needAuth: false,
+ isHideLoadMore: true,
+ loadText: '正在加载',
+ list: [],
+ queryData: {
+ createTime: null,
+ communityId: null,
+ page: page,
+ pageSize: 20
+ },
+ status: ['待配送', '配送中', '已送达团长'],
+ page: 1,
+ searchKey: ""
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.data.queryData.createTime = null;
+ this.getData();
+ },
+
+ /**
+ * 获取数据
+ */
+ getData: function () {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+
+ this.setData({
+ isHideLoadMore: true
+ })
+
+ this.data.no_list = 1
+ let that = this;
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.get_head_deliverylist',
+ date: that.data.date,
+ searchKey: that.data.searchKey,
+ token: token,
+ page: that.data.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ console.log(that.data.page);
+ let rushList = that.data.list.concat(res.data.data);
+ that.setData({
+ list: rushList,
+ hide_tip: true,
+ no_list: 0
+ });
+ wx.hideLoading();
+ } else {
+ that.setData({
+ isHideLoadMore: true
+ })
+ wx.hideLoading();
+ return false;
+ }
+ }
+ })
+ },
+
+ /**
+ * 监控输入框
+ */
+ bindSearchChange: function (e) {
+ this.setData({
+ searchKey: e.detail.value
+ });
+ },
+
+ /**
+ * 搜索
+ */
+ searchByKey: function () {
+ page = 1;
+ this.setData({
+ list: [],
+ no_list: 0,
+ page: 1
+ });
+ this.data.queryData.memberNickName = this.data.searchKey;
+ this.getData();
+ },
+
+ /**
+ * 取消
+ */
+ cancel: function () {
+ page = 1;
+ this.setData({
+ searchKey: "",
+ list: []
+ });
+ this.data.queryData.memberNickName = null;
+ this.getData();
+ },
+
+ /**
+ * 监控日期
+ */
+ bindDateChange: function (e) {
+ page = 1;
+ this.setData({
+ date: e.detail.value,
+ list: [],
+ no_list: 0,
+ page: 1
+ });
+ this.data.queryData.createTime = new Date(e.detail.value).getTime() - 28800000;
+ this.getData();
+ },
+
+ /**
+ * 清除日期
+ */
+ clearDate: function () {
+ page = 1;
+ this.setData({
+ date: "",
+ list: [],
+ no_list: 0,
+ page: 1
+ });
+ this.data.queryData.createTime = null;
+ this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 拨打电话
+ */
+ callTelphone: function (e) {
+ var that = this;
+ var phoneNumber = e.currentTarget.dataset.phone;
+ if (phoneNumber != "未下单") {
+ this.data.isCalling || (this.data.isCalling = true, wx.makePhoneCall({
+ phoneNumber: phoneNumber,
+ complete: function () {
+ that.data.isCalling = false;
+ }
+ }));
+ }
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ // todo
+ },
+
+ /**
+ * 跳转详情
+ */
+ goDetails: function (e) {
+ let state = e.currentTarget.dataset.state;
+ let list_id = e.currentTarget.dataset.id;
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/moduleA/groupCenter/listDetails?id=' + list_id + '&state=' + state,
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (this.data.no_list == 1) return false;
+ this.data.page += 1;
+ this.getData();
+
+ this.setData({
+ isHideLoadMore: false
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/list.json b/eaterplanet_ecommerce/moduleA/groupCenter/list.json
new file mode 100644
index 0000000..a464bdf
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/list.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "配送单",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-auth": "../../components/auth/index",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/list.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/list.wxml
new file mode 100644
index 0000000..ee49cd2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/list.wxml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ 您还没有相关的清单~
+
+
+
+
+
+
+
+ 配送员
+ {{item.clerk_name}} 联系配送员
+
+
+ 配送状态
+
+ {{status[item.state]}}
+
+
+
+ 商品数量
+
+ {{item.goods_count}}
+
+
+
+ 开始配送时间
+
+ {{item.express_time}}
+
+
+
+ 团长取货时间
+
+ {{item.head_get_time}}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/list.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/list.wxss
new file mode 100644
index 0000000..f36e653
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/list.wxss
@@ -0,0 +1,171 @@
+.search {
+ background: #fff;
+ padding: 20rpx 30rpx;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ position: relative;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+}
+
+.search .icon-search {
+ position: absolute;
+}
+
+.search .icon-search {
+ left: 54rpx;
+}
+
+.search input {
+ padding-left: 68rpx;
+ width: 520rpx;
+ height: 56rpx;
+ background: #f8f8f8;
+ border-radius: 28rpx;
+ color: #999;
+ box-sizing: border-box;
+ line-height: 40rpx;
+}
+
+.search text {
+ color: #4facfe;
+ margin-left: 28rpx;
+}
+
+.date {
+ padding: 0 30rpx;
+ background: #fff;
+ height: 90rpx;
+ line-height: 90rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular;
+ font-weight: 400;
+ color: #9b9b9b;
+}
+
+.date .date-value {
+ margin-left: 12rpx;
+ color: #4facfe;
+}
+
+.date .icon-date {
+ height: 36rpx;
+ width: 36rpx;
+ float: right;
+ margin: 6rpx 0 0 0;
+}
+
+.date .icon-date image {
+ height: 36rpx;
+ width: 36rpx;
+}
+
+.date .icon-clear {
+ height: 32rpx;
+ float: right;
+ color: #4facfe;
+ margin: 0 28rpx 0 0;
+ font-size: 24rpx;
+}
+
+.list-box {
+ padding: 20rpx 20rpx 30rpx;
+}
+
+.list-info {
+ margin-bottom: 20rpx;
+}
+
+.i-card {
+ width: 710rpx;
+ border-radius: 20rpx;
+ background: #fff;
+ box-shadow: 0 0 40rpx 0 rgba(0, 0, 0, 0.05);
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ margin-bottom: 20rpx;
+}
+
+.header {
+ padding: 20rpx 30rpx;
+ color: #444;
+ font-size: 28rpx;
+ font-weight: 500;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.header .rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+ color: #a7a7a7;
+ margin-left: 30rpx;
+}
+
+.content-wrap {
+ border-top: 0.1rpx solid #efefef;
+ padding-bottom: 20rpx;
+}
+
+.content-wrap .item {
+ display: flex;
+ justify-content: space-between;
+ font-size: 24rpx;
+ padding: 16rpx 30rpx;
+ padding-bottom: 0;
+}
+
+.content-wrap .item .title {
+ color: #aaa;
+}
+
+.content-wrap .item .detail {
+ color: #444;
+}
+
+.noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.noRecordCon .noRecordImg {
+ width: 132rpx;
+ height: 138rpx;
+ margin-top: 50%;
+}
+
+.noRecordCon .noRefundImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 50%;
+}
+
+.noRecordCon .noRecord {
+ padding-top: 32rpx;
+ font-size: 30rpx;
+ font-family: PingFangSC-Light;
+ font-weight: 300;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.item-phone {
+ display: inline-block;
+ padding: 5rpx 16rpx;
+ border: 2rpx solid #4facfe;
+ border-radius: 22rpx;
+ margin-left: 10rpx;
+ color: #4facfe;
+}
+
+.icon-phone {
+ width: 18rpx;
+ height: 22rpx;
+ margin-right: 2px;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.js b/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.js
new file mode 100644
index 0000000..cce319c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.js
@@ -0,0 +1,150 @@
+var app =getApp();
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isIpx: app.globalData.isIpx,
+ list: [],
+ state: 0,
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true
+ },
+ list_id: '',
+ page: 1,
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let list_id = options.id || '';
+ let state = options.state || 0;
+ if (list_id) {
+ this.setData({ state });
+ wx.showLoading();
+ this.list_id = list_id;
+ this.getData();
+ } else {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/moduleA/groupCenter/list',
+ })
+ }
+ },
+
+ getData: function () {
+ let that = this;
+ let list_id = this.list_id;
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'community.get_head_deliverygoods',
+ token,
+ list_id,
+ page: this.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 20) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({
+ list,
+ ...h
+ })
+ } else {
+ // 无数据
+ if (that.page == 1) that.setData({
+ noData: 1
+ })
+ that.setData({
+ loadMore: false,
+ noMore: false,
+ loadText: "没有更多记录了~"
+ })
+ }
+ },
+ fail: (err)=> {
+ console.log(err);
+ wx.hideLoading();
+ }
+ })
+ },
+
+ signAll: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let list_id = this.list_id;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.sub_head_delivery',
+ token: token,
+ list_id: list_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ console.log(res);
+ if (res.data.code == 0) {
+ wx.showToast({
+ title: '收货成功',
+ icon: false
+ })
+ setTimeout(()=>{
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/moduleA/groupCenter/list',
+ })
+ }, 2000);
+ } else {
+ wx.showToast({
+ title: '签收失败,请重试!',
+ icon: false
+ })
+ }
+ },
+ fail: (err) => {
+ console.log(err);
+ wx.hideLoading();
+ }
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.json b/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.json
new file mode 100644
index 0000000..18b60e8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+"ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.wxml
new file mode 100644
index 0000000..e97a749
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.wxml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+ {{item.goods_name}}
+
+
+ 商品数量:{{item.goods_count}}
+ 规格:{{item.sku_str}}
+
+
+
+
+
+
+暂无记录~
+
+
+
+
+ 待配送
+ 已送达
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.wxss
new file mode 100644
index 0000000..7115a59
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/listDetails.wxss
@@ -0,0 +1,93 @@
+.list-box {
+ padding-bottom: 100rpx;
+}
+
+.bottom-bar {
+ width: 100%;
+ height: 104rpx;
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ background: #fff;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ z-index: 9;
+}
+
+.flex {
+ display:flex;
+}
+
+.bottom-bar .btn {
+ flex: 1;
+ padding: 0 40rpx;
+ height: 80rpx;
+ border-radius: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ color: #fff;
+ font-size: 30rpx;
+ margin-right: 20rpx;
+ background: #f75451;
+ white-space: nowrap;
+}
+
+.bottom-bar .btn.btn-disabled {
+ background: #e3e3e3;
+}
+
+.item {
+ background: #fff;
+ overflow: hidden;
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.05);
+ border-radius: 20rpx;
+ margin: 20rpx;
+}
+
+.spu {
+ padding: 30rpx;
+ display: flex;
+ justify-content: flex-start;
+ align-content: center;
+}
+
+.spu .goodsImg {
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 20rpx;
+}
+
+.spu .goodsImg .img-class {
+ width: 120rpx;
+ height: 120rpx;
+}
+
+.spu .detail {
+ width: 0;
+ margin-left: 20rpx;
+ font-size: 24rpx;
+ color: #aaa;
+}
+
+.spu .detail .spuName {
+ color: #444;
+ font-size: 28rpx;
+ font-weight: 500;
+ overflow: hidden;
+}
+
+.spu .detail .tips {
+ line-height: 1;
+ margin-top: 16rpx;
+ position: relative;
+}
+
+.spu .detail .tips .last {
+ float: right;
+}
+
+.spu .detail .tips .price {
+ color: #ff5344;
+ font-size: 32rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/memberList.js b/eaterplanet_ecommerce/moduleA/groupCenter/memberList.js
new file mode 100644
index 0000000..2d135d4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/memberList.js
@@ -0,0 +1,82 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isHideLoadMore: false,
+ loadText: '正在加载'
+ },
+handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/memberList.json b/eaterplanet_ecommerce/moduleA/groupCenter/memberList.json
new file mode 100644
index 0000000..ef08823
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/memberList.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "查看会员",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+"ep-navBar": "../../components/navigation-bar",
+ "i-img": "../../components/img/index",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/memberList.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/memberList.wxml
new file mode 100644
index 0000000..38f17e2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/memberList.wxml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+ 贺佳.
+ 最近成交:2018-12-06
+
+
+ 付款订单数:5
+ 消费总金额:¥63.30
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/memberList.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/memberList.wxss
new file mode 100644
index 0000000..18ad386
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/memberList.wxss
@@ -0,0 +1,91 @@
+.member-list {
+ background-color: #fff;
+ margin-top: 20rpx;
+}
+
+.member-list .list-item {
+ font-size: 24rpx;
+ display: flex;
+ padding: 24rpx;
+ min-height: 130rpx;
+ position: relative;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.member-list .list-item:after {
+ content: '';
+ position: absolute;
+ left: 0.16rem;
+ right: 0.16rem;
+ top: auto;
+ bottom: 0;
+ background-color: #e9e9e9;
+ height: 0.02667rem;
+ transform: scaleY(0.5);
+}
+
+image {
+ width: 100%;
+ height: 80rpx;
+}
+
+.member-list .list-item .list-item-img {
+ width: 80rpx;
+ height: 80rpx;
+ flex-shrink: 0;
+ border-radius: 100%;
+ margin-right: 16rpx;
+ overflow: hidden;
+}
+
+.member-list .list-item .list-item-mes {
+ width: 100%;
+ flex-shrink: 1;
+ overflow: hidden;
+}
+
+.flex-items {
+ display: flex;
+}
+
+.member-list .list-item .list-item-name {
+ color: #747474;
+ height: 40rpx;
+ line-height: 40rpx;
+ margin-bottom: 8rpx;
+ justify-content: space-between;
+}
+
+.member-list .list-item .list-item-name .name {
+ font-size: 26rpx;
+ color: #212121;
+ width: 100%;
+ flex-shrink: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.member-list .list-item .list-item-mes .text-right {
+ flex-shrink: 0;
+ text-align: right;
+}
+
+.member-list .list-item .list-item-submes {
+ height: 32rpx;
+ line-height: 32rpx;
+ color: #424242;
+ justify-content: space-between;
+}
+
+.member-list .list-item .icon-right {
+ flex-shrink: 0;
+ color: #bdbdbd;
+ margin-left: 24rpx;
+}
+
+.member-list .list-item .icon-right image {
+ width: 12rpx;
+ height: 22rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.js b/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.js
new file mode 100644
index 0000000..83c58c3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.js
@@ -0,0 +1,379 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var memberId = "";
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ checkedAll: true,
+ checkedCount: 0,
+ is_check_all: false,
+ needAuth: false,
+ memberId: 0,
+ order: [],
+ param: [],
+ isIpx: false
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ app.globalData.isIpx && this.setData({
+ isIpx: true
+ });
+ if (options.scene != undefined) {
+ var scene = decodeURIComponent(options.scene);
+ if (scene != 'undefined') {
+ options.memberId = scene;
+ }
+ }
+
+ memberId = options.memberId;
+ this.setData({
+ memberId: memberId
+ })
+
+ if (!util.check_login()) {
+ this.setData({
+ needAuth: true
+ })
+ } else {
+ console.log('peding login in ');
+ this.getData();
+ }
+
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ this.setData({
+ needAuth: false
+ })
+ this.getData();
+ },
+
+ /**
+ * 获取数据
+ */
+ getData: function() {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+ var that = this;
+ var token = wx.getStorageSync('token');
+
+ //currentTab
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.get_member_ziti_order',
+ memberId: that.data.memberId,
+ token: token
+ },
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ let rushList = that.data.order.concat(res.data.data);
+ var order = rushList.filter(function (item) {
+ return item.delivery != 'express';
+ });
+ if (order.length>0){
+ that.setData({
+ order: order,
+ checkedCount: order.length,
+ checkedAll: true,
+ is_check_all: true
+ });
+ }
+ } else if (res.data.code == 1) {
+ that.setData({
+ order: []
+ });
+ } else if (res.data.code == 2) {
+ // no login
+ }
+ wx.hideLoading();
+ }
+ })
+ // 成功
+
+ },
+
+ /**
+ * 状态改变
+ */
+ transformOrderStatus: function(e) {
+ switch (Number(e)) {
+ case 1:
+ return "待提货";
+ case 4:
+ return "待配送";
+ default:
+ return "";
+ }
+ },
+
+ /**
+ * 勾选
+ */
+ checkboxChange: function(e) {
+ var t = e.currentTarget.dataset.type,
+ o = e.currentTarget.dataset.index,
+ n = this.data.order,
+ a = [],
+ i = e.detail.value,
+ r = this.data.checkedAll,
+ s = false,
+ c = 0;
+ var is_check_all = this.data.is_check_all;
+
+
+ if ("all" === t) {
+ if (is_check_all) {
+ n.forEach(function(e) {
+ e.checked = 0;
+ })
+ } else {
+ n.forEach(function(e) {
+ e.checked = 1;
+ })
+ }
+ this.setData({
+ checkedCount: n.length,
+ order: n,
+ is_check_all: !is_check_all,
+ checkedAll: !is_check_all
+ })
+ } else if ("order" === t) {
+ n.forEach(function(e, t) {
+ // e.checked = 0;
+
+ if (o == t) {
+ if (e.checked) {
+ e.checked = 0
+ } else {
+ e.checked = 1
+ }
+ }
+ })
+
+ var ck = 0;
+ n.forEach(function(e) {
+ if (e.checked) {
+ ck++;
+ }
+ })
+
+ this.setData({
+ checkedCount: ck,
+ order: n,
+ is_check_all: ck == n.length ? true : false,
+ checkedAll: ck == n.length ? true : false
+ })
+ }
+
+ },
+
+ /**
+ * 商品提货确认
+ */
+ sign: function(e) {
+ var t = this;
+ var orderno = e.target.dataset.orderno,
+ orderskuid = e.target.dataset.orderskuid;
+ wx.showModal({
+ title: "商品提货确认",
+ content: "请确认买家已收到货,再进行提货确认哦!",
+ confirmText: "确定",
+ confirmColor: "#FF673F",
+ success: function(e) {
+ if (e.confirm) {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+ var data = {
+ orderNo: orderno,
+ orderSkuId: orderskuid
+ }
+ // 发送请求
+ //成功
+ t.getData();
+ wx.showToast({
+ title: "商品提货成功",
+ icon: "none"
+ });
+ } else {
+ wx.hideLoading();
+ }
+ }
+ });
+ },
+
+ /**
+ * 订单提货确认
+ */
+ signOrder: function(e) {
+ var t = this;
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+ var that = this;
+ var orderid = e.target.dataset.orderid;
+ wx.showModal({
+ title: "订单提货确认",
+ content: "请确认买家已收改订单的所有商品,再进行提货确认哦!",
+ confirmText: "确定",
+ confirmColor: "#FF673F",
+ success: function(e) {
+ if (e.confirm) {
+ wx.hideLoading();
+ let data = {
+ orderId: orderid
+ }
+ // 发送请求
+ // 成功
+ that.getData();
+ wx.showToast({
+ title: "订单提货成功",
+ icon: "none"
+ });
+ } else {
+ wx.hideLoading();
+ }
+ }
+ });
+ },
+
+ /**
+ * 批量订单提货确认
+ */
+ signAll: function() {
+ var that = this;
+ var n = this.data.order;
+
+ var sub_order_arr = [];
+ let is_cashon_delivery = false;
+
+ n.forEach(function(e) {
+ if (e.checked) {
+ sub_order_arr.push(e.order_id)
+ }
+ if(e.payment_code=="cashon_delivery") {
+ is_cashon_delivery = true;
+ }
+ })
+
+ if (sub_order_arr.length <= 0) {
+ wx.showToast({
+ title: '请选择签收商品',
+ })
+ return false;
+ }
+
+ var token = wx.getStorageSync('token');
+ wx.showModal({
+ title: "订单提货确认",
+ content: is_cashon_delivery?"所选商品含货到付款,请再次确认是否已收款":"请确认买家已收选中的商品,再进行提货确认哦!",
+ confirmText: "确定",
+ confirmColor: "#FF673F",
+ success: function(t) {
+ if (t.confirm) {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+
+ // 请求成功
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'order.receive_order_list',
+ order_data: sub_order_arr,
+ token: token
+ },
+ method: 'post',
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ that.setData({
+ order: []
+ })
+ that.getData();
+
+ console.log('iniinin');
+ wx.showToast({
+ title: "订单提货成功",
+ icon: "none"
+ });
+ } else {
+ wx.showToast({
+ title: "订单提货失败",
+ icon: "none"
+ });
+ }
+ }
+ })
+ }
+ }
+ });
+ },
+
+ /**
+ * 复制信息
+ */
+ copyGoodsMsg: function() {
+ if (0 !== this.data.checkedCount) {
+ var info = "";
+ this.data.list.forEach(function(items) {
+ items.skuRspS.forEach(function(item) {
+ item.checked && (info += ",【" + item.skuName + "】" + item.spec + "*" + item.skuNum);
+ });
+ }),
+ wx.setClipboardData({
+ data: info.substring(1),
+ success: function() {
+ wx.showToast({
+ title: "复制成功",
+ icon: "none"
+ });
+ },
+ fail: function(error) {
+ wx.showToast({
+ title: "复制失败,请重试",
+ icon: "none"
+ }), console.log(error);
+ }
+ });
+ } else {
+ wx.showToast({
+ title: "请选择商品",
+ icon: "none"
+ });
+ }
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.json b/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.json
new file mode 100644
index 0000000..fa8c405
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.json
@@ -0,0 +1,12 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "用户待核销订单",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-auth": "../../components/auth/index",
+ "component-img": "../../components/image/index",
+ "i-aside-btn": "../../components/asideBtn/index",
+ "i-cashon_delivery": "../../components/cashon_delivery/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.wxml
new file mode 100644
index 0000000..04b6392
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.wxml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+ 订单编号:{{item.order_num_alias}}
+
+ 提货人:{{item.shipping_name}}手机号:{{item.shipping_tel}}
+ {{item.createTime}}
+
+
+ {{item.status_name}}
+
+
+
+
+
+
+
+
+
+ {{skuItem.name}}
+ 货到付款
+ {{skuItem.option_str}}; 共{{skuItem.quantity}}件
+
+ 提货确认
+
+ 已签
+
+
+
+
+ 已退款
+
+ 退款金额:¥{{skuItem.refund_info.ref_money}}
+ {{skuItem.refund_info.real_refund_quantity}}个 申请中
+ {{skuItem.refund_info.real_refund_quantity}}个 退款成功
+ {{skuItem.refund_info.real_refund_quantity}}个 退款失败
+
+
+
+
+
+
+
+ 暂无数据
+
+
+
+
+
+
+ 合计:
+ {{checkedCount}}条
+
+
+
+ 确认签收
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.wxss
new file mode 100644
index 0000000..c7af764
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/pendingDeliveryOrders.wxss
@@ -0,0 +1,210 @@
+.container {
+ padding-bottom: 120rpx;
+}
+
+.container.pb80 {
+ padding-bottom: 160rpx;
+}
+
+.no-list {
+ text-align: center;
+ width: 100%;
+ height: 100rpx;
+ line-height: 100rpx;
+ background: #fff;
+}
+
+.check-box {
+ box-sizing: border-box;
+ width: 50rpx;
+ height: 50rpx;
+ display: flex;
+ justify-content: center;
+}
+
+.check-box .checkbox-checked {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.check-box .checkbox-disabled {
+ width: 48rpx;
+ height: 48rpx;
+ margin-top: 2rpx;
+}
+
+.check-box-content {
+ width: 84rpx;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.order-item {
+ margin-top: 20rpx;
+}
+
+.order-item .order-title {
+ display: flex;
+ align-items: center;
+ background: #fff;
+ margin-bottom: 2rpx;
+ /* height: 145rpx; */
+}
+
+.order-item .order-title .order-msg {
+ width: 550rpx;
+ /* height: 145rpx; */
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+}
+
+.order-item .order-title .order-msg span {
+ font-size: 26rpx;
+ margin-bottom: 12rpx;
+}
+
+.order-item .order-title .order-msg em {
+ color: #666;
+}
+
+.order-item .order-title .order-status {
+ color: #4facfe;
+ font-size: 28rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+}
+
+.order-item .order-title .order-sign-btn {
+ width: 160rpx;
+ height: 60rpx;
+ border-radius: 60rpx;
+ background: #4facfe;
+ color: #fff;
+ display: block;
+ text-align: center;
+ line-height: 60rpx;
+ font-size: 26rpx;
+}
+
+.order-item .goods-item {
+ display: flex;
+ align-items: center;
+ background: #fff;
+ height: 188rpx;
+ position: relative;
+}
+
+.order-item .goods-item .goods-img {
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 30rpx;
+}
+
+.order-item .goods-item .goods-detail {
+ width: 492rpx;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ flex-direction: column;
+}
+
+.order-item .goods-item .goods-detail .goods-title {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ text-overflow: initial;
+ white-space: normal;
+ font-size: 28rpx;
+ /* height: 80rpx; */
+ margin-bottom: 12rpx;
+}
+
+.order-item .goods-item .goods-detail .goods-desc {
+ color: #999;
+ font-size: 26rpx;
+ width: 360rpx;
+}
+
+.order-item .goods-item .goods-sign-btn {
+ height: 52rpx;
+ padding: 0 24rpx;
+ border: 2rpx solid #4facfe;
+ border-radius: 52rpx;
+ text-align: center;
+ line-height: 52rpx;
+ color: #4facfe;
+ position: absolute;
+ right: 24rpx;
+ bottom: 20rpx;
+}
+
+.order-item .goods-item .goods-sign-btn.goods-sign-btn-disabled {
+ border-color: #ccc;
+ color: #ccc;
+}
+
+.bottom-bar {
+ width: 100%;
+ height: 104rpx;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ background: #fff;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ z-index: 9;
+}
+
+.bottom-bar .check-box-content {
+ width: 140rpx;
+}
+
+.bottom-bar .check-box-content .check-box {
+ margin-right: 20rpx;
+}
+
+.bottom-bar .flex {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+}
+
+.bottom-bar .total {
+ margin-right: 20rpx;
+ text-align: right;
+}
+
+.bottom-bar .total span {
+ color: #4facfe;
+}
+
+.bottom-bar .btn {
+ flex: 3;
+ padding: 0 40rpx;
+ height: 80rpx;
+ border-radius: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ color: #fff;
+ font-size: 30rpx;
+ margin-right: 20rpx;
+ background: #4facfe;
+ white-space: nowrap;
+}
+
+.bottom-bar .btn.btn-disabled {
+ flex: 1;
+ padding: 0 40rpx;
+ background: #e3e3e3;
+}
+
+.tips .tag {
+ font-size: 20rpx;
+ padding: 4rpx 8rpx;
+ border-radius: 5rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/ranking.js b/eaterplanet_ecommerce/moduleA/groupCenter/ranking.js
new file mode 100644
index 0000000..89c0a80
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/ranking.js
@@ -0,0 +1,80 @@
+var app = getApp();
+var status = require('../../utils/index.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ type: 1, // 1:今日,2:昨日,3:上周,4:上月
+ list: []
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let that = this;
+ status.setGroupInfo().then((groupInfo) => {
+ let owner_name = groupInfo && groupInfo.owner_name || '团长';
+ wx.setNavigationBarTitle({
+ title: `${owner_name}排行`,
+ })
+ that.setData({ groupInfo })
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.getData();
+ },
+
+ getData: function () {
+ let token = wx.getStorageSync('token');
+ wx.showLoading();
+ app.util.ProReq('community.community_ranking_list', { token, type: this.data.type }).then(res => {
+ wx.hideLoading();
+ if(res.is_show_community_ranking!=1) {
+ return app.util.message('访问页面不存在或已关闭', 'redirect:/eaterplanet_ecommerce/moduleA/groupCenter/index', 'error');
+ }
+ this.setData({
+ list: res.data
+ })
+ })
+ },
+
+ changeType: function(e) {
+ let type = e.currentTarget.dataset.type || 1;
+ this.setData({
+ type
+ }, ()=>{
+ this.getData();
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/ranking.json b/eaterplanet_ecommerce/moduleA/groupCenter/ranking.json
new file mode 100644
index 0000000..75754a7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/ranking.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "团长排行",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/ranking.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/ranking.wxml
new file mode 100644
index 0000000..5a2a7ac
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/ranking.wxml
@@ -0,0 +1,37 @@
+
+
+
+
+
+ 今日
+ 昨日
+ 上周
+ 上月
+
+
+
+
+ 排名
+ 社区信息
+ 订单数
+ 收入金额
+
+
+
+
+
+
+ {{index<9?'0':''}}{{index+1}}
+
+
+
+ {{item.community_name}}
+
+ {{item.order_count}}
+ ¥ {{item.money}}
+
+
+
+
+ 暂无记录~
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/ranking.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/ranking.wxss
new file mode 100644
index 0000000..b0549b4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/ranking.wxss
@@ -0,0 +1,83 @@
+page {
+ background: #FF7256;
+}
+
+.nav {
+ position: relative;
+ margin: -88rpx 36rpx 0;
+ text-align: center;
+ border: 2rpx solid #FA853E;
+ border-radius: 5rpx;
+ overflow: hidden;
+}
+
+.nav .item {
+ line-height: 66rpx;
+ background-color: #ffffff;
+ color: #FA853E;
+ border-left: 2rpx solid #FA853E;
+}
+
+.nav .item:first-child {
+ border: 0;
+}
+
+.nav .item.active {
+ background: linear-gradient(0deg, #FD6F3D 0%, #FE8E4A 100%);
+ color: #ffffff;
+}
+
+.list {
+ margin: 20rpx 20rpx 80rpx;
+ border-radius: 20rpx;
+}
+
+.th {
+ font-weight: 400;
+ color: #4D4D4D;
+ font-size: 30rpx;
+}
+
+.th .item {
+ padding: 30rpx 0;
+}
+
+.td {
+ padding: 25rpx 0;
+}
+
+.num {
+ font-size: 32rpx;
+ color: #AFB9D7;
+ font-weight: bold;
+}
+
+.icon {
+ width:58rpx;
+ height:58rpx;
+}
+
+.avatar {
+ width:72rpx;
+ height:72rpx;
+ border-radius: 50%;
+ margin-right: 10rpx;
+}
+
+.name {
+ color: #333333;
+ font-size: 30rpx;
+}
+
+.order {
+ font-size: 32rpx;
+ font-weight: bold;
+ color: #FFB847;
+}
+
+.empty {
+ font-size: 28rpx;
+ font-weight: bold;
+ line-height: 300rpx;
+ color: #666666;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/recommend.js b/eaterplanet_ecommerce/moduleA/groupCenter/recommend.js
new file mode 100644
index 0000000..c3b72e3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/recommend.js
@@ -0,0 +1,79 @@
+var util = require('../../utils/util.js');
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ qrcode: ''
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ if (!util.check_login()) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ wx.showLoading();
+ },
+
+ getData(){
+ var token = wx.getStorageSync('token');
+ var that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'community.get_community_zhitui_qrcode',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ that.setData({ qrcode: res.data.qrcode })
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ },
+
+ preImg: function (event) {
+ var goodShareImg = this.data.qrcode;
+ //图片预览
+ wx.previewImage({
+ current: goodShareImg, // 当前显示图片的http链接
+ urls: [goodShareImg] // 需要预览的图片http链接列表
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.getData();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/recommend.json b/eaterplanet_ecommerce/moduleA/groupCenter/recommend.json
new file mode 100644
index 0000000..8cafc3a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/recommend.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "推荐二维码",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/recommend.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/recommend.wxml
new file mode 100644
index 0000000..c16f3b8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/recommend.wxml
@@ -0,0 +1,5 @@
+
+
+
+ 点击二维码图片预览,长按保存图片,发送至群。
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/recommend.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/recommend.wxss
new file mode 100644
index 0000000..24b1708
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/recommend.wxss
@@ -0,0 +1,10 @@
+.content {
+ background-color: #fff;
+ padding: 50rpx 30rpx;
+ text-align: center;
+}
+
+.img image {
+ width: 300rpx;
+ height: 300rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/recruit.js b/eaterplanet_ecommerce/moduleA/groupCenter/recruit.js
new file mode 100644
index 0000000..fdfff65
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/recruit.js
@@ -0,0 +1,91 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+
+ onLoad: function (options) {
+ status.setNavBgColor();
+ status.setGroupInfo().then((groupInfo) => {
+ wx.setNavigationBarTitle({
+ title: groupInfo.owner_name || '团长',
+ })
+ });
+
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'community.get_apply_page'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let article = res.data.data || '';
+ that.setData({ article })
+ }
+ }
+ })
+ },
+
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ that.setData({ needAuth: !res });
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ authSuccess: function () {
+ this.setData({
+ needAuth: false,
+ showAuthModal: false
+ })
+ },
+
+ goLink: function (event) {
+ if (!this.authModal()) return;
+ let url = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({ url })
+ } else {
+ wx.navigateTo({ url })
+ }
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/recruit.json b/eaterplanet_ecommerce/moduleA/groupCenter/recruit.json
new file mode 100644
index 0000000..f75bcd9
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/recruit.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "团长",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-aside-btn": "../../components/asideBtn/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/recruit.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/recruit.wxml
new file mode 100644
index 0000000..c19562d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/recruit.wxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+ 点击申请
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/recruit.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/recruit.wxss
new file mode 100644
index 0000000..7cec1ee
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/recruit.wxss
@@ -0,0 +1,20 @@
+.section {
+ background: #fff;
+ margin-bottom: 20rpx;
+ padding: 0 0rpx 20rpx;
+}
+
+.section .apply-btn {
+ width: 710rpx;
+ height: 96rpx;
+ background: #4facfe;
+ border-radius: 20rpx;
+ color: #fff;
+ font-size: 30rpx;
+ line-height: 96rpx;
+ text-align: center;
+ display: block;
+ margin: 16rpx auto 16rpx;
+}
+
+/* share-modal end */
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/setting.js b/eaterplanet_ecommerce/moduleA/groupCenter/setting.js
new file mode 100644
index 0000000..72aa75b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/setting.js
@@ -0,0 +1,362 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+import WxValidate from '../../utils/WxValidate.js';
+var status = require('../../utils/index.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showEditAvatar: false,
+ showEditUserInfo: false,
+ showEditFinance: false,
+ currentFocus: '',
+ rest: 0, // 1休息 0营业
+ headInfo: '',
+ btnLoading: false,
+ tuanItems: [
+ { name: 0, value: '跟随系统' },
+ { name: 1, value: '开启' },
+ { name: 2, value: '关闭' }
+ ],
+ tuanType: ['跟随系统','开启','关闭'],
+ fareItems: [
+ { name: 0, value: '跟随系统' },
+ { name: 1, value: '自定义' }
+ ],
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ },
+ image_o: ''
+ },
+ is_modify_shipping_method: 0,
+ is_modify_shipping_fare: 0,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let that = this;
+ status.setGroupInfo().then((groupInfo) => {
+ let owner_name = groupInfo && groupInfo.owner_name || '团长';
+ wx.setNavigationBarTitle({
+ title: `${owner_name}中心`,
+ })
+ that.setData({ groupInfo })
+ });
+
+ let id = options && (options.id || 0);
+ if (!util.check_login()) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ if (!id) wx.switchTab({ url: '/eaterplanet_ecommerce/pages/user/me' });
+ this.initValidate(); //验证规则函数
+ this.getData(id);
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ radioChange(e) {
+ console.log(e)
+ let name = e.currentTarget.dataset.name;
+ if (name =='method'){
+ this.is_modify_shipping_method = e.detail.value;
+ } else if (name == 'fare'){
+ this.is_modify_shipping_fare = e.detail.value;
+ let showFare = false;
+ if(e.detail.value == 1) showFare = true;
+ this.setData({ showFare })
+ }
+ },
+
+ //资料验证函数
+ initValidate() {
+ const rules = {
+ head_name: {
+ required: true,
+ minlength: 1
+ },
+ head_mobile: {
+ required: true,
+ tel: true
+ }
+ }
+ const messages = {
+ head_name: {
+ required: '请填写团长名称',
+ minlength: '请输入正确的团长名称'
+ },
+ head_mobile: {
+ required: '请填写手机号',
+ tel: '请填写正确的手机号'
+ }
+ }
+ this.WxValidate = new WxValidate(rules, messages)
+ },
+
+ /**
+ * 获取数据
+ */
+ getData: function(id){
+ let token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.get_head_info',
+ id,
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let headInfo = res.data.data;
+ let showFare = headInfo.is_modify_shipping_fare == 1 ? true : false;
+ that.setData({
+ headInfo: headInfo,
+ rest: res.data.data.rest,
+ showFare
+ })
+ that.is_modify_shipping_method = headInfo.is_modify_shipping_method || 0;
+ that.is_modify_shipping_fare = headInfo.is_modify_shipping_fare || 0;
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 显示头像修改窗口
+ */
+ showEdit: function (t) {
+ let type = t.currentTarget.dataset.type;
+ if (type == 'avatar') {
+ this.setData({
+ showEditAvatar: true
+ })
+ } else if (type == 'info') {
+ this.setData({
+ showEditUserInfo: true
+ })
+ } else if (type == 'finance') {
+ this.setData({
+ showEditFinance: true
+ })
+ }
+ },
+
+ /**
+ * 隐藏头像修改窗口
+ */
+ hideEdit: function () {
+ this.setData({
+ showEditAvatar: false,
+ showEditUserInfo: false,
+ showEditFinance: false
+ })
+ },
+
+ /**
+ * 输入框获得焦点
+ */
+ iptFocus: function (t) {
+ let name = t.currentTarget.dataset.name;
+ this.setData({
+ currentFocus: name
+ })
+ },
+
+ /**
+ * 输入框失去焦点
+ */
+ iptBlur: function () {
+ this.setData({
+ currentFocus: ''
+ })
+ },
+
+ /**
+ * 状态切换
+ */
+ switchChange(e) {
+ let rest = e.detail.value ? 0 : 1 ;
+ let headInfo = this.data.headInfo;
+ let id = headInfo && (headInfo.id || 0);
+ let token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.set_head_rest',
+ id,
+ token,
+ rest
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ that.setData({
+ rest: rest
+ })
+ } else if (res.data.code == 1) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ } else {
+ that.setData({
+ rest: !rest
+ })
+ wx.showToast({
+ title: '修改失败',
+ })
+ }
+ }
+ })
+ },
+
+ //报错
+ showModal(error) {
+ wx.showModal({
+ content: error.msg,
+ showCancel: false,
+ })
+ },
+
+ /**
+ * 资料修改表单提交
+ */
+ infoFormSubmit(e) {
+ this.setData({ btnLoading: true })
+ const params = e.detail.value
+ //校验表单
+ if (!this.WxValidate.checkForm(params)) {
+ const error = this.WxValidate.errorList[0];
+ this.showModal(error);
+ this.setData({ btnLoading: false })
+ return false;
+ }
+ let is_modify_shipping_method = this.is_modify_shipping_method;
+ let is_modify_shipping_fare = this.is_modify_shipping_fare;
+ let data = Object.assign({}, params, { is_modify_shipping_method, is_modify_shipping_fare });
+ if (is_modify_shipping_fare==1) {
+ if (params.shipping_fare*1<=0) {
+ wx.showToast({
+ title: '请输入配送费',
+ icon: 'none'
+ })
+ this.setData({ btnLoading: false })
+ return;
+ }
+ }
+ this.modifyHeadInfo(data);
+ },
+
+ /**
+ * 资料修改
+ */
+ modifyHeadInfo(params) {
+ let token = wx.getStorageSync('token');
+ let headInfo = this.data.headInfo;
+ let id = headInfo.id;
+ let that = this;
+ let share_wxcode = this.data.image_o;
+ if (share_wxcode) params.share_wxcode = share_wxcode;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'community.modify_head_info',
+ id,
+ token,
+ ...params
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let share_wxcode_old = headInfo.share_wxcode;
+ headInfo = Object.assign({}, headInfo, params);
+ headInfo.share_wxcode = share_wxcode_old;
+ that.setData({
+ headInfo
+ })
+ that.showModal({
+ msg: '修改成功'
+ })
+ } else if (res.data.code == 1) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ } else {
+ that.showModal({
+ msg: '修改失败'
+ })
+ }
+ that.hideEdit();
+ that.setData({ btnLoading: false })
+ }
+ })
+ },
+
+ choseImg: function () {
+ var self = this;
+ wx.chooseMedia({
+ count: 1, // 默认9
+ sizeType: ['original', 'compressed'],
+ sourceType: ['album', 'camera'],
+ success: function (res) {
+ const tempFiles = res.tempFiles;
+ wx.showLoading({
+ title: '上传中',
+ })
+ wx.uploadFile({
+ url: app.util.url('entry/wxapp/index', { 'm': 'eaterplanet_ecommerce', 'controller': 'goods.doPageUpload' }),
+ filePath: tempFiles[0].tempFilePath,
+ name: 'upfile',
+ formData: {
+ 'name': tempFiles[0].tempFilePath
+ },
+ header: {
+ 'content-type': 'multipart/form-data'
+ },
+ success: function (res) {
+ wx.hideLoading();
+ var data = JSON.parse(res.data);
+ var image_o = data.image_o;
+ self.setData({
+ 'headInfo.share_wxcode': image_o,
+ image_o: image_o
+ })
+ }
+ })
+ }
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/setting.json b/eaterplanet_ecommerce/moduleA/groupCenter/setting.json
new file mode 100644
index 0000000..e562a81
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/setting.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "",
+ "navigationBarBackgroundColor": "#4facfe",
+ "usingComponents": {
+"ep-navBar": "../../components/navigation-bar",
+ "i-modal": "../../components/modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/setting.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/setting.wxml
new file mode 100644
index 0000000..4ea81f6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/setting.wxml
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+ ID: {{headInfo.re_id}}
+
+ {{rest==1?"休息中":"营业中"}}
+
+
+
+
+
+
+
+
+ 关联会员
+ {{headInfo.member_info.username}}
+
+
+
+ {{groupInfo.owner_name}}名称
+ {{headInfo.head_name}}
+
+
+
+ 手机号
+ {{headInfo.head_mobile}}
+
+
+
+ {{groupInfo.group_name}}名称
+ {{headInfo.community_name}}
+
+
+
+
+ 自定义配送开关
+ {{tuanType[headInfo.is_modify_shipping_method]}}
+
+
+
+ 自定义配送费
+ {{headInfo.is_modify_shipping_fare==0?'跟随系统':headInfo.shipping_fare}}
+
+
+ 群分享二维码
+
+
+
+
+
+
+
+
+
+
+
+ 修改头像
+
+
+ 上传头像
+
+ 取消
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/setting.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/setting.wxss
new file mode 100644
index 0000000..37887cb
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/setting.wxss
@@ -0,0 +1,252 @@
+.gcs-box {
+ padding-bottom: 100rpx;
+}
+
+.top-bg {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 500rpx;
+ background: linear-gradient(35deg,#f6f6f6 200rpx,#4facfe 0);
+}
+
+.avatar-box {
+ position: relative;
+ margin-top: 50rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.avatar-box image {
+ width: 110rpx;
+ height: 110rpx;
+ border-radius: 50%;
+}
+
+.avatar-edit {
+ color: #fff;
+ border: 1rpx solid #fff;
+ font-size: 24rpx;
+ border-radius: 6rpx;
+ padding: 5rpx 22rpx;
+ margin-top: 30rpx;
+}
+
+.user-id {
+ color: #fff;
+ font-size: 28rpx;
+ margin-top: 30rpx;
+}
+
+.gcs-box .card {
+ position: relative;
+ background: #fff;
+ border-radius: 20rpx;
+ padding: 60rpx 0 60rpx 36rpx;
+ margin: 30rpx 36rpx 0;
+ box-shadow: 0 0 40rpx rgba(0,0,0,0.1);
+}
+
+.gcs-info.card {
+ margin-top: 70rpx;
+}
+
+.card-header {
+ display: flex;
+ padding: 20rpx 0;
+}
+
+.card-header .title {
+ flex: 1;
+ color: #000;
+ font-size: 32rpx;
+ font-weight: bold;
+}
+
+.card-edit {
+ margin-right: 36rpx;
+ color: #666;
+}
+
+.bot-line {
+ width: 100%;
+ height: 1rpx;
+ border-bottom: 1rpx solid #f5f5f5;
+ transition: 200ms all ease-in-out;
+}
+
+.bot-line.focus {
+ border-bottom: 2rpx solid #4facfe;
+}
+
+.info-item {
+ margin-top: 32rpx;
+ margin-bottom: 20rpx;
+}
+
+.info-item .item-title {
+ font-size: 24rpx;
+ color: #7593b4;
+ margin-bottom: 15rpx;
+}
+
+.info-item .item-content {
+ font-size: 30rpx;
+ color: #000;
+}
+
+/* 弹窗 */
+
+.avatar-edit-box {
+ width: 580rpx;
+ background: #fff;
+ border-radius: 10rpx;
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-start;
+ margin: 60px auto;
+ overflow: hidden;
+ z-index: 1001;
+}
+
+.avatar-edit-box .modal-title {
+ font-size: 32rpx;
+ color: #555;
+ padding: 28rpx 0;
+}
+
+.avatar-edit-box image {
+ width: 185rpx;
+ height: 185rpx;
+ border-radius: 50%;
+ border: 5rpx solid #cacbcd;
+ margin-bottom: 30rpx;
+}
+
+.avatar-edit-box .modal-btn {
+ color: #1db1fd;
+ line-height: 94rpx;
+ font-size: 30rpx;
+ width: 100%;
+ text-align: center;
+}
+
+.avatar-edit-box .modal-btn.cancel {
+ color: #9f9f9f;
+}
+
+.edit-box {
+ width: 660rpx;
+ box-sizing: border-box;
+ background: #fff;
+ border-radius: 10rpx;
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-start;
+ margin: 60px auto;
+ overflow: hidden;
+ z-index: 1001;
+ padding: 0 25rpx;
+ padding-bottom: 30rpx;
+}
+
+.edit-box .card-header {
+ line-height: 60rpx;
+ text-align: center;
+ font-size: 36rpx;
+}
+
+.edit-close {
+ position: absolute;
+ width: 30rpx;
+ height: 30rpx;
+ right: 20rpx;
+ top: 20rpx;
+}
+
+.edit-box .edit-btn button {
+ background-color: #4facfe;
+ text-align: center;
+ line-height: 68rpx;
+ margin-top: 40rpx;
+ color: #fff;
+ border-radius: 6rpx;
+ font-size: 30rpx;
+}
+
+.edit-box .edit-btn button::after {
+ border: 0;
+}
+
+.rest {
+ position: absolute;
+ right: 36rpx;
+ top: 0;
+}
+
+.rest text {
+ color: #fff;
+ font-size: 24rpx;
+ margin-right: 10rpx;
+}
+
+.rest switch {
+ zoom: 0.5;
+}
+
+.radio-group .radio{
+ margin-right: 10px;
+}
+
+.radio-group .radio text{
+ display: inline-block;
+ vertical-align: middle;
+}
+
+radio {
+ width: 38rpx;
+}
+
+radio .wx-radio-input {
+ border-radius: 50%;
+ width: 28rpx;
+ height: 28rpx;
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before {
+ border-radius: 50%;
+ width: 44rpx;
+ height: 44rpx;
+ line-height: 44rpx;
+ text-align: center;
+ font-size: 28rpx;
+ color: #fff;
+ background: #2facff;
+ border-color: #2facff;
+}
+
+.img {
+ width: 240rpx;
+ height: 240rpx;
+}
+
+.upload-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 240rpx;
+ height: 240rpx;
+ border: 1rpx dashed #ccc;
+ border-radius: 5rpx;
+}
+
+.upload-btn .iconfont {
+ font-size: 100rpx;
+ color: #ccc;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.js b/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.js
new file mode 100644
index 0000000..dbe296c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.js
@@ -0,0 +1,74 @@
+var page = 1;
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ containerHeight: "",
+ LoadingComplete: !1,
+ loadText: "没有更多订单了~",
+ orderDetail: {},
+ rewardList: []
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var sysInfo = wx.getSystemInfoSync();
+ this.setData({
+ containerHeight: sysInfo.windowHeight,
+ orderDetail: options
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ page = 1, wx.showLoading({
+ title: "加载中...",
+ mask: true
+ }), this.data.rewardList = [], this.getDetailInfo();
+ },
+
+ /**
+ * 获取订单详情
+ */
+ getDetailInfo: function(){
+ console.log(211)
+ wx.hideLoading();
+ },
+
+ getMoreList: function () {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ }), this.data.LoadingComplete ? (page += 1, this.getDetailInfo()) : wx.hideLoading();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.json b/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.json
new file mode 100644
index 0000000..55c96b4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "结算单详情",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "component-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.wxml
new file mode 100644
index 0000000..9b61e42
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.wxml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+ {{item.createTime}}
+ {{item.disStatusName}}
+
+
+
+
+
+
+
+ {{item.spuName}}
+
+ 团单金额 ¥{{item.totalAmount/100}}
+ | 佣金 ¥{{item.orderCommission/100}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.wxss
new file mode 100644
index 0000000..f906ccd
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/settlementDetail.wxss
@@ -0,0 +1,232 @@
+.nav {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 10;
+ background: #fff;
+ height: 92rpx;
+ border-top: 2rpx solid #f2f2f2;
+ border-bottom: 2rpx solid #f2f2f2;
+ padding: 0 60rpx;
+ width: unset;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.nav .orderList_item {
+ margin-bottom: 4rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+ color: #666;
+ position: relative;
+ height: 96rpx;
+ line-height: 96rpx;
+}
+
+.nav .orderList_item .line {
+ position: absolute;
+ bottom: 0;
+ height: 6rpx;
+ width: 100%;
+ background: linear-gradient(90deg,#4facfe 0%,#00f2fe 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255,89,0,0.25);
+ border-radius: 24rpx;
+}
+
+.nav .on {
+ color: #4facfe;
+}
+
+.swiper-box {
+ width: 100%;
+ margin-top: 90rpx;
+}
+
+.swiper-box .order-scroll-view {
+ width: 750rpx;
+ height: 100%;
+}
+
+.swiper-box .noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.swiper-box .noRecordCon .noRecordImg {
+ width: 132rpx;
+ height: 138rpx;
+ margin-top: 50%;
+}
+
+.swiper-box .noRecordCon .noRefundImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 50%;
+}
+
+.swiper-box .noRecordCon .noRecord {
+ padding-top: 32rpx;
+ font-size: 30rpx;
+ font-family: PingFangSC-Light;
+ font-weight: 300;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.swiper-box .noRecordCon .goIndex {
+ width: 164rpx;
+ height: 60rpx;
+ background: #4facfe;
+ border-radius: 30rpx;
+ font-size: 28rpx;
+ color: #fff;
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.swiper-box .item {
+ width: 710rpx;
+ height: 266rpx;
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.05);
+ border-radius: 20rpx;
+ margin: 20rpx auto 0;
+ background: #fff;
+}
+
+.swiper-box .item:last-of-type {
+ margin: 20rpx auto;
+}
+
+.refresh {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+ border: 2rpx solid #999;
+ box-shadow: 2rpx 2rpx 4rpx #999;
+ position: fixed;
+ right: 50rpx;
+ bottom: 200rpx;
+ font-size: 20rpx;
+ color: #666;
+ background: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.refresh image {
+ width: 32rpx;
+ height: 32rpx;
+ margin-bottom: 4rpx;
+}
+
+page {
+ height: 100%;
+}
+
+.settlementDetail {
+ width: 750rpx;
+ height: 100%;
+ overflow: auto;
+ font-family: PingFangSC-Regular;
+ font-size: 28rpx;
+}
+
+.settlementDetail .header {
+ background: #fff;
+ margin-top: 20rpx;
+}
+
+.settlementDetail .header .title {
+ height: 96rpx;
+ line-height: 96rpx;
+ width: 688rpx;
+ margin: 0 auto;
+ color: #333;
+ border-bottom: 2rpx solid #e4e4e4;
+}
+
+.settlementDetail .header .container {
+ padding: 12rpx 30rpx 42rpx;
+ color: #666;
+}
+
+.settlementDetail .header .container .per {
+ display: flex;
+ justify-content: space-between;
+ line-height: 40rpx;
+ margin-top: 12rpx;
+}
+
+.settlementDetail .main {
+ margin-top: 20rpx;
+}
+
+.settlementDetail .main .title {
+ padding: 0 30rpx;
+ display: flex;
+ justify-content: space-between;
+ line-height: 80rpx;
+ background: #fff;
+ border-bottom: 2rpx solid #e4e4e4;
+}
+
+.settlementDetail .main .title .date {
+ font-size: 24rpx;
+ color: #666;
+}
+
+.settlementDetail .main .title .status {
+ font-size: 26rpx;
+ color: #4facfe;
+}
+
+.settlementDetail .main .figcaption {
+ background: #fff;
+ display: flex;
+ justify-content: flex-start;
+ padding: 24rpx 30rpx;
+ height: 120rpx;
+}
+
+.settlementDetail .main .figcaption .figure {
+ margin-right: 30rpx;
+}
+
+.settlementDetail .main .figcaption .figure image {
+ width: 120rpx;
+ height: 120rpx;
+}
+
+.settlementDetail .main .figcaption .desc .goodsName {
+ color: #333;
+ font-size: 28rpx;
+ line-height: 40rpx;
+ height: 80rpx;
+ width: 540rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ text-overflow: initial;
+ white-space: normal;
+}
+
+.settlementDetail .main .figcaption .desc .goods-detail {
+ line-height: 34rpx;
+ font-size: 24rpx;
+ color: #999;
+}
+
+.settlementDetail .main .figcaption .desc .line {
+ font-size: 16rpx;
+ vertical-align: middle;
+}
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.js b/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.js
new file mode 100644
index 0000000..d54cdfd
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.js
@@ -0,0 +1,153 @@
+var page = 1;
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ settlementList: [{
+ id: "1",
+ disSettleNo: "111111111111",
+ settleNum: "111",
+ totalAmount: "2222",
+ payNo: "4444",
+ createTime: "2018-12-16"
+ }],
+ loadText: "没有更多记录了~",
+ LoadingComplete: !1,
+ scrollTop: 0,
+ containerHeight: 0,
+ chooseDate: "",
+ chooseDateTime: "",
+ data: "",
+ settle: "",
+ communnityId: ""
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ var sysInfo = wx.getSystemInfoSync();
+ this.setData({
+ containerHeight: sysInfo.windowHeight
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ page = 1, wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+ var dayTime = new Date(),
+ year = dayTime.getFullYear(),
+ mon = dayTime.getMonth() + 1,
+ dateTime = Date.parse(dayTime);
+ this.setData({
+ chooseDate: year + "年" + mon + "月",
+ chooseDateTime: dateTime
+ }), this.data.settlementList = [], this.getData();
+ },
+
+ /**
+ * 获取数据
+ */
+ getData: function() {
+ console.log(111)
+ wx.hideLoading();
+ },
+
+ /**
+ * 获取列表
+ */
+ getSettlementList: function() {
+ console.log(222)
+ },
+
+ /**
+ * 获取更多
+ */
+ getMoreList: function() {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ }), this.data.LoadingComplete ? (page += 1, this.getSettlementList()) : wx.hideLoading();
+ },
+
+ /**
+ * 日期监控
+ */
+ bindDateChange: function(t) {
+ page = 1, console.log("picker发送选择改变,携带值为", t.detail.value), this.setData({
+ date: t.detail.value
+ });
+ var e = this.data.date.split("-"),
+ a = Date.parse(this.data.date);
+ this.setData({
+ chooseDate: e[0] + "年" + e[1] + "月",
+ chooseDateTime: a
+ }), this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.json b/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.json
new file mode 100644
index 0000000..340c53d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarBackgroundColor": "#FFF",
+ "navigationBarTitleText": "结算记录",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "component-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.wxml
new file mode 100644
index 0000000..e5f9650
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.wxml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+ {{chooseDate}}
+
+
+
+
+
+ 佣金收入:¥{{settle/100}}
+
+
+
+
+
+
+ 还没有记录 快去分享吧~
+
+
+
+
+ 佣金结算单号({{item.disSettleNo}})
+
+
+
+
+ 结算量
+ {{item.settleNum}}
+
+
+ 结算金额
+ ¥{{item.totalAmount/100}}
+
+
+ 结算日期
+ {{item.createTime}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.wxss
new file mode 100644
index 0000000..4d7562e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/settlementList.wxss
@@ -0,0 +1,241 @@
+.nav {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 10;
+ background: #fff;
+ height: 92rpx;
+ border-top: 2rpx solid #f2f2f2;
+ border-bottom: 2rpx solid #f2f2f2;
+ padding: 0 60rpx;
+ width: unset;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.nav .orderList_item {
+ margin-bottom: 4rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+ color: #666;
+ position: relative;
+ height: 96rpx;
+ line-height: 96rpx;
+}
+
+.nav .orderList_item .line {
+ position: absolute;
+ bottom: 0;
+ height: 6rpx;
+ width: 100%;
+ background: linear-gradient(90deg,#4facfe 0%,#00f2fe 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255,89,0,0.25);
+ border-radius: 24rpx;
+}
+
+.nav .on {
+ color: #4facfe;
+}
+
+.swiper-box {
+ width: 100%;
+ margin-top: 90rpx;
+}
+
+.swiper-box .order-scroll-view {
+ width: 750rpx;
+ height: 100%;
+}
+
+.swiper-box .noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.swiper-box .noRecordCon .noRecordImg {
+ width: 132rpx;
+ height: 138rpx;
+ margin-top: 50%;
+}
+
+.swiper-box .noRecordCon .noRefundImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 50%;
+}
+
+.swiper-box .noRecordCon .noRecord {
+ padding-top: 32rpx;
+ font-size: 30rpx;
+ font-family: PingFangSC-Light;
+ font-weight: 300;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.swiper-box .noRecordCon .goIndex {
+ width: 164rpx;
+ height: 60rpx;
+ background: #4facfe;
+ border-radius: 30rpx;
+ font-size: 28rpx;
+ color: #fff;
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.swiper-box .item {
+ width: 710rpx;
+ height: 266rpx;
+ box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.05);
+ border-radius: 20rpx;
+ margin: 20rpx auto 0;
+ background: #fff;
+}
+
+.swiper-box .item:last-of-type {
+ margin: 20rpx auto;
+}
+
+.refresh {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+ border: 2rpx solid #999;
+ box-shadow: 2rpx 2rpx 4rpx #999;
+ position: fixed;
+ right: 50rpx;
+ bottom: 200rpx;
+ font-size: 20rpx;
+ color: #666;
+ background: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.refresh image {
+ width: 32rpx;
+ height: 32rpx;
+ margin-bottom: 4rpx;
+}
+
+page {
+ height: 100%;
+}
+
+.settlementList {
+ width: 750rpx;
+ height: 100%;
+ overflow: auto;
+ margin-top: 80rpx;
+ font-family: PingFangSC-Regular;
+ font-size: 28rpx;
+}
+
+.settlementList .order-scroll-view {
+ width: 750rpx;
+ height: 100%;
+}
+
+.settlementList .noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.settlementList .noRecordCon .noRecordImg {
+ width: 132rpx;
+ height: 138rpx;
+ margin-top: 328rpx;
+}
+
+.settlementList .noRecordCon .noRecord {
+ padding-top: 18rpx;
+ font-size: 28rpx;
+ color: #999;
+}
+
+.settlementList navigator {
+ background: #fff;
+ margin-top: 20rpx;
+}
+
+.settlementList .title {
+ height: 96rpx;
+ line-height: 96rpx;
+ width: 688rpx;
+ margin: 0 auto;
+ color: #333;
+ border-bottom: 2rpx solid #e4e4e4;
+}
+
+.settlementList .main {
+ color: #666;
+ width: 688rpx;
+ margin: 0 auto;
+ display: flex;
+ justify-content: space-between;
+}
+
+.settlementList .main .left {
+ flex: 1;
+ padding: 12rpx 0 24rpx;
+}
+
+.settlementList .main .left .per {
+ display: flex;
+ justify-content: space-between;
+ line-height: 40rpx;
+ margin-top: 12rpx;
+}
+
+.settlementList .main .arrow {
+ width: 52rpx;
+ text-align: right;
+ line-height: 192rpx;
+}
+
+.settlementList .main .arrow .rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+}
+
+.section {
+ position: fixed;
+ width: 690rpx;
+ top: 0;
+ z-index: 20;
+ display: flex;
+ font-size: 28rpx;
+ color: #666;
+ padding: 20rpx 30rpx;
+ background-color: #fff;
+}
+
+.section .groupDay {
+ width: 36rpx;
+ height: 36rpx;
+}
+
+.section .picker {
+ margin-left: 20rpx;
+ display: flex;
+ flex: 1;
+}
+
+.section .picker .choose-day .iconfont {
+ font-size: 12rpx;
+ margin-left: 6rpx;
+ vertical-align: middle;
+ color: #999;
+}
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/wallet.js b/eaterplanet_ecommerce/moduleA/groupCenter/wallet.js
new file mode 100644
index 0000000..18ddd24
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/wallet.js
@@ -0,0 +1,124 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showDialog: false
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 点击提现
+ */
+ cashMoney: function(){
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/moduleA/groupCenter/editInfo'
+ })
+ } else {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/moduleA/groupCenter/editInfo'
+ })
+ }
+
+ },
+
+ /**
+ * 确认对话框
+ */
+ confirm: function(){
+ this.setData({
+ showDialog: false
+ })
+ console.log(111)
+ },
+
+ /**
+ * 取消对话框
+ */
+ cancel: function(){
+ this.setData({
+ showDialog: false
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'community.get_community_info',
+ 'token': token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let commission_info = res.data.commission_info;
+ if(commission_info&&commission_info.mix_total_money) {
+ commission_info.mix_total_money = (commission_info.mix_total_money*1).toFixed(2);
+ }
+ that.setData({
+ member_info: res.data.member_info,
+ community_info: res.data.community_info,
+ commission_info,
+ total_order_count: res.data.total_order_count,
+ total_member_count: res.data.total_member_count,
+ today_order_count: res.data.today_order_count,
+ today_effect_order_count: res.data.today_effect_order_count,
+ today_pay_order_count: res.data.today_pay_order_count,
+ today_pre_total_money: res.data.today_pre_total_money,
+ today_all_total_money: res.data.today_all_total_money,
+ month_pre_total_money: res.data.month_pre_total_money,
+ pre_total_money: res.data.pre_total_money,
+ wait_sub_total_money: res.data.wait_sub_total_money,
+ dongmoney: res.data.dongmoney,
+ tixian_sucess_money: res.data.tixian_sucess_money
+ });
+ } else {
+ //is_login
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/wallet.json b/eaterplanet_ecommerce/moduleA/groupCenter/wallet.json
new file mode 100644
index 0000000..d26d6b8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/wallet.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarBackgroundColor": "#fe8464",
+ "navigationBarTitleText": "我的钱包",
+ "navigationBarTextStyle": "white",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-dialog": "../../components/dialog/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/wallet.wxml b/eaterplanet_ecommerce/moduleA/groupCenter/wallet.wxml
new file mode 100644
index 0000000..6d0511d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/wallet.wxml
@@ -0,0 +1,43 @@
+
+
+
+
+ 今日收入(元)
+ {{today_all_total_money}}
+
+
+
+ 本月收入
+ {{month_pre_total_money}}
+
+
+ 累计收入
+ {{commission_info.mix_total_money}}
+
+
+
+
+
+ 待确认收入
+ 订单明细
+
+ {{wait_sub_total_money}}
+
+ 可提现金额
+ 收益明细
+
+ {{commission_info.money}}
+
+ 提现中金额
+ 提现记录
+
+ {{dongmoney}}
+
+ 已打款金额
+ 提现记录
+
+ {{tixian_sucess_money}}
+
+ 提 现
+
+
diff --git a/eaterplanet_ecommerce/moduleA/groupCenter/wallet.wxss b/eaterplanet_ecommerce/moduleA/groupCenter/wallet.wxss
new file mode 100644
index 0000000..0c25a62
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/groupCenter/wallet.wxss
@@ -0,0 +1,85 @@
+.basicInForm {
+ width: 100%;
+ background: #4facfe;
+ color: #fff;
+ text-align: center;
+ padding: 50rpx 0 20rpx;
+}
+
+.today-box {
+ margin-bottom: 30rpx;
+}
+
+.today-income {
+ font-size: 30rpx;
+}
+
+.today-income-money {
+ font-size: 60rpx;
+ font-weight: bold;
+ line-height: 2;
+}
+
+.flex {
+ display: flex;
+}
+
+.flex-item {
+ flex: 1;
+}
+
+.other-item {
+ position: relative;
+}
+
+.other-income .other-item:first-child::after {
+ position: absolute;
+ content: "";
+ top: 0;
+ bottom: 0;
+ right: 0;
+ width: 1px;
+ border-left: 1px solid #fff;
+ transform: scaleX(0.5);
+}
+
+.income-money {
+ font-weight: bold;
+ line-height: 2;
+}
+
+.income-data {
+ padding: 20rpx 30rpx;
+}
+
+.common-title {
+ display: flex;
+ color: #999;
+ align-content: center;
+ align-items: center;
+}
+
+.common-title .subtit {
+ margin-right: 10px;
+}
+
+.common-nav {
+ color: #000;
+ margin: 5px;
+}
+
+.common-money {
+ font-size: 40rpx;
+ line-height: 2;
+}
+
+.income-btn {
+ margin: 40rpx 30rpx;
+ line-height: 70rpx;
+ background-color: #4facfe;
+ border-radius: 5px;
+ color: #fff;
+ text-align: center;
+ font-weight: bold;
+ font-size: 30rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/details.js b/eaterplanet_ecommerce/moduleA/menu/details.js
new file mode 100644
index 0000000..d3553da
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/details.js
@@ -0,0 +1,293 @@
+const app = getApp()
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/compoentCartMixin.js')],
+ data: {
+ info: {},
+ fmShow: true,
+ canvasWidth: 375,
+ canvasHeight: 300
+ },
+ gid: 0,
+ goodsImg: '',
+ imageUrl: '',
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ app.setShareConfig();
+ let gid = options.id || '';
+ this.gid = gid;
+ this.getData(gid);
+ let showBackBtn = false;
+ let pages_all = getCurrentPages();
+ if (pages_all.length > 1) {
+ showBackBtn = true;
+ }
+ this.setData({ showBackBtn })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ const that = this;
+ util.check_login_new().then((res) => {
+ let needAuth = !res;
+ that.setData({ needAuth })
+ if (res) {
+ (0, status.cartNum)('', true).then((res) => {
+ res.code == 0 && that.setData({
+ cartNum: res.data
+ })
+ });
+ }
+ })
+ },
+
+ onReady: function (res) {
+ this.videoContext = wx.createVideoContext('myVideo');
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ const that = this;
+ let gid = this.gid;
+ this.setData({
+ needAuth: false,
+ showAuthModal: false
+ }, () => {
+ that.getData(gid);
+ })
+ },
+
+ vipModal: function(t) {
+ this.setData(t.detail)
+ },
+
+ imageLoad: function (e) {
+ var imageSize = util.imageUtil(e)
+ this.setData({
+ imageSize
+ })
+ },
+
+ /**
+ * 播放视频隐藏封面图
+ */
+ btnPlay: function () {
+ this.setData({
+ fmShow: false
+ })
+ this.videoContext.play();
+ },
+
+ videEnd: function () {
+ this.setData({
+ fmShow: true
+ })
+ },
+
+ endPlay: function () {
+ this.videoContext.pause();
+ this.setData({
+ fmShow: true
+ })
+ },
+
+ /**
+ * 获取信息
+ */
+ getData: function (id) {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let community = wx.getStorageSync('community');
+ let head_id = community.communityId || '';
+
+ wx.showLoading();
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'recipe.get_recipe_detail',
+ token,
+ id,
+ head_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code==0) {
+ let info = res.data.data || {};
+ let is_open_recipe_full_video = res.data.is_open_recipe_full_video;
+ let showCoverVideo = (is_open_recipe_full_video==1) && info.video;
+ that.setData({ info, showCoverVideo }, ()=>{
+ let shareImg = info.images;
+ info.video && shareImg && status.download(shareImg + "?imageView2/1/w/500/h/400").then(function (a) {
+ that.goodsImg = a.tempFilePath, that.drawImg();
+ });
+ })
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ /**
+ * 点赞
+ */
+ agree: function () {
+ if (!this.authModal()) return;
+ let that = this;
+ let item = this.data.info;
+ let token = wx.getStorageSync('token');
+
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'recipe.fav_recipe_do',
+ token: token,
+ id: item.id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ //成功
+ wx.showToast({
+ title: '已喜欢~',
+ icon: 'none'
+ })
+ item.fav_count = res.data.fav_count;
+ item.has_fav = 1;
+ that.setData({ info: item })
+ } else if (res.data.code == 1) {
+ //未登录
+ that.setData({ needAuth: true });
+ } else if (res.data.code == 2) {
+ //取消收藏
+ item.fav_count = res.data.fav_count;
+ item.has_fav = 0;
+ that.setData({ info: item })
+ wx.showToast({
+ title: '取消喜欢~',
+ icon: 'none'
+ })
+ }
+ }
+ })
+ },
+
+ goLink: function(e){
+ let link = e.currentTarget.dataset.link;
+ app.util.navTo(link);
+ },
+
+ drawImg: function () {
+ var t = this;
+ wx.createSelectorQuery().select(".canvas-img").boundingClientRect(function () {
+ const context = wx.createCanvasContext("myCanvas");
+ context.drawImage(t.goodsImg, 0, 0, status.getPx(375), status.getPx(300));
+ context.drawImage("../../images/play.png", status.getPx(127.5), status.getPx(70), status.getPx(120), status.getPx(120));
+ context.save();
+ context.draw(false, t.checkCanvas());
+ }).exec();
+ },
+
+ checkCanvas: function () {
+ var that = this;
+ setTimeout(() => {
+ wx.canvasToTempFilePath({
+ canvasId: "myCanvas",
+ success: function (res) {
+ res.tempFilePath ? that.imageUrl = res.tempFilePath : that.drawImg();
+ console.log('我画完了')
+ },
+ fail: function (a) {
+ that.drawImg();
+ }
+ })
+ }, 500)
+ },
+
+ clickStore: function() {
+ this.setData({ showStore: !this.data.showStore })
+ },
+
+ coverVideoEnd: function(){
+ this.setData({
+ showCoverVideo: false
+ })
+ },
+
+ _backhome: function() {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ let info = this.data.info;
+ var community = wx.getStorageSync('community');
+ var gid = info.id;
+ var community_id = community.communityId;
+ var share_title = info.recipe_name;
+ var share_id = wx.getStorageSync('member_id');
+ var share_path = `eaterplanet_ecommerce/moduleA/menu/details?id=${gid}&share_id=${share_id}&community_id=${community_id}`;
+ console.log('分享地址:', share_path);
+ return {
+ title: share_title,
+ path: share_path,
+ imageUrl: this.imageUrl,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function () {
+ let info = this.data.info;
+ var community = wx.getStorageSync('community');
+ var gid = info.id;
+ var community_id = community.communityId;
+ var share_title = info.recipe_name;
+ var share_id = wx.getStorageSync('member_id');
+ var query= `id=${gid}&share_id=${share_id}&community_id=${community_id}`;
+
+ return {
+ title: share_title,
+ query,
+ imageUrl: this.imageUrl,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/menu/details.json b/eaterplanet_ecommerce/moduleA/menu/details.json
new file mode 100644
index 0000000..f603340
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/details.json
@@ -0,0 +1,11 @@
+{
+ "navigationBarTitleText": "详情",
+ "navigationStyle": "custom",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-goods-item": "../components/menuGoodsItem",
+ "sku": "../../components/sku/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/details.wxml b/eaterplanet_ecommerce/moduleA/menu/details.wxml
new file mode 100644
index 0000000..7a63f9a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/details.wxml
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 退出播放
+
+
+
+
+
+
+
+ {{info.recipe_name}}
+
+ 制作时间:{{info.make_time}} |
+ 难度:{{info.diff_name}}
+
+
+
+
+ {{info.username}}
+
+ {{info.sub_name}}
+
+
+
+
+
+ 清单
+
+
+ · {{item.ingredients_title}}
+
+
+
+
+
+
+
+
+
+
+ 详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ · {{list.ingredients_title}}
+
+
+
+
+
+ {{item.spuName}}
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+ ¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}
+
+
+
+
+
+
+ 暂无清单
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/menu/details.wxss b/eaterplanet_ecommerce/moduleA/menu/details.wxss
new file mode 100644
index 0000000..c756b57
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/details.wxss
@@ -0,0 +1,432 @@
+.foot {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 10;
+ border-top: 1rpx solid #ccc;
+ text-align: center;
+ height: 100rpx;
+ font-size: 24rpx;
+ color: #666;
+}
+
+.foot-item .btn {
+ line-height: 1.2;
+ background: transparent;
+ font-size: 24rpx;
+ padding: 0;
+ color: #666;
+}
+
+.foot-item .btn::after {
+ border: 0;
+}
+
+.foot-item .iconfont {
+ color: #333;
+ font-size: 42rpx;
+ display: inline-block;
+}
+
+.foot-item .iconfont.active {
+ color: #ff5344!important;
+}
+
+.foot-item .cart-num {
+ position: absolute;
+ right: -16rpx;
+ top: -4rpx;
+ width: 36rpx;
+ height: 36rpx;
+ background: #f43530;
+ border-radius: 36rpx;
+ color: #fff;
+ font-size: 22rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+::-webkit-scrollbar {
+ display: none;
+ width: 0;
+ height: 0;
+ color: transparent;
+}
+
+.topImg {
+ width: 100%;
+ vertical-align: top;
+}
+
+.com-tit {
+ font-size: 32rpx;
+ color: #1a1d21;
+ padding-bottom: 20rpx;
+}
+
+.title {
+ font-size: 45rpx;
+ color: #1a1d21;
+ padding: 15rpx 0;
+}
+
+.desc {
+ font-size: 24rpx;
+ color: #b0b2b5;
+}
+
+.userinfo {
+ margin-top: 30rpx;
+}
+
+.avatar {
+ width: 66rpx;
+ height: 66rpx;
+ border-radius: 50%;
+ margin-right: 24rpx;
+}
+
+.p {
+ color: #666;
+ font-size: 26rpx;
+ line-height: 1.8;
+ margin-top: 20rpx;
+}
+
+.list-box {
+ display: flex;
+ overflow-x: scroll;
+ overflow-y: hidden;
+ white-space: nowrap;
+}
+
+.wxParse-p image {
+ max-width: 100%!important;
+}
+
+.list-tit {
+ color: #333;
+ font-size: 28rpx;
+}
+
+/* 视频 */
+.media-box {
+ position: relative;
+}
+
+.btn_view {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ z-index: 100;
+ transform: translate(-50%, -50%);
+}
+
+.btn_view image {
+ width: 120rpx;
+ height: 120rpx;
+ background: rgba(0, 0, 0, 0.1);
+ border-radius: 50%;
+ animation: playScale 2s ease-in-out infinite;
+}
+
+.video-wrap, .swiper-video {
+ width: 100%;
+ /* height: 100%; */
+ vertical-align: top;
+}
+
+.end-play {
+ position: relative;
+ z-index: 1000;
+ background: #000;
+ text-align: center;
+ padding: 20rpx 0;
+}
+
+.end-play .btn {
+ display: inline-block;
+ padding: 5rpx 30rpx;
+ background-color: #f6f6f6;
+ border-radius: 20rpx;
+ font-size: 24rpx;
+}
+
+@keyframes playScale {
+ 0% {
+ transform: scale(1);
+ }
+ 25% {
+ transform: scale(1.1);
+ }
+ 50% {
+ transform: scale(1);
+ }
+ 75% {
+ transform: scale(1.1);
+ }
+}
+
+.canvas-img {
+ position: absolute;
+ top: -20000rpx;
+}
+
+
+.nav-btn {
+ position: relative;
+ left: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 31px;
+ height: 31px;
+ line-height: 31px;
+ padding: 0;
+ min-width: 31px;
+ max-width: 31px;
+ text-align: center;
+ border-radius: 50%;
+ min-height: initial;
+ box-sizing: border-box;
+ border: 1px solid rgba(255,255,255,0.05);
+ color: #000;
+}
+
+.nav-btn .img {
+ width: 22px;
+ height: 22px;
+}
+
+/* 全屏视频 */
+.livepage {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 20;
+ padding-bottom: 24px;
+ box-sizing: border-box;
+ width: 100%;
+ height: 100vh;
+ overflow: hidden;
+}
+
+.livepage1 {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ z-index: 0;
+}
+
+.livepage1 video {
+ width: 100%;
+ height: 100%;
+}
+
+.livepage2 {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 20;
+ padding-bottom: 24px;
+ box-sizing: border-box;
+ width: 100%;
+ height: 100%;
+}
+
+
+.operation {
+ position: absolute;
+ right: 17px;
+ bottom: 24px;
+ z-index: 10;
+}
+
+.operation .item {
+ width: 42px;
+ height: 42px;
+ background-image: linear-gradient(180deg, #8385F3 0%, #6467F0 100%);
+ border-radius: 50%;
+ margin-bottom: 23px;
+ overflow: hidden;
+}
+
+.operation .item .iconfont {
+ font-size: 24px;
+ color: #fff;
+}
+
+.operation .item.operation--mode-filter-black {
+ background: rgba(0, 0, 0, 0.25);
+ backdrop-filter: blur(20px);
+ border-radius: 50%;
+ overflow: hidden;
+}
+
+.operation button.item::after {
+ content: none;
+}
+
+.store {
+ padding: 0 16px;
+ position: absolute;
+ z-index: 2;
+ left: 0;
+ right: 0;
+ bottom: 30px;
+}
+
+.store-list {
+ border-radius: 16px;
+ overflow: hidden;
+ position: relative;
+ bottom: -999px;
+}
+
+.store-list.fadeIn {
+ bottom: 0;
+ animation: fadeInStoreList 0.2s 1 forwards;
+}
+
+.store__mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 100%;
+}
+
+.mode-filter-black {
+ background-color: rgba(0, 0, 0, 0.25);
+ backdrop-filter: blur(20px);
+ border-radius: inherit;
+}
+
+.store-list__inner {
+ position: relative;
+ z-index: 5002;
+ padding: 16px 12px;
+ box-sizing: border-box;
+}
+
+.store-list__header {
+ position: relative;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 0 4px;
+ font-weight: 500;
+}
+
+.store-list__title {
+ font-size: 15px;
+ color: #ffffff;
+ text-shadow: 0.5px 0.5px 2px rgba(0, 0, 0, 0.1);
+}
+
+.store-list__body {
+ margin-top: 4px;
+ overflow: hidden;
+ padding: 2px 5px 0 0;
+ box-sizing: border-box;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.store-list__page__inner {
+ position: relative;
+ width: calc(100% + 20px);
+ box-sizing: border-box;
+ -webkit-mask-image: -webkit-gradient(linear, left bottom, left 96%, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 04)));
+}
+
+.store-list__item {
+ margin-bottom: 12px;
+ background: #ffffff;
+ border-radius: 8px;
+}
+
+.store-list__item:last-child {
+ margin-bottom: 0;
+}
+
+.store-list__item__inner {
+ display: flex;
+ justify-content: flex-start;
+ align-items: stretch;
+ padding: 8px;
+}
+
+.store-list__item__header {
+ position: relative;
+ margin-right: 9px;
+ font-size: 0;
+}
+
+.store-list__item__avatar {
+ width: 64px;
+ height: 64px;
+ border-radius: 2px;
+ box-sizing: border-box;
+}
+
+.store-list__item__index {
+ position: absolute;
+ top: 0;
+ left: 0;
+ background: rgba(0, 0, 0, 0.5);
+ border-radius: 2px 0px 8px 0px;
+ text-align: center;
+ padding: 0 2px;
+ min-width: 14px;
+ line-height: 12px;
+ font-size: 10px;
+ color: #ffffff;
+ text-align: center;
+}
+
+.store-list__item__page {
+ height: initial;
+}
+
+.store-list__item__title {
+ font-size: 15px;
+ color: rgba(0, 0, 0, 0.7);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ word-break: break-all;
+ line-height: 19.6px;
+ margin-bottom: 5px;
+}
+
+.store-list__item__price {
+ opacity: 0.9;
+ font-size: 14px;
+ color: #fa9d3b;
+}
+
+.store-list__item__price-before {
+ color: #B2B2B2;
+ text-decoration: line-through;
+}
+
+.store-list__empty {
+ text-align: center;
+ height: 287px;
+ line-height: 140px;
+ color: #fff;
+ font-size: 14px;
+}
+
+.operation--mode-filter-black .icon-xinaixin.active {
+ color: #ff5344!important;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/fav.js b/eaterplanet_ecommerce/moduleA/menu/fav.js
new file mode 100644
index 0000000..5c1ad30
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/fav.js
@@ -0,0 +1,151 @@
+const app = getApp()
+var util = require('../../utils/util.js');
+
+Page({
+ data: {
+ loadMore: true,
+ classification: {
+ tabs: [],
+ activeIndex: 0
+ }
+ },
+ pageNum: 1,
+
+ onLoad: function () {
+ this._doRefreshMasonry();
+ },
+
+ onShow: function () {
+ util.check_login_new().then((res) => {
+ this.setData({
+ needAuth: !res
+ });
+ })
+ },
+
+ noLogin: function () {
+ this.setData({
+ needAuth: true,
+ showAuthModal: true
+ })
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ const that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ showEmpty: 0,
+ needAuth: false,
+ showAuthModal: false
+ }, () => {
+ that._doRefreshMasonry()
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ onPullDownRefresh: function () {
+ const that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ showEmpty: 0
+ }, () => {
+ that.getInfo();
+ that._doRefreshMasonry()
+ })
+ },
+
+ onReachBottom: function () {
+ this.data.loadMore && this._doAppendMasonry()
+ },
+
+ _doRefreshMasonry() {
+ let that = this;
+ this.masonryListComponent = this.selectComponent('#masonry');
+ this.getData().then(res => {
+ that.masonryListComponent.start(res).then(() => { })
+ }).catch(() => {
+ that.masonryListComponent.start([]).then(() => { })
+ })
+ },
+
+ _doAppendMasonry() {
+ let that = this;
+ this.masonryListComponent = this.selectComponent('#masonry')
+ // 获取接口数据后使用瀑布流组件append方法,当append完成后调用then,是否可触底价在的标志位可以在这里处理
+ this.getData().then(res => {
+ that.masonryListComponent.append(res).then(() => {
+ console.log('refresh completed')
+ })
+ }).catch(() => {
+ console.log('没有更多了')
+ })
+ },
+
+ /**
+ * 获取列表
+ */
+ getData: function () {
+ return new Promise((resolve, reject) => {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let gid = that.data.classificationId;
+
+ wx.showLoading();
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'recipe.get_fav_recipelist',
+ token: token,
+ pageNum: this.pageNum
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.stopPullDownRefresh();
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ that.pageNum++;
+ resolve(list);
+ } else {
+ // 无数据
+ let h = {
+ loadMore: false
+ }
+ if (that.pageNum == 1) h.showEmpty = 1;
+ that.setData(h);
+ reject('');
+ }
+ wx.hideLoading();
+ }
+ })
+ })
+ }
+
+})
diff --git a/eaterplanet_ecommerce/moduleA/menu/fav.json b/eaterplanet_ecommerce/moduleA/menu/fav.json
new file mode 100644
index 0000000..8372cb8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/fav.json
@@ -0,0 +1,13 @@
+{
+ "navigationBarTitleText": "我的收藏",
+ "backgroundTextStyle": "light",
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh": false,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "masonry": "../components/masonry/masonry",
+ "img-box": "../components/img-box/img-box",
+ "i-empty": "../../components/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/fav.wxml b/eaterplanet_ecommerce/moduleA/menu/fav.wxml
new file mode 100644
index 0000000..7cda857
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/fav.wxml
@@ -0,0 +1,5 @@
+
+
+
+
+暂无喜欢~
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/fav.wxss b/eaterplanet_ecommerce/moduleA/menu/fav.wxss
new file mode 100644
index 0000000..5b8f301
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/fav.wxss
@@ -0,0 +1 @@
+/* eaterplanet_ecommerce/moduleA/menu/fav.wxss */
diff --git a/eaterplanet_ecommerce/moduleA/menu/index.js b/eaterplanet_ecommerce/moduleA/menu/index.js
new file mode 100644
index 0000000..7a6bae6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/index.js
@@ -0,0 +1,396 @@
+const app = getApp()
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ loadMore: true,
+ classification: {
+ menutabs: [],
+ activeIndex: 0
+ },
+ tabTop: 0,
+ showSubCate: true
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ pageNum: 1,
+
+ onLoad: function() {
+ app.setShareConfig();
+ this.getInfo();
+ this._doRefreshMasonry();
+ },
+
+ onReady: function(){
+ let that = this;
+ const query = wx.createSelectorQuery();
+ let searH = Math.round(app.globalData.systemInfo.windowWidth / 750 * 100) || 0;
+ setTimeout(() => {
+ query.select('#tab').boundingClientRect(function (res) {
+ that.setData({ tabTop: res.top - searH });
+ }).exec();
+ }, 1000)
+ },
+
+ onShow: function() {
+ const that = this;
+ util.check_login_new().then((res) => {
+ let needAuth = !res;
+ that.setData({ needAuth })
+ if (res) {
+ (0, status.cartNum)('', true).then((res) => {
+ res.code == 0 && that.setData({
+ cartNum: res.data
+ })
+ });
+ }
+ })
+ },
+
+ onPageScroll: function (event) {
+ if (event.scrollTop > this.data.tabTop) {
+ if (this.data.tabFix) {
+ return
+ } else {
+ this.setData({
+ oneFixed: "Fixed"
+ })
+ }
+ } else {
+ this.setData({
+ oneFixed: ''
+ })
+ }
+ },
+
+ noLogin: function() {
+ this.setData({
+ needAuth: true,
+ showAuthModal: true
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ const that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ showEmpty: 0,
+ needAuth: false,
+ showAuthModal: false
+ }, () => {
+ that._doRefreshMasonry()
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * 监控分类导航
+ */
+ classificationChange: function (t) {
+ var that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ showEmpty: 0,
+ "classification.activeIndex": t.detail.e,
+ classificationId: t.detail.a
+ }, function () {
+ that._doRefreshMasonry()
+ });
+ },
+
+ onPullDownRefresh: function() {
+ const that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ showEmpty: 0
+ }, () => {
+ that.getInfo();
+ that._doRefreshMasonry()
+ })
+ },
+
+ onReachBottom: function() {
+ this.data.loadMore && this._doAppendMasonry()
+ },
+
+ _doRefreshMasonry(keyword = '') {
+ let that = this;
+ this.masonryListComponent = this.selectComponent('#masonry');
+ this.getData(keyword).then(res => {
+ that.masonryListComponent.start(res).then(() => {})
+ }).catch(()=>{
+ that.masonryListComponent.start([]).then(() => {})
+ })
+ },
+
+ _doAppendMasonry() {
+ let that = this;
+ this.masonryListComponent = this.selectComponent('#masonry')
+ // 获取接口数据后使用瀑布流组件append方法,当append完成后调用then,是否可触底价在的标志位可以在这里处理
+ this.getData().then(res => {
+ that.masonryListComponent.append(res).then(() => {
+ console.log('refresh completed')
+ })
+ }).catch(() => {
+ console.log('没有更多了')
+ })
+ },
+
+ /**
+ * 获取列表
+ */
+ getData: function(keyword = '') {
+ return new Promise((resolve, reject) => {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let gid = that.data.classificationId;
+
+ wx.showLoading();
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'recipe.get_recipe_list',
+ token: token,
+ gid,
+ pageNum: this.pageNum,
+ keyword
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.stopPullDownRefresh();
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ that.pageNum++;
+ resolve(list);
+ } else {
+ // 无数据
+ let h = {
+ loadMore: false
+ }
+ if (that.pageNum == 1) h.showEmpty = 1;
+ that.setData(h);
+ reject('');
+ }
+ wx.hideLoading();
+ }
+ })
+ })
+ },
+
+ /**
+ * 获取信息
+ */
+ getInfo: function() {
+ let that = this;
+ let token = wx.getStorageSync('token');
+
+ wx.showLoading();
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'recipe.get_index_info'
+ },
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code) {
+ let {
+ adv_arr,
+ cate_list,
+ is_open_recipe,
+ modify_recipe_name,
+ modify_recipe_share_title,
+ modify_vipcard_share_image
+ } = res.data.code;
+ if (is_open_recipe != 1) {
+ app.util.message('未开启功能', 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ }
+
+ wx.setNavigationBarTitle({
+ title: modify_recipe_name || '菜谱'
+ })
+
+ // 菜单
+ let params = {
+ classification: {
+ activeIndex: 0
+ }
+ };
+ let index_type_first_name = '全部';
+ if (cate_list.length > 0) {
+ cate_list.unshift({
+ name: index_type_first_name,
+ id: 0
+ })
+ params.isShowClassification = true;
+ params.classification.tabs = cate_list;
+ } else {
+ params.isShowClassification = false;
+ }
+
+ that.setData({
+ adv_arr: adv_arr || [],
+ modify_recipe_share_title,
+ modify_vipcard_share_image,
+ modify_recipe_name: modify_recipe_name || '菜谱',
+ ...params
+ })
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ /**
+ * 搜索
+ */
+ goResult: function(e) {
+ let that = this;
+ let keyword = e.detail.value.replace(/\s+/g, '');
+ if (!keyword) {
+ wx.showToast({
+ title: '请输入关键词',
+ icon: 'none'
+ })
+ return;
+ }
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ showEmpty: 0
+ }, () => {
+ that._doRefreshMasonry(keyword);
+ })
+ },
+
+ /**
+ * 幻灯片跳转
+ */
+ goBannerUrl: function(t) {
+ let idx = t.currentTarget.dataset.idx;
+ let {
+ adv_arr,
+ needAuth
+ } = this.data;
+ if (adv_arr.length > 0) {
+ let url = adv_arr[idx].link;
+ let type = adv_arr[idx].linktype;
+ if (util.checkRedirectTo(url, needAuth)) {
+ this.authModal();
+ return;
+ }
+ if (type == 0) {
+ // 跳转webview
+ url && wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url)
+ })
+ } else if (type == 1) {
+ if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
+ url && wx.switchTab({
+ url: url
+ })
+ } else {
+ url && wx.navigateTo({
+ url: url
+ })
+ }
+
+ } else if (type == 2) {
+ // 跳转小程序
+ let appid = slider_list[idx].appid;
+ appid && wx.navigateToMiniProgram({
+ appId: slider_list[idx].appid,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ // 打开成功
+ },
+ fail(error) {
+ console.log(error)
+ }
+ })
+ }
+ }
+ },
+
+ goLink: function (event) {
+ if (!this.authModal()) return;
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ onShareAppMessage: function() {
+ var member_id = wx.getStorageSync('member_id');
+ let {
+ modify_recipe_share_title,
+ modify_vipcard_share_image,
+ modify_recipe_name
+ } = this.data;
+ return {
+ title: modify_recipe_share_title || modify_recipe_name,
+ path: "eaterplanet_ecommerce/moduleA/menu/index?share_id=" + member_id,
+ imageUrl: modify_vipcard_share_image,
+ success: function() {},
+ fail: function() {}
+ };
+ },
+
+ onShareTimeline: function() {
+ var member_id = wx.getStorageSync('member_id');
+ let {
+ modify_recipe_share_title,
+ modify_vipcard_share_image,
+ modify_recipe_name
+ } = this.data;
+ var query= `share_id=${member_id}`;
+
+ return {
+ title: modify_recipe_share_title || modify_recipe_name,
+ query,
+ imageUrl: modify_vipcard_share_image,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+
+})
diff --git a/eaterplanet_ecommerce/moduleA/menu/index.json b/eaterplanet_ecommerce/moduleA/menu/index.json
new file mode 100644
index 0000000..e91e226
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/index.json
@@ -0,0 +1,16 @@
+{
+ "backgroundTextStyle": "light",
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTextStyle": "white",
+ "enablePullDownRefresh": false,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "masonry": "../components/masonry/masonry",
+ "i-img": "../../components/img/index",
+ "i-menutabs": "../../components/menutabs/index",
+ "img-box": "../components/img-box/img-box",
+ "i-empty": "../../components/empty/index",
+ "i-tabbar": "../../components/tabbar/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/index.wxml b/eaterplanet_ecommerce/moduleA/menu/index.wxml
new file mode 100644
index 0000000..fd481ee
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/index.wxml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+ 喜欢
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 今日推荐
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂时没有{{modify_recipe_name}}
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/menu/index.wxss b/eaterplanet_ecommerce/moduleA/menu/index.wxss
new file mode 100644
index 0000000..67d2219
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/index.wxss
@@ -0,0 +1,122 @@
+.search-box {
+ position: fixed;
+ background-color: #ff758c;
+ left: 0;
+ right: 0;
+ padding: 20rpx;
+ z-index: 100;
+}
+
+.ipt-box {
+ position: relative;
+ background-color: #f0f0f0;
+ height: 60rpx;
+ line-height: 60rpx;
+ border-radius: 28rpx;
+ color: #acacac;
+ display: flex;
+ flex: 1;
+ margin-right: 20rpx;
+ align-items: center;
+}
+
+.ipt-box .ipt {
+ flex: 1;
+ line-height: 60rpx;
+}
+
+.ipt-box .iconfont {
+ margin-right: 12rpx;
+ font-size: 34rpx;
+ margin-left: 20rpx;
+}
+
+.search-fav {
+ text-align: center;
+ line-height: 1;
+ color: #fff;
+}
+
+.search-fav .iconfont {
+ font-size: 36rpx;
+}
+
+/* 幻灯片 */
+.swipe {
+ height: 200rpx;
+}
+
+.swiper-content {
+ width: 750rpx;
+ height: 200rpx;
+ border-radius: 20rpx;
+}
+
+.swiper-content swiper-item {
+ border-radius: 12rpx;
+ margin-right: 20rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.swiper-content swiper-item:last-child {
+ margin: 0;
+}
+
+.swiper-content .banner {
+ width: 710rpx;
+ height: 200rpx;
+ margin: 0 20rpx;
+ display: block;
+ border-radius: 20rpx;
+ position: relative;
+ overflow: hidden;
+}
+
+.swiper-content .banner .banner-img {
+ width: 710rpx;
+ height: 200rpx;
+ border-radius: 20rpx;
+ display: block;
+ overflow: hidden;
+}
+
+.cate-title {
+ position: relative;
+ padding: 30rpx 20rpx 16rpx 40rpx;
+ font-size: 34rpx;
+ color: #fff;
+}
+
+.cate-title::before {
+ content: "";
+ position: absolute;
+ top: 35rpx;
+ bottom: 20rpx;
+ left: 20rpx;
+ border-left: 8rpx solid #fff;
+}
+
+::-webkit-scrollbar {
+ display: none;
+ width: 0;
+ height: 0;
+ color: transparent;
+}
+
+.sticky-content.Fixed {
+ position: fixed;
+ top: 100rpx;
+ z-index: 100;
+ transition: top 0.3s ease-in;
+ left: 0;
+ right: 0;
+}
+
+.sticky-content .iconfont {
+ padding: 12rpx 20rpx;
+ font-weight: bold;
+ color: #5e6062;
+ box-shadow: -5px 0 5px -5px #ccc;
+ margin-left: -5px;
+}
diff --git a/eaterplanet_ecommerce/moduleA/menu/list.js b/eaterplanet_ecommerce/moduleA/menu/list.js
new file mode 100644
index 0000000..51982af
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/list.js
@@ -0,0 +1,159 @@
+const app = getApp()
+var util = require('../../utils/util.js');
+
+Page({
+ data: {
+ loadMore: true,
+ classification: {
+ tabs: [],
+ activeIndex: 0
+ }
+ },
+ pageNum: 1,
+
+ onLoad: function(options) {
+ this.gid = options.gid || '';
+ let name = options.name || '';
+ name && wx.setNavigationBarTitle({
+ title: name
+ })
+ this._doRefreshMasonry();
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onShow: function() {
+ util.check_login_new().then((res) => {
+ this.setData({
+ needAuth: !res
+ });
+ })
+ },
+
+ noLogin: function() {
+ this.setData({
+ needAuth: true,
+ showAuthModal: true
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ const that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ showEmpty: 0,
+ needAuth: false,
+ showAuthModal: false
+ }, () => {
+ that._doRefreshMasonry()
+ })
+ },
+
+ authModal: function() {
+ if (this.data.needAuth) {
+ this.setData({
+ showAuthModal: !this.data.showAuthModal
+ });
+ return false;
+ }
+ return true;
+ },
+
+ onPullDownRefresh: function() {
+ const that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ showEmpty: 0
+ }, () => {
+ that.getInfo();
+ that._doRefreshMasonry()
+ })
+ },
+
+ onReachBottom: function() {
+ this.data.loadMore && this._doAppendMasonry()
+ },
+
+ _doRefreshMasonry() {
+ let that = this;
+ this.masonryListComponent = this.selectComponent('#masonry');
+ this.getData().then(res => {
+ that.masonryListComponent.start(res).then(() => {})
+ }).catch(() => {
+ that.masonryListComponent.start([]).then(() => {})
+ })
+ },
+
+ _doAppendMasonry() {
+ let that = this;
+ this.masonryListComponent = this.selectComponent('#masonry')
+ // 获取接口数据后使用瀑布流组件append方法,当append完成后调用then,是否可触底价在的标志位可以在这里处理
+ this.getData().then(res => {
+ that.masonryListComponent.append(res).then(() => {
+ console.log('refresh completed')
+ })
+ }).catch(() => {
+ console.log('没有更多了')
+ })
+ },
+
+ /**
+ * 获取列表
+ */
+ getData: function() {
+ return new Promise((resolve, reject) => {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let gid = that.gid;
+
+ wx.showLoading();
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'recipe.get_recipe_list',
+ token: token,
+ gid,
+ pageNum: this.pageNum
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.stopPullDownRefresh();
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ that.pageNum++;
+ resolve(list);
+ } else {
+ // 无数据
+ let h = {
+ loadMore: false
+ }
+ if (that.pageNum == 1) h.showEmpty = 1;
+ that.setData(h);
+ reject('');
+ }
+ wx.hideLoading();
+ }
+ })
+ })
+ }
+
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/list.json b/eaterplanet_ecommerce/moduleA/menu/list.json
new file mode 100644
index 0000000..af96f73
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/list.json
@@ -0,0 +1,10 @@
+{
+ "enablePullDownRefresh": false,
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "masonry": "../components/masonry/masonry",
+ "img-box": "../components/img-box/img-box",
+ "i-empty": "../../components/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/list.wxml b/eaterplanet_ecommerce/moduleA/menu/list.wxml
new file mode 100644
index 0000000..05e7079
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/list.wxml
@@ -0,0 +1,5 @@
+
+
+
+
+暂无结果~
diff --git a/eaterplanet_ecommerce/moduleA/menu/list.wxss b/eaterplanet_ecommerce/moduleA/menu/list.wxss
new file mode 100644
index 0000000..0bfa16f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/list.wxss
@@ -0,0 +1 @@
+/* eaterplanet_ecommerce/moduleA/menu/list.wxss */
diff --git a/eaterplanet_ecommerce/moduleA/menu/subcate.js b/eaterplanet_ecommerce/moduleA/menu/subcate.js
new file mode 100644
index 0000000..6762e85
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/subcate.js
@@ -0,0 +1,58 @@
+const app = getApp();
+
+Page({
+ data: {
+ subCate: []
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getCate();
+ },
+
+ /**
+ * 获取子分类
+ */
+ getCate: function () {
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'recipe.get_recipe_categorylist'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let subCate = res.data.data || [];
+ that.setData({ subCate })
+ }
+ }
+ })
+ },
+
+ goList: function(e){
+ let subId = e.currentTarget.dataset.id || '';
+ let name = e.currentTarget.dataset.name || '';
+ wx.navigateTo({
+ url: `/eaterplanet_ecommerce/moduleA/menu/list?gid=${subId}&name=${name}`
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/menu/subcate.json b/eaterplanet_ecommerce/moduleA/menu/subcate.json
new file mode 100644
index 0000000..671d40e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/subcate.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-img": "../../components/img/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/subcate.wxml b/eaterplanet_ecommerce/moduleA/menu/subcate.wxml
new file mode 100644
index 0000000..f70d95a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/subcate.wxml
@@ -0,0 +1,13 @@
+
+
+
+
+ {{item.name}}
+
+
+
+ {{sub.name}}
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/menu/subcate.wxss b/eaterplanet_ecommerce/moduleA/menu/subcate.wxss
new file mode 100644
index 0000000..0f4f4e6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/menu/subcate.wxss
@@ -0,0 +1,43 @@
+/* 子分类 */
+.cate {
+ padding-top: 20rpx;
+}
+
+.sub-tit {
+ font-size: 32rpx;
+ color: #000;
+ padding: 20rpx 30rpx;
+}
+
+.scroll-lock {
+ height: 100vh;
+ overflow-y: hidden;
+}
+
+.sub-list {
+ flex-wrap: wrap;
+ padding: 0 15rpx;
+}
+
+.sub-list .item {
+ width: 25%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ margin-bottom: 30rpx;
+}
+
+.sub-list .item .img {
+ width: 122rpx;
+ height: 122rpx;
+ border-radius: 50%;
+}
+
+.sub-list .item .name {
+ font-size: 28rpx;
+ color: #666;
+ margin: 15rpx 0;
+ width: 100%;
+ text-align: center;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/excharge.js b/eaterplanet_ecommerce/moduleA/pin/excharge.js
new file mode 100644
index 0000000..e1408f9
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/excharge.js
@@ -0,0 +1,320 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+ mixins: [require('../../mixin/commonMixin.js')],
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ type: 1,
+ items: [{
+ name: '1',
+ value: '系统余额',
+ show: true,
+ checked: false
+ },
+ {
+ name: '2',
+ value: '微信零钱',
+ show: true,
+ checked: false
+ },
+ {
+ name: '3',
+ value: '支付宝',
+ show: true,
+ checked: false
+ },
+ {
+ name: '4',
+ value: '银行卡',
+ show: true,
+ checked: false
+ }
+ ],
+ info: [],
+ tixian_money: '',
+ final_money: 0
+ },
+ canTixian: true,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ wx.showLoading();
+ this.getData();
+ },
+
+ onShow: function() {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ that.setData({
+ needAuth: false
+ })
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ wx.showLoading();
+ that.getData();
+ })
+ },
+
+ getData: function() {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'groupdo.get_commission_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let commiss_tixian_publish = res.data.data.commiss_tixian_publish;
+ let items = that.data.items;
+ let rdata = res.data.data;
+ if (rdata.commiss_tixianway_yuer == 0) items[0].show = false;
+ if (rdata.commiss_tixianway_weixin == 0) items[1].show = false;
+ if (rdata.commiss_tixianway_alipay == 0) items[2].show = false;
+ if (rdata.commiss_tixianway_bank == 0) items[3].show = false;
+
+ let type = that.data.type;
+ for (let i = 0; i < items.length; i++) {
+ if (items[i].show) {
+ items[i].checked = true;
+ type = items[i].name;
+ break
+ }
+ }
+
+ that.setData({
+ info: res.data.data,
+ items,
+ type,
+ commiss_tixian_publish
+ })
+ } else {
+ wx.showModal({
+ title: '提示',
+ content: res.data.msg,
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+ formSubmit: function(e) {
+ const params = e.detail.value;
+ let isNull = 0;
+ let type = this.data.type;
+ let errortip = [{}, {}, {
+ bankusername: '微信真实姓名'
+ }, {
+ bankusername: '支付宝真实姓名',
+ bankaccount: '支付宝账户'
+ }, {
+ bankname: '银行卡名称',
+ bankusername: '持卡人姓名',
+ bankaccount: '银行卡账户'
+ }];
+ for (let item in params) {
+ params[item] = params[item].replace(/(^\s*)|(\s*$)/g, "");
+ if (!params[item]) {
+ const itemTip = errortip[type][item];
+ wx.showToast({
+ title: '请输入' + (itemTip || '正确的表单内容'),
+ icon: 'none'
+ })
+ isNull = 1;
+ break;
+ }
+ if (item == 'money' && params[item] * 1 <= 0) {
+ wx.showToast({
+ title: '请输入正确的金额',
+ icon: 'none'
+ })
+ return;
+ }
+ }
+
+ if (isNull == 1) return;
+ params.type = this.data.type;
+ console.log(params);
+
+ let tdata = this.data;
+ let tixian_money = parseFloat(tdata.tixian_money);
+ let max_tixian_money = tdata.info.money;
+ let community_min_money = parseFloat(tdata.info.commiss_min_tixian_money);
+
+ if (tixian_money == '' || community_min_money > tixian_money) {
+ wx.showToast({
+ title: '最小提现' + community_min_money + '元',
+ icon: "none",
+ })
+ return false;
+ }
+
+ if (tixian_money > max_tixian_money) {
+ wx.showToast({
+ title: '本次最大可提现' + max_tixian_money + '元',
+ icon: "none",
+ })
+ let fee = tdata.info.commiss_tixian_bili;
+ let final_money = (max_tixian_money * (100 - fee) / 100).toFixed(2);
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money
+ })
+ return false;
+ }
+
+ if (!this.canTixian) return;
+ this.canTixian = false;
+
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'groupdo.tixian_sub',
+ token: token,
+ ...params
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ wx.showToast({
+ title: '已提交申请',
+ icon: 'none',
+ duration: 2000,
+ success: function () {
+ that.setData({
+ canPay: false,
+ tixian_money: '',
+ final_money: 0
+ })
+ that.getData();
+ }
+ })
+ } else {
+ wx.showToast({
+ title: res.data.msg ? res.data.msg : '提交失败,请重试',
+ icon: 'none'
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 获得焦点
+ */
+ bindIptFocus: function() {
+ this.setData({
+ onFocus: true
+ })
+ },
+
+ /**
+ * 失去焦点
+ */
+ bindIptBlur: function() {
+ this.setData({
+ onFocus: false
+ })
+ },
+
+ radioChange(e) {
+ this.setData({
+ type: e.detail.value
+ })
+ },
+
+ bindTixianMoneyInput: function(t) {
+ let max_val = this.data.info.money;
+ var value = t.detail.value;
+ if (!(/^(\d?)+(\.\d{0,2})?$/.test(value))) {
+ value = value.substring(0, value.length - 1);
+ value = parseFloat(value);
+ }
+
+ if (value > max_val) {
+ wx.showToast({
+ title: '本次最大可提现' + max_val + '元',
+ icon: "none",
+ })
+ }
+ let fee = this.data.info.commiss_tixian_bili;
+ let final_money = (value * (100 - fee) / 100).toFixed(2);
+
+ let canPay = false;
+ value ? canPay = true : canPay = false;
+
+ this.setData({
+ tixian_money: value,
+ final_money: final_money,
+ canPay
+ })
+ return value;
+ },
+
+ getAll: function() {
+ const tdata = this.data;
+ var max_tixian_money = tdata.info.money * 1;
+ let fee = tdata.info.commiss_tixian_bili;
+ let final_money = (max_tixian_money * (100 - fee) / 100).toFixed(2);
+
+ let canPay = false;
+ max_tixian_money ? canPay = true : canPay = false;
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money,
+ canPay
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/pin/excharge.json b/eaterplanet_ecommerce/moduleA/pin/excharge.json
new file mode 100644
index 0000000..7639879
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/excharge.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "提现",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/excharge.wxml b/eaterplanet_ecommerce/moduleA/pin/excharge.wxml
new file mode 100644
index 0000000..510bce2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/excharge.wxml
@@ -0,0 +1,58 @@
+
+
+
+
+ {{info.money}}
+ 可提现金额(元)
+
+ 提现记录
+
+
+
+ 提现规则:
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/pin/excharge.wxss b/eaterplanet_ecommerce/moduleA/pin/excharge.wxss
new file mode 100644
index 0000000..4849b5f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/excharge.wxss
@@ -0,0 +1 @@
+@import "/eaterplanet_ecommerce/resource/css/excharge.wxss";
diff --git a/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.js b/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.js
new file mode 100644
index 0000000..4786678
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.js
@@ -0,0 +1,120 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ loadText: '加载中',
+ loadMore: false,
+ noData: false,
+ state: ['提现中', '提现成功', '提现失败']
+ },
+ page: 1,
+ noMore: false,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ this.getData();
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ that.getData();
+ })
+ },
+
+ getData: function() {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'groupdo.tixian_record',
+ token: token,
+ page: this.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list })
+ } else {
+ // 无数据
+ if (that.page == 1) that.setData({ noData: true })
+ that.noMore = true;
+ that.setData({ loadMore: false })
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ wx.showModal({
+ title: '提示',
+ content: '您还未登录',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ this.noMore || (this.setData({ loadMore: true }), this.getData());
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.json b/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.json
new file mode 100644
index 0000000..b0c579c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "提现记录",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.wxml b/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.wxml
new file mode 100644
index 0000000..11517cb
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.wxml
@@ -0,0 +1,22 @@
+
+
+
+
+ 申请时间
+ 状态
+ 金额(元)
+
+
+
+ {{item.addtime}}
+ {{state[item.state]}}
+ {{item.money}}
+
+
+
+
+
+ 暂无任何明细记录
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.wxss b/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.wxss
new file mode 100644
index 0000000..0d4a5e2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/exchargeRecord.wxss
@@ -0,0 +1,63 @@
+
+.title {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ display: flex;
+ align-items: center;
+ background-color: #fff;
+ color: #333;
+ line-height: 80rpx;
+ font-size: 28rpx;
+ text-align: center;
+ box-shadow: 1px 2px 3px rgba(0, 0, 0, .3);
+ font-weight: bold;
+}
+
+.time {
+ flex: 3;
+}
+
+.status {
+ flex: 1;
+}
+
+.money {
+ flex: 2;
+}
+
+.list {
+ padding-top: 80rpx;
+ text-align: center;
+ background-color: #fff;
+ font-size: 24rpx;
+}
+
+.list-item {
+ position: relative;
+ display: flex;
+ align-items: center;
+ line-height: 76rpx;
+ border-bottom: 1rpx solid #efefef;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-top: 200rpx;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/goodsDetail.js b/eaterplanet_ecommerce/moduleA/pin/goodsDetail.js
new file mode 100644
index 0000000..3314648
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/goodsDetail.js
@@ -0,0 +1,1414 @@
+// eaterplanet_ecommerce/pages/goods/goodsDetail.js
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+var app = getApp();
+var detailClearTime = null;
+
+function count_down(that, total_micro_second) {
+ var second = Math.floor(total_micro_second / 1000);
+ var days = second / 3600 / 24;
+ var daysRound = Math.floor(days);
+ var hours = second / 3600 - (24 * daysRound);
+ var hoursRound = Math.floor(hours);
+ var minutes = second / 60 - (24 * 60 * daysRound) - (60 * hoursRound);
+ var minutesRound = Math.floor(minutes);
+ var seconds = second - (24 * 3600 * daysRound) - (3600 * hoursRound) - (60 * minutesRound);
+
+ that.setData({
+ endtime: {
+ days: fill_zero_prefix(daysRound),
+ hours: fill_zero_prefix(hoursRound),
+ minutes: fill_zero_prefix(minutesRound),
+ seconds: fill_zero_prefix(seconds),
+ show_detail: 1
+ }
+ });
+
+ if (total_micro_second <= 0) {
+ clearTimeout(detailClearTime);
+ detailClearTime = null;
+ if (that.data.goods.over_type == 0) {
+ that.authSuccess();
+ }
+ that.setData({
+ endtime: {
+ days: "00",
+ hours: "00",
+ minutes: "00",
+ seconds: "00",
+ }
+ });
+ return;
+ }
+
+ detailClearTime = setTimeout(function () {
+ total_micro_second -= 1000;
+ count_down(that, total_micro_second);
+ }, 1000)
+
+}
+// 位数不足补零
+function fill_zero_prefix(num) {
+ return num < 10 ? "0" + num : num
+}
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ needAuth: false,
+ goodsIndex: 1,
+ goods_id: 0,
+ endtime: {
+ days: "00",
+ hours: "00",
+ minutes: "00",
+ seconds: "00",
+ },
+ is_share_html: true,
+ imageSize: {
+ imageWidth: "100%",
+ imageHeight: 600
+ },
+ cartNum: 0,
+ noIns: false,
+ index_bottom_image: '',
+ hideModal: true,
+ shareImgUrl: '',
+ goods_details_middle_image: '',
+ is_show_buy_record: 0,
+ stopNotify: true,
+ iconArr: {
+ home: '',
+ car: ''
+ },
+ canvasWidth: 375,
+ canvasHeight: 300,
+ fmShow: true,
+ pinListCount: 0,
+ pinList: [],
+ needPosition: false,
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ }
+ },
+ $data: {
+ id: '',
+ scene: ''
+ },
+ imageUrl: '',
+ goodsImg: '',
+ currentOptions: [],
+ buy_type: 'pindan',
+ canPreSub: true,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ app.setShareConfig();
+ app.globalData.navBackUrl = '';
+ var that = this;
+ status.setNavBgColor();
+ status.setGroupInfo().then((groupInfo) => { that.setData({ groupInfo }) });
+ status.setIcon().then(function (iconArr) {
+ that.setData({ iconArr });
+ });
+ var scene = decodeURIComponent(options.scene);
+ this.$data.id = options.id;
+ this.$data.scene = options.scene;
+ if (scene !== 'undefined') {
+ var opt_arr = scene.split("_");
+ options.id = opt_arr[0];
+ options.share_id = opt_arr[1];
+ options.community_id = opt_arr[2];
+ }
+ if (options.community_id !== 'undefined' && options.community_id > 0) {
+ this.$data.community_id = options.community_id;
+ }
+ wx.showLoading();
+
+ if (options.share_id != 'undefined' && options.share_id > 0) wx.setStorage({ key: "share_id", data: options.share_id })
+
+ this.get_goods_details(options.id);
+ this.get_instructions();
+ this.setData({
+ canvasWidth: app.globalData.systemInfo.windowWidth,
+ canvasHeight: 0.8 * app.globalData.systemInfo.windowWidth,
+ goods_id: options.id
+ })
+ },
+
+ get_goods_details: function (id) {
+ let that = this;
+ if (!id) {
+ wx.hideLoading();
+ wx.showModal({
+ title: '提示',
+ content: '参数错误',
+ showCancel: false,
+ confirmColor: '#F75451',
+ success(res) {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ }
+ }
+ })
+ return false;
+ }
+ this.getFujinTuan(id);
+ let token = wx.getStorageSync('token');
+ let community = wx.getStorageSync('community');
+ let community_id = community.communityId || 0;
+
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'groupdo.get_goods_detail',
+ token: token,
+ id,
+ community_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ let goods = (res.data.data && res.data.data.goods) || '';
+ // 商品不存在
+ if (!goods || goods.length == 0 || Object.keys(goods) == '') {
+ wx.showModal({
+ title: '提示',
+ content: '该商品不存在,回首页',
+ showCancel: false,
+ confirmColor: '#F75451',
+ success(res) {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/moduleA/pin/index',
+ })
+ }
+ }
+ })
+ }
+ let comment_list = res.data.comment_list;
+ comment_list.map(function (item) {
+ 14 * item.content.length / app.globalData.systemInfo.windowWidth > 3 && (item.showOpen = true), item.isOpen = true;
+ })
+
+ // 幻灯片预览数组
+ let goods_images = res.data.data.goods_image;
+ let prevImgArr = [];
+ goods_images.forEach(function (item) { prevImgArr.push(item.image); })
+
+ that.currentOptions = res.data.data.options;
+ let pin_info = res.data.data.pin_info || {};
+
+ // 开启社区
+ let pintuan_model_buy = res.data.pintuan_model_buy || 0;
+ let is_comunity_rest = res.data.is_comunity_rest || 0;
+ let needPosition = false;
+ if (pintuan_model_buy==1) {
+ needPosition = true;
+ // 团长休息
+ if (is_comunity_rest==1) {
+ wx.showModal({
+ title: '温馨提示',
+ content: '团长休息中,欢迎下次光临!',
+ showCancel: false,
+ confirmColor: '#F75451',
+ confirmText: '好的',
+ success(res) { }
+ })
+ }
+ that.needCommunity();
+ }
+
+ that.setData({
+ needPosition,
+ pintuan_model_buy,
+ is_comunity_rest,
+ order_comment_count: res.data.order_comment_count,
+ comment_list: comment_list,
+ goods: goods,
+ options: res.data.data.options,
+ order: {
+ goods_id: res.data.data.goods.goods_id,
+ pin_id: res.data.data.pin_id,
+ },
+ share_title: goods.share_title,
+ buy_record_arr: res.data.data.buy_record_arr,
+ goods_image: res.data.data.goods_image,
+ goods_image_length: res.data.data.goods_image.length,
+ service: goods.tag,
+ showSkeleton: false,
+ is_comunity_rest: res.data.is_comunity_rest,
+ prevImgArr,
+ open_man_orderbuy: res.data.open_man_orderbuy,
+ man_orderbuy_money: res.data.man_orderbuy_money,
+ goodsdetails_addcart_bg_color: res.data.goodsdetails_addcart_bg_color || 'linear-gradient(270deg, #f9c706 0%, #feb600 100%)',
+ goodsdetails_buy_bg_color: res.data.goodsdetails_buy_bg_color || 'linear-gradient(90deg, #ff5041 0%, #ff695c 100%)',
+ pin_info,
+ pintuan_close_stranger: res.data.pintuan_close_stranger,
+ is_need_subscript: res.data.is_need_subscript,
+ need_subscript_template: res.data.need_subscript_template
+ }, () => {
+ let goods_share_image = goods.goods_share_image;
+ if (goods_share_image) {
+ console.log('draw分享图');
+ status.download(goods_share_image + "?imageView2/1/w/500/h/400").then(function (a) {
+ that.goodsImg = a.tempFilePath, that.drawImgNoPrice();
+ });
+ } else {
+ console.log('draw价格');
+ let shareImg = goods.image_thumb;
+ status.download(shareImg + "?imageView2/1/w/500/h/400").then(function (a) {
+ that.goodsImg = a.tempFilePath, that.drawImg();
+ });
+ }
+ })
+ let over_type = goods.over_type;
+ var seconds = 0;
+ if (over_type == 0) {
+ seconds = (goods.begin_time - res.data.data.cur_time) * 1000;
+ } else {
+ seconds = (goods.end_time - res.data.data.cur_time) * 1000;
+ }
+ if (seconds > 0) {
+ count_down(that, seconds);
+ }
+ }
+ })
+ },
+
+ /**
+ * 需要社区
+ * 判断是否已绑定
+ */
+ needCommunity: function () {
+ let that = this;
+ console.log('需要社区')
+ let token = wx.getStorageSync('token');
+ //当前社区
+ let currentCommunity = wx.getStorageSync('community');
+ let currentCommunityId = (currentCommunity && currentCommunity.communityId) || '';
+ let shareCommunityId = this.$data.community_id;
+ console.log('shareCommunityId', shareCommunityId)
+
+ // 单社区
+ util.getCommunityById(shareCommunityId).then(res => {
+ if (res.open_danhead_model == 1) {
+ let default_head_info = res.default_head_info;
+ app.globalData.community = default_head_info;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: default_head_info })
+ that.setData({ community: default_head_info })
+ token && that.addhistory(default_head_info);
+ } else {
+ // 社区是否存在
+ if (currentCommunityId != '') {
+ // 存在并且不相同
+ console.log('currentCommunityId存在 比较社区')
+ if (currentCommunityId != shareCommunityId) {
+ console.log('currentCommunityId存在 社区不同')
+ if (res.data) {
+ that.setData({
+ showChangeCommunity: true,
+ changeCommunity: res.data,
+ community: currentCommunity
+ })
+ }
+ }
+ } else {
+ // 不存在社区id
+ //token 是否存在
+ if (token) {
+ util.getCommunityInfo().then(function (ret) {
+ //比较社区
+ console.log('token存在 比较社区')
+ if (ret.community_id && ret.community_id != shareCommunityId) {
+ that.setData({
+ showChangeCommunity: true,
+ changeCommunity: res.data,
+ community: currentCommunity
+ })
+ }
+ }).catch((param) => {
+ console.log('step4 新人')
+ if (Object.keys(param) != '') that.addhistory(param, true);
+ });
+ } else {
+ console.log('token不存在 存社区')
+ // 直接存本地
+ app.globalData.community = res.data;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: res.data })
+ that.setData({ community: res.data })
+ }
+ }
+ }
+ })
+ },
+
+ /**
+ * 切换提示
+ */
+ confrimChangeCommunity: function () {
+ let community = this.data.changeCommunity;
+ let token = wx.getStorageSync('token');
+ app.globalData.community = community;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({
+ key: "community",
+ data: community
+ })
+ token && this.addhistory(community);
+
+ this.setData({ community, showChangeCommunity: false })
+ this.get_goods_details(this.data.goods_id, community, community.communityId);
+ console.log('用户点击确定')
+ },
+
+ /**
+ * 历史社区
+ */
+ addhistory: function (community, isNew = false) {
+ var community_id = community.communityId;
+ console.log('addhistory');
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.addhistory_community',
+ community_id: community_id,
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (isNew) {
+ console.log('新人 社区')
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.get_community_info',
+ community_id: community_id
+ },
+ dataType: 'json',
+ success: function (result) {
+ if (result.data.code == 0) {
+ let community = result.data.data;
+ app.globalData.community = community;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: community })
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ var id = this.$data.id;
+ var scene = this.$data.scene;
+ let url = '/eaterplanet_ecommerce/moduleA/pin/goodsDetail?id=' + id + '&scene=' + scene;
+ app.globalData.navBackUrl = url;
+ wx.redirectTo({ url })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ that.setData({
+ needAuth: true
+ })
+ } else {
+ (0, status.cartNum)('', true).then((res) => {
+ res.code == 0 && that.setData({
+ cartNum: res.data
+ })
+ });
+ }
+ })
+ this.setData({
+ stopNotify: false
+ });
+ },
+
+ /**
+ * 图片信息
+ */
+ imageLoad: function (e) {
+ var imageSize = util.imageUtil(e)
+ this.setData({
+ imageSize
+ })
+ },
+
+ /**
+ * 获取服务信息
+ */
+ get_instructions: function () {
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'goods.get_instructions'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ var instructions = res.data.data.value;
+ if (instructions == '') that.setData({ noIns: true })
+ that.setData({
+ instructions,
+ index_bottom_image: res.data.data.index_bottom_image,
+ goods_details_middle_image: res.data.data.goods_details_middle_image,
+ is_show_buy_record: res.data.data.is_show_buy_record,
+ order_notify_switch: res.data.data.order_notify_switch,
+ is_show_comment_list: res.data.data.is_show_comment_list,
+ goods_details_price_bg: res.data.data.goods_details_price_bg,
+ isShowContactBtn: res.data.data.index_service_switch || 0,
+ goods_industrial_switch: res.data.data.goods_industrial_switch || 0,
+ goods_industrial: res.data.data.goods_industrial || '',
+ is_show_ziti_time: res.data.data.is_show_ziti_time || 0,
+ hide_community_change_btn: res.data.data.hide_community_change_btn || 0,
+ is_show_goodsdetails_communityinfo: res.data.data.is_show_goodsdetails_communityinfo || 0
+ })
+ }
+ }
+ })
+ },
+
+ getFujinTuan: function (goods_id){
+ let that = this;
+ let community = wx.getStorageSync('community');
+ let head_id = community.communityId || 0;
+
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'groupdo.get_goods_fujin_tuan',
+ goods_id,
+ limit: 4,
+ head_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let { list, count } = res.data;
+ if (list.length) {
+ let timestamp = Date.parse(new Date());
+ list.forEach((item, index)=>{
+ list[index].seconds = (item.end_time - item.cur_interface_time)*1000 + timestamp;
+ console.log((item.end_time - item.cur_interface_time))
+ })
+ }
+ that.setData({
+ pinList: list || [],
+ pinListCount: count || 0
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 打开购物车
+ */
+ openSku: function (t) {
+ if (!this.authModal()) return;
+ this.canPreSub = true;
+ var that = this;
+ var is_just_addcar = 0;
+ var goods_id = this.data.goods_id;
+ var options = this.currentOptions;
+ that.setData({ addCar_goodsid: goods_id })
+ let list = options.list || [];
+ let arr = [];
+ if (list.length > 0) {
+ for (let i = 0; i < list.length; i++) {
+ let sku = list[i]['option_value'][0];
+ let temp = {
+ name: sku['name'],
+ id: sku['option_value_id'],
+ index: i,
+ idx: 0
+ };
+ arr.push(temp);
+ }
+ //把单价剔除出来begin
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ var cur_sku_arr = options.sku_mu_list[id];
+ that.setData({
+ sku: arr,
+ sku_val: 1,
+ cur_sku_arr: cur_sku_arr,
+ skuList: options,
+ visible: true,
+ showSku: true,
+ is_just_addcar
+ });
+ } else {
+ let goods = this.data.goods;
+ let danprice = this.data.pin_info.danprice || 0;
+ let cur_sku_arr = {
+ canBuyNum: goods.total,
+ spuName: goods.goodsname,
+ // actPrice: goods.actPrice,
+ marketPrice: goods.marketPrice,
+ stock: goods.total,
+ skuImage: goods.image_thumb,
+ pinprice: goods.actPrice,
+ actPrice: danprice.split(".")
+ }
+ that.setData({
+ sku: [],
+ sku_val: 1,
+ cur_sku_arr: cur_sku_arr,
+ skuList: [],
+ visible: true,
+ showSku: true
+ })
+ }
+ },
+
+ /**
+ * 确认购物车
+ */
+ gocarfrom: function (e) {
+ var that = this;
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'user.get_member_form_id',
+ 'token': token,
+ "from_id": e.detail.formId
+ },
+ dataType: 'json',
+ success: function (res) { }
+ })
+
+ that.goOrder();
+ },
+
+ /**
+ * 关闭购物车
+ */
+ closeSku: function () {
+ this.setData({
+ visible: 0,
+ stopClick: false,
+ });
+ },
+
+ goOrder: function () {
+ var that = this;
+ if (that.data.can_car) {
+ that.data.can_car = false;
+ }
+
+ let open_man_orderbuy = this.data.open_man_orderbuy;
+ if (open_man_orderbuy == 1) {
+ let man_orderbuy_money = this.data.man_orderbuy_money * 1;
+ let sku_val = this.data.sku_val;
+ let cur_sku_arr = this.data.cur_sku_arr;
+ let actPrice = cur_sku_arr.actPrice[0] + '.' + cur_sku_arr.actPrice[1];
+ console.log(actPrice * 1 * sku_val);
+ if (actPrice * 1 * sku_val < man_orderbuy_money) {
+ wx.showToast({
+ title: '满' + man_orderbuy_money + '元可下单!',
+ icon: 'none'
+ })
+ return false;
+ }
+ }
+
+ var goods_id = that.data.addCar_goodsid;
+ var quantity = that.data.sku_val;
+ var cur_sku_arr = that.data.cur_sku_arr;
+ var sku_str = '';
+ var is_just_addcar = 0;
+ let buy_type = this.buy_type;
+ let community = wx.getStorageSync('community');
+ let community_id = community.communityId || 0;
+
+ if (cur_sku_arr && cur_sku_arr.option_item_ids) {
+ sku_str = cur_sku_arr.option_item_ids;
+ }
+
+ let data = {
+ goods_id,
+ community_id,
+ quantity,
+ sku_str,
+ buy_type,
+ pin_id: 0,
+ is_just_addcar
+ }
+
+ util.addCart(data).then(res=>{
+ if(res.showVipModal==1) {
+ let { pop_vipmember_buyimage } = res.data;
+ wx.hideLoading();
+ that.setData({ pop_vipmember_buyimage, showVipModal: true, visible: false })
+ } else if (res.data.code == 3 || res.data.code == 7) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 4) {
+ wx.hideLoading();
+ that.setData({ needAuth: true, showAuthModal: true, visible: false })
+ } else if (res.data.code == 6) {
+ var msg = res.data.msg;
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({ sku_val: max_quantity })
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ var is_limit = res.data.is_limit_distance_buy;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: `/eaterplanet_ecommerce/pages/order/placeOrder?type=${buy_type}&is_limit=${is_limit}`
+ })
+ } else {
+ wx.navigateTo({
+ url: `/eaterplanet_ecommerce/pages/order/placeOrder?type=${buy_type}&is_limit=${is_limit}`
+ })
+ }
+ }
+ }).catch(res=>{
+ app.util.message(res||'请求失败', '', 'error');
+ })
+ },
+
+ selectSku: function (event) {
+ var that = this;
+ let str = event.currentTarget.dataset.type;
+ let obj = str.split("_");
+ let arr = that.data.sku;
+ let temp = {
+ name: obj[3],
+ id: obj[2],
+ index: obj[0],
+ idx: obj[1]
+ };
+ arr.splice(obj[0], 1, temp);
+ that.setData({
+ sku: arr
+ })
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ var options = this.data.skuList;
+ var cur_sku_arr = options.sku_mu_list[id];
+
+ that.setData({
+ cur_sku_arr: cur_sku_arr
+ });
+
+ console.log(id);
+ },
+
+ submit: function (e) {
+ var from_id = e.detail.formId;
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'user.get_member_form_id',
+ 'token': token,
+ "from_id": from_id
+ },
+ dataType: 'json',
+ success: function (res) { }
+ })
+ },
+
+ /**
+ * 开团订阅
+ */
+ preBalance: function(e){
+ if (!this.authModal()) return;
+ let that = this;
+ if(!this.canPreSub) return;
+ this.canPreSub = false;
+ let is_need_subscript = this.data.is_need_subscript;
+ let buy_type = e.currentTarget.dataset.type;
+ this.buy_type = buy_type;
+ this.setData({ buy_type })
+
+ if(is_need_subscript==1) {
+ //弹出订阅消息
+ this.subscriptionNotice().then(()=>{
+ that.openSku(buy_type);
+ }).catch(()=>{
+ that.openSku(buy_type);
+ });
+ } else {
+ that.openSku(buy_type);
+ }
+ },
+
+ /**
+ * 订阅消息
+ */
+ subscriptionNotice: function() {
+ console.log('subscriptionNotice')
+ let that = this;
+ return new Promise((resolve, reject)=>{
+ let obj = that.data.need_subscript_template;
+ let tmplIds = Object.keys(obj).map(key => obj[key]); // 订阅消息模版id
+ if (wx.requestSubscribeMessage) {
+ tmplIds.length && wx.requestSubscribeMessage({
+ tmplIds: tmplIds,
+ success(res) {
+ let is_need_subscript = 1;
+ let acceptId = [];
+ tmplIds.forEach(item=>{
+ if (res[item] == 'accept') {
+ //用户同意了订阅,添加进数据库
+ acceptId.push(item);
+ } else {
+ //用户拒绝了订阅或当前游戏被禁用订阅消息
+ is_need_subscript = 0;
+ }
+ })
+
+ if(acceptId.length) {
+ that.addAccept(acceptId);
+ }
+ that.setData({ is_need_subscript })
+ resolve();
+ },
+ fail() {
+ reject();
+ }
+ })
+ } else {
+ // 兼容处理
+ reject();
+ }
+ })
+ },
+
+ // 用户点击订阅添加到数据库
+ addAccept: function (acceptId) {
+ let token = wx.getStorageSync('token');
+ let type = acceptId.join(',');
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.collect_subscriptmsg',
+ token,
+ type
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function () {}
+ })
+ },
+
+ balance: function (e) {
+ if (!this.authModal()) return;
+ let that = this;
+ let buy_type = e.currentTarget.dataset.type;
+ // let isZreo = e.currentTarget.dataset.zero || 0;
+ this.buy_type = buy_type;
+ this.setData({ buy_type })
+ // if (isZreo == 1) {
+ // this.zeroModal(()=>{
+ // that.openSku(buy_type);
+ // });
+ // } else {
+ that.openSku(buy_type);
+ // }
+ },
+
+ /**
+ * 数量加减
+ */
+ setNum: function (event) {
+ let types = event.currentTarget.dataset.type;
+ var that = this;
+ var num = 1;
+ let sku_val = this.data.sku_val * 1;
+ if (types == 'add') {
+ num = sku_val + 1;
+ } else if (types == 'decrease') {
+ if (sku_val > 1) {
+ num = sku_val - 1;
+ }
+ }
+
+ let arr = that.data.sku;
+ var options = this.data.skuList;
+ if (arr.length > 0) {
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ }
+ if (options.length > 0) {
+ var cur_sku_arr = options.sku_mu_list[id];
+ if (num > cur_sku_arr['canBuyNum']) {
+ num = num - 1;
+ }
+ } else {
+ let cur_sku_arr = this.data.cur_sku_arr;
+ if (num > cur_sku_arr['canBuyNum']) {
+ num = num - 1;
+ }
+ }
+ this.setData({
+ sku_val: num
+ })
+ },
+
+ scrollImagesChange: function (t) {
+ this.videoContext.pause();
+ this.setData({
+ fmShow: true,
+ goodsIndex: t.detail.current + 1
+ });
+ },
+
+ share_handler: function () {
+ this.setData({
+ is_share_html: !this.data.is_share_html
+ })
+ },
+
+ share_quan: function () {
+ if (!this.authModal()) return;
+ wx.showLoading({
+ title: '获取中',
+ })
+ var token = wx.getStorageSync('token');
+ var community = wx.getStorageSync('community');
+ var goods_id = this.data.order.goods_id;
+ var community_id = community.communityId;
+ var that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'goods.get_user_goods_qrcode',
+ token: token,
+ community_id: community_id,
+ goods_id: goods_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ setTimeout(function () {
+ wx.hideLoading()
+ }, 2000)
+ var image_path = res.data.image_path;
+ wx.getImageInfo({
+ src: image_path,
+ success: function (res) {
+ var real_path = res.path;
+ wx.saveImageToPhotosAlbum({
+ filePath: real_path,
+ success(res) {
+ wx.showToast({
+ title: '图片保存成功,可以分享了',
+ icon: 'none',
+ duration: 2000
+ })
+ that.setData({
+ is_share_html: true
+ });
+ }
+ })
+ }
+ })
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ }
+ })
+ },
+
+ onReady: function (res) {
+ this.videoContext = wx.createVideoContext('myVideo');
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+ this.setData({ stopNotify: true })
+ console.log('详情页hide', this.data.stopNotify)
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+ console.log('onUnload')
+ this.setData({ stopNotify: true })
+ console.log('详情页unload', this.data.stopNotify);
+ detailClearTime = null;
+ clearTimeout(detailClearTime);
+ },
+
+ /**
+ * 获取分享图并显示
+ * 20181225 新形式
+ */
+ get_share_img: function () {
+ if (!this.authModal()) return;
+ wx.showLoading();
+ let shareImgUrl = this.data.shareImgUrl;
+ if (shareImgUrl != '') {
+ wx.hideLoading();
+ this.setData({
+ hideModal: false,
+ is_share_html: true
+ })
+ } else {
+ var token = wx.getStorageSync('token');
+ var community = wx.getStorageSync('community');
+ var goods_id = this.data.goods_id;
+ var community_id = community.communityId;
+
+ var that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'goods.get_user_goods_qrcode',
+ token: token,
+ community_id: community_id,
+ goods_id: goods_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ wx.hideLoading();
+ var image_path = res.data.image_path;
+ wx.previewImage({
+ current: image_path, // 当前显示图片的http链接
+ urls: [image_path] // 需要预览的图片http链接列表
+ })
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ }
+ })
+ }
+ },
+
+ closeShareModal: function () {
+ this.setData({ hideModal: true })
+ },
+
+ /**
+ * 展开收起
+ */
+ bindOpen: function (t) {
+ var idx = t.currentTarget.dataset.idx;
+ console.log(idx)
+ if (this.data.comment_list[idx].isOpen) {
+ this.data.comment_list[idx].isOpen = false;
+ var comment_list = this.data.comment_list;
+ this.setData({
+ comment_list: comment_list
+ });
+ } else {
+ this.data.comment_list[idx].isOpen = true;
+ var comment_list = this.data.comment_list;
+ this.setData({
+ comment_list: comment_list
+ });
+ }
+ },
+
+ /**
+ * 保存分享图并显示
+ * 20181225 新形式
+ */
+ saveThumb: function (e) {
+ wx.showLoading();
+ let that = this;
+ var image_path = this.data.shareImgUrl;
+ wx.getImageInfo({
+ src: image_path,
+ success: function (res) {
+ var real_path = res.path;
+ real_path && wx.saveImageToPhotosAlbum({
+ filePath: real_path,
+ success(res) {
+ console.log(res)
+ wx.hideLoading();
+ wx.showToast({
+ title: '已保存相册',
+ icon: 'none',
+ duration: 2000
+ })
+ that.setData({
+ hideModal: true
+ });
+ },
+ fail: function (res) {
+ wx.hideLoading();
+ console.log(res)
+ if (res.errMsg === "saveImageToPhotosAlbum:fail:auth denied") {
+ wx.openSetting({
+ success(settingdata) {
+ if (settingdata.authSetting["scope.writePhotosAlbum"]) {
+ console.log("获取权限成功,再次点击图片保存到相册")
+ } else {
+ console.log("获取权限失败")
+ }
+ }
+ })
+ }
+ }
+ })
+ }
+ })
+ },
+
+ drawImgNoPrice: function () {
+ var t = this;
+ wx.createSelectorQuery().select(".canvas-img").boundingClientRect(function () {
+ const context = wx.createCanvasContext("myCanvas");
+ context.drawImage(t.goodsImg, 0, 0, status.getPx(375), status.getPx(300));
+ if (t.data.goods.video) context.drawImage("../../images/play.png", status.getPx(127.5), status.getPx(90), status.getPx(120), status.getPx(120));
+ context.save();
+ context.restore(), context.draw(false, t.checkCanvasNoPrice());
+ }).exec();
+ },
+
+ checkCanvasNoPrice: function () {
+ var that = this;
+ setTimeout(() => {
+ wx.canvasToTempFilePath({
+ canvasId: "myCanvas",
+ success: function (res) {
+ res.tempFilePath ? that.imageUrl = res.tempFilePath : that.drawImgNoPrice();
+ console.log('我画完了')
+ },
+ fail: function (a) {
+ that.drawImgNoPrice();
+ }
+ })
+ }, 500)
+ },
+
+ drawImg: function () {
+ let endtime = this.data.endtime;
+ let shareTime = (endtime.days > 0 ? endtime.days + '天' : '') + endtime.hours + ':' + endtime.minutes + ':' + endtime.seconds;
+ var t = this;
+ wx.createSelectorQuery().select(".canvas-img").boundingClientRect(function () {
+ const context = wx.createCanvasContext("myCanvas");
+ context.font = "28px Arial";
+ var e = context.measureText("¥").width + 2;
+ var o = context.measureText(t.data.goods.price_front + "." + t.data.goods.price_after).width;
+ context.font = "17px Arial";
+ var s = context.measureText("¥" + t.data.goods.productprice).width + 3,
+ n = context.measureText("累计销售 " + t.data.goods.seller_count).width,
+ u = context.measureText("· 剩余" + t.data.goods.total + " ").width + 10;
+ context.font = "18px Arial";
+ let over_type_text = t.data.goods.over_type == 0 ? '距开始' : '距结束';
+ var r = context.measureText(over_type_text).width;
+ var d = context.measureText(shareTime).width + 10;
+ context.drawImage(t.goodsImg, 0, 0, status.getPx(375), status.getPx(300));
+ context.drawImage("../../images/shareBottomBg.png", status.getPx(0), status.getPx(225), status.getPx(375), status.getPx(75));
+ if (t.data.goods.video) context.drawImage("../../images/play.png", status.getPx(127.5), status.getPx(70), status.getPx(120), status.getPx(120));
+ context.save();
+ status.drawText(context, { color: "#ffffff", size: 28, textAlign: "left" }, "¥", status.getPx(6), status.getPx(267), status.getPx(e));
+ status.drawText(context, { color: "#ffffff", size: 28, textAlign: "left" }, t.data.goods.price_front + "." + t.data.goods.price_after,
+ status.getPx(e), status.getPx(267), status.getPx(o));
+ context.restore();
+ context.save();
+ context.restore(),
+ context.save(),
+ (0, status.drawText)(context,
+ { color: "#ffffff", size: 15, textAlign: "left" },
+ "¥" + t.data.goods.productprice,
+ (0, status.getPx)(e + o + 10),
+ (0, status.getPx)(267),
+ (0, status.getPx)(s)
+ ),
+ context.restore(),
+ context.save(),
+ (0, status.drawText)(
+ context,
+ { color: "#ffffff", size: 17, textAlign: "left" },
+ "累计销售" + t.data.goods.seller_count,
+ (0, status.getPx)(10),
+ (0, status.getPx)(290),
+ (0, status.getPx)(n)
+ ),
+ context.restore(),
+ context.save(),
+ (0, status.drawText)(context,
+ { color: "#ffffff", size: 17, textAlign: "left" },
+ "· 剩余" + t.data.goods.total,
+ (0, status.getPx)(n + 10),
+ (0, status.getPx)(290),
+ (0, status.getPx)(u)
+ ),
+ context.restore(),
+ context.save(),
+ context.beginPath(),
+ context.setStrokeStyle("white"),
+ context.moveTo((0, status.getPx)(e + o + 10),
+ (0, status.getPx)(261)),
+ context.lineTo((0, status.getPx)(e + o + s + 15),
+ (0, status.getPx)(261)),
+ context.stroke(),
+ context.restore(),
+ context.save(),
+ (0, status.drawText)(context,
+ { color: "#F8E71C", size: 18, textAlign: "center" },
+ over_type_text,
+ (0, status.getPx)(318),
+ (0, status.getPx)(260),
+ (0, status.getPx)(r)
+ ),
+ context.restore(),
+ context.save(),
+ (0, status.drawText)(context, { color: "#F8E71C", size: 18, textAlign: "center" },
+ shareTime,
+ (0, status.getPx)(315),
+ (0, status.getPx)(288),
+ (0, status.getPx)(d)
+ ),
+ context.restore();
+ context.draw(false, t.checkCanvas());
+ }).exec();
+ },
+
+ checkCanvas: function () {
+ var that = this;
+ setTimeout(() => {
+ wx.canvasToTempFilePath({
+ canvasId: "myCanvas",
+ success: function (res) {
+ res.tempFilePath ? that.imageUrl = res.tempFilePath : that.drawImg();
+ console.log('我画完了')
+ },
+ fail: function (a) {
+ that.drawImg();
+ }
+ })
+ }, 500)
+ },
+
+ previewImg: function (e) {
+ let idx = e.currentTarget.dataset.idx || 0;
+ let prevImgArr = this.data.prevImgArr;
+ wx.previewImage({
+ current: prevImgArr[idx],
+ urls: prevImgArr
+ })
+ },
+
+ /**
+ * 播放视频隐藏封面图
+ */
+ btnPlay: function () {
+ this.setData({
+ fmShow: false
+ })
+ this.videoContext.play();
+ },
+
+ videEnd: function () {
+ this.videoContext.exitFullScreen();
+ this.setData({
+ fmShow: true
+ })
+ },
+
+ endPlay: function () {
+ this.videoContext.pause();
+ this.setData({
+ fmShow: true
+ })
+ },
+
+ goLink: function (e) {
+ var pages_all = getCurrentPages();
+ var url = e.currentTarget.dataset.link;
+ if (pages_all.length > 3) {
+ wx.redirectTo({ url })
+ } else {
+ wx.navigateTo({ url })
+ }
+ },
+
+ /**
+ * 0元开团提示
+ */
+ zeroModal: function(fn){
+ let pin_info = this.data.pin_info;
+ let notice = pin_info.pintuan_newman_notice || '';
+ if (notice) {
+ wx.showModal({
+ title: '温馨提示',
+ content: notice,
+ confirmColor: '#ff5041',
+ success(res) {
+ if (res.confirm) {
+ fn()
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ } else {
+ fn()
+ }
+ },
+
+ /**
+ * 0元开团
+ */
+ zeroTuanSub: function() {
+ if (!this.authModal()) return;
+ let that = this;
+ this.zeroModal(()=>{
+ that.zeroCartAdd()
+ });
+ },
+
+ zeroCartAdd: function(){
+ let goods_id = this.data.goods_id || '';
+ var token = wx.getStorageSync('token');
+ let community = wx.getStorageSync('community');
+ let community_id = community.communityId || 0;
+ goods_id && app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'car.add_newcar',
+ token: token,
+ goods_id: goods_id,
+ community_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if(res.data.code==0) {
+ let order_id = res.data.order_id;
+ wx.navigateTo({
+ url: `/eaterplanet_ecommerce/moduleA/pin/share?id=${order_id}`
+ })
+ } else {
+ wx.showToast({
+ title: res.data.msg || '开团失败',
+ icon: 'none'
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ let { goods_id, share_title, goods } = this.data;
+ var community = wx.getStorageSync('community');
+ var community_id = community.communityId;
+ var share_id = wx.getStorageSync('member_id');
+ var share_path = `eaterplanet_ecommerce/moduleA/pin/goodsDetail?id=${goods_id}&share_id=${share_id}&community_id=${community_id}`;
+ let shareImg = goods.goods_share_image;
+ // if(pin_info.is_zero_open!=1 && pin_info.pin_price) share_title = pin_info.pin_price + '元' + share_title;
+
+ var that = this;
+ that.setData({ is_share_html: true, hideModal: true });
+ return {
+ title: share_title,
+ path: share_path,
+ imageUrl: shareImg ? shareImg : that.imageUrl,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function() {
+ let { goods_id, share_title, goods } = this.data;
+ var community = wx.getStorageSync('community');
+ var community_id = community.communityId;
+ var share_id = wx.getStorageSync('member_id');
+ let shareImg = goods.goods_share_image;
+ this.setData({ is_share_html: true, hideModal: true });
+
+ var query= `id=${goods_id}&share_id=${share_id}&community_id=${community_id}`;
+ return {
+ title: share_title,
+ imageUrl: shareImg ? shareImg : this.imageUrl,
+ query,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/pin/goodsDetail.json b/eaterplanet_ecommerce/moduleA/pin/goodsDetail.json
new file mode 100644
index 0000000..9e6db2b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/goodsDetail.json
@@ -0,0 +1,12 @@
+{
+ "navigationBarTitleText": "商品详情",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-count-down": "../../components/count-down/index",
+ "i-order-notify": "../../components/order-notify/index",
+ "i-change-community": "../../components/changeCommunity/index",
+ "parser":"../../components/parser/parser",
+ "advimg": "../../components/advimg/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/goodsDetail.wxml b/eaterplanet_ecommerce/moduleA/pin/goodsDetail.wxml
new file mode 100644
index 0000000..f26c747
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/goodsDetail.wxml
@@ -0,0 +1,401 @@
+
+
+
+
+
+ 分享
+
+
+
+
+
+
+
+
+ 海报
+
+
+
+
+
+
+
+
+
+ {{goods.label_info.tagcontent}}
+
+
+ {{goodsIndex}}/{{goods_image_length}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 退出播放
+
+
+
+
+ ¥
+ {{goods.price_front}}.{{goods.price_after}}
+ ¥{{goods.productprice}}
+ {{pin_info.pin_count}}人团
+
+
+ 距结束
+ 距开始
+ 结束时间
+ {{goods.end_date}}
+
+ {{endtime.days}}天
+ {{endtime.hours}}:
+ {{endtime.minutes}}:
+ {{endtime.seconds}}
+
+
+
+
+ {{goods.goodsname}}
+
+ 销量
+ 已售
+ {{goods.seller_count}} {{goods_sale_unit}},仅剩
+ {{goods.total}} {{goods_sale_unit}}
+
+
+
+
+
+
+
+ {{pinListCount}}人正在拼团,可直接参与
+
+
+
+
+
+
+
+
+
+ 还差{{item.re_need_count}}人成团
+
+
+ 仅剩
+
+
+
+ 去参团
+
+
+
+
+
+
+
+
+ 拼团玩法
+ 查看规则
+
+
+
+ 1
+ 支付开团
+ 参团
+
+
+ 2
+ 邀请用户
+ 参团
+
+
+ 3
+ 拼团成功中
+ 奖人员发货
+
+
+ 4
+ 未中奖人员退
+ 款发放奖励
+
+
+
+
+
+
+
+
+ 拼团玩法
+ 查看规则
+
+
+
+ 1
+ 支付开团
+ 参团
+
+
+ 2
+ 邀请用户
+ 参团
+
+
+ 3
+ 拼团成功
+ 按时送达
+
+
+ 4
+ 逾期未成
+ 团退款
+
+
+
+
+
+
+
+
+
+
+
+
+ 商品评价
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 工商资质
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 即将开抢
+ 已抢光
+ 已结束
+ 已下架
+ 团长休息中
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+ {{value.name}}
+
+
+
+ 数量
+
+
+
+
+
+
+
+
+
+
+ 每人限{{skuList[current].limitMemberNum}}单
+ 每单限{{skuList[current].limitOrderNum}}份
+
+
+ 还可以购买 {{skuList[current].canBuyNum-value}} 件
+
+
+
+
+
+
+
+
+
+
+ 分享
+
+
+
+
+
+
+
+
+
+ 顶部
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存相册
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/pin/goodsDetail.wxss b/eaterplanet_ecommerce/moduleA/pin/goodsDetail.wxss
new file mode 100644
index 0000000..0bc102a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/goodsDetail.wxss
@@ -0,0 +1,1568 @@
+page {
+ background: #f6f6f6;
+}
+
+movable-view {
+width: 110rpx;
+height: 110rpx;
+top: 0;
+left: 0;
+position: absolute;
+
+}
+
+movable-area {
+ height: 100%;
+ width: 100%;
+ margin: 0rpx;
+
+
+}
+.goods-wrapper {
+ position: relative;
+}
+
+swiper {
+ height: 600rpx;
+}
+
+swiper image {
+ width: 100%;
+ height: auto;
+}
+
+.sticky-title {
+ width: 100%;
+ display: none;
+ justify-content: space-between;
+ background: #fff;
+ height: 160rpx;
+ position: relative;
+ z-index: 3;
+}
+
+.sticky-title.sticky {
+ position: fixed;
+ display: flex;
+ top: 0;
+ left: 0;
+ height: 80rpx;
+ line-height: 80rpx;
+ width: 100vw;
+ border-bottom: 2rpx solid rgba(0, 0, 0, 0.1);
+ animation: opacity 0.2s ease-in-out;
+}
+
+.sticky-title.sticky .nav {
+ padding-left: 30rpx;
+}
+
+.sticky-title.sticky .nav .tab-btn {
+ width: 56rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ margin-right: 36rpx;
+ color: #666;
+ font-size: 28rpx;
+ font-weight: bold;
+ position: relative;
+ display: inline-block;
+}
+
+.sticky-title.sticky .nav .tab-btn-active {
+ color: #ff5344;
+ line-height: 80rpx;
+}
+
+.sticky-title.sticky .nav .tab-btn-active:after {
+ content: '';
+ width: 56rpx;
+ height: 6rpx;
+ border-radius: 6rpx;
+ background: linear-gradient(to right, #fe655c, #fa875b);
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ box-shadow: 0 4rpx 8rpx rgba(255, 89, 9, 0.25);
+}
+
+.sticky-title.sticky .time {
+ width: 290rpx;
+ height: 80rpx;
+ font-size: 26rpx;
+ color: #444;
+ display: flex;
+ align-items: center;
+ padding-right: 30rpx;
+ justify-content: flex-end;
+}
+
+.sticky-title.sticky .time text {
+ white-space: nowrap;
+}
+
+.sticky-title.sticky .time .countdownTop {
+ font-size: 28rpx;
+ white-space: nowrap;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.sticky-title.sticky .time .countdownTop .itemTimeTop {
+ width: 38rpx;
+ height: 32rpx;
+ background: #444;
+ border-radius: 4rpx;
+ font-size: 26rpx;
+ color: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.spuInfoImg {
+ width: 100%;
+ height: 600rpx;
+ background-size: 100% 100%;
+ position: relative;
+}
+
+.spuInfoImg .share {
+ width: 160rpx;
+ height: 68rpx;
+ background: linear-gradient(90deg, #f75451 0%, #fa6f57 100%);
+ border-radius: 48rpx 0 0 48rpx;
+ position: absolute;
+ top: 60rpx;
+ right: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.spuInfoImg .share .shareImg {
+ width: 32rpx;
+ height: 28rpx;
+ margin-right: 14rpx;
+}
+
+.spuInfoImg .share text {
+ width: 60rpx;
+ height: 68rpx;
+ line-height: 68rpx;
+ font-size: 26rpx;
+ color: #fff;
+}
+
+.spuInfoImg .current {
+ width: 90rpx;
+ height: 32rpx;
+ line-height: 32rpx;
+ text-align: center;
+ border-radius: 24rpx;
+ background-color: rgba(0, 0, 0, 0.5);
+ font-size: 26rpx;
+ color: #fff;
+ position: absolute;
+ left: 50%;
+ bottom: 110rpx;
+ margin-left: -44rpx;
+ z-index: 1;
+}
+
+.spuInfoImg .slide-image {
+ width: 750rpx;
+ height: 600rpx;
+}
+
+.spuInfo {
+ width: 100%;
+ z-index: 2;
+ position: relative;
+ margin-top: -50px;
+}
+
+.spuInfo .spuPrice {
+ position: relative;
+ width: 680rpx;
+ height: 100rpx;
+ padding-left: 30rpx;
+ margin: 0 auto;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.spuInfo .spuPrice .spuPriceBg {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 710rpx;
+ height: 100rpx;
+ z-index: -1;
+}
+
+.spuInfo .spuPrice .price {
+ font-family: DIN;
+ font-size: 28rpx;
+ color: #fff;
+ margin-top: 10rpx;
+}
+
+.spuInfo .spuPrice .price .salePrice {
+ font-size: 68rpx;
+ font-weight: bold;
+}
+
+.spuInfo .spuPrice .price .storePrice {
+ text-decoration: line-through;
+ margin-left: 10rpx;
+}
+
+.spuInfo .spuPrice .time {
+ width: 220rpx;
+ height: 100rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ font-size: 26rpx;
+ color: #f8e71c;
+ white-space: nowrap;
+}
+
+.spuInfo .spuPrice .time text {
+ line-height: 28rpx;
+ margin-top: 10rpx;
+}
+
+.spuInfo .spuPrice .time .endAct {
+ color: #fff;
+}
+
+.spuInfo .spuPrice .time .countdown {
+ font-size: 28rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.spuInfo .spuPrice .time .countdown em {
+ margin: 0;
+}
+
+.spuInfo .spuPrice .time .countdown .itemTime {
+ width: 32rpx;
+ text-align: center;
+}
+
+.spuInfo .bgOne {
+ background: url("");
+ background-size: 100% 100%;
+}
+
+.spuInfo .bgTwo {
+ background: url("");
+ background-size: 100% 100%;
+}
+
+.spuInfo .spuDetailInfo, .spuInfo .straightInLive, .spuInfo .buyRecords {
+ width: 670rpx;
+ background: #fff;
+ box-shadow: 0 0 40rpx 0 rgba(0, 0, 0, 0.05);
+ border-radius: 0 0 20rpx 20rpx;
+ padding: 30rpx 20rpx 0;
+ margin: 0 auto;
+}
+
+.spuInfo .spuDetailInfo .spuName, .spuInfo .straightInLive .spuName,
+.spuInfo .buyRecords .spuName {
+ font-size: 36rpx;
+ color: #444;
+ font-weight: bold;
+ min-height: 48rpx;
+ line-height: 44rpx;
+ padding: 0 10rpx;
+ white-space: initial;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+}
+
+.spuInfo .spuDetailInfo .remind, .spuInfo .straightInLive .remind,
+.spuInfo .buyRecords .remind {
+ margin-top: 20rpx;
+ display: flex;
+ align-items: center;
+ padding: 0 10rpx;
+}
+
+.spuInfo .spuDetailInfo .remind .remindImg,
+.spuInfo .straightInLive .remind .remindImg,
+.spuInfo .buyRecords .remind .remindImg {
+ width: 28rpx;
+ height: 28rpx;
+ margin-right: 20rpx;
+}
+
+.spuInfo .spuDetailInfo .remind text, .spuInfo .straightInLive .remind text,
+.spuInfo .buyRecords .remind text {
+ font-size: 26rpx;
+ color: #aaa;
+}
+
+.spuInfo .spuDetailInfo .preferential, .spuInfo .straightInLive .preferential,
+.spuInfo .buyRecords .preferential {
+ padding: 24rpx 20rpx;
+ background: linear-gradient(223deg, #fff7f0 0%, #fff4ec 100%);
+ border-radius: 16rpx;
+ margin-top: 40rpx;
+ margin-bottom: 10rpx;
+ font-size: 24rpx;
+ color: #ca7e57;
+ font-weight: bold;
+ line-height: 40rpx;
+}
+
+.spuInfo .spuDetailInfo .preferential .tit,
+.spuInfo .straightInLive .preferential .tit,
+.spuInfo .buyRecords .preferential .tit {
+ font-size: 20rpx;
+ color: #ff5344;
+ border: 2rpx solid #ffa49c;
+ border-radius: 16rpx;
+ padding: 0 8rpx;
+ margin-right: 10rpx;
+}
+
+.spuInfo .spuDetailInfo .preferential .con,
+.spuInfo .straightInLive .preferential .con,
+.spuInfo .buyRecords .preferential .con {
+ margin-right: 20rpx;
+}
+
+.spuInfo .spuDetailInfo .purchasing, .spuInfo .spuDetailInfo .saleNum,
+.spuInfo .straightInLive .purchasing, .spuInfo .straightInLive .saleNum,
+.spuInfo .buyRecords .purchasing, .spuInfo .buyRecords .saleNum {
+ font-size: 26rpx;
+ color: #666;
+ padding: 30rpx 0;
+ margin: 0 10rpx;
+ border-bottom: 0.1rpx solid #efefef;
+}
+
+.spuInfo .spuDetailInfo .purchasing .purTit,
+.spuInfo .spuDetailInfo .saleNum .purTit,
+.spuInfo .straightInLive .purchasing .purTit,
+.spuInfo .straightInLive .saleNum .purTit,
+.spuInfo .buyRecords .purchasing .purTit, .spuInfo .buyRecords .saleNum .purTit {
+ color: #444;
+ font-weight: bold;
+ margin-right: 20rpx;
+}
+
+.spuInfo .spuDetailInfo .purchasing .remaining,
+.spuInfo .spuDetailInfo .saleNum .remaining,
+.spuInfo .straightInLive .purchasing .remaining,
+.spuInfo .straightInLive .saleNum .remaining,
+.spuInfo .buyRecords .purchasing .remaining,
+.spuInfo .buyRecords .saleNum .remaining {
+ font-weight: bold;
+ margin: 0;
+ color: #ff5344;
+}
+
+.spuInfo .spuDetailInfo .purchasing .stock,
+.spuInfo .spuDetailInfo .saleNum .stock,
+.spuInfo .straightInLive .purchasing .stock,
+.spuInfo .straightInLive .saleNum .stock,
+.spuInfo .buyRecords .purchasing .stock, .spuInfo .buyRecords .saleNum .stock {
+ display: inline-block;
+ font-weight: normal;
+ margin: 0;
+}
+
+.spuInfo .spuDetailInfo .saleNum, .spuInfo .straightInLive .saleNum,
+.spuInfo .buyRecords .saleNum {
+ border: none;
+}
+
+.spuInfo .straightInLive, .spuInfo .buyRecords {
+ width: 650rpx;
+ padding: 0 30rpx;
+ border-radius: 20rpx;
+ margin: 20rpx auto 0;
+}
+
+.spuInfo .straightInLive .title, .spuInfo .buyRecords .title {
+ height: 100rpx;
+ font-size: 32rpx;
+ color: #444;
+ font-weight: bold;
+ border-bottom: 0.1rpx solid #efefef;
+ display: flex;
+ align-items: center;
+}
+
+.spuInfo .straightInLive .title .commentsNum,
+.spuInfo .buyRecords .title .commentsNum {
+ font-size: 26rpx;
+ color: #aaa;
+ font-weight: normal;
+}
+
+.spuInfo .straightInLive .comments, .spuInfo .buyRecords .comments {
+ margin-top: 30rpx;
+}
+
+.spuInfo .straightInLive .comments .commentsCon,
+.spuInfo .buyRecords .comments .commentsCon {
+ font-size: 28rpx;
+ color: #666;
+ line-height: 44rpx;
+ margin-bottom: 10rpx;
+ word-wrap: break-word;
+}
+
+.spuInfo .straightInLive .comments .doubleHidden,
+.spuInfo .buyRecords .comments .doubleHidden {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 3;
+ overflow: hidden;
+ text-overflow: initial;
+ white-space: normal;
+}
+
+.spuInfo .straightInLive .comments .commentsOpen,
+.spuInfo .buyRecords .comments .commentsOpen {
+ height: 22rpx;
+ font-size: 22rpx;
+ color: #444;
+ font-weight: bold;
+ margin-bottom: 20rpx;
+ display: flex;
+ align-items: center;
+}
+
+.spuInfo .straightInLive .comments .commentsOpen .commentsOpenImg,
+.spuInfo .buyRecords .comments .commentsOpen .commentsOpenImg {
+ width: 16rpx;
+ height: 8rpx;
+ margin-left: 6rpx;
+}
+
+.spuInfo .straightInLive .comments .commentsOpen .down,
+.spuInfo .buyRecords .comments .commentsOpen .down {
+ transform: rotate(180deg);
+}
+
+.spuInfo .straightInLive .comments .allImg,
+.spuInfo .buyRecords .comments .allImg {
+ width: 650rpx;
+ height: 150rpx;
+ overflow: hidden;
+}
+
+.spuInfo .straightInLive .comments .allImg {
+ display: flex;
+ overflow-x: auto;
+}
+
+::-webkit-scrollbar {
+ width: 0;
+ height: 0;
+ color: transparent;
+}
+
+.spuInfo .straightInLive .comments .allImg .commentsImg,
+.spuInfo .buyRecords .comments .allImg .commentsImg {
+ width: 150rpx;
+ height: 150rpx;
+ margin-right: 16rpx;
+ display: inline-block;
+}
+
+.spuInfo .straightInLive .comments .allImg .commentsImg .goodsImg,
+.spuInfo .buyRecords .comments .allImg .commentsImg .goodsImg {
+ width: 150rpx;
+}
+
+.spuInfo .straightInLive .comments .allImg .commentsImg .goodsImg .img-class,
+.spuInfo .buyRecords .comments .allImg .commentsImg .goodsImg .img-class {
+ width: 150rpx;
+ height: 150rpx;
+ border-radius: 4rpx;
+ position: unset;
+}
+
+.spuInfo .straightInLive .comments .allImg .commentsImg:last-child,
+.spuInfo .buyRecords .comments .allImg .commentsImg:last-child {
+ margin: 0;
+}
+
+.spuInfo .straightInLive .comments .checkComments,
+.spuInfo .buyRecords .comments .checkComments {
+ font-size: 26rpx;
+ color: #aaa;
+ line-height: 26rpx;
+ padding: 40rpx 0;
+ text-align: center;
+}
+
+.spuInfo .buyRecords {
+ width: 650rpx;
+}
+
+.spuInfo .buyRecords .title {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.spuInfo .buyRecords .title .buyNum {
+ font-size: 24rpx;
+ color: #aaa;
+ font-weight: normal;
+}
+
+.spuInfo .buyRecords .title .buyNum text {
+ color: #ff5344;
+ font-weight: bold;
+}
+
+.spuInfo .buyRecords .title .buyNum .goBuyRecords {
+ width: 12rpx;
+ height: 24rpx;
+ display: inline-block;
+ margin-bottom: -4rpx;
+ margin-left: 10rpx;
+}
+
+.spuInfo .buyRecords .buyerList {
+ padding: 30rpx 20rpx 20rpx;
+ display: flex;
+ flex-wrap: wrap;
+ width: 650rpx;
+ box-sizing: border-box;
+}
+
+.spuInfo .buyRecords .buyerList .buyerImg {
+ width: 90rpx;
+ height: 90rpx;
+ margin-right: 40rpx;
+ margin-bottom: 24rpx;
+ border-radius: 100%;
+ display: block;
+}
+
+.spuInfo .buyRecords .buyerList .buyerImg .img-class {
+ width: 90rpx;
+ height: 90rpx;
+ border-radius: 100%;
+}
+
+.spuInfo .buyRecords .buyerList .buyerImg:nth-child(5) {
+ margin-right: 0;
+}
+
+.spuInfo .buyRecords .buyerList .moreBuyer {
+ display: inline-block;
+}
+
+.spuInfo .buyRecords .buyerList .moreBuyer .buyerImg {
+ margin-right: 0;
+}
+
+.spuInfo .spuDetail {
+ width: 100%;
+}
+
+.spuInfo .spuDetail .goodsDetailTitleImg {
+ width: 336rpx;
+ height: 60rpx;
+ margin: 60rpx auto;
+ display: block;
+}
+
+.spuInfo .spuDetail .warmPrompt .wxParse .wxParse-p .wxParse-inline,.spuInfo .spuDetail .warmPrompt .wxParse .wxParse-inline {
+ margin: 0 30rpx;
+}
+
+.spuInfo .service {
+ padding: 40rpx 20rpx 0;
+}
+
+.spuInfo .service .detailLogo {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-bottom: 40rpx;
+}
+
+.spuInfo .service .detailLogo text {
+ width: 130rpx;
+ height: 2rpx;
+ background: #e4e4e4;
+}
+
+.spuInfo .service .detailLogo .detailLogoImg {
+ width: 184rpx;
+ height: 48rpx;
+ margin: 0 40rpx;
+}
+
+.spuInfo .service .instructions {
+ background: #fff;
+ padding: 40rpx 30rpx;
+ border-radius: 20rpx;
+ overflow: hidden;
+}
+
+.spuInfo .service .instructions .instructionsTit {
+ height: 36rpx;
+ line-height: 36rpx;
+ color: #1c1819;
+ font-size: 28rpx;
+ font-weight: bold;
+ margin-left: 28rpx;
+ margin-bottom: 30rpx;
+}
+
+.spuInfo .service .instructions .instructionsList {
+ line-height: 36rpx;
+ color: #999;
+ font-size: 24rpx;
+ margin-bottom: 20rpx;
+ display: flex;
+ justify-content: space-between;
+}
+
+.spuInfo .service .instructions .instructionsList:last-child {
+ margin: 0;
+}
+
+.spuInfo .service .instructions .instructionsList .instructionsMark {
+ width: 6rpx;
+ height: 6rpx;
+ background: #ff5344;
+ margin-top: 16rpx;
+}
+
+.spuInfo .service .instructions .instructionsList .instructionsText {
+ width: 630rpx;
+}
+
+.spuInfo .service .instructions .instructionsList .instructionsText .instructionsTextTit {
+ color: #666;
+ font-weight: bold;
+}
+
+.spuInfo .service .instructions .instructionsList .instructionsText .instructionsUnderline {
+ color: #666;
+ text-decoration: underline;
+}
+
+.spuInfo .service .instructions .instructionsList .instructionsText .instructionsTime {
+ color: #ff6557;
+ font-weight: bold;
+}
+
+.spuInfo .sloganImg {
+ width: 250rpx;
+ height: 56rpx;
+ padding: 80rpx 0 180rpx;
+ margin: 0 auto;
+ display: block;
+}
+
+.goTopImg {
+ bottom: 160rpx;
+ right: 30rpx;
+ width: 45rpx;
+ height: 45rpx;
+ position: fixed;
+ background: rgba(0, 0, 0, 0.5);
+ border-radius: 50%;
+ color: #fff;
+ text-align: center;
+ z-index: 3;
+ padding: 15rpx;
+}
+
+@-webkit-keyframes opacity {
+ 0% {
+ opacity: 0;
+ }
+
+ 25% {
+ opacity: 0.3;
+ }
+
+ 50% {
+ opacity: 0.5;
+ }
+
+ 75% {
+ opacity: 0.8;
+ }
+
+ 100% {
+ opacity: 1;
+ }
+}
+
+@keyframes opacity {
+ 0% {
+ opacity: 0;
+ }
+
+ 25% {
+ opacity: 0.3;
+ }
+
+ 50% {
+ opacity: 0.5;
+ }
+
+ 75% {
+ opacity: 0.8;
+ }
+
+ 100% {
+ opacity: 1;
+ }
+}
+
+.canvas-img {
+ position: absolute;
+ top: -20000rpx;
+}
+
+.goodsDetailSkeleton_content {
+ position: relative;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_img {
+ width: 750rpx;
+ height: 600rpx;
+ background-color: #e4e4e4;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu {
+ width: 710rpx;
+ height: 540rpx;
+ position: absolute;
+ left: 20rpx;
+ top: 650rpx;
+ background: #fff;
+ border-radius: 20rpx;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list {
+ height: 60rpx;
+ margin: 10rpx 30rpx;
+ display: flex;
+ justify-content: space-between;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list text {
+ width: 200rpx;
+ background: #e4e4e4;
+ border-radius: 10rpx;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list2 {
+ height: 60rpx;
+ margin: 30rpx;
+ background: #e4e4e4;
+ border-radius: 10rpx;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list3,
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list5 {
+ height: 60rpx;
+ margin: 30rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list3 .spec1,
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list3 .spec2,
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list5 .spec1,
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list5 .spec2 {
+ width: 40rpx;
+ background: #e4e4e4;
+ border-radius: 10rpx;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list3 .spec2,
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list5 .spec2 {
+ width: 400rpx;
+ margin-left: 20rpx;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list3 {
+ height: 36rpx;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_list5 {
+ height: 44rpx;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_listAct {
+ width: 670rpx;
+ height: 120rpx;
+ margin: 0 auto;
+ border-radius: 16rpx;
+ background: linear-gradient(223deg, #fff7f0 0%, #fff4ec 100%);
+ overflow: hidden;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_listAct .goodsDetailSkeleton_list4 {
+ height: 32rpx;
+ margin: 20rpx;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_listAct .goodsDetailSkeleton_list4 .spec1,
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_listAct .goodsDetailSkeleton_list4 .spec2 {
+ width: 40rpx;
+ height: 32rpx;
+ background: #e4e4e4;
+ border-radius: 8rpx;
+ margin-right: 20rpx;
+}
+
+.goodsDetailSkeleton_content .goodsDetailSkeleton_spu .goodsDetailSkeleton_listAct .goodsDetailSkeleton_list4 .spec2 {
+ width: 400rpx;
+ height: 40rpx;
+}
+
+button::after {
+ border: none;
+}
+
+/***商品底部按钮begin **/
+
+.goods-bottom-bar {
+ height: 96rpx;
+ display: flex;
+}
+
+.goods-bottom-bar .leftBtn {
+ height: 94rpx;
+ display: flex;
+ border-top: 2rpx solid #efefef;
+}
+
+.goods-bottom-bar .leftBtn .bar-item {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.goods-bottom-bar .leftBtn .back-to-index {
+ background-color: #36362D;
+ border-radius: 0rpx 8rpx 8rpx 0rpx;
+ width: 125rpx;
+ height: 96rpx;
+ font-size: 20rpx;
+ color: #fff;
+}
+
+.goods-bottom-bar .leftBtn .back-to-index image {
+ width: 50rpx;
+ height: 50rpx;
+}
+
+.goods-bottom-bar .leftBtn .shop-cart {
+
+ border-radius: 8rpx 0rpx 0rpx 8rpx;
+ margin-left: 6rpx;
+ background-color: #36362D;
+ width: 125rpx;
+ height: 96rpx;
+ font-size: 20rpx;
+ color: #fff;
+ position: relative;
+}
+
+.goods-bottom-bar .leftBtn .shop-cart .icon {
+
+ width: 50rpx;
+ height: 50rpx;
+ position: relative;
+}
+
+.goods-bottom-bar .leftBtn .shop-cart .icon image {
+ border-right:3rpx solid #fff;
+ padding-right: 40rpx;
+ width: 100%;
+ height: 100%;
+}
+
+.goods-bottom-bar .leftBtn .shop-cart .icon .cart-num {
+ position: absolute;
+ right: -16rpx;
+ top: -4rpx;
+ width: 36rpx;
+ height: 36rpx;
+ background: #ff758c;
+ border-radius: 36rpx;
+ color: #fff;
+ font-size: 22rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.goods-bottom-bar .goodsStatus {
+ width: 100%;
+ height: 96rpx;
+ background: #dcdcdc;
+ font-size: 30rpx;
+ color: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.goods-bottom-bar .gobuy {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-weight: bold;
+ /**background-color: #1c1819;**/
+ overflow: hidden;
+ border-radius: 0rpx 40rpx 40rpx 0rpx;
+
+}
+.bar-item add-to-cart {
+
+ background-color: rgb(247, 112, 98);
+
+}
+
+
+.goods-bottom-bar .gobuy .add-to-cart {
+ width: 270rpx;
+ height: 96rpx;
+ background-color: #36362D;
+ color: #fff;
+ font-size: 28rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+
+}
+
+.goods-bottom-bar .gobuy .btn {
+ width: 270rpx;
+ height: 96rpx;
+ position: absolute;
+ opacity: 0;
+ z-index: 9;
+ top: 0;
+ padding: 0;
+ margin: 0;
+ box-shadow: 20rpx 20rpx 20rpx 0rpx rgba(0,0,0,0.8);
+
+}
+
+.goods-bottom-bar .gobuy .balanceBtn {
+ display: flex;
+ flex: 1;
+}
+
+.goods-bottom-bar .gobuy .balanceBtn .balance {
+ height: 96rpx;
+ flex: 1;
+ background: linear-gradient(90deg, #e7614d 0%, #E57868 100%);
+ color: #fff;
+ font-size: 28rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ border-radius: 0rpx 0px 0px 0rpx;
+}
+
+
+.bar-item-price {
+ font-family: DIN;
+}
+
+.i-fixed-bottom {
+ background-color: rgba(0,0,0,0.3);
+ position: fixed;
+ bottom: 40rpx;
+ z-index: 100;
+ overflow: hidden;
+ left: 30rpx;
+ right:30rpx;
+ border-radius: 48rpx 48rpx 48rpx 48rpx;
+ box-shadow: 0rpx 10rpx 20rpx 10rpx rgba(0,0,0,0.4);
+
+}
+
+ .filter {
+ background-color: rgba(255, 255, 255, 0.8);
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
+ position: fixed;
+ bottom: 40rpx;
+ left: 0;
+ z-index: 2;
+ width: 100%;
+ height: 96rpx;
+ backdrop-filter: blur(30rpx) ;
+ border-radius: 30rpx 30rpx 30rpx 30rpx;
+ margin-left: 20rpx;
+ margin-right: 20rpx;
+ overflow: hidden;
+}
+
+.i-fixed-bottom.iphoneX-height {
+ padding-bottom: 48rpx;
+}
+
+.i-fixed-bottom.pb20 {
+ padding-bottom: 40rpx;
+}
+
+.ui-mask {
+ position: fixed;
+ display: block;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 999;
+ background: rgba(0, 0, 0, 0.6);
+}
+
+.model-services {
+ width: 100%;
+ position: fixed;
+ background-color: #fff;
+ bottom: 0;
+ z-index: 1000;
+ color: #333;
+ -webkit-transition: all 0.3s;
+ transition: all 0.3s;
+ -webkit-transform: translate(0, 100%);
+ transform: translate(0, 100%);
+}
+
+.model-services.show {
+ -webkit-transform: translate(0);
+ transform: translate(0);
+}
+
+.model-services .model-services-title {
+ font-size: 36rpx;
+ text-align: center;
+ height: 80rpx;
+ line-height: 80rpx;
+ border-bottom: 1px solid #f2f5f8;
+}
+
+.model-services .model-services-content {
+ padding: 40rpx;
+}
+
+.model-services .model-services-content .service-item {
+ margin-bottom: 20rpx;
+ width: 50%;
+ float: left;
+ text-align: center;
+}
+
+.model-services .model-services-content .service-icon {
+ font-size: 80rpx;
+ color: #50b674;
+}
+
+.service-name {
+ padding-left: 10rpx;
+}
+
+.cube-text {
+ position: relative;
+ width: 100%;
+ height: 32rpx;
+ line-height: 32rpx;
+ color: #777;
+ margin-top: 5rpx;
+ font-size: 24rpx;
+}
+
+.none_btn {
+ border: none;
+ line-height: 1.1;
+ padding: 0px;
+}
+
+button[plain] {
+ border: none;
+}
+
+.share-modal {
+ position: fixed;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.6);
+ z-index: 101;
+ transition: all 400ms ease-in;
+}
+
+.share-modal-content {
+ position: relative;
+ width: 70%;
+ top: 50%;
+ left: 15%;
+ transform: translateY(-50%);
+ z-index: 110;
+}
+
+.share-modal-img {
+ width: 100%;
+ height: 956rpx;
+ background: #f7f7f7;
+}
+
+.share-modal-img image {
+ width: 100%;
+}
+
+.share-modal-btn-list {
+ display: flex;
+ margin-top: 30rpx;
+}
+
+.share-modal-btn-item {
+ text-align: center;
+ flex: 1;
+}
+
+.share-modal .btn-icon {
+ font-size: 70rpx;
+ color: #fff;
+ margin: 0 auto;
+}
+
+.share-modal .btn-text {
+ position: relative;
+ width: 100%;
+ height: 32rpx;
+ line-height: 32rpx;
+ color: #fff;
+ margin-top: 5rpx;
+ font-size: 24rpx;
+}
+
+
+.spuInfoImg .item-tag {
+ position: absolute;
+ left: 30rpx;
+ top: 20rpx;
+ width: 80rpx;
+ height: 92rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 80rpx;
+ height: 92rpx;
+ z-index: 0;
+}
+
+.spuInfoImg .item-tag .tag-name {
+ position: relative;
+ padding-top: 12rpx;
+ font-size: 28rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.spuInfoImg .item-tag .tag-name.two-word {
+ font-size: 28rpx;
+ padding-top: 24rpx;
+}
+
+/* 评论 */
+
+.comment-user {
+ line-height: 60rpx;
+ display: flex;
+ margin-bottom: 10rpx;
+}
+
+.comment-user image {
+ width: 60rpx;
+ height: 60rpx;
+ border-radius: 50%;
+ margin-right: 14rpx;
+ background-color: #f0f0f0;
+}
+
+.comment-user text {
+ font-size: 26rpx;
+}
+
+.fixed-aside {
+ float:right;
+ position: fixed;
+ right: 20rpx;
+ top:110rpx;
+ background-color: #fff;
+ z-index: 100;
+ width: 80rpx;
+}
+
+.fixed-service {
+ display: inline-block;
+ width: 80rpx;
+ height: 80rpx;
+ background: #e7614d93;
+ border-radius: 20rpx 20rpx 20rpx 20rpx;
+ text-align: center;
+ color: #fff;
+ box-sizing: border-box;
+ font-size: 20rpx;
+ padding: 10rpx;
+ line-height: 1.2;
+ z-index: 100;
+ margin-bottom: 10rpx;
+}
+
+.fixed-service::after {
+ border: 0;
+}
+
+.fixed-service .iconfont {
+ font-size: 30rpx;
+}
+
+.fixed-share {
+ display: inline-block;
+ transform: translateY(950rpx);
+ width: 80rpx;
+ height: 80rpx;
+ background: #e7614d93;
+ border-radius: 20rpx 20rpx 20rpx 20rpx;
+ text-align: center;
+ color: #fff;
+ box-sizing: border-box;
+ font-size: 20rpx;
+ padding: 10rpx;
+ line-height: 1.2;
+ z-index: 100;
+ margin-bottom: 10rpx;
+}
+
+.fixed-share::after {
+ border: 0;
+}
+
+.fixed-share .iconfont {
+ font-size: 30rpx;
+}
+
+.cell {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin: 30rpx 0;
+ background-color: #fff;
+ padding: 20rpx 30rpx;
+}
+
+.cell-left {
+ flex: 1;
+ line-height: 40rpx;
+}
+
+.cell-left text {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.icon-right {
+ width: 12rpx;
+ height: 22rpx;
+}
+
+.cell-icon {
+ width: 40rpx;
+ display: inline-block;
+ vertical-align: middle;
+ margin-right: 10rpx;
+}
+
+/* 幻灯片视频 */
+
+.btn_view {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ z-index: 100;
+ transform: translate(-50%, -50%);
+}
+
+.btn_view image {
+ width: 120rpx;
+ height: 120rpx;
+ background: rgba(0, 0, 0, 0.1);
+ border-radius: 50%;
+ animation: playScale 2s ease-in-out infinite;
+}
+
+.video-wrap, .swiper-video {
+ width: 100%;
+ height: 100%;
+}
+
+.end-play {
+ position: relative;
+ z-index: 1000;
+ background: #000;
+ text-align: center;
+ padding: 20rpx 0;
+}
+
+.end-play .btn {
+ display: inline-block;
+ padding: 5rpx 30rpx;
+ background-color: #f6f6f6;
+ border-radius: 20rpx;
+ font-size: 24rpx;
+}
+
+@keyframes playScale {
+ 0% {
+ transform: scale(1);
+ }
+ 25% {
+ transform: scale(1.1);
+ }
+ 50% {
+ transform: scale(1);
+ }
+ 75% {
+ transform: scale(1.1);
+ }
+}
+
+/* 群 */
+.group {
+ background-color: #fff;
+ width:650rpx;
+ padding:20rpx 30rpx;
+ border-radius:20rpx;
+ margin:20rpx auto 0;
+ box-shadow:0 0 40rpx 0 rgba(0, 0, 0, 0.05);
+ display: flex;
+ align-items: center;
+}
+
+.group-avatar image {
+ width: 94rpx;
+ height: 94rpx;
+ border-radius: 10rpx;
+}
+
+.group-m {
+ flex: 1;
+ margin: 0 15rpx;
+ width: 0;
+}
+
+.group-btn {
+ background: #ff5344;
+ color: #fff;
+ padding: 10rpx 30rpx;
+ border-radius: 60rpx;
+}
+
+.group-title {
+ font-size: 28rpx;
+ color: #333;
+ overflow: hidden;
+ text-overflow:ellipsis;
+ white-space: nowrap;
+}
+
+.group-desc {
+ font-size: 24rpx;
+ color: #999;
+ margin-top: 6rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+
+.group-r-icon {
+ width: 20rpx;
+ height: 36rpx;
+ vertical-align: middle;
+}
+
+/* 拼团 */
+.pin-type {
+ font-size: 20rpx;
+ margin-left: 10rpx;
+ color: #fff;
+ font-weight: normal;
+ border: 1rpx solid #fff;
+ border-radius: 4rpx;
+ padding: 2rpx 10rpx;
+}
+
+.spuInfo .pinRecords .title {
+ font-size: 28rpx;
+}
+
+.spuInfo .pinRecords .title .buyNum text {
+ font-size: 22rpx;
+ color: #aaa;
+ margin-top: -2rpx;
+}
+
+.pinList {
+ padding-bottom: 30rpx;
+}
+
+.pinList .pinList-item {
+ display: flex;
+ align-items: center;
+ padding-top: 30rpx;
+}
+
+.pinList .pinList-item-l .avatar,
+.pinList .pinList-item-l .iconfont {
+ display: inline-block;
+ width: 75rpx;
+ height: 75rpx;
+ border-radius: 50%;
+ vertical-align: middle;
+}
+
+.pinList .pinList-item-l .iconfont {
+ line-height: 67rpx;
+ text-align: center;
+ background-color: #d9d9d9;
+ color: #fff;
+ margin-left: -10rpx;
+ box-sizing: border-box;
+ border: 4rpx solid #fff;
+}
+
+.pinList .pinList-item-m {
+ flex: 1;
+ margin: 0 20rpx;
+}
+
+.pinList .pinList-item-m .num {
+ font-size: 26rpx;
+ color: #666;
+ margin-bottom: 10rpx;
+}
+
+.pinList .pinList-item-m .num text {
+ color: #ff5344;
+}
+
+.pinList .pinList-item-m .time {
+ font-size: 24rpx;
+ color: #999;
+}
+
+.pinList .pinList-item-r {
+ padding: 15rpx 30rpx;
+ line-height: 1;
+ font-size: 26rpx;
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ color: #fff;
+ border-radius: 30rpx;
+}
+
+.pinIntro {
+ color: #333;
+ font-size: 26rpx;
+}
+
+.pinIntro .pinIntro-top {
+ height: 100rpx;
+ border-bottom: 0.1rpx solid #efefef;
+}
+
+.pinIntro .pinIntro-title {
+ font-weight: bold;
+ color: #000;
+}
+
+.pinIntro .iconfont {
+ font-size: 24rpx;
+ margin-top: 2rpx;
+}
+
+.pinIntro-bot {
+ padding: 30rpx 0;
+}
+
+.pinIntro .rule-item {
+ position: relative;
+ text-align: center;
+ z-index: 1;
+}
+
+.pinIntro .rule-item::before {
+ content: "";
+ position: absolute;
+ left: 80rpx;
+ right: -100%;
+ top: 42rpx;
+ border-bottom: 4rpx dotted #ccc;
+ z-index: -1;
+}
+
+.pinIntro .rule-item:last-child:before {
+ content: none;
+}
+
+.pinIntro .rule-item .step {
+ background-color: #ededed;
+ font-size: 36rpx;
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+ color: #666;
+ line-height: 80rpx;
+ margin: 0 auto 10rpx;
+}
+
+.pinIntro .rule-item .p {
+ font-size: 26rpx;
+ color: #333;
+ line-height: 1.2;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/income.js b/eaterplanet_ecommerce/moduleA/pin/income.js
new file mode 100644
index 0000000..ef21d79
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/income.js
@@ -0,0 +1,163 @@
+var app = getApp();
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ currentTab: 0,
+ pageSize: 10,
+ navList: [{
+ name: "全部",
+ status: "-1"
+ }, {
+ name: "待结算",
+ status: "0"
+ }, {
+ name: "已结算",
+ status: "1"
+ }, {
+ name: "已失效",
+ status: "2"
+ }
+ ],
+ list: [],
+ loadText: "加载中...",
+ info: {},
+ noData: 0,
+ loadMore: true,
+ stateArr: ["待结算", "已结算", "已失效"]
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ status.setNavBgColor();
+ this.getInfo();
+ this.getData();
+ },
+
+ getInfo: function () {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'groupdo.get_pincommiss_account_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ that.setData({ info: res.data.data })
+ } else {
+ wx.showModal({
+ title: '提示',
+ content: res.data.msg || '获取失败',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+ getData: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let currentTab = this.data.currentTab;
+ let state = this.data.navList[currentTab].status;
+
+ wx.showLoading();
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'groupdo.listorder_list',
+ token: token,
+ state: state,
+ page: this.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 6) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list, ...h })
+ } else {
+ // 无数据
+ if (that.page == 1) that.setData({ noData: 1 })
+ that.setData({ loadMore: false, noMore: false, loadText: "没有更多记录了~" })
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ getCurrentList: function () {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ this.setData({
+ isHideLoadMore: false
+ })
+ },
+
+ onReachBottom: function(){
+ this.getCurrentList();
+ },
+
+ bindChange: function () {
+ this.page = 1;
+ this.setData({
+ list: [],
+ noData: 0,
+ loadMore: true,
+ loadText: "加载中...",
+ }, () => {
+ console.log('我变啦');
+ this.getData();
+ });
+ },
+
+ /**
+ * 切换导航
+ */
+ switchNav: function (e) {
+ let that = this;
+ if (this.data.currentTab === 1 * e.target.dataset.current) return false;
+ this.setData({
+ currentTab: 1 * e.target.dataset.current
+ }, ()=>{
+ that.bindChange()
+ });
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/pin/income.json b/eaterplanet_ecommerce/moduleA/pin/income.json
new file mode 100644
index 0000000..a1648e9
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/income.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "拼团收益",
+ "navigationBarBackgroundColor": "#fff",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-goods-info": "../components/pinGoodsInfo",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/income.wxml b/eaterplanet_ecommerce/moduleA/pin/income.wxml
new file mode 100644
index 0000000..f549673
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/income.wxml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ 提现记录
+
+
+ 可提现(元)
+ {{info.money}}
+ 提现
+
+
+
+
+ 待结算
+ {{info.wait_statements_money}}
+
+
+ 已结算
+ {{info.has_statements_money}}
+
+
+ 已提现
+ {{info.getmoney}}
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+ 还没有记录 快去分享吧~
+
+
+
+
+
+ {{stateArr[item.state]}}
+
+
+
+
+
+ 订单编号
+ {{item.order_num_alias}}
+
+
+ 订单状态
+ {{item.status_name}}
+
+
+ 下单会员
+ {{item.uname}}
+
+
+ 订单时间
+ {{item.date_added}}
+
+
+ 预估佣金
+ {{item.money}}
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/pin/income.wxss b/eaterplanet_ecommerce/moduleA/pin/income.wxss
new file mode 100644
index 0000000..69f5d3a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/income.wxss
@@ -0,0 +1,210 @@
+.zr {
+ background: #fff;
+ width: 100%;
+ position: relative;
+ overflow: hidden;
+ padding-bottom: 30rpx;
+ margin-bottom: 20rpx;
+}
+
+.top_box {
+ color: #333;
+ font-size: 24rpx;
+ line-height: 1;
+}
+
+.total {
+ text-align: center;
+ padding-bottom: 40rpx;
+}
+
+.total-money {
+ font-weight: bold;
+ font-size: 58rpx;
+ margin-top: 15rpx;
+ padding-left: 80rpx;
+}
+
+.three {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.three-item {
+ position: relative;
+ flex: 1;
+ text-align: center;
+}
+
+.three-item::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 1rpx;
+ border-left: 1rpx solid #cfcfcf;
+}
+
+.three-item:first-child::before {
+ content: none;
+}
+
+.three-title {
+ color: #999;
+ font-size: 24rpx;
+}
+
+.three-money {
+ margin-top: 15rpx;
+ font-size: 28rpx;
+ font-weight: bold;
+}
+
+.rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+ margin-left: 8rpx;
+}
+
+.qrcode {
+ display: inline-block;
+ width: 80rpx;
+ font-size: 22rpx;
+ text-align: center;
+ padding: 8rpx 0;
+ border-radius: 5rpx;
+ background: #4facfe;
+ color: #fff;
+ vertical-align: middle;
+}
+
+.nav {
+ position: sticky;
+ position: -webkit-sticky;
+ top: 0;
+ transition: top 0.3s;
+ z-index: 10;
+ background: #fff;
+ height: 92rpx;
+ border-bottom: 2rpx solid #f2f2f2;
+ padding: 0 60rpx;
+ width: unset;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.nav .orderList_item {
+ margin-bottom: 4rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+ color: #666;
+ position: relative;
+ height: 96rpx;
+ line-height: 96rpx;
+}
+
+.nav .on {
+ position: relative;
+ color: #4facfe;
+ border-bottom: 4rpx solid #4facfe;
+}
+
+.nav .on::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border-bottom: 2rpx solid #4facfe;
+}
+
+.noRecordCon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.noRecordCon .noRecordImg {
+ width: 132rpx;
+ height: 138rpx;
+ margin-top: 30%;
+}
+
+.noRecordCon .noRefundImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-top: 50%;
+}
+
+.noRecordCon .noRecord {
+ padding-top: 32rpx;
+ font-size: 30rpx;
+ font-family: PingFangSC-Light;
+ font-weight: 300;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.noRecordCon .goIndex {
+ width: 164rpx;
+ height: 60rpx;
+ background: #4facfe;
+ border-radius: 30rpx;
+ font-size: 28rpx;
+ color: #fff;
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.list-item {
+ padding: 30rpx;
+ background-color: #fff;
+ margin-bottom: 20rpx;
+ font-size: 26rpx;
+}
+
+.item-head {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ border-bottom: 1rpx solid #ececec;
+ padding-bottom: 20rpx;
+}
+
+.item-head .status {
+ color: #4facfe;
+}
+
+.list-item .line {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ line-height: 2;
+}
+
+.line-tit {
+ color: #999;
+}
+
+.top_box_head {
+ padding: 30rpx;
+}
+
+.tx-btn {
+ color: #4facfe;
+}
+
+.goodsInfo {
+ padding: 0 !important;
+}
+
+.goodsInfo .identity {
+ left: 0 !important;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/index.js b/eaterplanet_ecommerce/moduleA/pin/index.js
new file mode 100644
index 0000000..0f22f2b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/index.js
@@ -0,0 +1,338 @@
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+var app = getApp();
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ classification: {
+ tabs: [],
+ activeIndex: 0
+ },
+ slider_list: [],
+ pintuan_show_type: 0,
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: [],
+ isIpx: app.globalData.isIpx
+ },
+ pageNum: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ app.setShareConfig();
+ status.setNavBgColor();
+ this.initFn();
+ },
+
+ initFn: function(){
+ wx.showLoading();
+ this.getTabs();
+ this.getData();
+ },
+
+ authSuccess: function () {
+ let that = this;
+ this.pageNum = 1;
+ this.setData({
+ classification: {
+ tabs: [],
+ activeIndex: 0
+ },
+ slider_list: [],
+ pintuan_show_type: 0,
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: []
+ }, () => {
+ that.initFn();
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * 获取分类
+ */
+ getTabs: function () {
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'group.pintuan_slides'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if(res.data.code==0) {
+ let {
+ category_list,
+ pintuan_show_type,
+ slider_list,
+ pintuan_index_share_title,
+ pintuan_index_share_img
+ } = res.data;
+
+ let params = {
+ classification: {}
+ };
+ params.slider_list = slider_list || [];
+ params.pintuan_show_type = pintuan_show_type;
+ params.pintuan_index_share_title = pintuan_index_share_title || '';
+ params.pintuan_index_share_img = pintuan_index_share_img || '';
+ category_list = category_list || [];
+ let index_type_first_name = '推荐';
+
+ if (category_list.length > 0) {
+ category_list.unshift({
+ name: index_type_first_name,
+ id: 0
+ })
+ params.isShowClassification = true;
+ params.classification.tabs = category_list;
+ } else {
+ params.isShowClassification = false;
+ }
+ that.setData(params)
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ (0, status.cartNum)('', true).then((res) => {
+ res.code == 0 && that.setData({
+ cartNum: res.data
+ })
+ });
+ },
+
+ /**
+ * 监控分类导航
+ */
+ classificationChange: function (t) {
+ console.log(t.detail.e)
+ wx.showLoading();
+ var that = this;
+ this.pageNum = 1;
+ this.setData({
+ rushList: [],
+ showEmpty: false,
+ "classification.activeIndex": t.detail.e,
+ classificationId: t.detail.a
+ }, function () {
+ that.getData();
+ });
+ },
+
+ /**
+ * 获取商品列表
+ */
+ getData: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let gid = that.data.classificationId;
+ let community = wx.getStorageSync('community');
+ let head_id = community.communityId || 0;
+
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'group.get_pintuan_list',
+ pageNum: this.pageNum,
+ gid,
+ token,
+ head_id,
+ is_index: 1
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ wx.stopPullDownRefresh();
+ if (res.data.code == 0) {
+ let oldRushList = that.data.rushList;
+ if (that.pageNum == 1) oldRushList = [];
+
+ let h = {}, list = res.data.list;
+ if (that.pageNum == 1 && list.length == 0) h.showEmpty = true;
+ let rushList = oldRushList.concat(list);
+ let rdata = res.data;
+ let reduction = { full_money: rdata.full_money, full_reducemoney: rdata.full_reducemoney, is_open_fullreduction: rdata.is_open_fullreduction }
+ let pintuan_model_buy = rdata.pintuan_model_buy || 0;
+ h.rushList = rushList;
+ h.reduction = reduction;
+ h.loadOver = true;
+ let loadMore = that.data.loadMore;
+ if(res.data.list.length<20) { loadMore = false }
+ h.loadMore = loadMore;
+ h.loadText = loadMore ? "加载中..." : "没有更多商品了~";
+ h.pintuan_model_buy = pintuan_model_buy;
+ h.pintuan_show_type = rdata.pintuan_show_type;
+ if (pintuan_model_buy == 1) h.needPosition=true,(!head_id&&that.needCommunity());
+ that.setData(h, function () {
+ that.pageNum += 1;
+ })
+ } else if (res.data.code == 1) {
+ let s = { loadMore: false }
+ if (that.pageNum == 1) s.showEmpty = true;
+ that.setData(s);
+ } else if (res.data.code == 2) {
+ //no login
+ that.setData({ needAuth: true })
+ }
+ }
+ })
+ },
+
+ /**
+ * 需要社区
+ * 判断是否已绑定
+ */
+ needCommunity: function(){
+ let token = wx.getStorageSync('token');
+ let that = this;
+ console.log('需要社区')
+ if (token) {
+ util.getCommunityInfo().then(res=>{
+ if(res) {
+ that.pageNum = 1;
+ that.setData({
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: []
+ }, () => {
+ that.getData();
+ })
+ }
+ })
+ }
+ },
+
+ /**
+ * 幻灯片跳转
+ */
+ goBannerUrl: function (t) {
+ let idx = t.currentTarget.dataset.idx;
+ let { slider_list, needAuth } = this.data;
+ if (slider_list.length > 0) {
+ let url = slider_list[idx].link;
+ let type = slider_list[idx].linktype;
+ if (util.checkRedirectTo(url, needAuth)) {
+ this.authModal();
+ return;
+ }
+ if (type == 0) {
+ // 跳转webview
+ url && wx.navigateTo({ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url) })
+ } else if (type == 1) {
+ if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
+ url && wx.switchTab({ url: url })
+ } else {
+ url && wx.navigateTo({ url: url })
+ }
+
+ } else if (type == 2) {
+ // 跳转小程序
+ let appid = slider_list[idx].appid;
+ appid && wx.navigateToMiniProgram({
+ appId: slider_list[idx].appid,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ // 打开成功
+ },
+ fail(error) {
+ console.log(error)
+ }
+ })
+ }
+ }
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ let that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: []
+ }, () => {
+ that.getData();
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ console.log('这是我的底线');
+ this.data.loadMore && (this.setData({ loadOver: false }), this.getData());
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var member_id = wx.getStorageSync('member_id');
+ let { pintuan_index_share_title, pintuan_index_share_img } = this.data;
+ return {
+ title: pintuan_index_share_title,
+ path: "eaterplanet_ecommerce/moduleA/pin/index?share_id=" + member_id,
+ imageUrl: pintuan_index_share_img,
+ success: function () { },
+ fail: function () { }
+ };
+ },
+
+ onShareTimeline: function() {
+ var member_id = wx.getStorageSync('member_id');
+ let { pintuan_index_share_title, pintuan_index_share_img } = this.data;
+ var query= `share_id=${member_id}`;
+ return {
+ title: pintuan_index_share_title,
+ imageUrl: pintuan_index_share_img,
+ query,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/pin/index.json b/eaterplanet_ecommerce/moduleA/pin/index.json
new file mode 100644
index 0000000..f7c764b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/index.json
@@ -0,0 +1,14 @@
+{
+ "navigationBarTitleText": "拼团",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-tabs": "../../components/tabs/index",
+ "i-img": "../../components/img/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-spu-big": "../components/rushBig",
+ "i-spu-col": "../components/pinGoods",
+ "i-tabbar": "../../components/tabbar/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/index.wxml b/eaterplanet_ecommerce/moduleA/pin/index.wxml
new file mode 100644
index 0000000..150a406
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/index.wxml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂时没有拼团
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/pin/index.wxss b/eaterplanet_ecommerce/moduleA/pin/index.wxss
new file mode 100644
index 0000000..cf2648f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/index.wxss
@@ -0,0 +1,94 @@
+.wrap {
+ padding-bottom: 100rpx;
+}
+
+.wrap.pb20 {
+ padding-bottom: 140rpx;
+}
+
+.sticky-content {
+ position: fixed;
+ left: 0;
+ right: 0;
+ top: 0;
+ z-index: 100;
+}
+
+.sticky-content .category-list {
+ background-color: #fff;
+}
+
+.blank35 {
+ height: 70rpx;
+}
+
+.swipe {
+ margin-top: 20rpx;
+ height: 320rpx;
+ margin-bottom: 20rpx;
+}
+
+.swiper-content {
+ width: 750rpx;
+ height: 320rpx;
+ border-radius: 12rpx;
+}
+
+.swiper-content swiper-item {
+ border-radius: 12rpx;
+ margin-right: 20rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.swiper-content swiper-item:last-child {
+ margin: 0;
+}
+
+.swiper-content .banner {
+ width: 710rpx;
+ height: 320rpx;
+ margin: 0 20rpx;
+ display: block;
+ border-radius: 12rpx;
+ position: relative;
+ overflow: hidden;
+}
+
+.swiper-content .banner .banner-img {
+ width: 710rpx;
+ height: 320rpx;
+ border-radius: 12rpx;
+ display: block;
+ overflow: hidden;
+}
+
+.none-rush-list {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding-bottom: 140rpx;
+ padding-top: 140rpx;
+}
+
+.none-rush-list .img-block {
+ width: 240rpx;
+ height: 240rpx;
+ margin-bottom: 30rpx;
+}
+
+.none-rush-list .h1 {
+ font-size: 32rpx;
+ line-height: 32rpx;
+ color: #444;
+ margin-bottom: 20rpx;
+}
+
+.twoCol {
+ padding: 0 20rpx;
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/me.js b/eaterplanet_ecommerce/moduleA/pin/me.js
new file mode 100644
index 0000000..f127b4b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/me.js
@@ -0,0 +1,298 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+//state 0:拼团中 1:成功 2:失败
+//order_status_id 1:已付款 2:拼团中,已付款 3:待付款 5:交易已取消 7:退款
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ tabs: [
+ { id: 0, name: '全部' },
+ { id: 1, name: '拼团中' },
+ { id: 2, name: '拼团成功' },
+ { id: 3, name: '拼团失败' }
+ ],
+ order_status: 0,
+ showEmpty: false,
+ list: [],
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false
+ },
+ pageNum: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ status.setNavBgColor();
+ this.getData();
+ },
+
+ /**
+ * 切换导航
+ */
+ changeTabs: function (e) {
+ let that = this;
+ let order_status = e.currentTarget.dataset.type || 0;
+ this.pageNum = 1;
+ this.setData({ order_status, list: [], showEmpty: false, loadMore: true, loadOver: false }, ()=>{
+ that.getData();
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ this.setData({ needAuth: false });
+ } else {
+ this.setData({ needAuth: true });
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let that = this;
+ this.pageNum = 1;
+ this.setData({
+ needAuth: false,
+ showEmpty: false,
+ list: [],
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false
+ }, () => {
+ that.getData();
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({
+ showAuthModal: !this.data.showAuthModal
+ });
+ return false;
+ }
+ return true;
+ },
+
+ getData: function () {
+ wx.showLoading();
+ let that = this;
+ var token = wx.getStorageSync('token');
+ let order_id = this.orderId;
+ let pageNum = this.pageNum;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'user.group_orders',
+ token,
+ page: pageNum,
+ type: this.data.order_status
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ wx.stopPullDownRefresh();
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ let h = {};
+ if (pageNum == 1 && list.length == 0) h.showEmpty = true;
+
+ let oldList = that.data.list;
+ list = list.concat(oldList);
+ h.list = list;
+ h.loadOver = true;
+ h.loadText = that.data.loadMore ? "加载中..." : "没有更多商品了~";
+ that.setData(h, function () {
+ that.pageNum += 1;
+ })
+ } else {
+ let s = { loadMore: false }
+ if (pageNum == 1) s.showEmpty = true;
+ that.setData( s )
+ }
+ }
+ })
+ },
+
+ goLink: function (e) {
+ var pages_all = getCurrentPages();
+ var url = e.currentTarget.dataset.link;
+ let type = e.currentTarget.dataset.type || '';
+ if (type == 'ignore'){
+ let id = e.currentTarget.dataset.id;
+ if (type == 'ignore') url = `/eaterplanet_ecommerce/moduleA/pin/share?id=${id}`;
+ }
+ if (pages_all.length > 3) {
+ wx.redirectTo({ url })
+ } else {
+ wx.navigateTo({ url })
+ }
+ },
+
+ /**
+ * 取消订单
+ */
+ cancelOrder: function (event) {
+ let id = event.currentTarget.dataset.type;
+ var token = wx.getStorageSync('token');
+ var that = this;
+ wx.showModal({
+ title: '取消支付',
+ content: '好不容易挑出来,确定要取消吗?',
+ confirmColor: '#F75451',
+ success(res) {
+ if (res.confirm) {
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'order.cancel_order',
+ token: token,
+ order_id: id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.showToast({
+ title: '取消成功',
+ icon: 'success',
+ duration: 1000
+ })
+ that.order();
+ }
+ })
+ }
+ }
+ })
+ },
+
+ order: function (status) {
+ var that = this;
+ var token = wx.getStorageSync('token');
+ this.pageNum = 1;
+ this.setData({
+ showEmpty: false,
+ list: [],
+ loadMore: true,
+ loadText: "加载中..."
+ }, () => {
+ that.getData();
+ })
+ },
+
+ /**
+ * 付款
+ */
+ orderPay: function (event) {
+ var that = this;
+ var token = wx.getStorageSync('token');
+ let id = event.currentTarget.dataset.type;
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'car.wxpay',
+ token: token,
+ order_id: id,
+ scene: app.globalData.scene
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ // 交易组件
+ if(res.data.isRequestOrderPayment==1) {
+ wx.requestOrderPayment({
+ orderInfo: res.data.order_info,
+ timeStamp: res.data.timeStamp,
+ nonceStr: res.data.nonceStr,
+ package: res.data.package,
+ signType: res.data.signType,
+ paySign: res.data.paySign,
+ success: function (wxres) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/moduleA/pin/share?id=' + id
+ })
+ },
+ fail: function (res) {
+ console.log(res);
+ }
+ })
+ } else {
+ wx.requestPayment({
+ appId: res.data.appId,
+ timeStamp: res.data.timeStamp,
+ nonceStr: res.data.nonceStr,
+ package: res.data.package,
+ signType: res.data.signType,
+ paySign: res.data.paySign,
+ success: function (wxres) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/moduleA/pin/share?id=' + id
+ })
+ },
+ fail: function (res) {
+ console.log(res);
+ }
+ })
+ }
+ } else if (res.data.code == 2) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none'
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ let that = this;
+ this.pageNum = 1;
+ this.setData({
+ showEmpty: false,
+ list: [],
+ loadMore: true,
+ loadText: "加载中..."
+ }, () => {
+ that.getData();
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ console.log('这是我的底线');
+ this.data.loadMore && (this.setData({ loadOver: false }), this.getData());
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/pin/me.json b/eaterplanet_ecommerce/moduleA/pin/me.json
new file mode 100644
index 0000000..ddda143
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/me.json
@@ -0,0 +1,13 @@
+{
+ "navigationBarTitleText": "我的拼团",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-card": "../../components/card/index",
+ "i-img": "../../components/img/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-goods-info": "../components/pinGoodsInfo"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/me.wxml b/eaterplanet_ecommerce/moduleA/pin/me.wxml
new file mode 100644
index 0000000..d031e6b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/me.wxml
@@ -0,0 +1,56 @@
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 你还没有参加任何团购,快与小伙伴拼团吧!
+
+ 去开团
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/pin/me.wxss b/eaterplanet_ecommerce/moduleA/pin/me.wxss
new file mode 100644
index 0000000..bc4836b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/me.wxss
@@ -0,0 +1,139 @@
+.nav-bar {
+ width: 100%;
+ position: fixed;
+ left: 0;
+ top: 0;
+ z-index: 10;
+}
+
+.nav-bar .nav-bar-inner {
+ display: flex;
+ justify-content: space-between;
+ padding: 0 40rpx;
+ background-color: white;
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255,255,255,0.25);
+}
+
+.nav-bar .nav-bar-item {
+ position: relative;
+ word-break: keep-all;
+ font-size: 28rpx;
+ font-weight: 500;
+ color: #666;
+ padding: 20rpx 0;
+}
+
+.nav-bar .current.nav-bar-item::after {
+ content: "";
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 3px;
+ background: linear-gradient(90deg,#ff4936 0%,#ff6e3c 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255,89,0,0.25);
+ border-radius: 24rpx;
+}
+
+.nav-bar-content {
+ margin-top:49px;
+ padding-bottom: 30rpx;
+}
+
+.empty-wrap {
+ padding-top: 100rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.empty-wrap .empty-img {
+ width: 218rpx;
+ height: 218rpx;
+}
+
+.empty-wrap .empty-txt {
+ font-size: 30rpx;
+ font-weight: 400;
+ color: #777;
+ margin-top: 32rpx;
+}
+
+.list {
+ padding-top: 100rpx;
+ padding-bottom: 50rpx;
+}
+
+.list .item {
+ margin: 0 auto 20rpx;
+}
+
+.list .suppy {
+ line-height: 40rpx;
+}
+
+.list .suppy .logo {
+ width: 40rpx;
+ height: 40rpx;
+ border-radius: 2rpx;
+ overflow: hidden;
+ vertical-align: middle;
+ margin-right: 5rpx;
+}
+
+.list .suppy .name {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.list .header {
+ padding: 20rpx 30rpx;
+ color: #444;
+ font-size: 24rpx;
+ border-bottom: 0.1rpx solid #efefef;
+}
+
+.list .content-wrap {
+ padding-bottom: 20rpx;
+}
+
+.list .footer {
+ padding: 20rpx 30rpx;
+ color: #444;
+ font-size: 24rpx;
+ border-top: 0.1rpx solid #efefef;
+}
+
+.footer .btn {
+ min-width: 136rpx;
+ box-sizing: border-box;
+ text-align: center;
+ padding: 10rpx 20rpx;
+ margin-left: 20rpx;
+ border-radius: 10rpx;
+ font-size: 24rpx;
+}
+
+.footer .btn.hollow {
+ border: 1rpx solid #999;
+ padding: 10rpx 20rpx;
+}
+
+.footer .btn.solid {
+ color: #fff;
+ background-color: #ff5344;
+}
+
+.redBtn {
+ width: 320rpx;
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ color: #fff;
+ margin: 0 30rpx 10rpx;
+ height: 84rpx;
+ line-height: 84rpx;
+ font-size: 32rpx;
+ border-radius: 10rpx;
+ text-align: center;
+ margin-top: 30rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/rule.js b/eaterplanet_ecommerce/moduleA/pin/rule.js
new file mode 100644
index 0000000..ff10a8c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/rule.js
@@ -0,0 +1,49 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ wx.showLoading();
+ this.get_article();
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 获取列表
+ */
+ get_article: function () {
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'group.pintuan_slides'
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let { pintuan_publish } = res.data;
+ that.setData({ pintuan_publish })
+ }
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/rule.json b/eaterplanet_ecommerce/moduleA/pin/rule.json
new file mode 100644
index 0000000..2734119
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/rule.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "拼团规则",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/rule.wxml b/eaterplanet_ecommerce/moduleA/pin/rule.wxml
new file mode 100644
index 0000000..5ee1bc5
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/rule.wxml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/rule.wxss b/eaterplanet_ecommerce/moduleA/pin/rule.wxss
new file mode 100644
index 0000000..438e737
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/rule.wxss
@@ -0,0 +1,13 @@
+.article {
+ background: #fff;
+ padding: 20rpx 30rpx;
+ font-size: 28rpx;
+}
+
+.wxParse-img {
+ width: 100%;
+}
+
+.wxParse-inline {
+ padding: 5rpx 0;
+}
diff --git a/eaterplanet_ecommerce/moduleA/pin/share.js b/eaterplanet_ecommerce/moduleA/pin/share.js
new file mode 100644
index 0000000..97a04c8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/share.js
@@ -0,0 +1,772 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ seconds: 0,
+ surplus: 0,
+ likeList: [],
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ }
+ },
+ orderId: '',
+ canPreSub: true,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ app.setShareConfig();
+ let that = this;
+ let { id, share_id } = options;
+ if (share_id != 'undefined' && options.share_id > 0) wx.setStorageSync('share_id', share_id);
+ status.setGroupInfo().then((groupInfo) => { that.setData({ groupInfo }) });
+ console.log(id)
+ var scene = decodeURIComponent(options.scene);
+ if (scene != 'undefined' && scene != '') id = scene;
+ if (id === void 0) {
+ wx.showModal({
+ title: '提示',
+ content: '参数错误',
+ showCancel: false,
+ confirmColor: '#F75451',
+ success(res) {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ }
+ }
+ })
+ return false;
+ }
+ this.orderId = id;
+ this.getData();
+ this.getLikeList();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ this.setData({ needAuth: false });
+ } else {
+ this.setData({ needAuth: true });
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let that = this;
+ this.setData({
+ needAuth: false,
+ }, () => {
+ that.getData();
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({
+ showAuthModal: !this.data.showAuthModal
+ });
+ return false;
+ }
+ return true;
+ },
+
+ getData: function () {
+ wx.showLoading();
+ let that = this;
+ var token = wx.getStorageSync('token');
+ let order_id = this.orderId;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'groupdo.group_info',
+ token,
+ order_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let {
+ order_goods,
+ goods_info,
+ options,
+ pin_info,
+ share_title,
+ pin_order_arr,
+ me_take_in,
+ is_me,
+ interface_get_time,
+ order_id,
+ order_type,
+ pintuan_model_buy,
+ community_id,
+ hide_community_change_btn,
+ pintuan_show_community_info,
+ is_need_subscript,
+ need_subscript_template
+ } = res.data.data;
+ goods_info.goods_id = order_goods.goods_id;
+ let order = {
+ goods_id: order_goods.goods_id,
+ pin_id: pin_info.pin_id,
+ }
+ var timestamp = Date.parse(new Date());
+ let seconds = (pin_info.end_time - interface_get_time) * 1000 + timestamp;
+ let surplus = goods_info.pin_count - pin_order_arr.length;
+
+ util.getCommunityById(community_id).then(ret => {
+ that.setData({ changeCommunity: ret.data })
+ })
+
+ //开启社区关联
+ if (pintuan_model_buy==1) {
+ pin_info.state == 0 && that.needCommunity(community_id, hide_community_change_btn, goods_info);
+ }
+
+ that.setData({
+ seconds: seconds > 0 ? seconds: 0,
+ order,
+ order_goods,
+ goods_info,
+ options,
+ pin_info,
+ share_title,
+ pin_order_arr,
+ me_take_in,
+ is_me,
+ interface_get_time,
+ order_id,
+ surplus,
+ order_type,
+ hide_community_change_btn: hide_community_change_btn || 0,
+ goodsComunityId: community_id,
+ pintuan_model_buy,
+ pintuan_show_community_info,
+ is_need_subscript,
+ need_subscript_template
+ })
+ } else {
+ app.util.message('无数据', '/eaterplanet_ecommerce/moduleA/pin/index', 'error');
+ }
+ }
+ })
+ },
+
+ /**
+ * 需要社区
+ * 判断是否已绑定
+ */
+ needCommunity: function (shareCommunityId, hideCommunityChangeBtn, goods_info={}) {
+ let that = this;
+ console.log('需要社区')
+ let token = wx.getStorageSync('token');
+ let is_all_sale = goods_info.is_all_sale || 0;
+ //当前社区
+ let currentCommunity = wx.getStorageSync('community');
+ let currentCommunityId = (currentCommunity && currentCommunity.communityId) || '';
+ console.log('shareCommunityId', shareCommunityId);
+
+ // 单社区
+ util.getCommunityById(shareCommunityId).then(res => {
+ if (res.open_danhead_model == 1) {
+ console.log(res)
+ let default_head_info = res.default_head_info;
+ app.globalData.community = default_head_info;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: default_head_info })
+ that.setData({ community: default_head_info })
+ token && that.addhistory(default_head_info);
+ } else {
+ // 社区是否存在
+ if (currentCommunityId != '' && shareCommunityId) {
+ // 存在并且不相同
+ console.log('currentCommunityId存在 比较社区')
+ if (currentCommunityId != shareCommunityId) {
+ console.log('currentCommunityId存在 社区不同')
+ //如果禁止切换
+ let { groupInfo } = that.data;
+ console.log(hideCommunityChangeBtn)
+ if (hideCommunityChangeBtn == 1 && is_all_sale!=1) {
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, '/eaterplanet_ecommerce/moduleA/pin/index', 'error', '知道了');
+ return;
+ }
+ that.setData({
+ showChangeCommunity: true,
+ changeCommunity: res.data,
+ community: currentCommunity
+ })
+ }
+ } else {
+ // 不存在社区id
+ //token 是否存在
+ if (token) {
+ util.getCommunityInfo().then(function (ret) {
+ //比较社区
+ console.log('token存在 比较社区')
+ if (ret.community_id && ret.community_id != shareCommunityId) {
+ that.setData({
+ showChangeCommunity: true,
+ community: currentCommunity
+ })
+ }
+ }).catch((param) => {
+ console.log('step4 新人')
+ if (Object.keys(param) != '') that.addhistory(param, true);
+ });
+ } else {
+ console.log('token不存在 存社区')
+ // 直接存本地
+ app.globalData.community = res;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: res })
+ that.setData({ community: res })
+ }
+ }
+ }
+ })
+ },
+
+ /**
+ * 切换提示
+ */
+ confrimChangeCommunity: function () {
+ let community = this.data.changeCommunity;
+ let token = wx.getStorageSync('token');
+ app.globalData.community = community;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({
+ key: "community",
+ data: community
+ })
+ token && this.addhistory(community);
+
+ this.setData({ community, showChangeCommunity: false })
+ console.log('用户点击确定')
+ },
+
+ /**
+ * 取消切换
+ */
+ cancelChangeCommunity: function(){
+ let { community, goods_info, groupInfo } = this.data;
+ (goods_info.is_all_sale == 1) || wx.showModal({
+ title: '提示',
+ content: `此拼团在您所属${groupInfo.group_name}不可参与`,
+ showCancel: false,
+ confirmColor: '#ff5041',
+ success(res) {
+ if (res.confirm) {
+ let community_id = (community && community.communityId) || '';
+ let goods_id = goods_info.goods_id;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'goods.check_goods_community_canbuy',
+ community_id,
+ goods_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ wx.redirectTo({
+ url: `/eaterplanet_ecommerce/moduleA/pin/goodsDetail?id=${goods_id}`
+ })
+ } else {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/moduleA/pin/index'
+ })
+ }
+ }
+ })
+ }
+ }
+ });
+ },
+
+ /**
+ * 历史社区
+ */
+ addhistory: function (community, isNew = false) {
+ var community_id = community.communityId;
+ console.log('addhistory');
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.addhistory_community',
+ community_id,
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (isNew) {
+ console.log('新人 社区')
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.get_community_info',
+ community_id: community_id
+ },
+ dataType: 'json',
+ success: function (result) {
+ if (result.data.code == 0) {
+ let community = result.data.data;
+ app.globalData.community = community;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: community })
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+ getLikeList: function(){
+ let that = this;
+ var token = wx.getStorageSync('token');
+ let order_id = this.orderId;
+ let community = wx.getStorageSync('community');
+ let community_id = (community && community.communityId) || '';
+
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'group.pintuan_like_list',
+ order_id,
+ community_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let { is_show_order_guess_like, list } = res.data;
+ that.setData({ is_show_order_guess_like, likeList: list || [] })
+ } else {
+ console.log('猜你喜欢无数据')
+ }
+ }
+ })
+ },
+
+ goLink: function (e) {
+ var pages_all = getCurrentPages();
+ var url = e.currentTarget.dataset.link;
+ if (pages_all.length > 6) {
+ url && wx.redirectTo({ url })
+ } else {
+ url && wx.navigateTo({ url })
+ }
+ },
+
+ /**
+ * 开团订阅
+ */
+ preSub: function(e){
+ let that = this;
+ if(!this.canPreSub) return;
+ this.canPreSub = false;
+ let is_need_subscript = this.data.is_need_subscript;
+ if(is_need_subscript==1) {
+ //弹出订阅消息
+ this.subscriptionNotice().then(()=>{
+ that.preOpenSku();
+ }).catch(()=>{
+ that.preOpenSku();
+ });
+ } else {
+ that.preOpenSku();
+ }
+ },
+
+ /**
+ * 订阅消息
+ */
+ subscriptionNotice: function() {
+ console.log('subscriptionNotice')
+ let that = this;
+ return new Promise((resolve, reject)=>{
+ let obj = that.data.need_subscript_template;
+ let tmplIds = Object.keys(obj).map(key => obj[key]); // 订阅消息模版id
+ if (wx.requestSubscribeMessage) {
+ tmplIds.length && wx.requestSubscribeMessage({
+ tmplIds: tmplIds,
+ success(res) {
+ let is_need_subscript = 1;
+ let acceptId = [];
+ tmplIds.forEach(item=>{
+ if (res[item] == 'accept') {
+ //用户同意了订阅,添加进数据库
+ acceptId.push(item);
+ } else {
+ //用户拒绝了订阅或当前游戏被禁用订阅消息
+ is_need_subscript = 0;
+ }
+ })
+
+ if(acceptId.length) {
+ that.addAccept(acceptId);
+ }
+ that.setData({ is_need_subscript })
+ resolve();
+ },
+ fail() {
+ reject();
+ }
+ })
+ } else {
+ // 兼容处理
+ reject();
+ }
+ })
+ },
+
+ // 用户点击订阅添加到数据库
+ addAccept: function (acceptId) {
+ let token = wx.getStorageSync('token');
+ let type = acceptId.join(',');
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.collect_subscriptmsg',
+ token,
+ type
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function () {}
+ })
+ },
+
+ preOpenSku: function(){
+ this.canPreSub = true;
+ var that = this;
+ var { order, options, goods_info } = that.data;
+
+ order.buy_type = 'pintuan';
+ order.quantity = 1;
+ that.setData({ order: order })
+
+ var is_just_addcar = 0;
+ let list = options.list || [];
+ let arr = [];
+ if (list.length > 0) {
+ for (let i = 0; i < list.length; i++) {
+ let sku = list[i]['option_value'][0];
+ let temp = {
+ name: sku['name'],
+ id: sku['option_value_id'],
+ index: i,
+ idx: 0
+ };
+ arr.push(temp);
+ }
+ //把单价剔除出来begin
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ let cur_sku_arr = options.sku_mu_list[id];
+ that.setData({
+ sku: arr,
+ sku_val: 1,
+ cur_sku_arr: cur_sku_arr,
+ skuList: options,
+ visible: true,
+ showSku: true,
+ is_just_addcar
+ });
+ } else {
+ let actPrice = goods_info.danprice || '0.00';
+ let pinprice = goods_info.pinprice || '0.00';
+ let cur_sku_arr = {
+ skuImage: goods_info.goods_images,
+ spuName: goods_info.name,
+ actPrice: actPrice.split('.'),
+ pinprice: pinprice.split('.')
+ };
+ that.setData({
+ visible: true,
+ showSku: true,
+ is_just_addcar,
+ sku: [],
+ sku_val: 1,
+ cur_sku_arr,
+ skuList: []
+ }, () => {
+ // that.goOrder();
+ })
+ }
+ },
+
+ openSku: function () {
+ if (!this.authModal()) return;
+ var that = this;
+ var { goodsComunityId, groupInfo, goods_info } = that.data;
+
+ if (this.data.pintuan_model_buy==1) {
+ //判断社区是否相同
+ let currentCommunity = wx.getStorageSync('community');
+ let currentCommunity_id = (currentCommunity && currentCommunity.communityId) || '';
+ if ((goodsComunityId != '' && currentCommunity_id != '' && goodsComunityId == currentCommunity_id) || goods_info.is_all_sale==1) {
+ this.preSub();
+ } else {
+ app.util.message(`此拼团在您所属${groupInfo.group_name}不可参与`, '','error');
+ }
+ } else {
+ this.preSub();
+ }
+ },
+
+ goOrder: function () {
+ var that = this;
+ if (that.data.can_car) { that.data.can_car = false; }
+ let { order, cur_sku_arr, sku_val } = this.data;
+ var goods_id = order.goods_id;
+ var quantity = sku_val;
+ var sku_str = '';
+ var is_just_addcar = 0;
+ let buy_type = order.buy_type;
+ let pin_id = order.pin_id;
+
+ let community = wx.getStorageSync('community');
+ let community_id = community.communityId || 0;
+
+ if (cur_sku_arr && cur_sku_arr.option_item_ids) {
+ sku_str = cur_sku_arr.option_item_ids;
+ }
+
+ let data = {
+ goods_id,
+ community_id,
+ quantity,
+ sku_str,
+ buy_type,
+ pin_id,
+ is_just_addcar
+ }
+
+ util.addCart(data).then(res=>{
+ if(res.showVipModal==1) {
+ let { pop_vipmember_buyimage } = res.data;
+ wx.hideLoading();
+ that.setData({ pop_vipmember_buyimage, showVipModal: true, visible: false })
+ } else if (res.data.code == 3 || res.data.code == 7) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 4) {
+ wx.hideLoading();
+ that.setData({ needAuth: true, showAuthModal: true, visible: false })
+ } else if (res.data.code == 6) {
+ var msg = res.data.msg;
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({ sku_val: max_quantity })
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ var pages_all = getCurrentPages();
+ let url = `/eaterplanet_ecommerce/pages/order/placeOrder?type=${buy_type}`;
+ (pages_all.length > 3) ? wx.redirectTo({ url }) : wx.navigateTo({ url });
+ }
+ }).catch(res=>{
+ app.util.message(res||'请求失败', '', 'error');
+ })
+ },
+
+ selectSku: function (event) {
+ var that = this;
+ let str = event.currentTarget.dataset.type;
+ let obj = str.split("_");
+ let arr = that.data.sku;
+ let temp = {
+ name: obj[3],
+ id: obj[2],
+ index: obj[0],
+ idx: obj[1]
+ };
+ arr.splice(obj[0], 1, temp);
+ that.setData({
+ sku: arr
+ })
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ var options = this.data.skuList;
+ var cur_sku_arr = options.sku_mu_list[id];
+
+ that.setData({
+ cur_sku_arr: cur_sku_arr
+ });
+ console.log(id);
+ },
+
+ /**
+ * 数量加减
+ */
+ setNum: function (event) {
+ let types = event.currentTarget.dataset.type;
+ var that = this;
+ var num = 1;
+ let sku_val = this.data.sku_val * 1;
+ if (types == 'add') {
+ num = sku_val + 1;
+ } else if (types == 'decrease') {
+ if (sku_val > 1) {
+ num = sku_val - 1;
+ }
+ }
+
+ let arr = that.data.sku;
+ var options = this.data.skuList;
+ if (arr.length > 0) {
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ }
+ if (options.length > 0) {
+ var cur_sku_arr = options.sku_mu_list[id];
+ if (num > cur_sku_arr['canBuyNum']) {
+ num = num - 1;
+ }
+ } else {
+ let cur_sku_arr = this.data.cur_sku_arr;
+ if (num > cur_sku_arr['canBuyNum']) {
+ num = num - 1;
+ }
+ }
+ this.setData({
+ sku_val: num
+ })
+ },
+
+ /**
+ * 确认购物车
+ */
+ gocarfrom: function (e) {
+ var that = this;
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'user.get_member_form_id',
+ 'token': token,
+ "from_id": e.detail.formId
+ },
+ dataType: 'json',
+ success: function (res) { }
+ })
+ that.goOrder();
+ },
+
+ /**
+ * 关闭购物车
+ */
+ closeSku: function () {
+ this.setData({
+ visible: 0,
+ stopClick: false,
+ });
+ },
+
+ showAllBtn: function() {
+ this.setData({
+ showAllUser: !this.data.showAllUser
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var that = this;
+ var share_id = wx.getStorageSync('member_id') || '';
+ var share_path = 'eaterplanet_ecommerce/moduleA/pin/share?id=' + that.data.order_id + '&share_id=' + share_id;
+ let { surplus, order_goods } = this.data;
+ let title = '';
+ if (surplus > 0) {
+ title = `还差${surplus}人!我${order_goods.price}元团了${order_goods.name}`;
+ } else {
+ title = `我${order_goods.price}元团了${order_goods.name}`;
+ }
+ return {
+ title,
+ path: share_path,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function() {
+ var share_id = wx.getStorageSync('member_id') || '';
+ let { surplus, order_goods, order_id } = this.data;
+ let title = '';
+ if (surplus > 0) {
+ title = `还差${surplus}人!我${order_goods.price}元团了${order_goods.name}`;
+ } else {
+ title = `我${order_goods.price}元团了${order_goods.name}`;
+ }
+
+ var query= `id=${order_id}&share_id=${share_id}`;
+ return {
+ title: title,
+ query,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/pin/share.json b/eaterplanet_ecommerce/moduleA/pin/share.json
new file mode 100644
index 0000000..0802a9c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/share.json
@@ -0,0 +1,14 @@
+{
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-img": "../../components/img/index",
+ "i-count-down": "../../components/count-down/index",
+ "i-goods-info": "../components/pinGoodsInfo",
+ "i-aside-btn": "../../components/asideBtn/index",
+ "i-spu": "../components/rushNormal",
+ "i-change-community": "../../components/changeCommunity/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/pin/share.wxml b/eaterplanet_ecommerce/moduleA/pin/share.wxml
new file mode 100644
index 0000000..cd9dc61
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/share.wxml
@@ -0,0 +1,229 @@
+
+
+
+
+ 拼团成功
+
+
+ 已成功下单,可在会员中心
+ 查看订单
+
+
+ 团长人气太高,已拼团成功啦
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{changeCommunity.communityName}}
+ 取货地址:{{changeCommunity.fullAddress}}
+
+
+
+
+
+
+
+
+
+ 仅剩
+ {{surplus}}个名额,团满即可拼团成功
+
+
+ 仅剩
+
+
+
+
+ 该团未能按时凑齐人数,拼团失败
+ 退款金额将原路返回
+
+
+
+
+
+ 团长
+
+
+
+
+
+
+
+
+
+
+ 收起
+ 查看全部
+
+
+
+ 我要参团
+
+
+
+
+ 查看更多拼团商品
+
+
+ 查看订单详情
+
+
+
+ 查看更多拼团商品
+
+
+ 查看更多拼团商品
+
+
+
+
+
+
+
+
+ 拼团玩法
+ 查看规则
+
+
+
+ 1
+ 支付开团
+ 参团
+
+
+ 2
+ 邀请用户
+ 参团
+
+
+ 3
+ 拼团成功中
+ 奖人员发货
+
+
+ 4
+ 未中奖人员退
+ 款发放奖励
+
+
+
+
+
+
+
+
+ 拼团玩法
+ 查看规则
+
+
+
+ 1
+ 支付开团
+ 参团
+
+
+ 2
+ 邀请用户
+ 参团
+
+
+ 3
+ 拼团成功
+ 按时送达
+
+
+ 4
+ 逾期未成
+ 团退款
+
+
+
+
+
+
+
+ ——猜你喜欢——
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+ {{value.name}}
+
+
+
+ 数量
+
+
+
+
+
+
+
+
+
+
+ 每人限{{skuList[current].limitMemberNum}}单
+ 每单限{{skuList[current].limitOrderNum}}份
+
+
+ 还可以购买 {{skuList[current].canBuyNum-value}} 件
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/pin/share.wxss b/eaterplanet_ecommerce/moduleA/pin/share.wxss
new file mode 100644
index 0000000..d82f0f9
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/pin/share.wxss
@@ -0,0 +1,274 @@
+.pinStatus {
+ padding: 30rpx;
+ text-align: center;
+}
+
+.pinStatus .title {
+ color: #6fc667;
+ font-size: 35rpx;
+ margin-bottom: 20rpx;
+}
+
+.pinStatus .title .iconfont {
+ font-size: 35rpx;
+}
+
+.pinStatus .tip {
+ font-size: 24rpx;
+ color: #bbb;
+}
+
+.pinStatus .tip text {
+ color: #93bdee;
+}
+
+.pinMember {
+ padding: 30rpx;
+ text-align: center;
+}
+
+.pinMember .title {
+ margin-bottom: 15rpx;
+}
+
+.pinMember .count-down {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.count-down-left-text {
+ margin-right: 10rpx;
+}
+
+.pinMember .item-time {
+ color: #fff;
+ background-color: #333;
+ font-size: 20rpx;
+ padding: 2rpx 4rpx;
+ border-radius: 5rpx;
+ width: 28rpx;
+}
+
+.pinMember .status .failTit {
+ font-size: 28rpx;
+}
+
+.pinMember .status .tip {
+ color: #999;
+ font-size: 24rpx;
+ margin-top: 10rpx;
+}
+
+.pinMemberList {
+ display: flex;
+ flex-wrap: wrap;
+ margin: 30rpx 0 20rpx;
+ justify-content: center;
+}
+
+.pinMemberList .item {
+ position: relative;
+ padding-left: 53rpx;
+ margin-bottom: 20rpx;
+}
+
+.pinMemberList .item:nth-child(5n+1) {
+ padding-left: 0;
+}
+
+.pinMemberList .avatar {
+ width: 85rpx;
+ height: 85rpx;
+ border-radius: 50%;
+ overflow: hidden;
+ left: 0;
+}
+
+.pinMemberList .iconfont {
+ display: inline-block;
+ color: #e4e4e4;
+ font-size: 85rpx;
+ text-align: center;
+}
+
+.pinMemberList .item .name {
+ position: absolute;
+ display: inline-block;
+ background: #fb9135;
+ color: #fff;
+ border-radius: 15rpx;
+ font-size: 20rpx;
+ padding: 5rpx 8rpx;
+ bottom: 8rpx;
+ right: -20rpx;
+ line-height: 1;
+ border: .1rpx solid #fff;
+}
+
+.btn {
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ color: #fff;
+ margin: 0 30rpx 10rpx;
+ height: 84rpx;
+ line-height: 84rpx;
+ font-size: 32rpx;
+ border-radius: 42rpx;
+}
+
+button.btn::after {
+ border: 0;
+}
+
+.goodsInfo {
+ position: relative;
+}
+
+.goodsInfo .iconfont {
+ position: absolute;
+ right: 50rpx;
+ top: 50rpx;
+ font-size: 120rpx;
+ color: #ccc;
+ z-index: 1;
+}
+
+.guessLike {
+ margin-top: 30rpx;
+ padding-bottom: 30rpx;
+}
+
+.guessLikeTitle {
+ padding: 30rpx;
+ font-size: 32rpx;
+ text-align: center;
+ font-weight: bold;
+ color: #666;
+}
+
+/* 规则 */
+.pinIntro {
+ color: #333;
+ font-size: 26rpx;
+}
+
+.pinIntro .pinIntro-top {
+ padding: 30rpx;
+ border-bottom: 0.1rpx solid #efefef;
+}
+
+.pinIntro .pinIntro-title {
+ font-weight: bold;
+ color: #000;
+}
+
+.pinIntro .iconfont {
+ font-size: 24rpx;
+ margin-top: 2rpx;
+}
+
+.pinIntro-bot {
+ padding: 30rpx;
+}
+
+.pinIntro .rule-item {
+ position: relative;
+ text-align: center;
+ z-index: 1;
+}
+
+.pinIntro .rule-item::before {
+ content: "";
+ position: absolute;
+ left: 80rpx;
+ right: -100%;
+ top: 42rpx;
+ border-bottom: 4rpx dotted #ccc;
+ z-index: -1;
+}
+
+.pinIntro .rule-item:last-child:before {
+ content: none;
+}
+
+.pinIntro .rule-item .step {
+ background-color: #ededed;
+ font-size: 36rpx;
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+ color: #666;
+ line-height: 80rpx;
+ margin: 0 auto 10rpx;
+}
+
+.pinIntro .rule-item .p {
+ font-size: 26rpx;
+ color: #333;
+ line-height: 1.2;
+}
+
+/* 团长信息 */
+.group {
+ padding: 20rpx 30rpx;
+ display: flex;
+ align-items: center;
+ margin-top: 20rpx;
+}
+
+.group-avatar image {
+ width: 94rpx;
+ height: 94rpx;
+ border-radius: 10rpx;
+}
+
+.group-m {
+ flex: 1;
+ margin: 0 15rpx;
+ width: 0;
+}
+
+.group-btn {
+ background: #ff5344;
+ color: #fff;
+ padding: 10rpx 30rpx;
+ border-radius: 60rpx;
+}
+
+.group-title {
+ font-size: 28rpx;
+ color: #333;
+ overflow: hidden;
+ text-overflow:ellipsis;
+ white-space: nowrap;
+}
+
+.group-desc {
+ font-size: 24rpx;
+ color: #999;
+ margin-top: 6rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+
+.group-r-icon {
+ width: 20rpx;
+ height: 36rpx;
+ vertical-align: middle;
+}
+
+.pin-more {
+ text-align: center;
+ padding-bottom: 20rpx;
+ font-size: 24rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #ff5344;
+}
+
+.pin-more .iconfont {
+ color: #ff5344;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/score/scoreDetails.js b/eaterplanet_ecommerce/moduleA/score/scoreDetails.js
new file mode 100644
index 0000000..03d908c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/score/scoreDetails.js
@@ -0,0 +1,123 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ is_login: true,
+ list: [],
+ showData: 1,
+ loadText: '加载中',
+ remark: {
+ goodsbuy: '商品购买送积分',
+ refundorder: '订单退款增加积分',
+ system_add: '系统后台增加积分',
+ system_del: '系统后台减少积分',
+ orderbuy: '商品购买扣除积分'
+ }
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ util.check_login() ? this.setData({ is_login: true }) : this.setData({ is_login: false });
+ this.getData();
+ },
+
+ getData: function () {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ wx.showLoading();
+ this.setData({ isHideLoadMore: false })
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'user.get_user_integral_flow',
+ token: token,
+ page: that.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ var list = that.data.list;
+ list = list.concat(res.data.data);
+ that.setData({ list, isHideLoadMore: true })
+ } else if (res.data.code == 1) {
+ if (that.data.list.length == 0 && that.page == 1) that.setData({ showData: 0 });
+ that.setData({ isHideLoadMore: true, no_data: 1 })
+ return false;
+ } else if (res.data.code == 2) {
+ that.setData({ is_login: false })
+ }
+ },
+ fail: (error) => {
+ console.log(error)
+ wx.showLoading();
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/scoreDetails',
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (this.data.no_data == 1) return false;
+ this.page += 1;
+ this.getData();
+ this.setData({
+ isHideLoadMore: false
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/score/scoreDetails.json b/eaterplanet_ecommerce/moduleA/score/scoreDetails.json
new file mode 100644
index 0000000..18d17ea
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/score/scoreDetails.json
@@ -0,0 +1,11 @@
+{
+ "navigationBarTitleText": "积分明细",
+ "navigationBarTextStyle": "black",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-auth": "../../components/auth/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-card": "../../components/card/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/score/scoreDetails.wxml b/eaterplanet_ecommerce/moduleA/score/scoreDetails.wxml
new file mode 100644
index 0000000..52540ae
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/score/scoreDetails.wxml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ 暂无任何明细记录
+
+
+
+
+
+
+ {{item.remark?item.remark:remark[item.type]}}
+ {{item.in_out=='in'?'+':'-'}}{{item.score}}
+
+ 订单号: {{item.trans_id}}
+
+ {{item.addtime}}
+ 剩余积分:{{item.current_yuer}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/score/scoreDetails.wxss b/eaterplanet_ecommerce/moduleA/score/scoreDetails.wxss
new file mode 100644
index 0000000..ad2e50b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/score/scoreDetails.wxss
@@ -0,0 +1,76 @@
+.score-box {
+ padding-top: 30rpx;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-top: 200rpx;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.list {
+ padding: 0 20rpx;
+}
+
+.list .listData {
+ padding: 30rpx;
+ border-bottom: 0.1rpx solid #eee;
+}
+
+.list .listData:last-child {
+ border: none;
+}
+
+.list .listData .list-tit {
+ line-height: 28rpx;
+ margin-bottom: 24rpx;
+ display: flex;
+ justify-content: space-between;
+}
+
+.list .listData .list-tit .tit {
+ font-size: 30rpx;
+ color: #444;
+}
+
+.list .listData .list-tit .num {
+ font-size: 32rpx;
+ color: #ff5344;
+ font-weight: bold;
+}
+
+.list .listData .list-tit .num.yue {
+ color: #666;
+ font-weight: normal;
+ font-size: 30rpx;
+}
+
+.list .listData .list-tit .num2 {
+ color: #999;
+}
+
+.list .listData .list-orderNo {
+ font-size: 26rpx;
+ color: #444;
+ margin-bottom: 16rpx;
+}
+
+.list .listData .list-time {
+ font-size: 26rpx;
+ color: #aaa;
+ line-height: 22rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleA/score/signin.js b/eaterplanet_ecommerce/moduleA/score/signin.js
new file mode 100644
index 0000000..dba52aa
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/score/signin.js
@@ -0,0 +1,263 @@
+// eaterplanet_ecommerce/moduleA/score/signin.js
+var util = require('../../utils/util.js');
+var app = getApp();
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/scoreCartMixin.js')],
+ data: {
+ info: {},
+ dayScore: [],
+ showSignModal: false,
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true
+ },
+ page: 1,
+ isLock: false,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function () {
+ app.setShareConfig();
+ status.setNavBgColor();
+ wx.showLoading();
+ this.getData();
+ this.getList();
+ },
+
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ that.setData({
+ needAuth: true
+ })
+ }
+ })
+ },
+
+ vipModal: function(t) {
+ this.setData(t.detail)
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let that = this;
+ that.page = 1;
+ this.setData({
+ needAuth: false,
+ showAuthModal: false,
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true
+ }, () => {
+ that.getData();
+ that.getList();
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ getData: function(){
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'signinreward.get_signinreward_baseinfo',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let info = res.data.data || {};
+ let dayScore = [];
+ dayScore.push(info.signinreward_day1_score || 0);
+ dayScore.push(info.signinreward_day2_score || 0);
+ dayScore.push(info.signinreward_day3_score || 0);
+ dayScore.push(info.signinreward_day4_score || 0);
+ dayScore.push(info.signinreward_day5_score || 0);
+ dayScore.push(info.signinreward_day6_score || 0);
+ dayScore.push(info.signinreward_day7_score || 0);
+
+ // let isopen_signinreward = info.isopen_signinreward;
+ // if (isopen_signinreward!=1) {
+ // app.util.message('未开启签到送积分功能', 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ // }
+
+ that.setData({
+ info: res.data.data || {},
+ dayScore
+ })
+ } else {
+ that.setData({ needAuth: true })
+ }
+ }
+ })
+ },
+
+ signIn: function () {
+ if (!this.authModal() || this.isLock) return;
+ this.isLock = true;
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'signinreward.sub_signin',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let { score, continuity_day, reward_socre } = res.data;
+ let info = that.data.info;
+ info.score = score;
+ info.today_is_signin = 1;
+ info.has_continuity_day = continuity_day;
+ info.show_day_arr[continuity_day-1].is_signin = 1;
+ that.setData({ info, showSignModal: true, reward_socre })
+ // app.util.message('签到成功', '', 'success');
+ } else{
+ app.util.message(res.data.msg || '签到失败', '', 'success');
+ }
+ this.isLock = false;
+ }
+ })
+ },
+
+ goLink: function (event) {
+ if (!this.authModal()) return;
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ handleTipModal: function(){
+ this.setData({
+ showSignModal: !this.data.showSignModal
+ })
+ },
+
+ getList: function () {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'signinreward.load_sign_goodslist',
+ token,
+ pageNum: this.page,
+ is_random: 1,
+ head_id: cur_community.communityId
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.list;
+ if (list.length < 10) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({
+ list,
+ ...h
+ })
+ } else {
+ let h = {};
+ if (that.page == 1) h.noData = 1;
+ that.setData({
+ loadMore: false,
+ noMore: false,
+ loadText: "没有更多记录了~",
+ ...h
+ })
+ }
+ }
+ })
+ },
+
+ onReachBottom: function() {
+ if (!this.data.loadMore) return false;
+ this.getList();
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ let info = this.data.info;
+ let { signinreward_share_title, signinreward_share_image } = info;
+ var share_id = wx.getStorageSync('member_id');
+ var share_path = 'eaterplanet_ecommerce/moduleA/score/signin?share_id=' + share_id;
+ console.log('签到分享地址:', share_path);
+
+ return {
+ title: signinreward_share_title,
+ path: share_path,
+ imageUrl: signinreward_share_image,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function () {
+ let info = this.data.info;
+ let { signinreward_share_title, signinreward_share_image } = info;
+ var share_id = wx.getStorageSync('member_id');
+ var query= `share_id=${share_id}`;
+
+ return {
+ title: signinreward_share_title,
+ query,
+ imageUrl: signinreward_share_image,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/score/signin.json b/eaterplanet_ecommerce/moduleA/score/signin.json
new file mode 100644
index 0000000..fecfbd6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/score/signin.json
@@ -0,0 +1,12 @@
+{
+ "navigationBarTitleText": "积分",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "sku": "../../components/sku/index",
+ "i-modal": "../../components/modal/index",
+ "guess-like": "../components/score-guess-like/index",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/score/signin.wxml b/eaterplanet_ecommerce/moduleA/score/signin.wxml
new file mode 100644
index 0000000..9e38816
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/score/signin.wxml
@@ -0,0 +1,70 @@
+
+
+
+
+
+ 活动规则
+
+
+ 当前积分
+
+ {{info.score || 0}}
+ 明细
+
+
+
+
+
+ 已签到
+ 签到
+ 已连续签到
+ {{info.has_continuity_day || 0}}天
+
+
+
+ +{{dayScore[index]}}
+ {{item.is_today==1?'今日':item.date}}
+
+
+
+
+
+ 连续签到有机会领取以下奖励:
+
+
+
+ 连续{{index+1}}天
+
+ {{item}}
+ 积分
+
+
+
+
+
+
+
+
+ ——积分兑换——
+
+
+
+
+
+
+
+
+
+
+ 签到成功
+ 获得{{reward_socre}}积分
+ 好的
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/score/signin.wxss b/eaterplanet_ecommerce/moduleA/score/signin.wxss
new file mode 100644
index 0000000..acb2635
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/score/signin.wxss
@@ -0,0 +1,202 @@
+.wrap {
+ width: 100%;
+ overflow-x: hidden;
+}
+
+.navItem {
+ font-size: 28rpx;
+}
+
+.score .tit {
+ color: #999;
+ margin-top: 40rpx;
+}
+
+.score .num {
+ font-family: DIN;
+ color: #4facfe;
+ font-size: 60rpx;
+ font-weight: bold;
+ padding-bottom: 20rpx;
+}
+
+.signBtn {
+ background: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
+ width: 200rpx;
+ height: 200rpx;
+ border-radius: 50%;
+ color: #fff;
+ text-align: center;
+ line-height: 200rpx;
+ margin: 20rpx 0;
+}
+
+.signBtn.disabled {
+ background: #ccc;
+}
+
+.sign .list {
+ width: 100%;
+ padding: 40rpx 0 20rpx;
+}
+
+.sign .list .list-item {
+ position: relative;
+ text-align: center;
+ min-width: 88rpx;
+}
+
+.sign .list .list-item::before {
+ position: absolute;
+ content: "";
+ border: 4rpx solid #8ec5fc;
+ left: -36rpx;
+ width: 55rpx;
+ top: 25rpx;
+}
+
+.sign .list .list-item.on::before {
+ content: "";
+ border: 4rpx solid #4facfe;
+}
+
+.sign .list .list-item:first-child::before {
+ content: none;
+}
+
+.sign .list .list-item .num {
+ position: relative;
+ z-index: 1;
+ display: inline-block;
+ text-align: center;
+ width: 52rpx;
+ height: 52rpx;
+ border-radius: 50%;
+ line-height: 52rpx;
+ margin-bottom: 10rpx;
+ font-size: 24rpx;
+ background: #8ec5fc;
+ color: #fff;
+}
+
+.sign .list .list-item .iconfont {
+ position: relative;
+ z-index: 1;
+ display: inline-block;
+ text-align: center;
+ color: #4facfe;
+ font-size: 50rpx;
+ margin-bottom: 10rpx;
+ width: 52rpx;
+ height: 52rpx;
+}
+
+.sign .list .list-item .datetime {
+ font-size: 20rpx;
+}
+
+.viplist .list {
+ display: flex;
+ overflow-x: scroll;
+ overflow-y: hidden;
+ white-space: nowrap;
+ margin: 30rpx 0;
+}
+
+.viplist .list .list-item {
+ position: relative;
+ border: 1rpx solid rgb(59, 140, 232);
+ padding: 18rpx 15rpx 10rpx;
+ border-radius: 15rpx;
+ min-width: 135rpx;
+ max-width: 135rpx;
+ height: 120rpx;
+ margin-right: 20rpx;
+ align-items: flex-start;
+}
+
+.signTip {
+ position: relative;
+ width: 644rpx;
+ height: 645rpx;
+}
+
+.loadingpic {
+ animation: load 3s linear 1s infinite;
+}
+
+@keyframes load {
+ from {
+ transform: rotate(0deg);
+ }
+
+ to {
+ transform: rotate(360deg);
+ }
+}
+
+.signTipLight {
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoQAAAKFCAMAAABiNQjYAAAAjVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8DizOFAAAAL3RSTlMABAsHDxMdGRYnKyEvQiQ+OUYzSjZOYFtkUmhteVhVdHCCfoaLkJWZnaGmrLG4xJtLVuIAALjgSURBVHja7NzdkuogEATgNO37P/OZYiFggKO1Q1yw+iMhP7d2DUGJh4iIiIiI/Abqrbklcj8MbyiQ8imo2oGmnRRDuQtyf83gJZGKoNwG46YUSo8yKN8HgHWIWx6VAZz5PG8qhnIXVNqLozpRBOUueJNSKHeBQiguUAjlCyiE4imCUCUUH3/6YJtCKH8H1qDhWP4ArP1swKyJCT8WQq3G+Q7VwoIpQQQBGhCGjF085ktDFUJJ2csNqZ9RVsA3gYcftDZxZ0i7dSWFh21efNvhBq1K3BVSBEurbRRCnPMpqBxupHxgqezBjs92DKGsDtcLlLVWdsCuIQSqYq6xeQN4eo7HmcO9Q5gn9NACxeXl8KXzsqBvfgjx0RDmHJ5NT4dLO+cgeTjuIf2VMASawFfgzmASQ6h3BjZQ1QgMMHXeEEa0ZpthiiVDvHFeTQzh9d1S/ZSyIOQeODBEMnaHS06aYdkj1ge6Sy6yEkS9RbUslCJo3bAGGvjHyafEVdUvd8xlEvMKIfqPh5otLwWpxxXzYdrDWo7dS/cs19EEZWGjmcjPTtYxdFbCglUtbIblyRlsnw/1tzerQR9TDiuBvkr4AudUQhAchDAGUQPygtDDjjAnhHcPxyRAYkhfYi+oXwT7McQWIYwwpr95WA4abCMYUinEB0LIST/MYOiAVjispflCpieE2AW4JyaPENLxcUsIWQGIIU1LllLlD2BfCiF9IXx0Wn1qF3NCWIwzqNcIVtIUwXYgjmaHsLQYvhRJXwgReAWiT8PxOgAOWTRSBukP4cMEEw+2W9cpiwHz14uBerV0cYMSmFJoewXOELbC9dQ7BWeHQrg4HOBIroDlZHYIW4cDYghHMaQyuK5h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');
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ width: 100%;
+ height: 100%;
+}
+
+.signTipCon {
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaQAAAGkCAMAAABJkqEHAAAC8VBMVEUAAAD1zGTtuVf////tuVf////////3zWX////40Gf40GfxwV33zWXrQC7qtFP0yGHzxWDrQC3rQjDwwFzrOCXsSDb54rLqNyT////sTj3rQjD////3z2frtlXrQzH40WjpslL////1zGTqtFT40WjrQzH99+j76Lr66b7////1znT1zGT1y2TrQzHsTj3qNyTblz30yWL87dL1y2T87M/dl0DdmEHclj7768v66snqyG/////3zWXrQC756MLqx2zdmUH45Lrpxmnzx2HqOCX3zmbblD7qOifrynPemkL45bz979fv04z45r7y2Zvst1balj3pxmj347fhoEbuz4LrRTP66cbfnEP347Xxwl31ymP0ymP24K3x2Jjbkz3akjzrPCn97tT66MTx15brPiz55r/w1ZL24rTqyXHmqk3uvFnzxmDsSjnrtVXqs1Por1DnrU/mrE7jpUnio0jlqEvry3XqtVTpslLosFHtuVfkpkv24bLwwFzvvlvgnkTsTTzz26Hy2p3YlTztu1j03aXz2p/40WjksVbsRzbu0ITszXz98Nny1pTw1ZDu0Ybsy3f03KP03aftzn/szHnoxGP13qjw1I/v0on136r20YDtzn3szHr+8dvoxWXrPSvyxF724LDlZDfsSDfv0YjlqUz40Gfw1pXnrlDXlDzQkDrTkTvsTDv+8t/77MzNjTnnYzf/8+Hnw2DnbD7Vkjvx2Zriokfv1I7vv1zmtlz+8d3636b0pFjocUHtVT/nWjTbjzzqXzn42pjy0IrsxHXqu2bqaEH//fnwekvGiDfjrFLvckPnWDTsSTPUo17bqFvJizjoy5jmvIDftnLQmUzox4TswG71y2nv1ZDu0oj0zXz3xmTXnUzt06Ly2Z3005Dsy4zxzITyyXjju3TYmEPx263kwo3Zrm7frWLcoU/Lk0f9+fL74arkaDfrTTT414j03cD037Xv1qfGjD/76sj20XLopU3pm0vbijrdgTn03sHt0ZrWmiJXAAAALXRSTlMAZkkK+fVV9qr4SGlIBfVpWqqMWllUEOHq4NpTfnvzzMx4dUI948mZkXxhLSxQhf6cAAASvUlEQVR42uzav0orQRTH8Qlh/yQK98KFICQgitx/2uimEI6dWPkEamXtK1jb+AQBwcrOhbROt00eYSGv4EIafQCz6i45+Tc7ZmZZ5Peph9N8mcMujPheWp3NRmOz0xJQWTvezTtvR0BFNRsPnxpNAZWUNkKlaksb6VVyBdjHG50w6kr1jboA+3gjzUptwlUqAW+kW8knX0B5mt7JHN760m3nkIN9ZxtvpF3JJcK+K8/6uJF+JZ8I+84q3uhoIVZpetsR9p1dvJF+pfoWpbZQyR7eSLdSve079MHx2+hkF2+krsQL5Z1cdDJhtzbfthdwr6PRa8B527UJfxyatYHPvNV1gmJGL/2xl1GwRByFA9wk8/aCYmT/kwwCVScUMqx2XkjSzyWqs3FCqX8oZMqPiyKSxwmJ6nQ8wH+S2Uj7BchHRqrOh0T0W0CZkeTTFFWliIj+CigxkryboagUD2jwX4DlSLyRdqWQwp8CjEU6VpC3c8njZSKKEMl2JN5Iv1L8HCOSwUhXE+LeNHm6kOzNirNJ0RUi2YnU656u6DLKZiGSnUgX3cvVDRHJvLX73PDAgCibhkhWIvUQqaLWznJmImXTEGkF7uJIXQMQyQD2SptHGhqN9EvAV7nkLox0uFyYOlRAJAN88nmk69xQ1Wh8UdSRsmmI9GWtN3btnrVtII7jeEjTUAhkLF36HoS54W45uFVwNGg4NHg6OAyGrIUgurirX0BHj5ZAWjx019TFVI2nghE22IZsSV5B7hRL6MAn8nDe7rva/JcPP/yA5FPan01IqDP4jIS6Gzuk9/Xh/NPH+tmDVyNB0JOB1CEdtfMvB56zuvjd9J91pJDAttdLEetsXF9zSBaX9KNpzTtiEIDiEQGAGO+qrK85JFufSToSNsdQCtLFny0AkHHckUM6wre7ry9D4ihNi7/ZHUohwy9CujhxWfqddHo2bFoLYxIJwnmcZFuokIS5sr52dnrisvCPg2YkkagxzBBcZrNpskAQcUzNlUOnZGFKBiOJ5JtSSGgej65mWYEQF9Q3lg+dks2k0c92a2JKIT1ksytvlCyYRPKJsbx10ClZNpKVxJBaElND8tSUGMOdSE7JqtGNVhmYIpSzjRqS543ieYUUmMq1m07JrlEemgqI4HwXTyWSmtKSY0qC0ND4xilZNPqmlQ8OVhlRjDdZIo0kkpwSxtSvkAaHyvW7TsmiUaS1BwpkhPgC4+ch7aeklAiRr+2dIi2ndCyjSbsoCisgIvN9KoS4r4ZUT0nIqC+daqkomrRySpaMrrXyfqtJNAgDhdPqthpSPaUH2lRZBZJp0rqw0q9fOqW3GF1ea636OlJI/Kb7ZfFvN4+TkVcjTePF7nZbbFpvIoOo33dKdo2+a61+aT2xcz8tbYNxAMfzBlqo2ImCQ/Cc9BXsIAy8jBJ68pDCIKPSg38KBcUc9qQ8uSkkh7gccyg1ySGXlOFhwjAN8zCt/3pSceiGetxADzvtqbjiL3k27O0R+rk19OF3+JIneS6RlEIvztGvnZ2ddtv3yBnpUSW/3SbXb3Z7sQqKZD32DU4YVOrXZLyRCZBIU/s3D3F833U9L3BIox5RdALP81zX99sPsRQSyQTilSa5gT68SM8DHQMyLaUwddD2Xa9bx3FqtZookkaPkN/kquMEwX2rm9OpGdsyoA6ckh58T7wf4/PQKo4xyX5X+OE5IA6NeB8rOPlZKCiWgaHVeWicG3i6iSVgU48jlcgR6fwyFohOrF0bMzPdRnrMJpwzwQ08XXoJaKEE3bDIaXY/XoneaO/77KxtYh3FteCcNMewVDYzuiUwZHEZaGlJCJu2ovy+rIlPaKQokqEjLaEF52zwDHk5lsmmuJ7sqMCYu2VgTqVAuiEpyukJqERrdEX+ZmGkqUlzcM4dz5ix7N/baEhgzpcFaDtPoSJs2bb2/0qicyXZtqlraj5pewH6xDNnKMV1MdhI2LpdAFp5Kk03JQldg0rxRoeSJJlIy9O04JTbrzx7hjgiK7AoWtwAwiJNU0WGJOE9UAk2uiCNMFKbRYoQzqh85hn0dphsdsw9jx4qVRaBUKYp5jVsWQaoBBodWJalq/miTBHCCWUmG/HTIylGbyQiKscqrVI05KKqm6ZxRa0kOsemaSKSiLb2eTTip3PDXEZgVVSuAGGJplE8w4Zx4VAjBWeGgZpyiSasAKw24l/nMhyjux210hpNqYgw3gtokWreMcaqXKItizWqs9qIz+VGOKbOsDFRvQyE6xQlWcP46B+RDjHON9Yoq8IyUGW20atcbpp7LzAsqpaBzpukNVnTz3z6duft6nqz8TG5qPNcGnUj5TiBaVG1DnSokdC561Bf7oIjhJqlZKSwDqyw24h/x34kIVqpAp0PcesyQofuH+7u57VpMAzg+F+U9aSCW1Gk2BaCKI14qhRSggdPDi8e1BZsSMAUEqGQ4sEfhFVQsWYhMDsEp6Uig85Ky8Yo1INzKDt780lHsjxJZ+uY8D5+D6PNs76HfQh5l461PHkH/iJ/94LE16J9QWuybMQVCCDFlZ7gAOnevfVnPhJuqdG7ty3xT6J9IWPEpSkggRLK1XADRyyVQvuGi1B451AqSfxAi7QWWvAG00ZEkCJKroLTHHHbhr/l8onK37pwxzVAWt+GM0lTIq2RMeJSNJDm3t8IJQs4jRftXmMpeAt2aNv5EbzJ5O8cbNuqKUKktWC5RcaNkgkiSHPvF2/43YohOXl71CjvE2317HHiBjDt7xws2+K1GBIVI0JIc29CZ5KO8pDysG/wiL6O8pBoifC1D3fzLo53DnmLV/RIAVKTY7wiIaTFINlE6R7S1uuLQLRhAY7k1Gp833s0XF+Co42NvAhIJm7NX+0lx3gFmkgqStf6otV4XS5/c0RRlHjNu/4oA8eCZ72dMuwcREAyVRwdpDRNpDrKVByr9+LZ+tCyrD6vCbqq1lVTVwa8BEfebTU+WxYvqHWUQQcpRQhpOUg2wo2RRlu9EBEc3WdygEkafZesmqAaONdfjXmkBCGkXFCniqrrA4mXJOl+TRPMuhEcN1RT0LyB49zXzHoVZbj+aqwjJYki3URVVaHm9J2BoqtGFU/qHlMfZoIKExQZpCJRpAwKlHRFEUzVgJ89mgCT4c2ArwoTFBmkwn+BBBYG7AQQA5qpHl+GKlKaEtLtoM61aBkIHZg+dP3VWEdKEUU6fQyRQUqwi9T+J0glekhJdpFam60o0pWgzpkjltnNBI9dfzXGkYrsIrUr7X+AVJovBY9lIkgFdpFWKitzuOYB0tNzRww+ZjF4TAUpzSxSa6Gy0DoUKXfpaEbX4ANLr/lPnhJBSrGJ1GqvLFQqlYWVdiuMlD1IvvT3nbbHH0j/4bl92nvqZv3YRkommERqb1b8NtsYKWhRjudOxnH3p8Pdeb/doSzfyhJBKrKJdOiZNC354YRkf5rr7o3PpF/dXBaiglRgFOmQa9LZqckTjMLzHbgm7cRexTZSml0ktLubFQmUHkSS8Xxvfu8sMaQUw0jx35OaJ2dIjhhFxt35bvw1TCMlEwwjoTsOCGmaEjbCXdm9QgypyDJS/N5d88QsnZJfBXXi4+6JeEwjFZhGivX2xGx1sNH0fnIMl6aFdOfNqdladj0id3m27z7/iGO5FC0kuE41D/rx6KAf50/hsrlcNmoRvAD3kunzCPYN1JDCXeZCrSKlSV1d5UhWJI3EoVavnv9jVI24AmWk61xU6diMPnIMlaKM9JiLKR2T0adNlv4D1G/y7Ni2YRgKwvBEB07ATgAnUBurcKkd1AWaQoXbDMFe8ihObZcxkBRSYoSQKv64G0EfeKTeC2SkVgWlo0aa3ys6SpGMNEh/lU5vL5N3Gek5NFQ16chIvQpKh42uz/F7Pa/yREYaVVA6ZnSdfxZZcyX3UiAjtXqZJZ9+JS97rqPVSriKiymSkQapoLQyAp+kiYzUq6C0MtqZz5rupERGGlVQ2hphX3cNGalVSWlrBP1PigGM1Ou/LPdvo/vKiDlxmMhIl8Jnvj1yftw23xo5u0tkpFYeCWCkQR6JZKReHunISKM8kshIMkkAI7m03ZmM5NJ2HRnJ5QHegJE+5JEYwEgXeWQiI7m0XQIjubSdAhjJpe3OZCTXtiMh2bRdA0ZyabsYwEgubdeBkXzbDoTk23YgJJe2m8BINm2XwEjGbcdBMm47DJLLTlYJjOSyk/1i1w5u5IhhIIpGRFQEuglQGjooD2fSCThJH+y1d7w7d318TgoPRRU5PQJGMk87CpJ62lGQ1NMOgmT5urgeMJJlSaoFRrLUhhEukuYk9ICRLLWhJhipJL8RLpJmSdpgJPu0IyBplqQRLpJ8SWIgWZakmlwkTW044SJpgrS4SJprwwgXSdO/NxipLL/JReraAEDq2nA/kiZIFS6SpjY8XCRN/67JRdIE6QSLpLl/1+Iiae7fI1wkTf/eXCRP/55cJE2QTrBIniAtLpKmf49gkTyL7OIidZDuR/IEaXORNEGqiUXyXIROsEiai1BNLJInSCNYJE+QFhapgwRA6iDdj9RBAiB5grSxSB0kAFIH6X4kT5BqYpE8QXpCReogAZA85+8nVCTP/0g1sUgdpPuROkgApA7S/Uieb+1qYpE0H63WEypSBwmA1EG6H8lzEKpJRRIdhHaoSJ76PUJFEu2xG4vUQbofSVS/FxbJU79HqEii+r2oSKL6fUJF8rSGmlQkUWs4oSJ5WkNNKpKoNexAkUStYYSKJGoNi4okag0jVCRRa1hUJFFrOIEiif6hqElFErWGHShSt4b7kX50a7gfSTTsTqBIomFXE4pkGnY7UCTRsBuBIpmG3YIimYbdCRTJNOwmFKmH3f1IPewASKJhVxOKZBp2O0wk07AbgSL1sLsfqYfd/Uimf2NHoEiiB6kmFEn06UntMJFMD9IIE8nUvmtCkUzte4eJZHqQRphIpgepJhNJ9SCtMJFMD9IJE8k07MZkIpmMagWJpHqQnjCRTA/SCBPJtCHVZCL1g3Q/kupBOmEimYzGZCKZSkOtIJFUD9IOEklldIJEUpWGMZlIJqOaQSJ1abgfSXVpOAkRSVUaRhIgkulr1d8PEg9JVexqJQkPSWW0kyQ4JFWx+1MaaEiqYvexxcKQVMWuPoxYSC6jv6UBheQq3/9KAwnJVb4/lQYQksvo86UBhOQy+lwaOEiqBalejDBILqPXYkdBUi2x/xc7CJJrQXry+mMguYy+lG8Eksvoa7EjILXR/UiuY1B9Y3Q/0k/VEvtt+b4eqY2S25FcB7s3RpcjyYzeLLF3I8mM3i1IVyO10a927d64bSgIAvA1gIAcaDCjwJlDDCp4MdtggNA9uBPUahpPhGmKpgBaP3u7uy18c3eLR9YgI9noJcBIYkZ3PmJxkWy0BBbJRn+CimSji4Ai2egymEhiRv0bRpBIYu91bz4GISLZ6CqASDa6Dh6S1u+wq4zgkGz0OmhINroRMCQb3QoWktb/VFcbQSFp/d97vRESkprR6ncGHCS1p6Cy3ggGyUb/DgqS2jPDJiMQJLXqvc0IA8lGdwOBpPZ5NG40QkBSq97jsDFfj6RW6wCMhnCtw/i/972EKwO80RCuDJDPdX8lXBngjYZwZYD9PHoA6YeNvirhyoD6CXuB5HN0O9OAk/A5wq3eC5LPEXCtOyP56wi5MqxF+il3jtCMhvCqA3xRvUq4eSNXhppw80auDDXhVQd9jiqSWx30OapIbnXQ56giedVBn6OK5FUHfY4qkv/JAH2OKpLHCHvVzUhuDNirbkbyGwPU73s3Ex4j2Oa9JOSLd4E+RxVJfYzQV92MpD1G2K1uQZIeI/BWtyApjxHSP4LuJYTHKMWqm5FkxyhDYzgjab7UJWkMZyTJl7osjeGMpLjp8N8YrpB6veQaI02kZGOkiJRujASR8o2RHFLGMVJDSjlGWkiJnhhUkfK81OkiTWnHSAYp8xipIGUtDEJIeQuDDFLyTSeBlH3TCSDl33T0SAybjhyJhogYieIYcSORHCNmJC4iSiSiY8SKxEdEh1SY+gIp0pHsGBEipf7NSAOJlogHiZiIBYmaiAOJnIgBiZ4oPVIhLd1ESJyfrlRIjA9AZEg6RGmR2H6M4EPSaAupkZT2XFKkUY8oGZLcnsuHJDlEqZCKwOtPciTBspAMSfUSJULSvURZkDxE6EgWQkcqk9ccOJIPEThSsRA4krccOpKF0JHc5dCRxoOFoJG85NCRRi85bKRy9AhBI3nHgSOVyTUBGskrDhupuCQ8mvjWf3Cqjzfc4znEc38Z+wCmi13/EvugZhdt35sHO200399Txzzvn66JeLIOdto4Zf9fNtPxYJ2PzD5+p9lvlqk0tvmE7JuoeXouc15x1IwnlOl4YjHMZ6drY0nT7jq/14Dl0O3aOka/ALQRAxfnKw8+AAAAAElFTkSuQmCC');
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ width: 420rpx;
+ height: 420rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ margin-left: -210rpx;
+ margin-top: -225rpx;
+}
+
+.signTip .signTipCon .state {
+ font-size: 34rpx;
+ color: #fff;
+ margin-top: 150rpx;
+}
+
+.signTip .signTipCon .integral {
+ font-size: 30rpx;
+ color: rgba(255,255,255,0.6);
+ margin-top: 9rpx;
+}
+
+.signTip .signTipCon .signTipBnt {
+ font-size: 30rpx;
+ color: #eb4331;
+ width: 260rpx;
+ height: 76rpx;
+ background-color: #f8d168;
+ border-radius: 38rpx;
+ line-height: 76rpx;
+ margin: 48rpx auto 0 auto;
+}
+
+.like {
+ margin-top: 60rpx;
+ margin-bottom: 100rpx;
+}
+
+.like-title {
+ font-size: 30rpx;
+ text-align: center;
+ font-weight: bold;
+ color: #666;
+ margin-bottom: 20rpx;
+}
+
+.like-list {
+ position: relative;
+ padding: 20rpx;
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ z-index: 0;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/seckill/list.js b/eaterplanet_ecommerce/moduleA/seckill/list.js
new file mode 100644
index 0000000..afaee8b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/seckill/list.js
@@ -0,0 +1,283 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ statusBarHeight: app.globalData.statusBarHeight + 44 + 'px',
+ searchBarHeight: app.globalData.statusBarHeight + 'px',
+ currentTab: 0,
+ scekillTimeList: [],
+ endTime: 10000,
+ list: [],
+ clearTimer: false
+ },
+ secTime: '',
+ seckill_share_title: '',
+ seckill_share_image: '',
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ status.setNavBgColor();
+ app.setShareConfig();
+ this.secTime = options.time || '';
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ that.setData({needAuth: !res})
+ res && (0, status.cartNum)('', true).then((resp) => {
+ resp.code == 0 && that.setData({
+ cartNum: resp.data
+ })
+ });
+ })
+ this.loadPage();
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+ this.setData({ clearTimer: false })
+ },
+
+ loadPage: function(){
+ this.getInfo();
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ const that = this;
+ this.setData({
+ showEmpty: false,
+ needAuth: false,
+ showAuthModal: false
+ }, () => {
+ that.loadPage()
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({
+ showAuthModal: !this.data.showAuthModal
+ });
+ return false;
+ }
+ return true;
+ },
+
+ getInfo: function(){
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'scekill.get_scekill_info'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if(res.data.code==0){
+ let {
+ seckill_is_open,
+ scekill_time_arr,
+ seckill_page_title,
+ seckill_bg_color,
+ seckill_share_title,
+ seckill_share_image,
+ showTabbar
+ } = res.data.data;
+ wx.setNavigationBarTitle({
+ title: seckill_page_title || '整点秒杀'
+ })
+
+ let myDate = new Date();
+ let curHour = myDate.getHours(); // 当前时间
+ console.log('当前时间:', curHour);
+ let curSeckillIdx = 0; //当前时间索引
+ let scekillTimeArr = scekill_time_arr || []; //显示的时间段
+ // if (scekill_time_arr.length > 5) {}
+ //判断各个时段状态
+ let scekillTimeList = [];
+ let currentTab = 0;
+ if (scekillTimeArr.length) {
+ scekillTimeArr.forEach((item, idx) => {
+ let secObj = {};
+ //state: 0已开抢 1疯抢中 2即将开抢
+ if (item == curHour) {
+ secObj.state = 1;
+ secObj.desc = '疯抢中';
+ currentTab = idx;
+ } else if (item < curHour) {
+ secObj.state = 0;
+ secObj.desc = '已开抢';
+ } else {
+ secObj.state = 2;
+ secObj.desc = '即将开抢';
+ }
+ secObj.timeStr = (item < 10 ? '0' + item : item) + ':00';
+ secObj.seckillTime = item;
+ scekillTimeList.push(secObj);
+ })
+ if (that.secTime!='') {
+ let k = scekillTimeArr.findIndex((n) => n == that.secTime);
+ if (k > 0) currentTab = k;
+ }
+ that.getSecKillGoods(scekillTimeArr[currentTab]);
+ }
+
+ let curTimeStr = (scekillTimeArr[currentTab]*1 + 1);
+ if (that.secTime!='' && curHour!=scekillTimeArr[currentTab]) {
+ curTimeStr = (scekillTimeArr[currentTab]*1);
+ }
+
+ let endTime = new Date(new Date().toLocaleDateString()).getTime() + curTimeStr*60*60*1000;
+ that.seckill_share_title = seckill_share_title;
+ that.seckill_share_image = seckill_share_image;
+ that.setData({ scekillTimeList, seckill_bg_color, currentTab, endTime, showTabbar })
+ }
+ }
+ })
+ },
+
+ handleClick(e) {
+ let that = this;
+ let currentTab = e.currentTarget.dataset.index;
+ let scekillTimeList = this.data.scekillTimeList;
+ let day = new Date(new Date().toLocaleDateString()).getTime();
+ let curTimeItem = scekillTimeList[currentTab];
+ let endTime = 0;
+ if (curTimeItem.state == 1) {
+ endTime = day + (curTimeItem.seckillTime * 1 + 1) * 60 * 60 * 1000;
+ } else {
+ if (curTimeItem.state == 2) {
+ endTime = day + (curTimeItem.seckillTime * 1) * 60 * 60 * 1000 + 1;
+ }
+ }
+
+ this.setData({
+ list: [],
+ currentTab,
+ endTime,
+ clearTimer: true
+ }, ()=>{
+ that.getSecKillGoods(curTimeItem.seckillTime);
+ })
+ },
+
+ getSecKillGoods: function (seckill_time) {
+ wx.showLoading();
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ var token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.load_gps_goodslist',
+ token: token,
+ pageNum: 1,
+ head_id: cur_community.communityId,
+ seckill_time,
+ is_seckill: 1,
+ per_page: 10000
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.stopPullDownRefresh();
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let list = res.data.list || [];
+ list = that.transTime(list);
+ let showEmpty = false;
+ if (list.length == 0) showEmpty = true;
+ that.setData({ list, clearTimer: false, showEmpty })
+ } else {
+ that.setData({ clearTimer: false, showEmpty: true })
+ }
+ }
+ })
+ },
+
+ /**
+ * 结束时间判断
+ */
+ transTime: function (list) {
+ let that = this;
+ let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
+ e === 0 && list.map(function (t) {
+ t.end_time *= 1000;
+ t.actEnd = t.end_time <= new Date().getTime();
+ })
+ return list;
+ },
+
+ endCurSeckill: function(){
+ this.loadPage();
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.loadPage();
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var member_id = wx.getStorageSync('member_id');
+ let {
+ seckill_share_title,
+ seckill_share_image
+ } = this;
+ return {
+ title: seckill_share_title,
+ path: "eaterplanet_ecommerce/moduleA/seckill/list?share_id=" + member_id,
+ imageUrl: seckill_share_image,
+ success: function () { },
+ fail: function () { }
+ };
+ },
+
+ onShareTimeline: function() {
+ var member_id = wx.getStorageSync('member_id');
+ let {
+ seckill_share_title,
+ seckill_share_image
+ } = this;
+ var query= `share_id=${member_id}`;
+ return {
+ title: seckill_share_title,
+ imageUrl: seckill_share_image,
+ query,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/seckill/list.json b/eaterplanet_ecommerce/moduleA/seckill/list.json
new file mode 100644
index 0000000..ff87a34
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/seckill/list.json
@@ -0,0 +1,11 @@
+{
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-count-down": "../../components/count-down/index",
+ "i-seckill-spu": "../../components/seckillItem/seckillItem",
+ "i-empty": "../../components/empty/index",
+ "i-tabbar": "../../components/tabbar/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/seckill/list.wxml b/eaterplanet_ecommerce/moduleA/seckill/list.wxml
new file mode 100644
index 0000000..c1486b7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/seckill/list.wxml
@@ -0,0 +1,32 @@
+
+
+
+
+
+ {{item.timeStr}}
+ {{item.desc}}
+
+
+
+
+ 限时抢购 先到先得
+
+
+ 距离本场{{scekillTimeList[currentTab].state==1?'结束':'开始'}}
+
+
+
+
+
+
+
+
+
+
+ 暂时没有商品
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/seckill/list.wxss b/eaterplanet_ecommerce/moduleA/seckill/list.wxss
new file mode 100644
index 0000000..caf66d1
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/seckill/list.wxss
@@ -0,0 +1,92 @@
+.fixed-top {
+ position: fixed;
+
+ left: 0;
+ right: 0;
+ z-index: 100;
+}
+
+.scroll-wrapper {
+ white-space: nowrap;
+ -webkit-overflow-scrolling: touch;
+ height: 114rpx;
+ box-sizing: border-box;
+ background: linear-gradient(90deg, #ea404b 0%, #ed745d 100%);
+}
+
+::-webkit-scrollbar {
+ width: 0;
+ height: 0;
+ color: transparent;
+}
+
+.navigate-item {
+ display: inline-block;
+ text-align: center;
+ height: 99rpx;
+ width: 20%;
+ color: #fff;
+ margin-top: 15rpx;
+}
+
+.names {
+ font-size: 28rpx;
+}
+
+.desc {
+ font-size: 22rpx;
+}
+
+.navigate-item.active .names {
+ color: #fff;
+ font-weight: bold;
+ font-size: 34rpx;
+}
+
+.navigate-item.active .desc {
+ color: #ea474e;
+ padding: 2rpx 10rpx;
+ background-color: #fff;
+ border-radius: 20rpx;
+}
+
+.counttime {
+ height: 60rpx;
+ background: #f0f4f7;
+ padding: 0 20rpx;
+ font-size: 24rpx;
+}
+
+.count-down {
+ height: 68rpx;
+ line-height: 68rpx;
+ color: #444;
+ font-size: 26rpx;
+ display: flex;
+ align-items: center;
+ flex: 1;
+}
+
+.count-down .item-time {
+ width: 34rpx;
+ height: 32rpx;
+ line-height: 32rpx;
+ color: #fff;
+ text-align: center;
+ background: #444;
+ border-radius: 4rpx;
+ padding: 0 2rpx;
+}
+
+.count-down-left-text {
+ font-size: 24rpx;
+ margin-right: 10rpx;
+}
+
+.list {
+ padding-top: 174rpx;
+}
+
+.list-item {
+ border-bottom: .1rpx solid #f2f5f8;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/addGood.js b/eaterplanet_ecommerce/moduleA/solitaire/addGood.js
new file mode 100644
index 0000000..c5593fe
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/addGood.js
@@ -0,0 +1,247 @@
+var app = getApp();
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ tabs: [{
+ id: 0,
+ name: '社区商品'
+ },
+ {
+ id: 1,
+ name: '仅快递'
+ }
+ ],
+ currentIdx: 0,
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ checkedAll: false,
+ checkedCount: 0
+ },
+ page: 1,
+ keyword: '',
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ let currentIdx = options.type || 0;
+ let that = this;
+ this.setData({
+ currentIdx
+ }, ()=>{
+ that.getData();
+ })
+ },
+
+ initFn: function() {
+ this.page = 1;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ checkedAll: false,
+ checkedCount: 0
+ },()=>{
+ this.getData();
+ })
+ },
+
+ /**
+ * 切换导航
+ */
+ changeTabs: function(e) {
+ let that = this;
+ let currentIdx = e.currentTarget.dataset.type || 0;
+ this.page = 1;
+ this.setData({
+ currentIdx,
+ list: [],
+ noData: 0,
+ showEmpty: false,
+ loadMore: true,
+ loadOver: false
+ }, () => {
+ that.getData();
+ })
+ },
+
+ /**
+ * 获取列表
+ */
+ getData: function() {
+ let that = this;
+ let keyword = this.keyword || '';
+ const token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.search_head_goodslist',
+ token: token,
+ page: this.page,
+ is_only_express: this.data.currentIdx,
+ keyword,
+ is_soli: 1
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 20) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list, ...h, checkedAll: false })
+ } else if (res.data.code == 1) {
+ // 无数据
+ if (that.page == 1) that.setData({ noData: 1 })
+ that.setData({ loadMore: false, noMore: false, loadText: "没有更多记录了~" })
+ } else if (res.data.code == 2) {
+ app.util.message('您还未登录', 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ } else {
+ app.util.message(res.data.msg, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ }
+ }
+ })
+ },
+
+ /**
+ * selType: 0单选 1多选
+ */
+ selectGoods: function(t){
+ let selType = t.currentTarget.dataset.type || 0;
+ let currentIdx = this.data.currentIdx;
+ var pages = getCurrentPages();
+ var prevPage = pages[pages.length - 2]; //上一个页面
+ let goods = prevPage.data.goods || [];
+ let goodsItem = t.detail;
+ if (selType==0) {
+ if(goods.length>0) {
+ let idx = goods.findIndex(item => { return (item.gid == goodsItem.gid) })
+ if (idx === -1) goods.push(goodsItem);
+ } else {
+ goods.push(goodsItem);
+ }
+ } else {
+ let list = this.data.list || [];
+ let selGoods = list.filter(item => item.checked==1 );
+ let newGoods = goods.concat(selGoods);
+ let uniq = new Map()
+ // 去重合并
+ for (let i = 0; i < newGoods.length; i++) {
+ let gid = newGoods[i].gid, val = newGoods[i];
+ if (uniq.has(gid)) uniq.set(gid, val)
+ else uniq.set(gid, val)
+ }
+ let res = [];
+ // 放入数组
+ for (let comb of uniq) {
+ console.log(comb[1])
+ res.push(comb[1])
+ }
+ goods = res;
+ }
+ prevPage.setData({
+ goods,
+ type: currentIdx
+ })
+ wx.navigateBack({
+ delta: 1
+ })
+ },
+
+ /**
+ * 勾选
+ */
+ checkboxChange: function (e) {
+ var type = e.currentTarget.dataset.type,
+ idx = e.currentTarget.dataset.index,
+ list = this.data.list,
+ checkedAll = this.data.checkedAll;
+
+ if ("all" === type) {
+ let ck = 0;
+ if (checkedAll) {
+ list.forEach(function (item) {
+ item.checked = 0;
+ })
+ } else {
+ list.forEach(function (item) {
+ item.checked = 1;
+ })
+ ck = list.length;
+ }
+ this.setData({
+ checkedCount: ck,
+ list,
+ checkedAll: !checkedAll
+ })
+ } else if ("item" === type) {
+ list.forEach(function (item, t) {
+ if (idx == t) {
+ if (item.checked) {
+ item.checked = 0
+ } else {
+ item.checked = 1
+ }
+ }
+ })
+ var ck = 0;
+ list.forEach(function (item) {
+ if (item.checked) {
+ ck++;
+ }
+ })
+ this.setData({
+ checkedCount: ck,
+ list,
+ checkedAll: ck == list.length ? true : false
+ })
+ }
+ },
+
+ goResult: function(e){
+ let keyword = e.detail.value || '';
+ (this.keyword = keyword), this.initFn();
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/addGood.json b/eaterplanet_ecommerce/moduleA/solitaire/addGood.json
new file mode 100644
index 0000000..13da4ca
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/addGood.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "选择商品",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index",
+ "i-solitaire-good": "../components/solitaireGood"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/addGood.wxml b/eaterplanet_ecommerce/moduleA/solitaire/addGood.wxml
new file mode 100644
index 0000000..1559d6c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/addGood.wxml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 合计:{{checkedCount}}条
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/addGood.wxss b/eaterplanet_ecommerce/moduleA/solitaire/addGood.wxss
new file mode 100644
index 0000000..199d7c8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/addGood.wxss
@@ -0,0 +1,203 @@
+.fixed-top {
+ position: fixed;
+ left: 0;
+ right: 0;
+ top: 0;
+ z-index: 100;
+}
+
+/* 搜索 S */
+
+.search-bar {
+ padding: 12rpx 25rpx;
+ background-color: #fff;
+ padding-bottom: 20rpx;
+}
+
+.search-box {
+ background-color: #f0f0f0;
+ height: 56rpx;
+ line-height: 56rpx;
+ border-radius: 28rpx;
+ color: #acacac;
+ display: flex;
+ align-content: center;
+}
+
+.search-icon {
+ position: absolute;
+ left: 20rpx;
+ margin-left: 25rpx;
+ margin-right: 12rpx;
+}
+
+.search-icon .iconfont {
+ font-size: 34rpx;
+ padding-top: 10rpx;
+}
+
+.search-box .ipt {
+ padding: 0 30rpx 0 60rpx;
+ line-height: 56rpx;
+ height: 56rpx;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+/* 搜索 E */
+
+.nav-bar {
+ width: 100%;
+ border-bottom: 1px solid#e5e5e5;
+}
+
+.nav-bar .nav-bar-inner {
+ display: flex;
+ justify-content: center;
+ padding: 0 40rpx;
+ background-color: white;
+ height: 58rpx;
+ text-align: center;
+}
+
+.nav-bar .nav-bar-item {
+ position: relative;
+ word-break: keep-all;
+ font-size: 28rpx;
+ font-weight: 500;
+ color: #666;
+ padding: 20rpx 0;
+}
+
+.nav-bar .current.nav-bar-item::after {
+ content: "";
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 3px;
+ background: linear-gradient(90deg, #ff4936 0%, #ff6e3c 100%);
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255, 89, 0, 0.25);
+ border-radius: 24rpx;
+}
+
+.nav-bar-content {
+ margin-top: 49px;
+ padding-bottom: 30rpx;
+}
+
+.list {
+ padding-top: 150rpx;
+ padding-bottom: 100rpx;
+}
+
+.list .item {
+ position: relative;
+ padding: 30rpx 0;
+ margin: 0 30rpx;
+}
+
+.list .item::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ border-bottom: 1px solid #e5e5e5;
+ transform-origin: 0 0;
+ transform: scaleY(0.5);
+}
+
+.list .item:last-child::after {
+ content: none;
+}
+
+/* 底部 */
+.bottom-bar {
+ width: 100%;
+ height: 104rpx;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ background: #fff;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ z-index: 9;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ box-shadow: 0px -1px 3px #ccc;
+}
+
+.bottom-bar .check-box-content {
+ width: 140rpx;
+}
+
+.bottom-bar .check-box-content .check-box {
+ margin-right: 20rpx;
+}
+
+.bottom-bar .flex {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+}
+
+.bottom-bar .total {
+ margin-right: 20rpx;
+ text-align: right;
+}
+
+.bottom-bar .total span {
+ color: #f75451;
+}
+
+.bottom-bar .btn {
+ flex: 3;
+ padding: 0 40rpx;
+ height: 60rpx;
+ border-radius: 60rpx;
+ line-height: 60rpx;
+ text-align: center;
+ color: #fff;
+ font-size: 30rpx;
+ background: #f75451;
+ white-space: nowrap;
+}
+
+.bottom-bar .btn.gray {
+ background: #f55b5b;
+}
+
+.bottom-bar .btn.btn-disabled {
+ flex: 1;
+ padding: 0 40rpx;
+ background: #e3e3e3;
+}
+
+.check-box {
+ box-sizing: border-box;
+ width: 50rpx;
+ height: 50rpx;
+ display: flex;
+ justify-content: center;
+}
+
+.check-box .checkbox-checked {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.check-box .checkbox-disabled {
+ width: 48rpx;
+ height: 48rpx;
+ margin-top: 2rpx;
+}
+
+.check-box-content {
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-right: 20rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/details.js b/eaterplanet_ecommerce/moduleA/solitaire/details.js
new file mode 100644
index 0000000..65c163d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/details.js
@@ -0,0 +1,1105 @@
+// 团长接龙详情
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/compoentCartMixin.js'), require('../../mixin/globalMixin.js')],
+ data: {
+ showGoodsModal: false,
+ showCommentModal: false,
+ showCartModal: false,
+ pid: 0,
+ hideGoods: true,
+ buy_type: 'soitaire',
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ },
+ showShareModal: false,
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ isIpx: app.globalData.isIpx,
+ orderList: [],
+ noOrderMore: false,
+ noOrderData: 0,
+ myOrderList: [],
+ noMyOrderMore: false,
+ noMyOrderData: false
+ },
+ imagePath: '',
+ options: '',
+ page: 1,
+ soli_id: 0,
+ orderPage: 1,
+ isFirst: 1,
+ myOrderPage: 1,
+ canCancel: true,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ app.setShareConfig();
+ let that = this;
+ status.setNavBgColor();
+ status.setGroupInfo().then((groupInfo) => { that.setData({ groupInfo }) });
+ var scene = decodeURIComponent(options.scene);
+ if (scene !== 'undefined') {
+ var opt_arr = scene.split("_");
+ options.id = opt_arr[0]; //接龙id
+ options.share_id = opt_arr[1]; //分享人id
+ }
+ let { id, share_id } = options;
+ this.options = options;
+ if (share_id != 'undefined' && share_id > 0) wx.setStorageSync('share_id', share_id);
+ if (!id) {
+ app.util.message('参数错误', 'redirect:/eaterplanet_ecommerce/moduleA/solitaire/index', 'error');
+ }
+ this.soli_id = id;
+ },
+
+ initFn(){
+ let that = this;
+ let id = this.options && this.options.id || 0;
+ this.page = 1;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true
+ }, ()=>{
+ id && that.getData(id);
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ let id = this.options && this.options.id || 0;
+ id && this.getData(id),this.getOrderList(), this.getMyOrderList();
+ util.check_login_new().then((res) => {
+ if (!res) {
+ that.setData({
+ needAuth: true
+ })
+ } else {
+ that.showCartGoods().catch(()=>{
+ console.log('购物车为空')
+ });
+ }
+ })
+ },
+
+ onHide: function () {
+ this.setData({ clearTime: true })
+ },
+
+ authSuccess: function(){
+ this.setData({ needAuth: false })
+ let head_data = this.data.community;
+ console.log('authSuccess');
+ this.compareCommunity(head_data);
+ this.visiteRecord();
+ },
+
+ /**
+ * 获取详情
+ */
+ getData: function (id) {
+ const token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_solitaire_detail',
+ id,
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let { head_data, soli_info, solitaire_target, solitaire_target_takemember, solitaire_target_takemoney, solitaire_target_type,solitaire_is_message } = res.data;
+
+ // 完成接龙差值
+ let {
+ soli_total_money, //一共下单金额
+ order_count //一共下多少单
+ } = soli_info;
+ let diffMoney = solitaire_target_takemoney * 1 - soli_total_money*1;
+ let diffMember = solitaire_target_takemember * 1 - order_count * 1;
+ that.setData({
+ community: head_data || '',
+ soli_info,
+ solitaire_target,
+ solitaire_target_takemember,
+ solitaire_target_takemoney,
+ solitaire_target_type,
+ diffMoney,
+ diffMember,
+ clearTime: false,
+ solitaire_is_message
+ })
+
+ if(that.isFirst==1) {
+ that.compareCommunity(head_data);
+ if(solitaire_is_message==1){
+ that.getCommentList()
+ }
+ setTimeout(() => {
+ that.drawImg(head_data, soli_info);
+ }, 1000);
+ token && that.visiteRecord();
+ }
+ that.isFirst++;
+ } else {
+ app.util.message(res.data.msg, 'redirect:/eaterplanet_ecommerce/moduleA/solitaire/index', 'error');
+ return;
+ }
+ }
+ })
+ },
+
+ showImgPrev: function (event) {
+ var idx = event ? event.currentTarget.dataset.idx : '';
+ let urls = this.data.soli_info.images_list || '';
+ wx.previewImage({
+ current: urls[idx],
+ urls
+ });
+ },
+
+ /**
+ * 比较社区
+ * shareCommunity: 这个接龙的所属社区
+ */
+ compareCommunity: function(shareCommunity) {
+ let that = this;
+ // 原来社区
+ let currentCommunity = wx.getStorageSync('community');
+ let currentCommunityId = currentCommunity.communityId || '';
+ const token = wx.getStorageSync('token');
+ let { groupInfo } = that.data;
+
+ let shareCommunityId = shareCommunity.head_id || '';
+ shareCommunityId && util.getCommunityById(shareCommunityId).then(res=>{
+ let { hide_community_change_btn, default_head_info } = res;
+ if (res.open_danhead_model == 1) {
+ // 开启单社区
+ app.globalData.community = default_head_info;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: default_head_info })
+ token && util.addhistory(default_head_info);
+ if(shareCommunityId!=default_head_info.communityId) {
+ let { groupInfo } = that.data;
+ console.log('开启单社区');
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, 'redirect:/eaterplanet_ecommerce/moduleA/solitaire/index', 'error', '知道了');
+ return;
+ }
+ } else {
+ // 社区是否存在
+ if (currentCommunityId != '' && shareCommunityId) {
+ // 存在并且不相同
+ console.log('currentCommunityId存在 比较社区')
+ if (currentCommunityId != shareCommunityId) {
+ console.log('currentCommunityId存在 社区不同')
+ //如果禁止切换
+ // if (hide_community_change_btn == 1) {
+ console.log('禁止切换');
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, 'redirect:/eaterplanet_ecommerce/moduleA/solitaire/index', 'error', '知道了');
+ return;
+ // }
+ // that.setData({
+ // hide_community_change_btn,
+ // showChangeCommunity: res.data ? true : false,
+ // changeCommunity: res.data,
+ // currentCommunity: currentCommunity
+ // })
+ }
+ } else {
+ // 不存在社区id
+ //token 是否存在
+ if (token) {
+ util.getCommunityInfo().then(function (ret) {
+ //比较社区
+ console.log('token存在 比较社区')
+ if (ret.community_id && ret.community_id != shareCommunityId) {
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, 'redirect:/eaterplanet_ecommerce/moduleA/solitaire/index', 'error', '知道了');
+ return;
+ // that.setData({
+ // showChangeCommunity: true,
+ // currentCommunity: ret
+ // })
+ }
+ }).catch((param) => {
+ console.log('step4 新人')
+ if (Object.keys(param) != '') util.addhistory(param, true);
+ });
+ } else {
+ console.log('token不存在 存社区')
+ // 直接存本地
+ app.globalData.community = res.data;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: res.data })
+ }
+ }
+ }
+ });
+ },
+
+ /**
+ * 切换提示
+ */
+ confrimChangeCommunity: function () {
+ let community = this.data.changeCommunity;
+ let token = wx.getStorageSync('token');
+ app.globalData.community = community;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({
+ key: "community",
+ data: community
+ })
+ token && util.addhistory(community);
+
+ this.setData({ showChangeCommunity: false })
+ console.log('用户点击确定')
+ },
+
+ /**
+ * 取消切换
+ */
+ cancelChangeCommunity: function () {
+ let { groupInfo } = this.data;
+ wx.showModal({
+ title: '提示',
+ content: `此接龙在您所属${groupInfo.group_name}不可参与`,
+ showCancel: false,
+ confirmColor: '#ff5041',
+ success(res) {
+ if (res.confirm) {
+ wx.switchTab({
+ url: `/eaterplanet_ecommerce/pages/index/index`
+ })
+ }
+ }
+ });
+ },
+
+ /**
+ * 商品弹窗
+ */
+ handleGoodsModal: function () {
+ this.setData({
+ showGoodsModal: !this.data.showGoodsModal
+ })
+ },
+
+ /**
+ * 评论弹窗
+ */
+ handleCommentModal: function () {
+ this.setData({
+ showCommentModal: !this.data.showCommentModal
+ })
+ },
+
+ changeCartNum: function(e){
+ let { goods_total_count, goods_id } = e.detail;
+ let soli_info = this.data.soli_info || '';
+ let goods_list = soli_info.goods_list || [];
+ let gidx = goods_list.findIndex(item => item.actId == goods_id);
+ if (gidx !== -1) {
+ this.showCartGoods().catch(()=>{
+ console.log('购物车为空')
+ });
+ goods_list[gidx].goods_total_count = goods_total_count || 0;
+ soli_info.goods_list = goods_list;
+ // let cartNum = 0;
+ // goods_list.forEach(item=>{
+ // cartNum += item.goods_total_count*1;
+ // })
+ this.setData({ soli_info })
+ }
+ },
+
+ /**
+ * 购物车弹窗
+ */
+ handleCartModal: function() {
+ console.log('购物车弹窗');
+ let that = this;
+ let showCartModal = this.data.showCartModal;
+ if (showCartModal){
+ this.setData({ showCartModal: false })
+ } else {
+ this.showCartGoods().then(()=>{
+ that.setData({ showCartModal: true })
+ }).catch(()=>{
+ console.log('购物车为空')
+ });
+ }
+ },
+
+ /**
+ * showModal
+ */
+ showCartGoods: function (showModal=true){
+ let that = this;
+ return new Promise(function (resolve, reject) {
+ const token = wx.getStorageSync('token');
+ let soli_id = that.soli_id || '';
+ let currentCommunity = wx.getStorageSync('community');
+ let community_id = currentCommunity.communityId || '';
+
+ soli_id && wx.showLoading(), app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'car.show_cart_goods',
+ token,
+ soli_id,
+ community_id,
+ buy_type: 'soitaire',
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let carts = res.data.carts;
+ if (Object.keys(carts).length == 0){
+ that.setData({ cartNum: 0 })
+ reject(res);
+ } else {
+ let { cartNum, totMoney } = that.countCartNum(carts);
+ showModal && that.setData({ carts, cartNum, totMoney })
+ resolve();
+ }
+ } else if(res.data.code == 5) {
+ that.setData({ needAuth: true, showAuthModal: true })
+ } else {
+ console.log(res)
+ }
+ }
+ })
+ })
+ },
+
+ /**
+ * 计算数量和金额
+ * @param {*} carts
+ */
+ countCartNum: function(carts){
+ let cartNum = 0;
+ let totMoney = 0;
+ Object.keys(carts).forEach(k=>{
+ Object.keys(carts[k].shopcarts).forEach(j=>{
+ let gnum = carts[k].shopcarts[j].goodsnum*1;
+ cartNum += gnum;
+ totMoney += carts[k].shopcarts[j].currntprice*gnum;
+ });
+ })
+ totMoney = totMoney.toFixed(2);
+ return { cartNum, totMoney };
+ },
+
+ /**
+ * 购物车改变
+ * 重新请求列表
+ */
+ changeCart: function(e){
+ let id = this.options && this.options.id || 0;
+ let carts = e.detail;
+ let { cartNum, totMoney } = this.countCartNum(carts);
+ id && this.setData({ clearTime: true, carts, cartNum, totMoney }), this.getData(id);
+ },
+
+ /**
+ * 留言
+ */
+ subComment: function (e) {
+ let { soli_info, pid } = this.data;
+ let soli_id = soli_info.id || '';
+ let content = e.detail.value.content || '';
+ if (content == '') {
+ wx.showToast({
+ title: '请输入内容',
+ icon: 'none'
+ })
+ return;
+ }
+ let that = this;
+ const token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.sub_solipost',
+ soli_id,
+ content,
+ pid,
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let { post_id, cur_time } = res.data;
+ let userInfo = wx.getStorageSync('userInfo');
+ let comment = {
+ id: post_id,
+ soli_id,
+ pid,
+ username: userInfo.nickName,
+ avatar: userInfo.avatarUrl,
+ content,
+ fav_count: 0,
+ addtime: cur_time,
+ reply: [],
+ is_agree: false
+ }
+ let list = that.data.list;
+ list.unshift(comment);
+
+ soli_info.comment_total = soli_info.comment_total*1 + 1;
+ that.setData({ soli_info, list, content: '', showCommentModal: false, noData: 0 })
+ app.util.message(res.data.msg || '留言成功', '', 'success');
+ } else {
+ app.util.message(res.data.msg || '留言失败', '', 'error');
+ }
+ }
+ })
+ },
+
+ /**
+ * 记录浏览次数
+ */
+ visiteRecord: function () {
+ let soli_id = this.soli_id || '';
+ const token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.send_visite_record',
+ soli_id,
+ token
+ },
+ dataType: 'json',
+ success: function (res) { }
+ })
+ },
+
+ /**
+ * 点赞
+ */
+ favComment: function (e) {
+ let that = this;
+ let soli_info = this.data.soli_info;
+ let soli_id = soli_info.id || '';
+ let post_id = e ? e.currentTarget.dataset.post_id : '';
+ let idx = e ? e.currentTarget.dataset.idx : 0;
+ const token = wx.getStorageSync('token');
+ post_id && app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.fav_soli_post',
+ soli_id,
+ post_id,
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ if (res.data.do == 1) {
+ // 点赞成功
+ let list = that.data.list;
+ list[idx].is_agree = true;
+ list[idx].fav_count = list[idx].fav_count * 1 + 1;
+ that.setData({ list })
+ } else {
+ // 取消成功
+ let list = that.data.list;
+ list[idx].is_agree = false;
+ list[idx].fav_count = list[idx].fav_count*1 - 1;
+ that.setData({ list })
+ }
+ } else if (res.data.code == 1) {
+ that.setData({ needAuth: true, showAuthModal: true })
+ } else {
+ wx.showToast({
+ title: res.data.msg || '点赞失败',
+ icon: 'none'
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 更多商品显示隐藏
+ */
+ handleMoreGoods: function(){
+ this.setData({ hideGoods: !this.data.hideGoods })
+ },
+
+ goPlaceOrder: function(){
+ let soli_info = this.data.soli_info;
+ // if (soli_info.is_involved) return;
+ this.showCartGoods(false).then(()=>{
+ let soli_id = soli_info.id || '';
+ let url = `/eaterplanet_ecommerce/pages/order/placeOrder?type=soitaire&soli_id=${soli_id}`;
+ wx.navigateTo({ url })
+ }).catch(()=>{
+ wx.showToast({
+ title: '请先选择商品!',
+ icon: 'none'
+ })
+ });
+ },
+
+ /**
+ * 获取评论列表
+ */
+ getCommentList: function () {
+ let that = this;
+ let id = this.options && this.options.id || 0;
+ const token = wx.getStorageSync('token');
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_comment_list',
+ page: this.page,
+ token,
+ id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 20) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({
+ list,
+ ...h
+ })
+ } else if (res.data.code == 1) {
+ // 无数据
+ if (that.page == 1) that.setData({
+ noData: 1
+ })
+ that.setData({
+ loadMore: false,
+ noMore: false,
+ loadText: "没有更多记录了~"
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 用户订单列表
+ */
+ getMyOrderList: function () {
+ console.log('getMyOrderList');
+ let that = this;
+ let soli_id = this.options && this.options.id || 0;
+ const token = wx.getStorageSync('token');
+ token && wx.showLoading(), app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'order.orderlist',
+ page: this.myOrderPage,
+ token,
+ soli_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 6) h.noMyOrderMore = true;
+ let oldList = that.data.myOrderList;
+ list = oldList.concat(list);
+ that.myOrderPage++;
+ that.setData({
+ myOrderList: list,
+ ...h
+ })
+ } else if (res.data.code == 1) {
+ // 无数据
+ let h = { noMyOrderMore: true };
+ if (that.myOrderPage == 1) h.noMyOrderData = 1;
+ that.setData(h)
+ }
+ }
+ })
+ },
+
+ getMoreMyOrder: function(){
+ this.data.noMyOrderMore || this.getMyOrderList();
+ },
+
+ //取消订单
+ cancelOrder: function(e){
+ let that = this;
+ this.canCancel && wx.showModal({
+ title: '取消订单并退款',
+ content: '取消订单后,款项将原路退回到您的支付账户;详情请查看退款进度。',
+ confirmText: '取消订单',
+ confirmColor: '#ff5344',
+ cancelText: '再等等',
+ cancelColor: '#666666',
+ success(res) {
+ if (res.confirm) {
+ that.canCancel = false;
+ let order_id = e.currentTarget.dataset.type;
+ let idx = e.currentTarget.dataset.index;
+ let token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'order.del_cancle_order',
+ token,
+ order_id
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function (res) {
+ if(res.data.code==0){
+ //提交成功
+ wx.showModal({
+ title: '提示',
+ content: '取消订单成功',
+ showCancel: false,
+ confirmColor: '#ff5344',
+ success(ret) {
+ if(ret.confirm) {
+ let myOrderList = that.data.myOrderList;
+ myOrderList[idx].order_status_id = 5;
+ that.setData({ myOrderList })
+ }
+ }
+ })
+ } else {
+ that.canCancel = true;
+ wx.showToast({
+ title: res.data.msg || '取消订单失败',
+ icon: 'none'
+ })
+ }
+ }
+ })
+ console.log('用户点击确定')
+ } else if (res.cancel) {
+ that.canCancel = true;
+ console.log('用户点击取消')
+ }
+ }
+ })
+ },
+
+ callTelphone: function(event) {
+ let phoneNumber = event.currentTarget.dataset.phone;
+ wx.makePhoneCall({ phoneNumber })
+ },
+
+ /**
+ * 获取评论列表
+ */
+ getOrderList: function () {
+ let that = this;
+ let id = this.options && this.options.id || 0;
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_soli_order_list',
+ page: this.orderPage,
+ id,
+ size: 6
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 6) h.noOrderMore = true;
+ let oldList = that.data.orderList;
+ let orderList = oldList.concat(list);
+ that.orderPage++;
+ that.setData({
+ orderList,
+ ...h
+ })
+ } else if (res.data.code == 1) {
+ // 无数据
+ let h = {};
+ if (that.orderPage == 1) h.noOrderData = 1;
+ that.setData({
+ noOrderMore: true,
+ ...h
+ })
+ }
+ }
+ })
+ },
+
+ getMoreOrder: function(){
+ this.data.noOrderMore || this.getOrderList();
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (!this.data.loadMore||this.data.solitaire_is_message==0) return false;
+ this.getCommentList();
+ },
+
+ drawImg: function (head, soli_info) {
+ let images_list = soli_info.images_list;
+ let qrcode_image = soli_info.qrcode_image;
+ let content = soli_info.content.replace(/<[^>]+>|&[^>]+;/g, "").trim();
+ content = content.replace(/<\/?.+?>/g, "");
+ content = content.replace(/ /g, "");
+ let option = [];
+ let h = 300
+ if (images_list.length) {
+ option.push({
+ "type": "image",
+ "url": images_list[0],
+ "css":
+ {
+ "width": "442px",
+ "height": "300px",
+ "top": "230px",
+ "left": "36px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "",
+ "shadow": "",
+ "mode": "aspectFill"
+ }
+ })
+ h = 0;
+ }
+
+ this.setData({
+ template: {
+ "width": "514px",
+ "height": (710-h) + "px",
+ "background": "#fff",
+ "views": [
+ {
+ "type": "image",
+ "url": head.avatar,
+ "css":
+ {
+ "width": "46px",
+ "height": "46px",
+ "top": "25px",
+ "left": "36px",
+ "rotate": "0",
+ "borderRadius": "3px",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "mode": "scaleToFill"
+ }
+ },
+ {
+ "type": "text",
+ "text": head.head_name,
+ "css":
+ {
+ "color": "#000000",
+ "background": "",
+ "width": "385px",
+ "height": "20px",
+ "top": "30px",
+ "left": "96px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "14px",
+ "fontWeight": "bold",
+ "maxLines": "1",
+ "lineHeight": "20px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": head.community_name,
+ "css":
+ {
+ "color": "#999999",
+ "background": "",
+ "width": "385px",
+ "height": "17px",
+ "top": "52px",
+ "left": "96px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "12px",
+ "fontWeight": "normal",
+ "maxLines": "1",
+ "lineHeight": "17px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": content,
+ "css":
+ {
+ "color": "#666666",
+ "background": "",
+ "width": "442px",
+ "height": "52px",
+ "top": "158px",
+ "left": "36px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "18px",
+ "fontWeight": "normal",
+ "maxLines": "2",
+ "lineHeight": "26px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": soli_info.solitaire_name,
+ "css":
+ {
+ "color": "#000000",
+ "background": "",
+ "width": "442px",
+ "height": "43px",
+ "top": "95px",
+ "left": "36px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "30px",
+ "fontWeight": "normal",
+ "maxLines": "1",
+ "lineHeight": "43px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": "一群人正在赶来接龙",
+ "css":
+ {
+ "color": "#999999",
+ "background": "",
+ "width": "442px",
+ "height": "23px",
+ "top": (595-h) + "px",
+ "left": "204px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "16px",
+ "fontWeight": "normal",
+ "maxLines": "2",
+ "lineHeight": "23px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": "长按识别或扫码参与",
+ "css":
+ {
+ "color": "#999999",
+ "background": "",
+ "width": "442px",
+ "height": "22.88px",
+ "top": (630-h) + "px",
+ "left": "204px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "16px",
+ "fontWeight": "normal",
+ "maxLines": "2",
+ "lineHeight": "23px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "image",
+ "url": qrcode_image,
+ "css":
+ {
+ "width": "120px",
+ "height": "120px",
+ "top": (560-h) + "px",
+ "left": "356px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "mode": "scaleToFill"
+ }
+ },
+ ...option
+ ]
+ }
+ });
+ },
+
+ onImgOK(e) {
+ this.imagePath = e.detail.path;
+ this.setData({
+ image: this.imagePath
+ })
+ },
+
+ saveImage() {
+ let that = this;
+ wx.saveImageToPhotosAlbum({
+ filePath: this.imagePath,
+ success(res) {
+ that.setData({ showShareModal: false })
+ wx.showToast({
+ title: '保存成功!'
+ })
+ },
+ fail(res) {
+ wx.showToast({
+ title: '保存失败,请重试!',
+ icon: 'none'
+ })
+ }
+ });
+ },
+
+ handleShareModal: function (e) {
+ let type = e ? e.currentTarget.dataset.type : '';
+ let h = {};
+ if(type=='order') {
+ h.showOrderModal = !this.data.showOrderModal
+ } else {
+ h.showShareModal = !this.data.showShareModal
+ this.data.showShareModal || wx.showLoading({ title: '生成中' })
+ }
+ if(!this.data.showShareModal){
+ setTimeout(() => {
+ wx.hideLoading()
+ this.setData(h)
+ }, 1000)
+ } else {
+ this.setData(h)
+ }
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ let share_id = wx.getStorageSync('member_id') || '';
+ let soli_info = this.data.soli_info || '';
+ let title = (soli_info&&soli_info.solitaire_name) || '';
+ let id = soli_info&&soli_info.id || '';
+ let share_path = `eaterplanet_ecommerce/moduleA/solitaire/details?id=${id}&share_id=${share_id}`;
+ console.log(share_path)
+ return {
+ title,
+ path: share_path,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function () {
+ let share_id = wx.getStorageSync('member_id') || '';
+ let soli_info = this.data.soli_info || '';
+ let title = (soli_info&&soli_info.solitaire_name) || '';
+ let id = soli_info&&soli_info.id || '';
+
+ var query= `id=${id}&share_id=${share_id}`;
+ return {
+ title,
+ query,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/details.json b/eaterplanet_ecommerce/moduleA/solitaire/details.json
new file mode 100644
index 0000000..89fa700
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/details.json
@@ -0,0 +1,18 @@
+{
+ "navigationBarTitleText": "接龙详情",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-solitaire-good": "../components/solitaireGood",
+ "i-solitaire-head": "../components/solitaireHead",
+ "i-count-down": "../../components/count-down/index",
+ "i-cart-modal": "../components/cartModal",
+ "i-sku": "../../components/sku/index",
+ "i-modal": "../../components/modal/index",
+ "i-painter": "../../components/painter/painter",
+ "i-load-more": "../../components/load-more/index",
+ "i-change-community": "../../components/changeCommunity/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/details.wxml b/eaterplanet_ecommerce/moduleA/solitaire/details.wxml
new file mode 100644
index 0000000..98d5aec
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/details.wxml
@@ -0,0 +1,288 @@
+
+
+
+
+ {{soli_info.solitaire_name}}
+
+
+
+ 接龙时间:{{soli_info.begin_time_str}}~{{soli_info.end_time_str}}
+
+
+
+
+
+ 商品信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 还有{{soli_info.goods_list.length-6}}{{goods_sale_unit}}商品,点击展开
+
+
+ 点击收缩
+
+
+
+
+
+ 活动统计
+
+
+ {{soli_info.invite_count|0}}
+ 浏览(次)
+
+
+ {{soli_info.order_count|0}}
+ 参与接龙(次)
+
+
+ {{soli_info.soli_total_money|0}}
+ 接龙金额(元)
+
+
+
+
+
+
+
+
+ 预计接龙完成还差{{diffMember}}人,分享邀请尽快完成目标!
+
+ 已完成目标人数
+
+
+
+ 还差{{diffMoney}}元订单金额完成接龙,分享邀请尽快完成目标
+
+ 已完成目标金额
+
+
+
+ 开始倒计时:
+
+
+ 接龙未开始
+
+
+
+ 接龙倒计时:
+
+
+
+ 已结束
+ 接龙规则
+
+
+ 已结束
+
+
+
+
+
+ 我的订单
+
+
+
+
+
+
+
+
+ {{goods.name}}
+ ¥{{goods.price}}
+
+
+
+
+
+
+
+ 提货人
+ {{item.shipping_name}} {{item.shipping_tel}}
+
+
+ 收货地址
+ {{item.shipping_address}}
+
+
+ {{groupInfo.owner_name}}信息
+
+ {{item.ziti_name}}
+
+
+ 联系{{groupInfo.owner_name}}
+
+
+
+
+
+ 取消订单
+ 已取消接龙
+ 已签收
+ 已退款
+ 等待退款
+ 交易完成
+ 售后中
+
+ 订单详情
+
+
+
+
+ 点击加载更多
+
+
+
+
+
+
+ 接龙记录
+
+
+
+
+
+ {{item.username}}
+ {{item.addtime}}
+
+
+
+
+
+
+ {{goods.name}}
+ ¥{{goods.price}}
+
+
+
+
+
+
+ 点击加载更多
+
+
+
+
+
+
+
+
+
+
+
+
+ 接龙留言
+
+
+
+
+
+
+ {{item.username}}
+ {{item.addtime}}
+
+
+ {{item.fav_count}}
+
+
+ {{item.content}}
+
+ {{community.head_name}}:{{item.reply[0].content}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{cartNum}}
+
+
+
+
+ ¥{{totMoney||0}}
+
+ 即将开始
+ 立即接龙
+ 已结束
+
+ 已结束
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存图片
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/details.wxss b/eaterplanet_ecommerce/moduleA/solitaire/details.wxss
new file mode 100644
index 0000000..924d2a3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/details.wxss
@@ -0,0 +1,117 @@
+@import './groupDetails.wxss';
+
+.rule {
+ text-decoration: underline;
+}
+
+.more .iconfont {
+ transition: 200ms all ease-in;
+}
+
+.more .iconfont.rotate {
+ display: inline-block;
+ transform: rotate(180deg);
+}
+
+.fixed-bar {
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 800;
+ height: 100rpx;
+}
+
+.fixed-bar-bg {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ top: 0;
+ background: linear-gradient(45deg, #474442 0%, #3f2a1c 50%, #4a3721 100%);
+ overflow: hidden;
+ z-index: 800;
+}
+
+.fixed-bar-bg::after{
+ content: "";
+ width:100%;
+ height:100%;
+ position: absolute;
+ left:0;
+ top:0;
+ background: inherit;
+ filter: blur(20px);
+ z-index: 801;
+}
+
+.cartBtn {
+ position: relative;
+ margin: -30rpx 30rpx 0;
+ width: 110rpx;
+ height: 110rpx;
+ line-height: 110rpx;
+ text-align: center;
+ border-radius: 50%;
+ background: linear-gradient(45deg, #fdd225 0%, #feb600 100%);
+}
+
+.cartBtn.disable {
+ background: rgb(70, 69, 69);
+ color: #ccc;
+}
+
+.cartBtn .iconfont {
+ font-size: 60rpx;
+}
+
+.cartBtn .num {
+ color: #fff;
+ background-color: #ff5041;
+ position: absolute;
+ top: -10rpx;
+ right: -10rpx;
+ min-width: 44rpx;
+ height: 44rpx;
+ line-height: 44rpx;
+ border-radius: 44rpx;
+ text-align: center;
+ font-size: 24rpx;
+}
+
+.fixed-bar-sub {
+ background: linear-gradient(270deg, #f9c706 0%, #feb600 100%);
+ padding: 0 40rpx;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+
+.fixed-bar-sub.disable {
+ background: rgba(103, 103, 103, 0.4);
+ color: #7f8285;
+}
+
+.order-goods-item {
+ width: 160rpx;
+ margin-right: 20rpx;
+}
+
+.order-goods-item .img {
+ width: 160rpx;
+ height: 160rpx;
+}
+
+.phone {
+ margin-left: 20rpx;
+ padding: 0 20rpx;
+ height: 44rpx;
+ display: flex;
+ align-items: center;
+ border: 0.1rpx solid #efefef;
+ border-radius: 26rpx;
+}
+
+.phone .icon-phone {
+ width: 20rpx;
+ height: 20rpx;
+ margin-right: 10rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.js b/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.js
new file mode 100644
index 0000000..808982c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.js
@@ -0,0 +1,790 @@
+// 团长接龙详情
+var app = getApp();
+var status = require('../../utils/index.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ showGoodsModal: false,
+ showCommentModal: false,
+ pid: 0,
+ showShareModal: false,
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ orderList: [],
+ noOrderMore: false,
+ noOrderData: 0,
+ solitaire_is_message: 0
+ },
+ imagePath: '',
+ options: '',
+ page: 1,
+ orderPage: 1,
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ status.setNavBgColor();
+ this.options = options;
+ let id = options.id || 0;
+ if(!id) {
+ app.util.message('参数错误', 'redirect:/eaterplanet_ecommerce/moduleA/solitaire/groupIndex', 'error');
+ }
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ initFn() {
+ let that = this;
+ let id = this.options && this.options.id || 0;
+ this.page = 1;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true
+ }, () => {
+ id && that.getData(id);
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let id = this.options && this.options.id || 0;
+ id && this.getData(id), this.getOrderList();
+ },
+
+ onHide: function () {
+ this.setData({ clearTime: true })
+ },
+
+ /**
+ * 获取详情
+ */
+ getData: function (id) {
+ const token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_solitaire_detail',
+ id,
+ token,
+ is_head: 1
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let { head_data, soli_info, solitaire_target, solitaire_target_takemember, solitaire_target_takemoney, solitaire_target_type,solitaire_is_message } = res.data;
+ // 完成接龙差值
+ let {
+ soli_total_money, //一共下单金额
+ order_count //一共下多少单
+ } = soli_info;
+ let diffMoney = solitaire_target_takemoney * 1 - soli_total_money * 1;
+ let diffMember = solitaire_target_takemember * 1 - order_count * 1;
+
+ that.setData({
+ community: head_data || '',
+ soli_info,
+ solitaire_target,
+ solitaire_target_takemember,
+ solitaire_target_takemoney,
+ solitaire_target_type,
+ diffMoney,
+ diffMember,
+ clearTime: false,
+ solitaire_is_message
+ }, ()=>{
+ that.drawImg(head_data, soli_info);
+ })
+ if(solitaire_is_message==1){
+ that.getCommentList()
+ }
+ } else if (res.data.code == 2) {
+ app.util.message('您还未登录', 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ } else {
+ app.util.message(res.data.msg, 'redirect:/eaterplanet_ecommerce/moduleA/solitaire/groupIndex', 'error');
+ return;
+ }
+ }
+ })
+ },
+
+ showImgPrev: function (event){
+ var idx = event ? event.currentTarget.dataset.idx : '';
+ let urls = this.data.soli_info.images_list || [];
+ wx.previewImage({
+ current: urls[idx],
+ urls
+ });
+ },
+
+ /**
+ * 商品弹窗
+ */
+ handleGoodsModal: function(){
+ this.setData({
+ showGoodsModal: !this.data.showGoodsModal
+ })
+ },
+
+ /**
+ * 评论弹窗
+ */
+ handleCommentModal: function () {
+ this.setData({
+ showCommentModal: !this.data.showCommentModal,
+ pid: 0
+ })
+ },
+
+ /**
+ * 留言
+ */
+ subComment: function (e) {
+ let { soli_info, pid } = this.data;
+ let soli_id = soli_info.id || '';
+ let content = e.detail.value.content || '';
+ if (content == '') {
+ wx.showToast({
+ title: '请输入内容',
+ icon: 'none'
+ })
+ return;
+ }
+ let that = this;
+ const token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.sub_solipost',
+ soli_id,
+ content,
+ pid,
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let { post_id, cur_time } = res.data;
+ let userInfo = wx.getStorageSync('userInfo');
+ let list = that.data.list;
+
+ if (pid!=0) {
+ let comment = {
+ id: post_id,
+ pid,
+ username: userInfo.nickName,
+ content
+ }
+ let idx = list.findIndex(item => item.id == pid);
+ if (idx !== -1) {
+ list[idx].reply.push(comment);
+ }
+ } else {
+ let comment = {
+ id: post_id,
+ soli_id,
+ pid,
+ username: userInfo.nickName,
+ avatar: userInfo.avatarUrl,
+ content,
+ fav_count: 0,
+ addtime: cur_time,
+ reply: [],
+ is_agree: false
+ }
+ list.unshift(comment);
+ }
+
+ soli_info.comment_total = soli_info.comment_total * 1 + 1;
+ that.setData({ soli_info, list, content: '', showCommentModal: false, noData: 0 })
+ app.util.message(res.data.msg || '留言成功', '', 'success');
+ } else {
+ app.util.message(res.data.msg || '留言失败', '', 'error');
+ }
+ }
+ })
+ },
+
+ /**
+ * 回复留言
+ */
+ replyComment: function(e){
+ let pid = e.currentTarget.dataset.id || '';
+ this.setData({
+ showCommentModal: !this.data.showCommentModal,
+ pid
+ })
+ },
+
+ /**
+ * 删除留言
+ */
+ deleteComment: function(e){
+ let that = this;
+ let id = e.currentTarget.dataset.id || '';
+ let idx = e.currentTarget.dataset.idx || '';
+ id && wx.showModal({
+ title: '操作提示',
+ content: '确认删除此留言?',
+ confirmColor: '#ff5041',
+ success(res) {
+ if (res.confirm) {
+ wx.showLoading({ title: '删除中...' })
+ const token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.delete_comment',
+ id,
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let { list, soli_info } = that.data;
+ list.splice(idx, 1);
+ let noData = false;
+ if (list.length==0) noData = true;
+
+ soli_info.comment_total = soli_info.comment_total * 1 - 1;
+ that.setData({ list, soli_info, noData });
+ wx.showToast({
+ title: res.data.msg || '删除成功',
+ icon: 'none'
+ })
+ } else if (res.data.code == 2) {
+ app.util.message('您还未登录', 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ } else {
+ app.util.message(res.data.msg || '删除失败', '', 'error');
+ }
+ }
+ })
+ }
+ }
+ });
+ },
+
+ /**
+ * 点赞
+ */
+ favComment: function (e) {
+ let that = this;
+ let soli_info = this.data.soli_info;
+ let soli_id = soli_info.id || '';
+ let post_id = e ? e.currentTarget.dataset.post_id : '';
+ let idx = e ? e.currentTarget.dataset.idx : 0;
+ const token = wx.getStorageSync('token');
+ post_id && app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.fav_soli_post',
+ soli_id,
+ post_id,
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ if (res.data.do == 1) {
+ // 点赞成功
+ let list = that.data.list;
+ list[idx].is_agree = true;
+ list[idx].fav_count = list[idx].fav_count * 1 + 1;
+ that.setData({ list })
+ } else {
+ // 取消成功
+ let list = that.data.list;
+ list[idx].is_agree = false;
+ list[idx].fav_count = list[idx].fav_count * 1 - 1;
+ that.setData({ list })
+ }
+ } else if (res.data.code == 1) {
+ that.setData({ needAuth: true, showAuthModal: true })
+ } else {
+ wx.showToast({
+ title: res.data.msg || '点赞失败',
+ icon: 'none'
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 结束接龙
+ */
+ endSolitaire: function (e) {
+ let that = this;
+ let soli_info = that.data.soli_info;
+ let id = soli_info.id;
+ id && wx.showModal({
+ title: '操作提示',
+ content: '确认终止此接龙吗?',
+ confirmColor: '#ff5041',
+ success(res) {
+ if (res.confirm) {
+ wx.showLoading({ title: '提交中...' })
+ const token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.end_solitaire',
+ id,
+ token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ soli_info.end = 1;
+ that.setData({ soli_info });
+ wx.showToast({
+ title: res.data.msg || '接龙已终止',
+ icon: 'none'
+ })
+ } else if (res.data.code == 2) {
+ app.util.message('您还未登录', 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ } else {
+ app.util.message(res.data.msg || '操作失败', '', 'error');
+ }
+ }
+ })
+ }
+ }
+ });
+ },
+
+ drawImg: function (head, soli_info) {
+ let images_list = soli_info.images_list;
+ let qrcode_image = soli_info.qrcode_image;
+ let content = soli_info.content.replace(/<[^>]+>|&[^>]+;/g, "").trim();
+ content = content.replace(/<\/?.+?>/g, "");
+ content = content.replace(/ /g, "");
+ let option = [];
+ let h = 300
+ if (images_list.length) {
+ option.push({
+ "type": "image",
+ "url": images_list[0],
+ "css":
+ {
+ "width": "442px",
+ "height": "300px",
+ "top": "230px",
+ "left": "36px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "",
+ "shadow": "",
+ "mode": "scaleToFill"
+ }
+ })
+ h = 0;
+ }
+
+ this.setData({
+ template: {
+ "width": "514px",
+ "height": (710 - h) + "px",
+ "background": "#fff",
+ "views": [
+ {
+ "type": "image",
+ "url": head.avatar,
+ "css":
+ {
+ "width": "46px",
+ "height": "46px",
+ "top": "25px",
+ "left": "36px",
+ "rotate": "0",
+ "borderRadius": "3px",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "mode": "scaleToFill"
+ }
+ },
+ {
+ "type": "text",
+ "text": head.head_name,
+ "css":
+ {
+ "color": "#000000",
+ "background": "",
+ "width": "385px",
+ "height": "20.02px",
+ "top": "30px",
+ "left": "96px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "14px",
+ "fontWeight": "bold",
+ "maxLines": "1",
+ "lineHeight": "20.202000000000005px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": head.community_name,
+ "css":
+ {
+ "color": "#999999",
+ "background": "",
+ "width": "385px",
+ "height": "17.16px",
+ "top": "52px",
+ "left": "96px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "12px",
+ "fontWeight": "normal",
+ "maxLines": "1",
+ "lineHeight": "17.316000000000003px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": content,
+ "css":
+ {
+ "color": "#666666",
+ "background": "",
+ "width": "442px",
+ "height": "52.181999999999995px",
+ "top": "158px",
+ "left": "36px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "18px",
+ "fontWeight": "normal",
+ "maxLines": "2",
+ "lineHeight": "25.974000000000004px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": soli_info.solitaire_name,
+ "css":
+ {
+ "color": "#000000",
+ "background": "",
+ "width": "442px",
+ "height": "42.89999999999999px",
+ "top": "95px",
+ "left": "36px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "30px",
+ "fontWeight": "normal",
+ "maxLines": "1",
+ "lineHeight": "43.290000000000006px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": "一群人正在赶来接龙",
+ "css":
+ {
+ "color": "#999999",
+ "background": "",
+ "width": "442px",
+ "height": "22.88px",
+ "top": (595 - h) + "px",
+ "left": "204px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "16px",
+ "fontWeight": "normal",
+ "maxLines": "2",
+ "lineHeight": "23.088000000000005px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "text",
+ "text": "长按识别或扫码参与",
+ "css":
+ {
+ "color": "#999999",
+ "background": "",
+ "width": "442px",
+ "height": "22.88px",
+ "top": (630 - h) + "px",
+ "left": "204px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "padding": "0px",
+ "fontSize": "16px",
+ "fontWeight": "normal",
+ "maxLines": "2",
+ "lineHeight": "23.088000000000005px",
+ "textStyle": "fill",
+ "textDecoration": "none",
+ "fontFamily": "",
+ "textAlign": "left"
+ }
+ },
+ {
+ "type": "image",
+ "url": qrcode_image,
+ "css":
+ {
+ "width": "120px",
+ "height": "120px",
+ "top": (560 - h) + "px",
+ "left": "356px",
+ "rotate": "0",
+ "borderRadius": "",
+ "borderWidth": "",
+ "borderColor": "#000000",
+ "shadow": "",
+ "mode": "scaleToFill"
+ }
+ },
+ ...option
+ ]
+ }
+ });
+ },
+
+ onImgOK(e) {
+ this.imagePath = e.detail.path;
+ this.setData({
+ image: this.imagePath
+ })
+ },
+
+ saveImage() {
+ let that = this;
+ wx.saveImageToPhotosAlbum({
+ filePath: this.imagePath,
+ success(res) {
+ that.setData({ showShareModal: false })
+ wx.showToast({
+ title: '保存成功!'
+ })
+ },
+ fail(res) {
+ wx.showToast({
+ title: '保存失败,请重试!',
+ icon: 'none'
+ })
+ }
+ });
+ },
+
+ handleShareModal: function () {
+ this.setData({
+ showShareModal: !this.data.showShareModal
+ })
+ },
+
+ handleGoodsModal: function(e){
+ if (this.data.showGoodsModal){
+ this.setData({
+ showGoodsModal: false,
+ goodsModalList: []
+ })
+ } else {
+ let idx = e ? e.currentTarget.dataset.idx : '';
+ let orderList = this.data.orderList;
+ let goodsModalList = orderList[idx].goodslist || [];
+ this.setData({
+ showGoodsModal: true,
+ goodsModalList
+ })
+ }
+ },
+
+ /**
+ * 获取评论列表
+ */
+ getCommentList: function () {
+ let that = this;
+ let id = this.options && this.options.id || 0;
+ const token = wx.getStorageSync('token');
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_comment_list',
+ page: this.page,
+ token,
+ id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 20) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({
+ list,
+ ...h
+ })
+ } else if (res.data.code == 1) {
+ // 无数据
+ if (that.page == 1) that.setData({
+ noData: 1
+ })
+ that.setData({
+ loadMore: false,
+ noMore: false,
+ loadText: "没有更多记录了~"
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (!this.data.loadMore||this.data.solitaire_is_message==0) return false;
+ this.getCommentList();
+ },
+
+ /**
+ * 获取评论列表
+ */
+ getOrderList: function () {
+ let that = this;
+ let id = this.options && this.options.id || 0;
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_soli_order_list',
+ page: this.orderPage,
+ id,
+ size: 5
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 5) h.noOrderMore = true;
+ let oldList = that.data.orderList;
+ let orderList = oldList.concat(list);
+ that.orderPage++;
+ that.setData({
+ orderList,
+ ...h
+ })
+ } else if (res.data.code == 1) {
+ // 无数据
+ let h = {};
+ if (that.orderPage == 1) h.noOrderData = 1;
+ that.setData({
+ noOrderMore: true,
+ ...h
+ })
+ }
+ }
+ })
+ },
+
+ getMoreOrder: function(){
+ this.data.noOrderMore || this.getOrderList();
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ let share_id = wx.getStorageSync('member_id') || '';
+ let soli_info = this.data.soli_info || '';
+ let title = soli_info.solitaire_name || '';
+ let share_path = `eaterplanet_ecommerce/moduleA/solitaire/details?id=${soli_info.id}&share_id=${share_id}`;
+ return {
+ title,
+ path: share_path,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.json b/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.json
new file mode 100644
index 0000000..bd8d24f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.json
@@ -0,0 +1,14 @@
+{
+ "navigationBarTitleText": "接龙详情",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-solitaire-good": "../components/solitaireGood",
+ "i-solitaire-head": "../components/solitaireHead",
+ "i-count-down": "../../components/count-down/index",
+ "i-painter": "../../components/painter/painter",
+ "i-modal": "../../components/modal/index",
+ "i-load-more": "../../components/load-more/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.wxml b/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.wxml
new file mode 100644
index 0000000..2ec49ad
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.wxml
@@ -0,0 +1,175 @@
+
+
+
+
+ {{soli_info.solitaire_name}}
+
+
+
+ 接龙时间:{{soli_info.begin_time_str}}~{{soli_info.end_time_str}}
+
+
+
+
+
+ 商品信息
+
+
+
+
+
+
+
+ 活动统计
+
+
+ {{soli_info.invite_count|0}}
+ 浏览(人)
+
+
+ {{soli_info.order_count|0}}
+ 参与接龙(人)
+
+
+ {{soli_info.soli_total_money|0}}
+ 接龙金额(元)
+
+
+
+
+ 接龙记录
+
+
+
+
+ {{item.username}}
+ {{item.addtime}}
+
+
+
+
+
+ 共{{item.goodsnum}}件
+
+
+ 查看更多订单信息
+
+
+
+
+
+
+
+
+
+
+
+ 预计接龙完成还差{{diffMember}}人,分享邀请尽快完成目标!
+
+ 已完成目标人数
+
+
+
+ 还差{{diffMoney}}元订单金额完成接龙,分享邀请尽快完成目标
+
+ 已完成目标金额
+
+
+
+ 开始倒计时:
+
+
+ 接龙未开始
+
+
+
+ 接龙倒计时:
+
+
+ 已结束
+ 终止活动
+
+
+ 已结束
+
+
+
+
+
+
+
+ 接龙留言
+
+
+
+
+
+
+ {{item.username}}
+ {{item.addtime}}
+
+
+ {{item.fav_count}}
+
+
+ {{item.content}}
+
+ 删除
+ 回复
+
+
+ {{community.head_name}}:{{item.reply[0].content}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存图片
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.wxss b/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.wxss
new file mode 100644
index 0000000..f7b0010
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/groupDetails.wxss
@@ -0,0 +1,169 @@
+.img-list .img-item {
+ width: 155rpx;
+ height: 155rpx;
+ margin-left: 24rpx;
+ margin-bottom: 24rpx;
+}
+
+.img-list .img-item:nth-child(4n+1) {
+ margin-left: 0;
+}
+
+.three {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 50rpx 0;
+}
+
+.three-item {
+ position: relative;
+ flex: 1;
+ text-align: center;
+}
+
+.three-item::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 1rpx;
+ border-left: 1rpx solid #cfcfcf;
+}
+
+.three-item:first-child::before {
+ content: none;
+}
+
+.three-title {
+ color: #999;
+ font-size: 24rpx;
+}
+
+.three-money {
+ margin-bottom: 15rpx;
+ font-size: 34rpx;
+ font-weight: bold;
+}
+
+.order .avatar {
+ width: 60rpx;
+ height: 60rpx;
+ border-radius: 50%;
+ margin-right: 20rpx;
+}
+
+.order-goods {
+ margin: 30rpx 0 0;
+}
+
+.order-goods-img {
+ width: 100rpx;
+ height: 100rpx;
+ margin-right: 18rpx;
+ border-radius: 50%;
+}
+
+.more {
+ line-height: 100rpx;
+}
+
+.order .item {
+ margin: 0 30rpx;
+ padding: 30rpx 0;
+}
+
+.btn {
+ background: linear-gradient(270deg, #f9c706 0%, #feb600 100%);
+ border-radius: 10rpx;
+ padding: 20rpx 0;
+}
+
+.end-btn {
+ display: inline-block;
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ border-radius: 10rpx;
+ padding: 15rpx 0;
+ width: 40%;
+ margin: 0 auto;
+}
+
+.comment {
+ border: 1rpx solid #e5e5e5;
+ line-height: 64rpx;
+ border-radius: 32rpx;
+}
+
+.msg .avatar {
+ width: 80rpx;
+ height: 80rpx;
+}
+
+.handled {
+ margin-left: 30rpx;
+}
+
+.goods-modal {
+ width: 90%;
+ overflow: hidden;
+}
+
+.goods-modal-body {
+ max-height: 80vh;
+}
+
+.modal-close {
+ padding: 20rpx 0;
+}
+
+.modal-close .iconfont {
+ color: #fff;
+ font-size: 60rpx;
+}
+
+.textarea {
+ border: 1rpx solid #e5e5e5;
+ width: 100%;
+ box-sizing: border-box;
+ padding: 15rpx;
+ border-radius: 10rpx;
+}
+
+.send {
+ padding: 8rpx 15rpx;
+ border-radius: 6rpx;
+ line-height: initial;
+ font-size: 24rpx;
+}
+
+.send::after {
+ content: none;
+}
+
+.shareModal-box {
+ background: transparent!important;
+ left: 115rpx!important;
+ right: 115rpx!important;
+ bottom: initial!important;
+ top: 50%;
+ transform: translateY(-50%)!important;
+ width: 520rpx!important;
+}
+
+.shareModal {
+ width: 520rpx;
+}
+
+.shareBtn {
+ line-height: 84rpx;
+}
+
+.item-time {
+ color: #fff;
+ background-color: #333;
+ font-size: 20rpx;
+ padding: 2rpx 4rpx;
+ border-radius: 5rpx;
+ width: 28rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.js b/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.js
new file mode 100644
index 0000000..295beaf
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.js
@@ -0,0 +1,132 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ keyword: ""
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 获取列表
+ */
+ getData: function () {
+ let that= this;
+ wx.showLoading();
+ const token = wx.getStorageSync('token');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_head_solitairelist',
+ token: token,
+ page: this.page,
+ keyword: this.data.keyword
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 20) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list, ...h })
+ } else if (res.data.code == 1) {
+ // 无数据
+ if (that.page == 1) that.setData({ noData: 1 })
+ that.setData({ loadMore: false, noMore: false, loadText: "没有更多记录了~" })
+ } else if (res.data.code == 2) {
+ app.util.message('您还未登录', 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ } else {
+ app.util.message(res.data.msg, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ }
+ }
+ })
+ },
+
+ goResult: function (e){
+ let keyword = e.detail.value || '', that = this;
+ this.page = 1;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ keyword
+ }, ()=>{
+ that.getData();
+ })
+ },
+
+ goDetails: function (e){
+ var id = e ? e.currentTarget.dataset.id : '';
+ if (!id) return;
+ let link = `/eaterplanet_ecommerce/moduleA/solitaire/groupDetails?id=${id}`;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.json b/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.json
new file mode 100644
index 0000000..417ac5c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "接龙中心",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-card": "../../components/card/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.wxml b/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.wxml
new file mode 100644
index 0000000..281cce6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.wxml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 发布时间:{{item.begin_time}}
+ 接龙状态:{{item.state_str}}
+
+ {{item.invite_count}}人看过 {{item.order_count}}人参加
+ 接龙详情
+
+ 接龙详情
+
+
+
+
+
+
+ 暂无接龙~
+
+
+
+
+
+ 发布接龙
+
+
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.wxss b/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.wxss
new file mode 100644
index 0000000..64b1553
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/groupIndex.wxss
@@ -0,0 +1,95 @@
+/* 搜索 S */
+.search-bar {
+ position: fixed;
+ left: 0;
+ right: 0;
+ top: 0;
+ z-index: 100;
+ padding: 12rpx 25rpx;
+ background-color: #fff;
+ padding-bottom: 20rpx;
+}
+
+.search-box {
+ background-color: #f0f0f0;
+ height: 56rpx;
+ line-height: 56rpx;
+ border-radius: 28rpx;
+ color: #acacac;
+ display: flex;
+ align-content: center;
+}
+
+.search-icon {
+ position: absolute;
+ left: 20rpx;
+ margin-left: 25rpx;
+ margin-right: 12rpx;
+}
+
+.search-icon .iconfont {
+ font-size: 34rpx;
+ padding-top: 10rpx;
+}
+
+.search-box .ipt {
+ padding: 0 30rpx 0 60rpx;
+ line-height: 56rpx;
+ height: 56rpx;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+/* 搜索 E */
+
+.list {
+ padding-top: 88rpx;
+}
+
+.list .item {
+ width: 710rpx;
+ border-radius: 20rpx;
+ background: #fff;
+ box-shadow: 0 0 40rpx 0 rgba(0, 0, 0, 0.05);
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ margin: 20rpx 20rpx 0;
+}
+
+.header {
+ padding: 20rpx 30rpx;
+ color: #444;
+ font-size: 28rpx;
+ border-bottom: 0.1rpx solid #efefef;
+}
+
+.middle {
+ padding: 20rpx 30rpx;
+ font-size: 26rpx;
+}
+
+.middle .btn {
+ color: #fff;
+ padding: 10rpx 15rpx;
+ border-radius: 6rpx;
+ font-size: 24rpx;
+}
+
+.pub {
+ position: fixed;
+ right: 20rpx;
+ bottom: 20%;
+ width: 120rpx;
+ height: 120rpx;
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ border-radius: 50%;
+ box-shadow: 0 0 5px #ccc;
+ z-index: 100;
+ color: #fff;
+ font-size: 22rpx;
+}
+
+.pub .iconfont {
+ font-size: 44rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/index.js b/eaterplanet_ecommerce/moduleA/solitaire/index.js
new file mode 100644
index 0000000..1360789
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/index.js
@@ -0,0 +1,337 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ },
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ app.setShareConfig();
+ let that = this;
+ status.setNavBgColor();
+ status.setGroupInfo().then((groupInfo) => { that.setData({ groupInfo }) });
+ let { share_id, community_id } = options;
+ this.options = options;
+ if (share_id != 'undefined' && share_id > 0) wx.setStorageSync('share_id', share_id);
+ this.compareCommunity(community_id)
+ this.getData(community_id);
+ },
+
+ initFn(community_id) {
+ let that = this;
+ this.page = 1;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ }, ()=>{
+ that.getData(community_id);
+ })
+ },
+
+ /**
+ * 比较社区
+ */
+ compareCommunity: function (shareCommunityId) {
+ let that = this;
+ // 原来社区
+ let currentCommunity = wx.getStorageSync('community');
+ let currentCommunityId = currentCommunity.communityId || '';
+ const token = wx.getStorageSync('token');
+
+ shareCommunityId && util.getCommunityById(shareCommunityId).then(res => {
+ let { hide_community_change_btn, default_head_info } = res;
+ let { groupInfo } = that.data;
+ if (res.open_danhead_model == 1) {
+ // 开启单社区
+ app.globalData.community = default_head_info;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: default_head_info })
+ token && util.addhistory(default_head_info);
+ if(shareCommunityId!=default_head_info.communityId) {
+ let { groupInfo } = that.data;
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error', '知道了');
+ return;
+ }
+ } else {
+ // 社区是否存在
+ if (currentCommunityId != '' && shareCommunityId) {
+ // 存在并且不相同
+ console.log('currentCommunityId存在 比较社区')
+ if (currentCommunityId != shareCommunityId) {
+ console.log('currentCommunityId存在 社区不同')
+ //如果禁止切换
+ // if (hide_community_change_btn == 1) {
+ console.log('禁止切换');
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error', '知道了');
+ return;
+ // }
+ // that.setData({
+ // hide_community_change_btn,
+ // showChangeCommunity: res.data ? true : false,
+ // changeCommunity: res.data,
+ // currentCommunity: currentCommunity
+ // })
+ }
+ } else {
+ // 不存在社区id
+ //token 是否存在
+ if (token) {
+ util.getCommunityInfo().then(function (ret) {
+ //比较社区
+ console.log('token存在 比较社区')
+ if (ret.community_id && ret.community_id != shareCommunityId) {
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error', '知道了');
+ // that.setData({
+ // showChangeCommunity: true,
+ // currentCommunity: ret
+ // })
+ }
+ }).catch((param) => {
+ console.log('step4 新人')
+ if (Object.keys(param) != '') util.addhistory(param, true);
+ });
+ } else {
+ console.log('token不存在 存社区')
+ // 直接存本地
+ app.globalData.community = res.data;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({ key: "community", data: res.data })
+ }
+ }
+ }
+ });
+ },
+
+ /**
+ * 切换提示
+ */
+ confrimChangeCommunity: function () {
+ let community = this.data.changeCommunity;
+ let token = wx.getStorageSync('token');
+ app.globalData.community = community;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({
+ key: "community",
+ data: community
+ })
+ token && util.addhistory(community);
+ this.initFn(community.communityId);
+ this.setData({ showChangeCommunity: false })
+ console.log('用户点击确定')
+ },
+
+ /**
+ * 取消切换
+ */
+ cancelChangeCommunity: function () {
+ let currentCommunity = this.data.currentCommunity;
+ let communityId = currentCommunity.communityId || '';
+ communityId && this.initFn(communityId);
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ that.setData({
+ needAuth: true
+ })
+ } else {
+ (0, status.cartNum)('', true).then((res) => {
+ that.setData({
+ cartNum: res.data
+ })
+ });
+ }
+ })
+ },
+
+ /**
+ * 获取列表
+ */
+ getData: function (head_id) {
+ let that = this;
+ wx.showLoading();
+ if (!head_id) {
+ let community = wx.getStorageSync('community');
+ head_id = community.communityId || '';
+ }
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_head_index_solitairelist',
+ head_id,
+ page: this.page
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.stopPullDownRefresh();
+ wx.hideLoading();
+ let showTabbar = res.data.showTabbar;
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ let head_data = res.data.head_data;
+ if (list.length < 20) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({
+ list,
+ ...h,
+ head_data,
+ showTabbar
+ })
+ } else if (res.data.code == 1) {
+ // 无数据
+ let head_data = res.data.head_data || '';
+ if (that.page == 1) that.setData({
+ noData: 1
+ })
+ that.setData({
+ loadMore: false,
+ noMore: false,
+ head_data,
+ loadText: "没有更多记录了~",
+ showTabbar
+ })
+ } else if (res.data.code == 2) {
+ // 您还未登录
+ } else if (res.data.code == 3) {
+ // 团长不存在
+ app.util.message(res.data.msg, '/eaterplanet_ecommerce/pages/position/community', 'error');
+ return;
+ } else {
+ app.util.message(res.data.msg, '', 'error');
+ return;
+ }
+ }
+ })
+ },
+
+ goDetails: function (event){
+ var id = event ? event.currentTarget.dataset.id : '';
+ if(!id) return;
+ var pages_all = getCurrentPages();
+ let link = `/eaterplanet_ecommerce/moduleA/solitaire/details?id=${id}`;
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ showImgPrev: function (event) {
+ var idx = event ? event.currentTarget.dataset.idx : '';
+ var sidx = event ? event.currentTarget.dataset.sidx : '';
+ let list = this.data.list;
+ let urls = list[sidx].images_list;
+ wx.previewImage({
+ current: urls[idx],
+ urls
+ });
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+ let that = this;
+ this.page = 1;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ }, ()=>{
+ that.getData();
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ let community = wx.getStorageSync('community');
+ let head_id = community.communityId || '';
+ let share_id = wx.getStorageSync('member_id') || '';
+ let share_path = `eaterplanet_ecommerce/moduleA/solitaire/index?share_id=${share_id}&community_id=${head_id}`;
+ let title = '';
+ return {
+ title,
+ path: share_path,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function () {
+ let community = wx.getStorageSync('community');
+ let head_id = community.communityId || '';
+ let share_id = wx.getStorageSync('member_id') || '';
+ let title = '';
+
+ var query= `share_id=${share_id}&community_id=${head_id}`;
+ return {
+ title,
+ query,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/index.json b/eaterplanet_ecommerce/moduleA/solitaire/index.json
new file mode 100644
index 0000000..7c8c3f7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/index.json
@@ -0,0 +1,13 @@
+{
+ "navigationBarTitleText": "群接龙",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index",
+ "i-solitaire-head": "../components/solitaireHead",
+ "i-change-community": "../../components/changeCommunity/index",
+ "i-tabbar": "../../components/tabbar/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/index.wxml b/eaterplanet_ecommerce/moduleA/solitaire/index.wxml
new file mode 100644
index 0000000..df407ca
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/index.wxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+ {{solitaire.solitaire_name}}
+ {{solitaire.state_str}}
+
+ 接龙时间:{{solitaire.begin_time}}~{{solitaire.end_time}}
+
+
+
+
+
+
+
+
+
+
+ {{solitaire.invite_count}}次浏览,{{solitaire.order_count}}次接龙
+
+
+
+
+
+ 暂无接龙~
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/index.wxss b/eaterplanet_ecommerce/moduleA/solitaire/index.wxss
new file mode 100644
index 0000000..cecac1b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/index.wxss
@@ -0,0 +1,40 @@
+.img-list .img-item {
+ width: 155rpx;
+ height: 155rpx;
+ margin-left: 24rpx;
+ margin-bottom: 24rpx;
+}
+
+.img-list .img-item:nth-child(4n+1) {
+ margin-left: 0;
+}
+
+.shareModal-box {
+ background: transparent!important;
+ left: 115rpx!important;
+ right: 115rpx!important;
+ bottom: initial!important;
+ top: 50%;
+ transform: translateY(-50%)!important;
+ width: 520rpx!important;
+}
+
+.shareModal {
+ width: 520rpx;
+}
+
+.shareBtn {
+ line-height: 84rpx;
+}
+
+.member-list .avatar {
+ width: 50rpx;
+ height: 50rpx;
+ border-radius: 50%;
+ border: 1px solid #fff;
+ margin-left: -15rpx;
+}
+
+.member-list .avatar:first-child {
+ margin-left: 0;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/me.js b/eaterplanet_ecommerce/moduleA/solitaire/me.js
new file mode 100644
index 0000000..4a08133
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/me.js
@@ -0,0 +1,156 @@
+var app = getApp();
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js')],
+ data: {
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getData();
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let that = this;
+ this.page = 1;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ needAuth: false
+ }, ()=>{
+ that.getData(this.specialId);
+ })
+ },
+
+ /**
+ * 获取列表
+ */
+ getData: function () {
+ let that = this;
+ const token = wx.getStorageSync('token');
+ let community = wx.getStorageSync('community');
+ let head_id = community && community.communityId || '';
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_member_solitairelist',
+ token,
+ page: this.page,
+ head_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.stopPullDownRefresh();
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 20) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({
+ list,
+ ...h
+ })
+ } else if (res.data.code == 1) {
+ // 无数据
+ if (that.page == 1) that.setData({
+ noData: 1
+ })
+ that.setData({
+ loadMore: false,
+ noMore: false,
+ loadText: "没有更多记录了~"
+ })
+ } else if (res.data.code == 2) {
+ // 您还未登录
+ that.setData({ needAuth: true, showAuthModal: true })
+ } else {
+ app.util.message(res.data.msg, '', 'error');
+ return;
+ }
+ }
+ })
+ },
+
+ goDetails: function (event) {
+ var id = event ? event.currentTarget.dataset.id : '';
+ if (!id) return;
+ var pages_all = getCurrentPages();
+ let link = `/eaterplanet_ecommerce/moduleA/solitaire/details?id=${id}`;
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ showImgPrev: function (event) {
+ var idx = event ? event.currentTarget.dataset.idx : '';
+ var sidx = event ? event.currentTarget.dataset.sidx : '';
+ let list = this.data.list;
+ let urls = list[sidx].images_list;
+ wx.previewImage({
+ current: urls[idx],
+ urls
+ });
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ let that = this;
+ this.page = 1;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ }, () => {
+ that.getData();
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/me.json b/eaterplanet_ecommerce/moduleA/solitaire/me.json
new file mode 100644
index 0000000..019ebed
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/me.json
@@ -0,0 +1,11 @@
+{
+ "navigationBarTitleText": "我的接龙",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/me.wxml b/eaterplanet_ecommerce/moduleA/solitaire/me.wxml
new file mode 100644
index 0000000..18f9a57
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/me.wxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+ {{solitaire.solitaire_name}}
+ {{solitaire.state_str}}
+
+
+
+
+ 接龙时间:{{solitaire.begin_time}}~{{solitaire.end_time}}
+
+
+
+ 暂无接龙~
+
+
+
+
+
+ 去接龙
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/me.wxss b/eaterplanet_ecommerce/moduleA/solitaire/me.wxss
new file mode 100644
index 0000000..5af9067
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/me.wxss
@@ -0,0 +1,28 @@
+.img-list .img-item {
+ width: 155rpx;
+ height: 155rpx;
+ margin-left: 24rpx;
+ margin-bottom: 24rpx;
+}
+
+.img-list .img-item:nth-child(4n+1) {
+ margin-left: 0;
+}
+
+.pub {
+ position: fixed;
+ right: 20rpx;
+ bottom: 20%;
+ width: 120rpx;
+ height: 120rpx;
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ border-radius: 50%;
+ box-shadow: 0 0 5px #ccc;
+ z-index: 100;
+ color: #fff;
+ font-size: 22rpx;
+}
+
+.pub .iconfont {
+ font-size: 44rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/order.js b/eaterplanet_ecommerce/moduleA/solitaire/order.js
new file mode 100644
index 0000000..76a4062
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/order.js
@@ -0,0 +1,82 @@
+// eaterplanet_ecommerce/moduleA/solitaire/order.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/order.json b/eaterplanet_ecommerce/moduleA/solitaire/order.json
new file mode 100644
index 0000000..33c9534
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/order.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "我的接龙",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/order.wxml b/eaterplanet_ecommerce/moduleA/solitaire/order.wxml
new file mode 100644
index 0000000..e91c4d9
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/order.wxml
@@ -0,0 +1,2 @@
+
+eaterplanet_ecommerce/moduleA/solitaire/order.wxml
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/order.wxss b/eaterplanet_ecommerce/moduleA/solitaire/order.wxss
new file mode 100644
index 0000000..93a0c1d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/order.wxss
@@ -0,0 +1 @@
+/* eaterplanet_ecommerce/moduleA/solitaire/order.wxss */
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/pub.js b/eaterplanet_ecommerce/moduleA/solitaire/pub.js
new file mode 100644
index 0000000..225d3de
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/pub.js
@@ -0,0 +1,188 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var chooseFlag = true;
+var myDate = new Date();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ begin_time: '',
+ end_time: '',
+ noteMaxLen: 500,
+ imgGroup: [],
+ goods: [], // 选择商品
+ type: 0, // 0社区商品 1仅快递
+ title: '',
+ content: ''
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ titleInput: function(e){
+ var title = e.detail.value;
+ this.setData({ title })
+ },
+
+ /**
+ * 开始时间
+ */
+ beginTimePicker: function(e){
+ this.setData({ begin_time: e.detail })
+ },
+
+ /**
+ * 开始时间
+ */
+ endTimePicker: function (e) {
+ this.setData({ end_time: e.detail })
+ },
+
+ contentInput: function(e){
+ var value = e.detail.value, len = parseInt(value.length);
+ if (len > this.data.noteMaxLen) return;
+ this.setData({
+ currentNoteLen: len, //当前字数
+ limitNoteLen: this.data.noteMaxLen - len, //剩余字数
+ content: value
+ });
+ },
+
+ chooseImage: function () {
+ chooseFlag = false;
+ },
+
+ changeImg: function (e) {
+ chooseFlag = e.detail.len === e.detail.value.length;
+ this.setData({
+ imgGroup: e.detail.value
+ });
+ },
+
+ deleteGoods: function(e){
+ let idx = e.detail;
+ console.log(idx);
+ let goods = this.data.goods;
+ if(idx!=-1) {
+ goods.splice(idx, 1);
+ this.setData({ goods })
+ }
+ },
+
+ /**
+ * 获取团长信息
+ */
+ getData: function () {
+ const token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.get_solitaire_headinfo',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ that.setData({ community: res.data.data || '' })
+ } else if (res.data.code == 1) {
+ app.util.message('您还未登录', 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ } else {
+ app.util.message(res.data.msg, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ return;
+ }
+ }
+ })
+ },
+
+ /**
+ * 提交
+ */
+ subForm: function(){
+ let { title, content, begin_time, end_time, imgGroup, goods } = this.data;
+ let that = this;
+ if(title=='') {
+ wx.showToast({
+ title: '请输入标题',
+ icon: 'none'
+ })
+ return;
+ }
+ if (content == '') {
+ wx.showToast({
+ title: '请输入内容',
+ icon: 'none'
+ })
+ return;
+ }
+ if (imgGroup.length <= 0) {
+ wx.showToast({
+ title: '请上传接龙图片',
+ icon: 'none'
+ })
+ return;
+ }
+ if (goods.length <= 0) {
+ wx.showToast({
+ title: '请选择商品',
+ icon: 'none'
+ })
+ return;
+ }
+
+ let ids = [];
+ goods.forEach(item=>{
+ ids.push(item.gid);
+ })
+ let goods_list = ids.join(',');
+ const token = wx.getStorageSync('token');
+ let data = { title, content, begin_time, end_time, images_list: imgGroup.join(','), goods_list, token };
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'solitaire.sub_head_solitaire',
+ ...data
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ app.util.message('提交成功', 'redirect:/eaterplanet_ecommerce/moduleA/solitaire/groupIndex', 'success');
+ } else {
+ app.util.message(res.data.msg || '提交失败', '', 'error');
+ return;
+ }
+ }
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/pub.json b/eaterplanet_ecommerce/moduleA/solitaire/pub.json
new file mode 100644
index 0000000..0ddd961
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/pub.json
@@ -0,0 +1,11 @@
+{
+ "navigationBarTitleText": "发布群接龙",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "DateTimePicker": "../../components/datetimepicker/datetimepicker",
+ "chooseImage": "../../components/chooseImage/index",
+ "i-solitaire-good": "../components/solitaireGood",
+ "i-solitaire-head": "../components/solitaireHead"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/pub.wxml b/eaterplanet_ecommerce/moduleA/solitaire/pub.wxml
new file mode 100644
index 0000000..9e6e68c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/pub.wxml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ 标题:
+
+
+
+
+
+ {{currentNoteLen|0}}/{{noteMaxLen}}
+
+
+
+ 上传接龙图片(最多10张)
+
+
+
+
+ 商品项目
+
+
+
+
+
+
+ 添加商品
+
+
+
+ 活动设置
+
+ 开始时间:
+
+
+
+
+
+ 结束时间:
+
+
+
+
+
+
+
+ 发布接龙
+
+
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/pub.wxss b/eaterplanet_ecommerce/moduleA/solitaire/pub.wxss
new file mode 100644
index 0000000..b719e38
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/pub.wxss
@@ -0,0 +1,179 @@
+.cell {
+ position: relative;
+ display: flex;
+ justify-content: space-between;
+ background-color: #fff;
+ padding: 30rpx;
+}
+
+.cell::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ border-bottom: 1px solid #e5e5e5;
+ transform-origin: 0 0;
+ transform: scaleY(0.5);
+}
+
+.cell-hd,
+.tit {
+ color: #000;
+}
+
+.cell-bd {
+ flex: 1;
+}
+
+.cell-col {
+ position: relative;
+ background-color: #fff;
+ padding: 20rpx 30rpx;
+}
+
+.cell-col .tit {
+ margin-bottom: 20rpx;
+}
+
+.cell-col::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ border-bottom: 1px solid #e5e5e5;
+ transform-origin: 0 0;
+ transform: scaleY(0.5);
+}
+
+.image_uploader_selector {
+ width: 56px;
+ height: 56px;
+ border: 1px dashed #ccc;
+ display: inline-block;
+}
+
+.image_uploader_indicate {
+ position: absolute;
+ font-size: 32px;
+ color: #ccc;
+ width: 56px;
+ height: 56px;
+ line-height: 52px;
+ text-align: center;
+}
+
+.cell-ipt {
+ text-align: right;
+}
+
+.cell-textarea {
+ width: 100%;
+ padding-bottom: 40rpx;
+}
+
+.wordLimit {
+ position: absolute;
+ right: 30rpx;
+ bottom: 20rpx;
+}
+
+.image_uploader_image {
+ position: relative;
+ display: inline-block;
+ width: 56px;
+ height: 56px;
+ border: 1px dashed #e6e6e6;
+ padding: 1px;
+ box-sizing: border-box;
+ margin-right: 12px;
+}
+
+.image_uploader_image image {
+ width: 52px;
+ height: auto;
+ max-width: 52px;
+ max-height: 52px;
+ overflow: hidden;
+ margin: auto;
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+}
+
+.image_uploader_image .image_uploader_image_img_portrait {
+ width: auto !important;
+ height: 52px !important;
+}
+
+.image_uploader_image .image_uploader_image_delete {
+ border-radius: 50%;
+ -webkit-border-radius: 50%;
+ position: absolute;
+ right: -8px;
+ top: -8px;
+ background-color: #ff2742;
+ line-height: 20px;
+ height: 20px;
+ width: 20px;
+ text-align: center;
+ color: #fff;
+ font-size: 14px;
+ font-weight: bold;
+}
+
+.submit_button {
+ height: 70rpx;
+ line-height: 70rpx;
+ top: 10px;
+ position: relative;
+ border-top: 1px solid #eee;
+ text-align: center;
+ margin: 15px 30rpx 30px;
+}
+
+.submit_button .span {
+ padding: 5px 20px;
+ font-size: 15px;
+ color: #fff;
+ background-color: #F75451;
+ position: relative;
+ text-align: center;
+ border-radius: 5px;
+}
+
+.addBtn {
+ display: inline-block;
+ color: #fff;
+ padding: 4px 15rpx;
+ border-radius: 8rpx;
+ background: #F75451;
+ margin-top: 20rpx;
+}
+
+.video-wrap {
+ padding: 0 0 10rpx;
+}
+
+.video-wrap .item {
+ position: relative;
+ padding: 30rpx 0;
+}
+
+.video-wrap .item::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ border-bottom: 1px solid #e5e5e5;
+ transform-origin: 0 0;
+ transform: scaleY(0.5);
+}
+
+.video-wrap .item:last-child::after {
+ content: none;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/share.js b/eaterplanet_ecommerce/moduleA/solitaire/share.js
new file mode 100644
index 0000000..1c8ef76
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/share.js
@@ -0,0 +1,82 @@
+// eaterplanet_ecommerce/moduleA/solitaire/share.js 用户打开群接龙主页面
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/share.json b/eaterplanet_ecommerce/moduleA/solitaire/share.json
new file mode 100644
index 0000000..8e59d78
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/share.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "接龙详情",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/share.wxml b/eaterplanet_ecommerce/moduleA/solitaire/share.wxml
new file mode 100644
index 0000000..c074925
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/share.wxml
@@ -0,0 +1,2 @@
+
+eaterplanet_ecommerce/moduleA/solitaire/share.wxml
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/share.wxss b/eaterplanet_ecommerce/moduleA/solitaire/share.wxss
new file mode 100644
index 0000000..a4de85e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/share.wxss
@@ -0,0 +1 @@
+/* eaterplanet_ecommerce/moduleA/solitaire/share.wxss */
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.js b/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.js
new file mode 100644
index 0000000..7681137
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.js
@@ -0,0 +1,82 @@
+// eaterplanet_ecommerce/moduleA/solitaire/shareDetails.js 用户打开群接龙详情
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.json b/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.json
new file mode 100644
index 0000000..8e59d78
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "接龙详情",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.wxml b/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.wxml
new file mode 100644
index 0000000..ce745b6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.wxml
@@ -0,0 +1,2 @@
+
+eaterplanet_ecommerce/moduleA/solitaire/shareDetails.wxml
diff --git a/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.wxss b/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.wxss
new file mode 100644
index 0000000..5364382
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/solitaire/shareDetails.wxss
@@ -0,0 +1 @@
+/* eaterplanet_ecommerce/moduleA/solitaire/shareDetails.wxss */
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/special/index.js b/eaterplanet_ecommerce/moduleA/special/index.js
new file mode 100644
index 0000000..b24c63e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/special/index.js
@@ -0,0 +1,167 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/cartMixin.js')],
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ info: {},
+ cartNum: 0,
+ needAuth: false
+ },
+ specialId: 0,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ app.setShareConfig();
+ status.setNavBgColor();
+ let id = options.id || 0;
+ this.specialId = id;
+ if (options.share_id != 'undefined' && options.share_id > 0) wx.setStorageSync('share_id', options.share_id);
+ this.getData(id);
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ this.getData(this.specialId);
+ this.setData({
+ needAuth: false
+ })
+ },
+
+ getData: function (id) {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'marketing.get_special',
+ token,
+ head_id: cur_community.communityId,
+ id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.stopPullDownRefresh();
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let list = res.data.list;
+ let info = res.data.data;
+ let ishowShareBtn = res.data.ishow_special_share_btn || 0;
+ wx.setNavigationBarTitle({
+ title: info.special_title || '专题'
+ })
+
+ let { full_money, full_reducemoney, is_open_fullreduction, is_open_vipcard_buy, is_vip_card_member, is_member_level_buy } = res.data;
+ let reduction = { full_money, full_reducemoney, is_open_fullreduction }
+
+ let noData = (list.length==0)? true : false;
+ that.setData({ list, info, ishowShareBtn, noData, reduction })
+ } else if (res.data.code == 1) {
+ wx.showModal({
+ title: '提示',
+ content: res.data.msg,
+ showCancel: false,
+ success(ret){
+ if (ret.confirm) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ }
+ }
+ })
+ } else if(res.data.code == 2) {
+ // 未登录
+ that.setData({ needAuth: true });
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ this.setData({ needAuth: false });
+ (0, status.cartNum)('', true).then((res) => {
+ res.code == 0 && that.setData({ cartNum: res.data })
+ });
+ } else {
+ let id = this.specialId;
+ this.setData({ needAuth: true, navBackUrl: `/eaterplanet_ecommerce/pages/supply/index?id=${id}` });
+ }
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.getData(this.specialId);
+ },
+
+ onShareAppMessage: function (res) {
+ var share_title = this.data.info.special_title || '活动专题';
+ var share_id = wx.getStorageSync('member_id');
+ var id = this.specialId;
+ var share_path = `eaterplanet_ecommerce/moduleA/special/index?id=${id}&share_id=${share_id}`;
+
+ return {
+ title: share_title,
+ path: share_path,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function (res) {
+ var share_title = this.data.info.special_title || '活动专题';
+ var share_id = wx.getStorageSync('member_id');
+ var id = this.specialId;
+
+ var query= `id=${id}&share_id=${share_id}`;
+ return {
+ title: share_title,
+ query,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/special/index.json b/eaterplanet_ecommerce/moduleA/special/index.json
new file mode 100644
index 0000000..48c2279
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/special/index.json
@@ -0,0 +1,15 @@
+{
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-img": "../../components/img/index",
+ "i-button": "../../components/button/index",
+ "i-router-link": "../../components/router-link/router-link",
+ "sku": "../../components/sku/index",
+ "i-cart-btn": "../../components/cartBtn/index",
+ "i-input-number": "../../components/input-number/index",
+ "i-aside-btn": "../../components/asideBtn/index",
+ "i-addcart": "../../components/addCartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/special/index.wxml b/eaterplanet_ecommerce/moduleA/special/index.wxml
new file mode 100644
index 0000000..ed64e8a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/special/index.wxml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+ {{item.label_info.tagcontent}}
+
+
+
+ 已抢光
+ 已结束
+
+ 满{{reduction.full_money}}减{{reduction.full_reducemoney}}
+ 限购
+
+
+ {{item.spuName}}
+
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+ ¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}
+
+
+ 已抢光
+ 已结束
+ 立即抢购
+
+
+
+
+
+
+
+
+
+
+ {{item.label_info.tagcontent}}
+
+
+
+
+ 满{{reduction.full_money}}减{{reduction.full_reducemoney}}
+ 限购
+
+
+
+
+
+
+ {{item.spuName}}
+
+
+ {{item.spuDescribe}}
+
+
+
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+
+ ¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}
+
+
+
+
+ 已抢光
+
+
+ 已结束
+
+
+ 立即抢购
+
+
+
+
+ 已抢光
+ 已结束
+
+
+
+
+
+
+
+ {{item.label_info.tagcontent}}
+
+
+
+
+
+
+ 满{{reduction.full_money}}减{{reduction.full_reducemoney}}
+ 限购
+
+
+
+
+ 已抢光
+ {{item.spuName}}
+
+
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂时没有商品
+ 我们正在为您准备更优惠的商品
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/special/index.wxss b/eaterplanet_ecommerce/moduleA/special/index.wxss
new file mode 100644
index 0000000..b001db8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/special/index.wxss
@@ -0,0 +1,743 @@
+.special {
+ min-height: 100vh;
+}
+
+.topic-img {
+ width: 100%;
+}
+
+.like {
+ padding-bottom: 100rpx;
+}
+
+.like-list {
+ position: relative;
+ padding: 20rpx;
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ z-index: 0;
+}
+
+.new-comers-item {
+ background-color: #fff;
+ width: 345rpx;
+ box-sizing: border-box;
+ padding: 30rpx;
+ border-radius: 10px;
+ font-size: 28rpx;
+ margin-bottom: 20rpx;
+}
+
+.new-comers-item .new-img {
+ width: 285rpx;
+ height: 285rpx;
+ margin-bottom: 20rpx;
+}
+
+.new-comers-item .title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.new-comers-item .new-bot {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 10rpx;
+}
+
+.new-comers-item .new-bot .market-price {
+ text-decoration: line-through;
+ color: #999;
+ font-size: 20rpx;
+}
+
+.new-comers-item .add-cart {
+ height: 48rpx;
+ line-height: 48rpx;
+ padding: 0 20rpx;
+ color: #fff;
+ border-radius: 22rpx;
+ margin: 0;
+ background: linear-gradient(270deg, #ff5041 0%, #ff695c 100%);
+ font-size: 24rpx;
+}
+
+.new-comers-item .add-cart.disabled {
+ background: #ccc;
+}
+
+.new-comers-item .price {
+ font-size: 30rpx;
+ color: #ff5041;
+ font-weight: bold;
+}
+
+.new-comers-item {
+ position: relative;
+}
+
+.new-comers-item .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 120rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.none-rush-list {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding-bottom: 140rpx;
+ padding-top: 140rpx;
+}
+
+.none-rush-list .img-block {
+ width: 240rpx;
+ height: 240rpx;
+ margin-bottom: 30rpx;
+}
+
+.none-rush-list .h1 {
+ font-size: 32rpx;
+ line-height: 32rpx;
+ color: #444;
+ margin-bottom: 20rpx;
+}
+
+.none-rush-list .h2 {
+ font-size: 24rpx;
+ line-height: 24rpx;
+ color: #aaa;
+}
+
+.item {
+ position: relative;
+ z-index: 999;
+}
+
+/* 数量加减 */
+
+.like-list .index-input-number {
+ position: absolute;
+ right: 20rpx;
+ bottom: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.like-list .index-input-number .i-input-number-view {
+ width: 80rpx;
+ height: 80rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.like-list .index-input-number .i-input-number-view .img {
+ width: 40rpx;
+ height: 40rpx;
+}
+
+.like-list .index-input-number .i-input-number-minus {
+ justify-content: flex-end;
+}
+
+.like-list .index-input-number .i-input-number-plus {
+ justify-content: flex-start;
+}
+
+.like-list .index-input-number .input-number-text {
+ height: 88rpx;
+ line-height: 88rpx;
+ font-size: 24rpx;
+ color: #333;
+ width: 58rpx;
+}
+
+/* 大图 */
+
+.i-btn {
+ text-align: center;
+ vertical-align: middle;
+ touch-action: manipulation;
+ cursor: pointer;
+ background-image: none;
+ white-space: nowrap;
+ user-select: none;
+ font-size: 28rpx;
+ border: 0 !important;
+ position: relative;
+ text-decoration: none;
+ height: 88rpx;
+ line-height: 88rpx;
+ background: none;
+ color: #495060;
+ border-radius: 0;
+ margin: 0;
+ box-shadow: none;
+}
+
+.i-btn::after {
+ border: none;
+}
+
+.spu {
+ width: 100%;
+ display: block;
+ margin-top: 20rpx;
+}
+
+.spu .img-class {
+ width: 710rpx;
+ height: 400rpx;
+ border-radius: 10rpx 10rpx 0 0;
+ image-rendering: crisp-edges;
+}
+
+.spu .mask {
+ background: rgba(255, 255, 255, 0.5);
+ width: 710rpx;
+ height: 400rpx;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+
+.spu .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 170rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.spu .spu-content {
+ background: #fff;
+ width: 710rpx;
+ border-radius: 20rpx;
+ overflow: hidden;
+ position: relative;
+ box-shadow: 0 0 40rpx rgba(0, 0, 0, 0.05);
+ margin: 0 auto 20rpx;
+ display: flex;
+ flex-direction: column;
+ box-sizing: border-box;
+}
+
+.spu .spu-content.disabled {
+ opacity: 0.6;
+}
+
+.spu .spu-content .item-top {
+ width: 100%;
+ height: 400rpx;
+ position: relative;
+}
+
+.spu .spu-content .item-bottom {
+ box-sizing: border-box;
+ padding: 20rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.spu .spu-content .item-bottom .spu-title {
+ color: #222;
+ font-size: 30rpx;
+ height: 32rpx;
+ width: 100%;
+ margin-bottom: 12rpx;
+ margin-top: 10rpx;
+ font-weight: 500;
+ position: relative;
+}
+
+.spu .spu-content .item-bottom .spu-title .span {
+ width: 100%;
+ height: 40rpx;
+ position: absolute;
+ left: 0;
+ top: -4rpx;
+ line-height: 40rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu .spu-content .item-bottom .spu-tag {
+ padding-left: 196rpx;
+ margin-bottom: 20rpx;
+ display: flex;
+ height: 28rpx;
+}
+
+.spu .spu-content .item-bottom .spu-desc {
+ font-size: 26rpx;
+ line-height: 26rpx;
+ color: #999;
+ position: relative;
+ width: 100%;
+ height: 26rpx;
+ margin-bottom: 12rpx;
+}
+
+.spu .spu-content .item-bottom .spu-desc em {
+ width: 100%;
+ height: 32rpx;
+ position: absolute;
+ left: 0;
+ top: -2rpx;
+ line-height: 32rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu .spu-content .item-bottom .spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ overflow: hidden;
+ margin-bottom: 10rpx;
+ margin-top: 10rpx;
+}
+
+.spu .spu-content .item-bottom .spu-price .sale-price {
+ color: #ff5344;
+ margin-right: 12rpx;
+}
+
+.spu .spu-content .item-bottom .spu-price .sale-price .span {
+ font-size: 46rpx;
+ line-height: 42rpx;
+ margin: 0;
+ font-weight: bold;
+}
+
+.spu .spu-content .item-bottom .spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+ margin-right: 20rpx;
+}
+
+.spu .spu-content .item-bottom .spu-count {
+ font-size: 24rpx;
+ line-height: 24rpx;
+ color: #999;
+}
+
+.spu .spu-content .add-cart, .spu .spu-content .add-cart-disabled {
+ width: 160rpx;
+ height: 60rpx;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ right: 28rpx;
+ bottom: 20rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #ff5344;
+ color: #fff;
+ border-radius: 30rpx;
+}
+
+.spu .spu-content .add-cart-disabled {
+ background: #ccc;
+}
+
+.spu .spu-content .add-cart.disabled {
+ background: #ccc;
+}
+
+.spu .item-top .spu-active {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ z-index: 9;
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: flex-start;
+}
+
+.spu .item-top .spu-active .tag {
+ background: linear-gradient(to right, #ff5041, #ff994b);
+ border-radius: 0 25rpx 25rpx 0;
+ padding: 0 15rpx;
+ height: 50rpx;
+ font-size: 26rpx;
+ line-height: 50rpx;
+ color: #fff;
+ display: inline-block;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ max-width: 220rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu .item-top .spu-active .tag-green {
+ background: linear-gradient(to left, #46c8d0, #29ba9a);
+}
+
+.spu .spu-content .time-tip {
+ position: absolute;
+ background: #ff5344;
+ left: 0;
+ bottom: 0;
+ width: 250rpx;
+ height: 40rpx;
+ border-radius: 0 8rpx 0 0;
+}
+
+.spu .spu-content .time-tip.notip {
+ display: none;
+}
+
+/* 标签 */
+
+.spu .item-tag {
+ position: absolute;
+ left: 22rpx;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.spu .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.spu .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.spu .index-input-number {
+ position: absolute;
+ right: 0;
+ bottom: 10rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.spu .index-input-number .i-input-number-view {
+ width: 80rpx;
+ height: 80rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.spu .index-input-number .i-input-number-view .img {
+ width: 40rpx;
+ height: 40rpx;
+}
+
+.spu .index-input-number .i-input-number-minus {
+ justify-content: flex-end;
+}
+
+.spu .index-input-number .i-input-number-plus {
+ justify-content: flex-start;
+}
+
+.spu .index-input-number .input-number-text {
+ height: 88rpx;
+ line-height: 88rpx;
+ font-size: 24rpx;
+ color: #333;
+ width: 58rpx;
+}
+
+.fixed-share {
+ display: inline-block;
+ bottom: 320rpx;
+ left: 30rpx;
+ width: 80rpx;
+ height: 80rpx;
+ position: fixed;
+ background: rgba(0, 0, 0, 0.5);
+ border-radius: 50%;
+ text-align: center;
+ color: #fff;
+ box-sizing: border-box;
+ font-size: 20rpx;
+ padding: 10rpx;
+ line-height: 1.2;
+ z-index: 100;
+}
+
+.fixed-share image {
+ width: 50%;
+ height: 50%;
+}
+
+/* 标签 */
+.new-comers-item .item-tag {
+ position: absolute;
+ left: 30rpx;
+ top: 30rpx;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.new-comers-item .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.new-comers-item .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+
+/* 小图满减 */
+.like-list .spu-active {
+ position: absolute;
+ left: 30rpx;
+ top: 280rpx;
+ z-index: 9;
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: flex-start;
+}
+
+.like-list .spu-active .tag {
+ background: linear-gradient(to right, #ff5041, #ff994b);
+ border-radius: 0 14rpx 14rpx 0;
+ padding: 0 12rpx;
+ height: 30rpx;
+ font-size: 22rpx;
+ line-height: 30rpx;
+ color: #fff;
+ display: inline-block;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ max-width: 180rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.like-list .spu-active .tag-green {
+ background: linear-gradient(to left, #46c8d0, #29ba9a);
+}
+
+.col-3 {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 20rpx 0;
+ border-radius: 10rpx;
+ overflow: hidden;
+ background-color: #fff;
+ border-radius: 0;
+ overflow-x: hidden;
+ max-width: 100%;
+}
+
+.col-3 .w250 {
+ width: 236rpx;
+ overflow: hidden;
+ position: relative;
+ padding: 0 3rpx;
+ box-sizing: border-box;
+ margin: 0 7rpx 20rpx;
+}
+
+.w250 .new-img {
+ width: 236rpx;
+ height: 236rpx;
+ margin-bottom: 20rpx;
+ overflow: hidden;
+}
+
+.w250 .title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.w250 .new-bot {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 10rpx;
+}
+
+.w250 .add-cart {
+ width: 44rpx;
+ height: 44rpx;
+ padding: 0;
+ margin: 0;
+}
+
+.w250 .price {
+ color: #ff5041;
+}
+
+.w250 .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 80rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+.col-3 .w250 .vip {
+ position: absolute;
+ left: 10rpx;
+ top: 20rpx;
+}
+
+.col-3 .w250 .item-tag {
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.col-3 .w250 .item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.col-3 .w250 .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.col-3 .w250 .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.col-3 .w250 .spu-active {
+ position: absolute;
+ left: 0;
+ top: 200rpx;
+ z-index: 9;
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: flex-start;
+}
+
+.col-3 .w250 .spu-active .tag {
+ background: linear-gradient(to right, #ff5041, #ff994b);
+ border-radius: 0 14rpx 14rpx 0;
+ padding: 0 12rpx;
+ height: 30rpx;
+ font-size: 22rpx;
+ line-height: 30rpx;
+ color: #fff;
+ display: inline-block;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ max-width: 180rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.col-3 .w250 .spu-active .tag-green {
+ background: linear-gradient(to left, #46c8d0, #29ba9a);
+}
+
+.col-3 .w250 .spu-play {
+ position: absolute;
+ left: 50%;
+ top: 20%;
+ width: 100rpx;
+ height: 100rpx;
+ margin-left: -50rpx;
+}
+
+.col-3 .w250 .spu-play .img {
+ width: 100%;
+ height: 100%;
+}
+
+.col-3 .w250 .addbtn {
+ width: 44rpx;
+ height: 44rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/special/list.js b/eaterplanet_ecommerce/moduleA/special/list.js
new file mode 100644
index 0000000..117e151
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/special/list.js
@@ -0,0 +1,233 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+ mixins: [require('../../mixin/cartMixin.js')],
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ specialList: [],
+ navBackUrl: '/eaterplanet_ecommerce/moduleA/special/list'
+ },
+ page: 1,
+ noMore: false,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ app.setShareConfig();
+ if (options.share_id != 'undefined' && options.share_id > 0) wx.setStorageSync('share_id', options.share_id);
+ this.getData();
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let that = this;
+ this.page = 1;
+ this.setData({
+ needAuth: false,
+ noMore: false,
+ list: [],
+ specialList: []
+ }, () => {
+ that.getData();
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ this.setData({ needAuth: false });
+ } else {
+ this.setData({ needAuth: true });
+ }
+ })
+ },
+
+ getData: function () {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'marketing.get_special_page_list',
+ token: token,
+ head_id: cur_community.communityId,
+ page: this.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.stopPullDownRefresh();
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let specialList = res.data.data;
+ let oldList = that.data.specialList;
+ specialList = oldList.concat(specialList);
+ that.page++;
+ that.setData({ specialList })
+ } else if(res.data.code == 1) {
+ that.noMore = true;
+ } else if (res.data.code == 2) {
+ that.setData({ needAuth: true })
+ }
+ }
+ })
+ },
+
+ goSpecial: function (e) {
+ let id = e.currentTarget.dataset.id;
+ id && wx.navigateTo({
+ url: `/eaterplanet_ecommerce/moduleA/special/index?id=${id}`,
+ })
+ },
+
+ openSku: function (e) {
+ if (!this.authModal()) return;
+ let shopidx = e.currentTarget.dataset.idx;
+ let specialList = this.data.specialList;
+ let rushList = specialList[shopidx].list || [];
+ this.setData({ list: rushList })
+
+ var that = this;
+ let idx = e.currentTarget.dataset.gidx;
+ let spuItem = rushList[idx];
+
+ var goods_id = spuItem.actId;
+ var options = spuItem.skuList;
+ that.setData({
+ addCar_goodsid: goods_id
+ })
+
+ let list = options.list || [];
+ let arr = [];
+ if (list.length > 0) {
+ for (let i = 0; i < list.length; i++) {
+ let sku = list[i]['option_value'][0];
+ let temp = {
+ name: sku['name'],
+ id: sku['option_value_id'],
+ index: i,
+ idx: 0
+ };
+ arr.push(temp);
+ }
+ //把单价剔除出来begin
+
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ var cur_sku_arr = options.sku_mu_list[id];
+ that.setData({
+ sku: arr,
+ sku_val: 1,
+ cur_sku_arr: cur_sku_arr,
+ skuList: spuItem.skuList,
+ visible: true,
+ showSku: true
+ });
+ } else {
+ let goodsInfo = spuItem;
+ that.setData({
+ sku: [],
+ sku_val: 1,
+ skuList: [],
+ cur_sku_arr: goodsInfo
+ })
+ let formIds = {
+ detail: {
+ formId: ""
+ }
+ };
+ formIds.detail.formId = "the formId is a mock one";
+ that.gocarfrom(formIds);
+ }
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.noMore = false;
+ this.page = 1;
+ let that = this;
+ that.setData({ list: [], specialList: [] },()=>{
+ that.getData();
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ this.noMore || this.getData();
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var share_title = '活动专题列表';
+ var share_id = wx.getStorageSync('member_id');
+ var share_path = `eaterplanet_ecommerce/moduleA/special/list?share_id=${share_id}`;
+
+ return {
+ title: share_title,
+ path: share_path,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function () {
+ var share_title = '活动专题列表';
+ var share_id = wx.getStorageSync('member_id');
+
+ var query= `share_id=${share_id}`;
+ return {
+ title: share_title,
+ query,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/special/list.json b/eaterplanet_ecommerce/moduleA/special/list.json
new file mode 100644
index 0000000..6f2be8f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/special/list.json
@@ -0,0 +1,14 @@
+{
+ "navigationBarTitleText": "专题列表",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-sku": "../../components/sku/index",
+ "i-img": "../../components/img/index",
+ "i-button": "../../components/button/index",
+ "i-router-link": "../../components/router-link/router-link",
+ "i-empty": "../../components/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/special/list.wxml b/eaterplanet_ecommerce/moduleA/special/list.wxml
new file mode 100644
index 0000000..9254338
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/special/list.wxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+ 已抢光
+ {{item.spuName}}
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无内容~
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/special/list.wxss b/eaterplanet_ecommerce/moduleA/special/list.wxss
new file mode 100644
index 0000000..16996ee
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/special/list.wxss
@@ -0,0 +1,90 @@
+page {
+ background-color: #f8f8f8;
+}
+
+.topic {
+ padding-bottom: 30rpx;
+ margin-bottom: 20rpx;
+ background-color: #fff;
+}
+
+.topic-img {
+ width: 100%;
+}
+
+.new-comers {
+ position: relative;
+}
+
+.new-comers-scroll {
+ max-height: 340rpx;
+}
+
+.new-comers-wrap {
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+}
+
+.new-comers-item {
+ width: 240rpx;
+ box-sizing: border-box;
+ padding: 20rpx;
+ font-size: 28rpx;
+}
+
+.new-comers-item .new-img {
+ width: 200rpx;
+ height: 180rpx;
+ margin-bottom: 20rpx;
+}
+
+.new-comers-item .title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.new-comers-item .new-bot {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 10rpx;
+}
+
+.new-comers-item .add-cart {
+ width: 44rpx;
+ height: 44rpx;
+ padding: 0;
+ margin: 0;
+}
+
+.new-comers-item .add-cart .img {
+ width: 44rpx;
+ height: 44rpx;
+ display: block;
+}
+
+.new-comers-item .price {
+ color: #ff758c;
+}
+
+.new-comers-item {
+ position: relative;
+}
+
+.new-comers-item .act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 80rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/static/1.png b/eaterplanet_ecommerce/moduleA/static/1.png
new file mode 100644
index 0000000..064daa0
Binary files /dev/null and b/eaterplanet_ecommerce/moduleA/static/1.png differ
diff --git a/eaterplanet_ecommerce/moduleA/static/2.png b/eaterplanet_ecommerce/moduleA/static/2.png
new file mode 100644
index 0000000..bb86d0c
Binary files /dev/null and b/eaterplanet_ecommerce/moduleA/static/2.png differ
diff --git a/eaterplanet_ecommerce/moduleA/static/3.png b/eaterplanet_ecommerce/moduleA/static/3.png
new file mode 100644
index 0000000..08d6820
Binary files /dev/null and b/eaterplanet_ecommerce/moduleA/static/3.png differ
diff --git a/eaterplanet_ecommerce/moduleA/static/tzph-top.png b/eaterplanet_ecommerce/moduleA/static/tzph-top.png
new file mode 100644
index 0000000..b61718d
Binary files /dev/null and b/eaterplanet_ecommerce/moduleA/static/tzph-top.png differ
diff --git a/eaterplanet_ecommerce/moduleA/video/detail.js b/eaterplanet_ecommerce/moduleA/video/detail.js
new file mode 100644
index 0000000..6b8443b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/video/detail.js
@@ -0,0 +1,235 @@
+var app = getApp();
+
+Page({
+
+ data: {
+ is_heng: 1,
+ rushList: [],
+ current: 0
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ onLoad: function (options) {
+ app.setShareConfig();
+ let id = options.id || '';
+ if (!id) {
+ wx.showModal({
+ title: '提示',
+ content: '参数错误',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ }
+ }
+ })
+ return;
+ }
+ this.getData(id);
+ this.get_goods_details(id);
+
+ let showBackBtn = false;
+ let pages_all = getCurrentPages();
+ if (pages_all.length > 1) {
+ showBackBtn = true;
+ }
+ this.setData({ showBackBtn })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ goDetails: function(){
+ let goods = this.data.goods;
+ let id = goods.id || '';
+ id && wx.redirectTo({
+ url: `/eaterplanet_ecommerce/pages/goods/goodsDetail?id=${id}`,
+ })
+ },
+
+ get_goods_details: function (id) {
+ let that = this;
+ if (!id) {
+ wx.hideLoading();
+ wx.showModal({
+ title: '提示',
+ content: '参数错误',
+ showCancel: false,
+ confirmColor: '#F75451',
+ success(res) {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ }
+ }
+ })
+ return false;
+ }
+ let token = wx.getStorageSync('token');
+ let community = wx.getStorageSync('community');
+ let community_id = community.communityId || '';
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'goods.get_goods_detail',
+ token: token,
+ id,
+ community_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ let goods = (res.data.data && res.data.data.goods) || '';
+ // 商品不存在
+ if (!goods || goods.length == 0 || Object.keys(goods) == '') {
+ wx.showModal({
+ title: '提示',
+ content: '该商品不存在,回首页',
+ showCancel: false,
+ confirmColor: '#F75451',
+ success(res) {
+ if (res.confirm) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ }
+ }
+ })
+ }
+ that.currentOptions = res.data.data.options;
+ that.setData({
+ goods: goods,
+ options: res.data.data.options,
+ order: {
+ goods_id: res.data.data.goods.goods_id,
+ pin_id: res.data.data.pin_id,
+ },
+ share_title: goods.share_title,
+ goods_image: res.data.data.goods_image
+ })
+ }
+ })
+ },
+
+ getData: function (goodsId) {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.load_gps_goodslist',
+ token: token,
+ pageNum: 1,
+ head_id: cur_community.communityId,
+ per_page: 10000,
+ is_video: 1
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let rdata = res.data;
+ let rushList = rdata.list || [];
+ let current = rushList.findIndex(item => item.actId == goodsId);
+ that.setData({ rushList, current });
+ }
+ }
+ })
+ },
+
+ changeSubject: function(t){
+ let rushList = this.data.rushList;
+ if (t < 0 || rushList.length<=1) {
+ wx.showToast({
+ title: "没有上一个视频了~",
+ icon: "none",
+ duration: 2000
+ });
+ } else {
+ console.log(t);
+ if (t>rushList.length-1) {
+ wx.showToast({
+ title: "没有下一个视频了~",
+ icon: "none",
+ duration: 2000
+ });
+ return;
+ }
+ var that = this;
+ t = t || 0, that.setData({
+ current: t
+ }), this.get_goods_details(rushList[t].actId);
+ }
+ },
+
+ pre: function(){
+ this.changeSubject(this.data.current*1 - 1)
+ },
+
+ next: function () {
+ this.changeSubject(this.data.current*1 + 1)
+ },
+
+ _backhome: function() {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var goods = this.data.goods;
+ var share_title = this.data.share_title;
+ var share_id = wx.getStorageSync('member_id');
+ var share_path = `eaterplanet_ecommerce/moduleA/video/detail?id=${goods.id}&share_id=${share_id}`;
+ let shareImg = goods.goods_share_image;
+ console.log('商品分享地址:', share_path);
+
+ return {
+ title: share_title,
+ path: share_path,
+ imageUrl: shareImg,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function() {
+ var goods = this.data.goods;
+ var share_title = this.data.share_title;
+ var share_id = wx.getStorageSync('member_id');
+ let shareImg = goods.goods_share_image;
+
+ var query= `id=${goods.id}&share_id=${share_id}`;
+ return {
+ title: share_title,
+ imageUrl: shareImg,
+ query,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/video/detail.json b/eaterplanet_ecommerce/moduleA/video/detail.json
new file mode 100644
index 0000000..8ff54b5
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/video/detail.json
@@ -0,0 +1,7 @@
+{
+ "navigationStyle": "custom",
+ "usingComponents": {
+ "i-auth": "../../components/new-auth/index",
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/video/detail.wxml b/eaterplanet_ecommerce/moduleA/video/detail.wxml
new file mode 100644
index 0000000..9b2cf8e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/video/detail.wxml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{goods.goodsname}}
+
+ ¥{{goods.price_front}}.{{goods.price_after}}
+
+
+
+
+
+ 上一个商品
+ 下一个商品
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/video/detail.wxss b/eaterplanet_ecommerce/moduleA/video/detail.wxss
new file mode 100644
index 0000000..51e2a85
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/video/detail.wxss
@@ -0,0 +1,122 @@
+.main {
+ width: 750rpx;
+ height: 100%;
+ background: #000;
+ overflow: hidden;
+ z-index: 99999;
+}
+
+.main .section video {
+ width: 750rpx;
+ height: 100vh;
+}
+
+.goods {
+ width: 400rpx;
+ height: 150rpx;
+ background: #fff;
+ border-radius: 10rpx;
+ position: fixed;
+ bottom: 160rpx;
+ left: 20rpx;
+ z-index: 9998;
+ display: flex;
+}
+
+.goods .good-img {
+ width: 150rpx;
+ height: 150rpx;
+ margin-right: 10rpx;
+ box-sizing: border-box;
+ padding: 10rpx;
+}
+
+.good-img cover-image {
+ width: 150rpx;
+ height: 150rpx;
+ object-fit: cover;
+ border-radius: 10rpx;
+ overflow: hidden;
+}
+
+.good-title {
+ display: inline-block;
+ font-size: 26rpx;
+ margin-top: 10rpx;
+ height: 60rpx;
+ line-height: 30rpx;
+ white-space: pre-wrap;
+}
+
+.xqbottom {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 10rpx;
+}
+
+.good-price {
+ display: inline-block;
+ flex: 1;
+ font-size: 28rpx;
+ color: red;
+}
+
+.cart {
+ width: 45rpx;
+ height: 45rpx;
+ margin-left: 8rpx;
+}
+
+.switch {
+ display: flex;
+ position: fixed;
+ bottom: 40rpx;
+ color: #fff;
+ font-size: 30rpx;
+ font-weight: bold;
+ left: 115rpx;
+}
+
+.switch .an {
+ width: 250rpx;
+ height: 80rpx;
+ background: rgba(0, 0, 0, 0.3);
+ margin-left: 20rpx;
+ border-radius: 10rpx;
+ line-height: 80rpx;
+ text-align: center;
+}
+
+.switch .an:nth-child(2) {
+ margin-right: 20rpx;
+}
+
+.nav-btn {
+ position: relative;
+ top: 0;
+ left: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 31px;
+ height: 31px;
+ line-height: 31px;
+ padding: 0;
+ min-width: 31px;
+ max-width: 31px;
+ text-align: center;
+ border-radius: 50%;
+ min-height: initial;
+ box-sizing: border-box;
+ background: rgba(0,0,0,0.25);
+ border: 1px solid rgba(255,255,255,0.05);
+ color: #fff;
+ backdrop-filter: blur(20px);
+}
+
+.nav-btn .img {
+ width: 20px;
+ height: 20px;
+ vertical-align: top;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/video/index.js b/eaterplanet_ecommerce/moduleA/video/index.js
new file mode 100644
index 0000000..ca3e18d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/video/index.js
@@ -0,0 +1,178 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ rushList: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ shareInfo: ''
+ },
+ pageNum: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ app.setShareConfig();
+ status.setNavBgColor();
+ this.getData();
+ this.getInfo();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ const that = this;
+ util.check_login_new().then((res) => {
+ let needAuth = !res;
+ that.setData({ needAuth })
+ if (res) {
+ (0, status.cartNum)('', true).then((res) => {
+ res.code == 0 && that.setData({
+ cartNum: res.data
+ })
+ });
+ }
+ })
+ },
+
+ getInfo: function() {
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'goods.get_video_list_share'
+ },
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ wx.setNavigationBarTitle({
+ title: res.data.data.nav_title || '详情',
+ })
+ that.setData({ shareInfo: res.data.data })
+ }
+ }
+ })
+ },
+
+ /**
+ * 获取商品列表
+ */
+ getData: function() {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ var cur_community = wx.getStorageSync('community');
+ wx.showLoading();
+
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.load_gps_goodslist',
+ token: token,
+ pageNum: that.pageNum,
+ head_id: cur_community.communityId,
+ per_page: 12,
+ is_video: 1
+ },
+ dataType: 'json',
+ success: function(res) {
+ if (res.data.code == 0) {
+ let rushList = '';
+ let h = {};
+ let rdata = res.data;
+ if (rdata.list.length < 12) h.noMore = true;
+ let oldRushList = that.data.rushList;
+ rushList = oldRushList.concat(rdata.list);
+ that.pageNum++;
+ that.setData({
+ rushList: rushList,
+ tip: '',
+ ...h
+ });
+ } else if (res.data.code == 1) {
+ if (that.pageNum == 1) that.setData({ noData: 1 })
+ that.setData({ loadMore: false, noMore: false, loadText: "没有更多记录了~" })
+ } else if (res.data.code == 2) {
+ //no login
+ that.setData({
+ needAuth: true
+ })
+ }
+ },
+ complete: function() {
+ wx.hideLoading();
+ }
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+ let shareInfo = this.data.shareInfo;
+ let share_title = shareInfo.share_title || '视频';
+ let shareImg = shareInfo.share_poster || '';
+ var share_id = wx.getStorageSync('member_id');
+ var share_path = `eaterplanet_ecommerce/moduleA/video/index?share_id=${share_id}`;
+
+ return {
+ title: share_title,
+ path: share_path,
+ imageUrl: shareImg,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function(res) {
+ let shareInfo = this.data.shareInfo;
+ let title = shareInfo.share_title || '视频';
+ let imageUrl = shareInfo.share_poster || '';
+ var share_id = wx.getStorageSync('member_id');
+
+ var query= `share_id=${share_id}`;
+ return {
+ title,
+ query,
+ imageUrl,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/video/index.json b/eaterplanet_ecommerce/moduleA/video/index.json
new file mode 100644
index 0000000..5cc6f0b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/video/index.json
@@ -0,0 +1,12 @@
+{
+ "navigationBarTitleText": "视频",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-img": "../../components/img/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-router-link": "../../components/router-link/router-link",
+ "i-empty": "../../components/empty/index",
+ "i-tabbar": "../../components/tabbar/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/video/index.wxml b/eaterplanet_ecommerce/moduleA/video/index.wxml
new file mode 100644
index 0000000..2a87e37
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/video/index.wxml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+ {{item.spuName}}
+
+
+ ¥{{item.actPrice[0]}}.{{item.actPrice[1]}}
+
+ ¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}
+
+
+
+
+
+
+
+ 暂时没有商品~
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/video/index.wxss b/eaterplanet_ecommerce/moduleA/video/index.wxss
new file mode 100644
index 0000000..96035f7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/video/index.wxss
@@ -0,0 +1,74 @@
+.list {
+ position: relative;
+ display: flex;
+ flex-wrap: wrap;
+ padding: 20rpx 10rpx;
+}
+
+.list .item {
+ position: relative;
+ width: 345rpx;
+ margin: 0 10rpx 20rpx;
+ border-radius: 10rpx;
+ background: #fff;
+ overflow: hidden;
+ box-shadow: 0 0 3px #ccc;
+}
+
+.list .item .img {
+ width: 345rpx;
+ height: 345rpx;
+}
+
+.spu-play {
+ position: absolute;
+ left: 50%;
+ width: 150rpx;
+ height: 150rpx;
+ z-index: 1;
+ top: 98rpx;
+ margin-left: -75rpx;
+}
+
+.list .item .cont {
+ padding: 20rpx;
+}
+
+.list .item .tit {
+ font-size: 28rpx;
+ font-weight: bold;
+ line-height: 1.4;
+ margin-bottom: 15rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ word-break: break-all;
+}
+
+.spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+ line-height: 26rpx;
+ overflow: hidden;
+ margin-top: 10rpx;
+}
+
+.spu-price .sale-price {
+ color: #ff5344;
+ margin-right: 12rpx;
+}
+
+.spu-price .sale-price .span {
+ font-size: 46rpx;
+ line-height: 42rpx;
+ margin: 0;
+ font-weight: bold;
+}
+
+.spu-price .market-price {
+ text-decoration: line-through;
+ color: #999;
+ margin-right: 20rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/vip/notice.js b/eaterplanet_ecommerce/moduleA/vip/notice.js
new file mode 100644
index 0000000..9088e1f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/vip/notice.js
@@ -0,0 +1,53 @@
+var app = getApp();
+
+Page({
+
+ data: {
+
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+ this.getData();
+ },
+
+ onShow: function () {
+
+ },
+
+ getData: function () {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'vipcard.get_vipcard_baseinfo',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let { vipcard_buy_pagenotice } = res.data.data;
+ that.setData({ vipcard_buy_pagenotice })
+ }
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/vip/notice.json b/eaterplanet_ecommerce/moduleA/vip/notice.json
new file mode 100644
index 0000000..fe14af7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/vip/notice.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "权益规则",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/vip/notice.wxml b/eaterplanet_ecommerce/moduleA/vip/notice.wxml
new file mode 100644
index 0000000..10e4a35
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/vip/notice.wxml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/eaterplanet_ecommerce/moduleA/vip/notice.wxss b/eaterplanet_ecommerce/moduleA/vip/notice.wxss
new file mode 100644
index 0000000..fed6a5e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/vip/notice.wxss
@@ -0,0 +1 @@
+/* eaterplanet_ecommerce/moduleA/vip/notice.wxss */
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/vip/upgrade.js b/eaterplanet_ecommerce/moduleA/vip/upgrade.js
new file mode 100644
index 0000000..5efe7f6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/vip/upgrade.js
@@ -0,0 +1,310 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('../../mixin/compoentCartMixin.js')],
+ data: {
+ classification: {
+ tabs: [],
+ activeIndex: 0
+ },
+ rushList: [],
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ is_show_vipgoods: 1
+ },
+ pageNum:1,
+ canLoad: 1,
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ status.setNavBgColor();
+ this.getData();
+ this.getList();
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let that = this;
+ wx.showLoading();
+ this.pageNum = 1;
+ that.setData({
+ needAuth: false,
+ showAuthModal: false,
+ classification: {
+ tabs: [],
+ activeIndex: 0
+ },
+ rushList: [],
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false
+ });
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ let url = '/eaterplanet_ecommerce/moduleA/vip/upgrade';
+ app.globalData.navBackUrl = url;
+ wx.redirectTo({ url })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ that.setData({
+ needAuth: true
+ })
+ } else {
+ this.setData({ needAuth: false });
+ (0, status.cartNum)('', true).then((res) => {
+ res.code == 0 && that.setData({ cartNum: res.data })
+ });
+ }
+ })
+ },
+
+ getData: function(){
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'vipcard.get_vipcard_baseinfo',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let {
+ member_info,
+ card_equity_list,
+ card_list,
+ is_open_vipcard_buy,
+ modify_vipcard_name,
+ is_vip_card_member,
+ vipcard_unopen_headbg,
+ vipcard_effect_headbg,
+ vipcard_afterefect_headbg,
+ vipcard_buy_pagenotice,
+ vipcard_equity_notice,
+ is_show_vipgoods,
+ category_list
+ // del_vip_day
+ } = res.data.data;
+ wx.setNavigationBarTitle({ title: modify_vipcard_name || '会员中心' })
+
+ let params = {
+ classification: {}
+ };
+ category_list = category_list || [];
+ if (category_list.length > 0) {
+ category_list.unshift({
+ name: '全部',
+ id: 0
+ })
+ params.isShowClassification = true;
+ params.classification.tabs = category_list;
+ } else {
+ params.isShowClassification = false;
+ }
+
+ card_list.map(item=>{
+ let expire_day = item.expire_day.split('.');
+ return item.expire_day = expire_day[0];
+ })
+
+ that.setData({
+ member_info,
+ card_equity_list,
+ card_list,
+ is_open_vipcard_buy,
+ modify_vipcard_name,
+ is_vip_card_member,
+ vipcard_unopen_headbg,
+ vipcard_effect_headbg,
+ vipcard_afterefect_headbg,
+ vipcard_equity_notice,
+ del_vip_day: res.data.del_vip_day || '',
+ is_show_vipgoods,
+ ...params
+ })
+ } else {
+ app.util.message('未登录', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ }
+ }
+ })
+ },
+
+ choosecard: function (t) {
+ this.setData({
+ selectid: t.currentTarget.dataset.id
+ });
+ },
+
+ submitpay: function (t) {
+ if (wx.getStorageSync("token")) {
+ var rech_id = this.data.selectid, token = wx.getStorageSync("token");
+ if (void 0 == rech_id) return wx.showToast({
+ icon: "none",
+ title: "请选择要开通的会员类型"
+ });
+ app.util.request({
+ url: "entry/wxapp/user",
+ data: {
+ controller: "vipcard.wxcharge",
+ token,
+ rech_id
+ },
+ dataType: "json",
+ success: function (res) {
+ if(res.data.is_zero_pay==1) {
+ wx.showToast({
+ title: "支付成功",
+ icon: "none",
+ duration: 2000,
+ success: function () {
+ setTimeout(function () {
+ wx.redirectTo({
+ url: "/eaterplanet_ecommerce/moduleA/vip/upgrade"
+ });
+ }, 2000);
+ }
+ });
+ } else {
+ wx.requestPayment({
+ appId: res.data.appId,
+ timeStamp: res.data.timeStamp,
+ nonceStr: res.data.nonceStr,
+ package: res.data.package,
+ signType: res.data.signType,
+ paySign: res.data.paySign,
+ success: function (wxres) {
+ wx.showToast({
+ title: "支付成功",
+ icon: "none",
+ duration: 2000,
+ success: function () {
+ setTimeout(function () {
+ wx.redirectTo({
+ url: "/eaterplanet_ecommerce/moduleA/vip/upgrade"
+ });
+ }, 2000);
+ }
+ });
+ },
+ fail: function (error) {
+ wx.showToast({
+ icon: "none",
+ title: "支付失败,请重试!"
+ });
+ }
+ })
+ }
+ }
+ });
+ } else{
+ this.setData({
+ needAuth: true
+ });
+ }
+ },
+
+ /**
+ * 监控分类导航
+ */
+ classificationChange: function (t) {
+ wx.showLoading();
+ var that = this;
+ this.pageNum = 1;
+ this.canLoad = 1;
+ this.setData({
+ rushList: [],
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ "classification.activeIndex": t.detail.e,
+ classificationId: t.detail.a
+ }, function () {
+ that.getList();
+ });
+ },
+
+ /**
+ * 获取商品列表
+ */
+ getList: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let gid = that.data.classificationId;
+ let community = wx.getStorageSync('community');
+ let head_id = community.communityId || 0;
+
+ this.canLoad==1 && (that.canLoad=0), app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'vipcard.get_vipgoods_list',
+ pageNum: this.pageNum,
+ gid,
+ token,
+ head_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ wx.stopPullDownRefresh();
+ if (res.data.code == 0) {
+ let oldRushList = that.data.rushList;
+ let h = {}, list = res.data.list;
+ if (that.pageNum == 1 && list.length == 0) h.showEmpty = true;
+ if(list.length < 10) h.loadMore = false;
+ let rushList = oldRushList.concat(list);
+ let rdata = res.data;
+ let reduction = { full_money: rdata.full_money, full_reducemoney: rdata.full_reducemoney, is_open_fullreduction: rdata.is_open_fullreduction }
+ h.rushList = rushList;
+ h.reduction = reduction;
+ h.loadOver = true;
+ h.loadText = that.data.loadMore ? "加载中..." : "没有更多商品了~";
+ console.log(h)
+ that.setData(h, function () {
+ that.pageNum += 1;
+ })
+ } else if (res.data.code == 1) {
+ let s = { loadMore: false }
+ if (that.pageNum == 1) s.showEmpty = true;
+ that.setData(s);
+ } else if (res.data.code == 2) {
+ //no login
+ that.setData({ needAuth: true })
+ }
+ console.log('that.canLoad', that.canLoad);
+ that.canLoad=1;
+ }
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ console.log('这是我的底线', this.canLoad);
+ this.data.loadMore && (this.canLoad==1) && (this.setData({ loadOver: false }), this.getList());
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleA/vip/upgrade.json b/eaterplanet_ecommerce/moduleA/vip/upgrade.json
new file mode 100644
index 0000000..a97d73b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/vip/upgrade.json
@@ -0,0 +1,15 @@
+{
+ "navigationBarTextStyle": "white",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-router-link": "../../components/router-link/router-link",
+ "i-img": "../../components/img/index",
+ "i-tabs": "../../components/tabs/index",
+ "i-type-item": "../../pages/type/type-item",
+ "sku": "../../components/sku/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-vip-modal": "../../components/vipModal/index",
+ "i-cart-btn": "../../components/cartBtn/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/vip/upgrade.wxml b/eaterplanet_ecommerce/moduleA/vip/upgrade.wxml
new file mode 100644
index 0000000..fe5935c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/vip/upgrade.wxml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+ 开通{{modify_vipcard_name}}
+
+
+ 尊享特权·会员专享价
+
+
+
+
+
+
+
+
+
+
+
+ {{member_info.username}}
+ 有效期至:{{member_info.card_end_time}}
+
+
+ 立即续卡
+
+
+ 尊享特权·会员专享价
+
+
+
+
+
+
+
+
+
+
+ 开通{{modify_vipcard_name}}
+
+
+ 尊享特权·会员专享价
+
+
+
+
+
+
+
+ {{modify_vipcard_name}}专享特权
+
+
+
+ {{item.equity_name}}
+
+
+
+
+
+ {{modify_vipcard_name}}类型
+
+
+
+ {{item.cardname}}
+
+ ¥{{item.price}}
+ ¥{{item.orignprice}}
+ 有效期 {{item.expire_day%30==0?item.expire_day/30+'个月':item.expire_day+'天'}}
+
+
+
+
+
+
+ {{is_vip_card_member!=0?"立即续费":"立即购买"}}
+
+
+
+
+
+ {{modify_vipcard_name}}专享特价
+
+
+
+
+
+
+
+
+
+ 暂时没有专享商品
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleA/vip/upgrade.wxss b/eaterplanet_ecommerce/moduleA/vip/upgrade.wxss
new file mode 100644
index 0000000..00bd0ee
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleA/vip/upgrade.wxss
@@ -0,0 +1,264 @@
+.section {
+ overflow-x: hidden;
+ background-color: #fff;
+}
+
+.topImg {
+ width: 100%;
+}
+
+.section .head {
+ width: 130%;
+ height: 350rpx;
+ border-radius: 0 0 50% 50%;
+ background: #2e3748;
+ position: relative;
+ left: -15%;
+ overflow: hidden;
+}
+
+.section .head1 {
+ width: 150%;
+ height: 240rpx;
+ border-radius: 0 0 50% 50%;
+ background: #2e3748;
+ position: relative;
+ left: -25%;
+ padding-top: 30rpx;
+}
+
+.section .head .card {
+ width: 538rpx;
+ height: 255rpx;
+ background: linear-gradient(to right, #e6b980 0%, #eacda3 100%);
+ margin: 30rpx auto 0 auto;
+ border-radius: 25rpx 25rpx 0 0;
+ padding: 50rpx;
+ text-align: center;
+ overflow: hidden;
+}
+
+.section .head1 .card {
+ width: 610rpx;
+ height: 295rpx;
+ background: linear-gradient(to right, #e6b980 0%, #eacda3 100%);
+ margin: 0 auto;
+ border-radius: 25rpx;
+ padding: 30rpx 40rpx;
+ overflow: hidden;
+ color: #282e42;
+}
+
+.card .card-title {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #885824;
+ font-size: 26rpx;
+}
+
+.card .card-title.vipinfo {
+ color: #282e42;
+}
+
+.card .card-title .vipinfo-avatar {
+ width: 120rpx;
+ height: 120rpx;
+ border-radius: 50%;
+ margin-right: 20rpx;
+}
+
+.card .card-title .vipinfo-r {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+}
+
+.card .card-title .vipinfo-name {
+ font-size: 30rpx;
+}
+
+.card .card-title .endtime {
+ font-size: 26rpx;
+ margin-top: 10rpx;
+ font-weight: 500;
+}
+
+.card .card-title .vip-xucard {
+ position: absolute;
+ display: flex;
+ align-items: center;
+ padding: 13rpx 20rpx;
+ background: #282e42;
+ border-radius: 50px;
+ color: #fff;
+ font-size: 26rpx;
+ right: 22%;
+}
+
+.card .sheng {
+ margin-top: 30rpx;
+ font-size: 30rpx;
+}
+
+.card .sheng text {
+ color: #fff;
+}
+
+.card .card-title .title-name {
+ margin: 0 20rpx;
+ color:linear-gradient(to right,#72491d,#885824);
+}
+
+.card .card-title text {
+ flex: 1;
+ border-top: 0.1rpx solid #72491d;
+}
+
+.section .content {
+
+ background-image: linear-gradient(to right,#72491d,#885824);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+}
+
+.card .bigtitle {
+ margin: 30rpx 0;
+ font-size: 55rpx;
+}
+
+.card .smalltitle {
+ font-size: 30rpx;
+ font-weight: 600;
+}
+
+.section .privilege {
+ padding: 30rpx;
+}
+
+.section .privilege1 {
+ padding: 140rpx 30rpx 0 30rpx;
+ background-color: #fff;
+}
+
+.section .privilege .privilegelist {
+ display: flex;
+ width: 100%;
+ overflow-x: scroll;
+ white-space: nowrap;
+ padding-top: 30rpx;
+}
+
+.section .privilege .privilegelist .list-item {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ margin-right: 30rpx;
+ min-width: 140rpx;
+ height: 160rpx;
+}
+
+.section .privilege .privilegelist .list-item image {
+ width: 90rpx;
+ height: 90rpx;
+ border-radius: 10rpx;
+}
+
+.section .privilege .privilegelist .list-item view {
+ font-size: 24rpx;
+ margin-top: 8rpx;
+}
+
+.section .greentitle {
+ font-size: 35rpx;
+ color: #2f3746;
+}
+
+.viptype {
+ padding: 30rpx;
+ margin-top: 20rpx;
+ background-color: #fff;
+
+}
+
+.viplist .list {
+ display: flex;
+ overflow-x: scroll;
+ overflow-y: hidden;
+ white-space: nowrap;
+ margin: 30rpx 0;
+}
+
+.viplist .list .list-item {
+ border: 1rpx solid #cca704;
+ padding: 18rpx 30rpx;
+ border-radius: 15rpx;
+ min-width: 160rpx;
+ max-width: 160rpx;
+ height: 180rpx;
+ text-align: center;
+ margin-right: 20rpx;
+}
+
+.viplist .list .list-item.active {
+ background: rgba(194, 177, 30, 0.2);
+}
+
+.gray {
+ font-family: DIN;
+ color: #999;
+}
+
+.green {
+ font-family: DIN;
+ color: #cca704;
+}
+
+.section .apply-btn {
+ background: linear-gradient(to bottom,#394456,#2F3848);
+ width: 68%;
+ color: #cca704;
+ font-size: 30rpx;
+ text-align: center;
+ border-radius: 50rpx;
+ padding: 20rpx 0;
+ margin: 0 auto 5rpx;
+ box-shadow: 1rpx 1rpx 5rpx #ccc;
+}
+
+.cate {
+ position: sticky;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 10;
+ background: linear-gradient(to right, #e6b980 0%, #eacda3 100%);
+
+}
+
+.goodsItem {
+ border-bottom: .1rpx solid #f5f5f5;
+}
+
+.none-rush-list {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding-bottom: 140rpx;
+ padding-top: 140rpx;
+}
+
+.none-rush-list .img-block {
+ width: 240rpx;
+ height: 240rpx;
+ margin-bottom: 30rpx;
+}
+
+.none-rush-list .h1 {
+ font-size: 32rpx;
+ line-height: 32rpx;
+ color: #444;
+ margin-bottom: 20rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/components/presale-goodsone.js b/eaterplanet_ecommerce/moduleB/components/presale-goodsone.js
new file mode 100644
index 0000000..48ba481
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/presale-goodsone.js
@@ -0,0 +1,5 @@
+var presaleBehavior = require('./presaleBehavior.js');
+
+Component({
+ behaviors: [presaleBehavior]
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/presale-goodsone.json b/eaterplanet_ecommerce/moduleB/components/presale-goodsone.json
new file mode 100644
index 0000000..0d19635
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/presale-goodsone.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../../components/button/index",
+ "i-img": "../../components/img/index",
+ "i-router-link": "../../components/router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/presale-goodsone.wxml b/eaterplanet_ecommerce/moduleB/components/presale-goodsone.wxml
new file mode 100644
index 0000000..57dae80
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/presale-goodsone.wxml
@@ -0,0 +1,48 @@
+
+
+
+
+ {{spuItem.label_info.tagcontent}}
+
+
+
+
+ 满{{reduction.full_money}}减{{reduction.full_reducemoney}}
+ 限购
+
+
+
+
+
+ {{spuItem.spuName}}
+
+
+
+ 定金¥{{spuItem.presale_ding_money}}可抵¥{{spuItem.presale_deduction_money>0?spuItem.presale_deduction_money:spuItem.presale_ding_money}}
+ 全款预售
+
+
+
+ 尾款:¥{{weikuan}}
+ 预售时间:{{spuItem.presale_ding_time_start}}-{{spuItem.presale_ding_time_end}}
+
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+ ¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}
+
+
+
+
+ 已抢光
+
+ 未开始
+ 已结束
+ 抢购
+
+
+ 已抢光
+ 即将开抢
+ 已结束
+
diff --git a/eaterplanet_ecommerce/moduleB/components/presale-goodsone.wxss b/eaterplanet_ecommerce/moduleB/components/presale-goodsone.wxss
new file mode 100644
index 0000000..29ab264
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/presale-goodsone.wxss
@@ -0,0 +1,177 @@
+.spu-content {
+ width: 350rpx;
+ height: 600rpx;
+ border-radius: 20rpx;
+ background: #fff;
+ box-sizing: border-box;
+ padding: 30rpx 25rpx;
+ box-shadow: 0 0 40rpx rgba(0, 0, 0, 0.05);
+ position: relative;
+ margin-bottom: 10rpx;
+}
+
+.spu-img {
+ width: 300rpx;
+ height: 300rpx;
+ border-radius: 10rpx;
+}
+
+.spu-content .spu-title {
+ font-size: 28rpx;
+ line-height: 36rpx;
+ height: 36rpx;
+ color: #444;
+ margin-bottom: 16rpx;
+ font-weight: 500;
+ position: relative;
+ margin-top: 16rpx;
+}
+
+.spu-content .spu-title .span {
+ display: block;
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.spu-content .spu-price {
+ display: flex;
+ align-items: flex-end;
+ font-size: 20rpx;
+ margin-top: 30rpx;
+}
+
+.spu-content .spu-price .sale-price {
+ font-family: DIN;
+ color: #ff758c;
+ margin-right: 8rpx;
+}
+
+.spu-content .spu-price .sale-price .span {
+ font-size: 40rpx;
+ line-height: 40rpx;
+ margin-left: 4rpx;
+ font-weight: 500;
+ font-weight: bold;
+}
+
+.spu-content .spu-price .market-price {
+ font-family: DIN;
+ text-decoration: line-through;
+ color: #999;
+}
+
+.spu-content .add-cart, .spu-content .add-cart-disabled {
+ width: 100rpx;
+ height: 50rpx;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ right: 20rpx;
+ bottom: 30rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: linear-gradient(90deg, #ff5041 0%, #ff695c 100%);
+ color: #fff;
+ border-radius: 25rpx;
+ font-size: 24rpx;
+ font-weight: bold;
+}
+
+.spu-content .add-cart-disabled {
+ background: #ccc;
+}
+
+.spu-content .pin-tag {
+ display: inline-block;
+ font-size: 24rpx;
+ padding: 6rpx 10rpx;
+ margin-right: 10rpx;
+ border: 0.1rpx solid #ff5344;
+ line-height: 1;
+ vertical-align: middle;
+ color: #ff5344;
+ border-radius: 8rpx;
+ font-weight: bold;
+}
+
+.spu-play {
+ position: absolute;
+ left: 50%;
+ top: 95rpx;
+ width: 100rpx;
+ height: 100rpx;
+ margin-left: -50rpx;
+}
+
+.spu-play .img {
+ width: 100%;
+ height: 100%;
+}
+
+.mask {
+ background: rgba(255, 255, 255, 0.5);
+ width: 300rpx;
+ height: 300rpx;
+ position: absolute;
+ left: 25rpx;
+ top: 30rpx;
+}
+
+.act-end {
+ position: absolute;
+ height: 60rpx;
+ border-radius: 10rpx;
+ background: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+ line-height: 60rpx;
+ left: 50%;
+ top: 140rpx;
+ padding: 0 12rpx;
+ transform: translateX(-50%);
+}
+
+/* 标签 */
+.spu-content .item-tag {
+ position: absolute;
+ left: 25rpx;
+ top: 35rpx;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.spu-content .item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.spu-content .item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
+
+.desc {
+ font-size: 21rpx;
+ color: #999;
+ height: 56rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.js b/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.js
new file mode 100644
index 0000000..48ba481
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.js
@@ -0,0 +1,5 @@
+var presaleBehavior = require('./presaleBehavior.js');
+
+Component({
+ behaviors: [presaleBehavior]
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.json b/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.json
new file mode 100644
index 0000000..0d19635
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../../components/button/index",
+ "i-img": "../../components/img/index",
+ "i-router-link": "../../components/router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.wxml b/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.wxml
new file mode 100644
index 0000000..be3c3be
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.wxml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+ {{spuItem.label_info.tagcontent}}
+
+
+
+
+
+
+ 已抢光
+ 已结束
+
+
+
+ {{spuItem.spuName}}
+
+
+ {{spuItem.spuDescribe}}
+
+
+
+ 定金¥{{spuItem.presale_ding_money}}可抵¥{{spuItem.presale_deduction_money>0?spuItem.presale_deduction_money:spuItem.presale_ding_money}}
+ 全款预售
+
+ 尾款:¥{{weikuan}}
+ 预售时间:{{spuItem.presale_ding_time_start}}-{{spuItem.presale_ding_time_end}}
+
+
+
+
+ ¥{{dingArr[0]}}.{{dingArr[1]}}
+
+ ¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}
+
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+ ¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}
+
+
+
+
+ 未开始
+ 已结束
+
+ 已抢光
+
+ 去抢购
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.wxss b/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.wxss
new file mode 100644
index 0000000..fa6daa6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/presale-goodsrow.wxss
@@ -0,0 +1,60 @@
+/* eaterplanet_ecommerce/moduleB/components/presale-goodsrow.wxss */
+@import "/eaterplanet_ecommerce/pages/index/template/pinrow.wxss";
+
+.pinrow-wrap {
+ background: #ffffff;
+ border-radius: 10rpx;
+}
+
+.pinrow-wrap .spu-content {
+ margin-top: 0;
+}
+
+.pinrow-wrap .mask {
+ width: 240rpx;
+ height: 240rpx;
+ left: 20rpx;
+ top: 20rpx;
+}
+
+.pinrow-wrap .act-end {
+ z-index: 1;
+ left: 118rpx;
+ top: 95rpx;
+}
+
+/* 标签 */
+
+.item-tag {
+ position: absolute;
+ left: 10rpx;
+ top: 20rpx;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 1;
+ color: #fff;
+ text-align: center;
+}
+
+.item-tag-bg {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 54rpx;
+ height: 62rpx;
+ z-index: 0;
+}
+
+.item-tag .tag-name {
+ position: relative;
+ padding-top: 6rpx;
+ font-size: 20rpx;
+ line-height: 1;
+ font-weight: 600;
+ z-index: 1;
+}
+
+.item-tag .tag-name.two-word {
+ font-size: 22rpx;
+ padding-top: 14rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/components/presaleBehavior.js b/eaterplanet_ecommerce/moduleB/components/presaleBehavior.js
new file mode 100644
index 0000000..713d56c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/presaleBehavior.js
@@ -0,0 +1,93 @@
+let app = getApp();
+
+module.exports = Behavior({
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ actId: "",
+ skuId: "",
+ spuImage: "",
+ spuName: "",
+ endTime: 0,
+ beginTime: "",
+ actPrice: ["", ""],
+ marketPrice: ["", ""],
+ spuCanBuyNum: "",
+ soldNum: "",
+ actId: "",
+ limitMemberNum: "",
+ limitOrderNum: "",
+ serverTime: "",
+ isLimit: false,
+ skuList: [],
+ spuDescribe: "",
+ is_take_fullreduction: 0,
+ bigImg: '',
+ car_count: 0
+ },
+ observer: function (t) {
+ let {presale_ding_time_start_int, presale_ding_time_end_int } = t;
+ let nowtime = Date.parse(new Date())/1000;
+ let saleStatus = 1; //客付定金 0未开始 2已结束
+ let h = {};
+
+ if(t.presale_type==0) {
+ let { presale_ding_money, actPrice, presale_deduction_money } = t;
+ let goodsPrice = (actPrice[0]+'.'+actPrice[1])*1;
+ presale_deduction_money = presale_deduction_money>0?presale_deduction_money:presale_ding_money;
+ let weikuan = goodsPrice - presale_deduction_money*1;
+ presale_ding_money = presale_ding_money.toFixed(2);
+ h.dingArr = (presale_ding_money+'').split('.');
+ h.weikuan = weikuan.toFixed(2);
+ }
+
+ if(nowtimepresale_ding_time_end_int) {
+ saleStatus = 2;
+ }
+ this.setData({
+ saleStatus,
+ ...h
+ })
+ }
+ },
+ isPast: {
+ type: Boolean,
+ value: false
+ },
+ actEnd: {
+ type: Boolean,
+ value: false
+ },
+ reduction: {
+ type: Object,
+ value: {
+ full_money: '',
+ full_reducemoney: '',
+ is_open_fullreduction: 0
+ }
+ },
+ skin: Object,
+ goods_sale_unit: String
+ },
+ attached() {
+ this.setData({ placeholdeImg: app.globalData.placeholdeImg })
+ },
+ data: {
+ disabled: false,
+ placeholdeImg: '',
+ weikuan: 0,
+ dingArr: ['0', '00'],
+ saleStatus: 1
+ },
+ methods: {
+ goLink: function () {
+ let id = this.data.spuItem.actId;
+ id && wx.navigateTo({
+ url: `/eaterplanet_ecommerce/pages/goods/goodsDetail?id=${id}&type=presale`,
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.js b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.js
new file mode 100644
index 0000000..9f52fa0
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.js
@@ -0,0 +1,5 @@
+var virtualcardBehavior = require('./virtualcardBehavior');
+
+Component({
+ behaviors: [virtualcardBehavior]
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.json b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.json
new file mode 100644
index 0000000..0d19635
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../../components/button/index",
+ "i-img": "../../components/img/index",
+ "i-router-link": "../../components/router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.wxml b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.wxml
new file mode 100644
index 0000000..5bd1a24
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.wxml
@@ -0,0 +1,44 @@
+
+
+
+
+ {{spuItem.label_info.tagcontent}}
+
+
+
+
+ 满{{reduction.full_money}}减{{reduction.full_reducemoney}}
+ 限购
+
+
+
+
+
+ {{spuItem.spuName}}
+
+
+
+ 可兑换{{spuItem.code_money}}元
+
+
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+ ¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}
+
+
+
+
+ 已抢光
+
+
+ 已结束
+
+ 抢购
+
+
+ 已抢光
+
+ 已结束
+
diff --git a/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.wxss b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.wxss
new file mode 100644
index 0000000..e2fc1f3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsone.wxss
@@ -0,0 +1,5 @@
+@import "./presale-goodsone.wxss";
+
+.spu-content {
+ height: 530rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.js b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.js
new file mode 100644
index 0000000..9f52fa0
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.js
@@ -0,0 +1,5 @@
+var virtualcardBehavior = require('./virtualcardBehavior');
+
+Component({
+ behaviors: [virtualcardBehavior]
+});
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.json b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.json
new file mode 100644
index 0000000..0d19635
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-button": "../../components/button/index",
+ "i-img": "../../components/img/index",
+ "i-router-link": "../../components/router-link/router-link"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.wxml b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.wxml
new file mode 100644
index 0000000..4c6f41a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.wxml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+ {{spuItem.label_info.tagcontent}}
+
+
+
+
+
+
+ 已抢光
+ 已结束
+
+
+
+ {{spuItem.spuName}}
+
+
+ {{spuItem.spuDescribe}}
+
+
+ 可兑换{{spuItem.code_money}}元
+
+
+
+ ¥{{spuItem.actPrice[0]}}.{{spuItem.actPrice[1]}}
+
+ ¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}
+
+
+
+
+ 已抢光
+
+ 去抢购
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.wxss b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.wxss
new file mode 100644
index 0000000..9d45119
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/virtualcard-goodsrow.wxss
@@ -0,0 +1 @@
+@import "presale-goodsrow.wxss";
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/components/virtualcardBehavior.js b/eaterplanet_ecommerce/moduleB/components/virtualcardBehavior.js
new file mode 100644
index 0000000..0208306
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/components/virtualcardBehavior.js
@@ -0,0 +1,93 @@
+let app = getApp();
+
+module.exports = Behavior({
+ properties: {
+ spuItem: {
+ type: Object,
+ value: {
+ actId: "",
+ skuId: "",
+ spuImage: "",
+ spuName: "",
+ endTime: 0,
+ beginTime: "",
+ actPrice: ["", ""],
+ marketPrice: ["", ""],
+ spuCanBuyNum: "",
+ soldNum: "",
+ actId: "",
+ limitMemberNum: "",
+ limitOrderNum: "",
+ serverTime: "",
+ isLimit: false,
+ skuList: [],
+ spuDescribe: "",
+ is_take_fullreduction: 0,
+ bigImg: '',
+ car_count: 0
+ },
+ observer: function (t) {
+ let {presale_ding_time_start_int, presale_ding_time_end_int } = t;
+ let nowtime = Date.parse(new Date())/1000;
+ let saleStatus = 1; //客付定金 0未开始 2已结束
+ let h = {};
+
+ if(t.presale_type==0) {
+ let { presale_ding_money, actPrice, presale_deduction_money } = t;
+ let goodsPrice = (actPrice[0]+'.'+actPrice[1])*1;
+ presale_deduction_money = presale_deduction_money>0?presale_deduction_money:presale_ding_money;
+ let weikuan = goodsPrice - presale_deduction_money*1;
+ presale_ding_money = presale_ding_money.toFixed(2);
+ h.dingArr = (presale_ding_money+'').split('.');
+ h.weikuan = weikuan.toFixed(2);
+ }
+
+ if(nowtimepresale_ding_time_end_int) {
+ saleStatus = 2;
+ }
+ this.setData({
+ saleStatus,
+ ...h
+ })
+ }
+ },
+ isPast: {
+ type: Boolean,
+ value: false
+ },
+ actEnd: {
+ type: Boolean,
+ value: false
+ },
+ reduction: {
+ type: Object,
+ value: {
+ full_money: '',
+ full_reducemoney: '',
+ is_open_fullreduction: 0
+ }
+ },
+ skin: Object,
+ goods_sale_unit: String
+ },
+ attached() {
+ this.setData({ placeholdeImg: app.globalData.placeholdeImg })
+ },
+ data: {
+ disabled: false,
+ placeholdeImg: '',
+ weikuan: 0,
+ dingArr: ['0', '00'],
+ saleStatus: 1
+ },
+ methods: {
+ goLink: function () {
+ let id = this.data.spuItem.actId;
+ id && wx.navigateTo({
+ url: `/eaterplanet_ecommerce/pages/goods/goodsDetail?id=${id}&type=virtualcard`,
+ })
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/generalmall/index.js b/eaterplanet_ecommerce/moduleB/generalmall/index.js
new file mode 100644
index 0000000..48fd26a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/generalmall/index.js
@@ -0,0 +1,954 @@
+const height = wx.getSystemInfoSync().windowHeight
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+var countDownInit = require("../../utils/countDown");
+var a = require("../../utils/public");
+var app = getApp();
+let globalData = getApp().globalData
+const key = globalData.key
+let SYSTEMINFO = globalData.systeminfo
+Page({
+ mixins: [countDownInit.default, require('../../mixin/globalMixin.js')],
+ data: {
+ classification: {
+ tabs: [],
+ activeIndex: -1
+ },
+ rushList: [],
+ statusBarHeight: app.globalData.statusBarHeight + 44 + 'px',
+ searchBarHeight: app.globalData.statusBarHeight + 'px',
+ rushboxHeight: app.globalData.statusBarHeight + 200 + 'px',
+ pageNum: 1
+
+ },
+ $data: {
+ statusBarHeight: app.globalData.statusBarHeight + 44,
+ top: 0,
+ stickyFlag: false,
+ scrollTop: 0,
+ overPageNum: 1,
+ loadOver: false,
+ hasOverGoods: false,
+ countDownMap: {},
+ actEndMap: {},
+ timer: {},
+ scrollHeight: 1300,
+ stickyTop: 0,
+ },
+
+ /**
+ * is_only_express
+ */
+ onLoad: function (options) {
+ app.setShareConfig();
+ let that = this;
+ status.setNavBgColor();
+ status.setGroupInfo().then((groupInfo) => {
+ that.setData({
+ groupInfo
+ })
+ });
+ },
+
+ loadPage: function () {
+ wx.showLoading();
+ this.hasRefeshin = false;
+ this.$data = {
+ ...this.$data,
+ ...{
+ overPageNum: 1,
+ loadOver: false,
+ hasOverGoods: false,
+ countDownMap: {},
+ actEndMap: {},
+ timer: {},
+ hasCommingGoods: true
+ }
+ }
+ this.setData({
+ rushList: [],
+ pageNum: 1
+ }, ()=>{
+ this.getIndexInfo();
+ this.load_goods_data();
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ that.setData({
+ needAuth: true
+ })
+ } else {
+ (0, status.cartNum)('', true).then((res) => {
+ that.setData({
+ cartNum: res.data
+ })
+ });
+ }
+ })
+ this.loadPage();
+ },
+
+ /**
+ * 监控滚动事件
+ */
+ onPageScroll: function (t) {
+ if (!this.$data.isLoadData) {
+ if (t.scrollTop < this.$data.scrollHeight) {
+ if (t.scrollTop > this.$data.scrollTop) {
+ "down" !== this.data.scrollDirect && this.setData({
+ scrollDirect: "down"
+ })
+ } else {
+ "up" != this.data.scrollDirect && this.setData({
+ scrollDirect: "up"
+ })
+ }
+ } else {
+ "down" !== this.data.scrollDirect && this.setData({
+ scrollDirect: "down"
+ })
+ }
+ if (t.scrollTop > this.$data.stickyTop) {
+ this.data.isSticky || (this.setData({
+ isSticky: true
+ }), this.$data.stickyFlag = true)
+ } else {
+ t.scrollTop < this.$data.stickyBackTop && this.data.isSticky && (this.setData({
+ isSticky: false
+ }), this.$data.stickyFlag = false)
+ }
+ this.$data.scrollTop = t.scrollTop
+ }
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.loadPage();
+ wx.stopPullDownRefresh();
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ this.load_goods_data();
+ },
+
+ authModal: function (e = {}) {
+ let needAuth = (e && e.detail) || this.data.needAuth;
+ if (this.data.needAuth || e.detail) {
+ this.setData({
+ showAuthModal: !this.data.showAuthModal,
+ needAuth
+ });
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ this.setData({
+ needAuth: false
+ })
+ this.loadPage();
+ },
+
+ /**
+ * 导航小图标
+ */
+ getIndexInfo: function () {
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'generalmall.get_index_info'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let {
+ navigat_list,
+ slider_list,
+ category_list,
+ shoname,
+ index_type_first_name,
+ theme,
+ index_list_top_image,
+ showTabbar,
+ is_show_list_timer,
+ is_show_list_count
+ } = res.data.data;
+ wx.setNavigationBarTitle({
+ title: shoname
+ });
+
+ let navigatEmpty = [];
+ if (navigat_list.length > 0) {
+ let len = (5 - navigat_list.length % 5) || 0;
+ if (len < 5 && len > 0) navigatEmpty = new Array(len);
+ }
+
+ let h = {
+ classification: {
+ tabs: ''
+ }
+ };
+ h.index_type_first_name = index_type_first_name || '全部';
+ if (category_list.length > 0) {
+ category_list.unshift({
+ name: index_type_first_name || '全部',
+ id: 0
+ })
+ h.isShowClassification = true;
+ h.classification.tabs = category_list;
+ } else {
+ h.isShowClassification = false;
+ }
+
+ that.setData({
+ navigat: navigat_list,
+ navigatEmpty,
+ slider_list,
+ theme,
+ index_list_top_image,
+ showTabbar,
+ isShowListTimer: is_show_list_timer,
+ isShowListCount: is_show_list_count,
+ ...h
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 幻灯片跳转
+ */
+ goBannerUrl: function (t) {
+ let idx = t.currentTarget.dataset.idx;
+ let {
+ slider_list,
+ needAuth
+ } = this.data;
+ if (slider_list.length > 0) {
+ let url = slider_list[idx].link;
+ let type = slider_list[idx].linktype;
+ if (util.checkRedirectTo(url, needAuth)) {
+ this.authModal();
+ return;
+ }
+ if (type == 0) {
+ // 跳转webview
+ url && wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url)
+ })
+ } else if (type == 1) {
+ if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
+ url && wx.switchTab({
+ url: url
+ })
+ } else {
+ url && wx.navigateTo({
+ url: url
+ })
+ }
+
+ } else if (type == 2) {
+ // 跳转小程序
+ let appid = slider_list[idx].appid;
+ appid && wx.navigateToMiniProgram({
+ appId: slider_list[idx].appid,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ // 打开成功
+ },
+ fail(error) {
+ console.log(error)
+ }
+ })
+ }
+ }
+ },
+
+ /**
+ * 导航图标跳转
+ */
+ goNavUrl: function (t) {
+ let idx = t.currentTarget.dataset.idx;
+ let {
+ navigat,
+ needAuth
+ } = this.data;
+ if (navigat.length > 0) {
+ let url = navigat[idx].link;
+ let type = navigat[idx].type;
+ if (util.checkRedirectTo(url, needAuth)) {
+ this.authModal();
+ return;
+ }
+ if (type == 0) {
+ // 跳转webview
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url),
+ })
+ } else if (type == 1) {
+ if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
+ wx.switchTab({
+ url: url
+ })
+ } else {
+ wx.navigateTo({
+ url: url
+ })
+ }
+
+ } else if (type == 2) {
+ // 跳转小程序
+ let appid = navigat[idx].appid;
+ appid && wx.navigateToMiniProgram({
+ appId: navigat[idx].appid,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ // 打开成功
+ },
+ fail(error) {
+ console.log(error)
+ }
+ })
+ } else if (type == 3) {
+ //首页分类
+ let classification = this.data.classification;
+ let tabs = classification && classification.tabs;
+ let cid = url;
+ let activeIdx = tabs.findIndex((p) => {
+ return p.id == cid
+ });
+ if (activeIdx != -1) {
+ let cateInfo = {
+ detail: {
+ e: activeIdx,
+ a: cid
+ }
+ };
+ this.classificationChange(cateInfo);
+ }
+ } else if (type == 4) {
+ //独立分类
+ app.globalData.typeCateId = url;
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/type/index'
+ })
+ }
+ }
+ },
+
+ /**
+ * 监控分类导航
+ */
+ classificationChange: function (t) {
+ wx.showLoading();
+ var that = this;
+ this.$data = {
+ ...this.$data,
+ ...{
+ overPageNum: 1,
+ loadOver: false,
+ hasOverGoods: false,
+ countDownMap: {},
+ actEndMap: {},
+ timer: {}
+ }
+ }, this.hasRefeshin = false, this.setData({
+ rushList: [],
+ showEmpty: false,
+ pageNum: 1,
+ "classification.activeIndex": t.detail.e,
+ classificationId: t.detail.a
+ }, function () {
+ if (!this.$data.stickyFlag && (that.$data.scrollTop != that.$data.stickyTop + 5)) {
+ wx.pageScrollTo({
+ scrollTop: that.$data.stickyTop - 30,
+ duration: 0
+ })
+ }
+ that.load_goods_data();
+ });
+ },
+
+ /**
+ * 获取商品列表
+ */
+ load_goods_data: function () {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ // var cur_community = wx.getStorageSync('community');
+ var gid = that.data.classificationId;
+ this.$data.isLoadData = true;
+ console.log('load_goods_begin ');
+
+ if (!that.hasRefeshin && !that.$data.loadOver) {
+ console.log('load_goods_in ');
+ this.hasRefeshin = true;
+ that.setData({
+ loadMore: true
+ });
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.load_gps_goodslist',
+ token: token,
+ pageNum: that.data.pageNum,
+ head_id: '',
+ gid,
+ per_page: 12,
+ is_only_express: 1
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (that.data.pageNum == 1) {
+ that.setData({
+ cate_info: res.data.cate_info || {}
+ })
+ }
+ if (res.data.code == 0) {
+ let rushList = '';
+ if (res.data.is_show_list_timer == 1) {
+ rushList = that.transTime(res.data.list);
+ for (let s in that.$data.countDownMap) that.initCountDown(that.$data.countDownMap[s]);
+ } else {
+ let oldRushList = that.data.rushList;
+ rushList = oldRushList.concat(res.data.list);
+ }
+ let rdata = res.data;
+ let {
+ full_money,
+ full_reducemoney,
+ is_open_fullreduction,
+ is_open_vipcard_buy,
+ is_vip_card_member,
+ is_member_level_buy
+ } = rdata;
+ let reduction = {
+ full_money,
+ full_reducemoney,
+ is_open_fullreduction
+ }
+
+ // 是否可以会员折扣购买
+ let canLevelBuy = false;
+ if (is_open_vipcard_buy == 1) {
+ if (is_vip_card_member != 1 && is_member_level_buy == 1) canLevelBuy = true;
+ } else {
+ (is_member_level_buy == 1) && (canLevelBuy = true);
+ }
+
+ if (that.data.pageNum == 1) that.setData({
+ copy_text_arr: rdata.copy_text_arr || []
+ })
+ that.hasRefeshin = false;
+ that.setData({
+ rushList: rushList,
+ pageNum: that.data.pageNum + 1,
+ loadMore: false,
+ reduction,
+ tip: '',
+ is_open_vipcard_buy: is_open_vipcard_buy || 0,
+ is_vip_card_member,
+ is_member_level_buy,
+ canLevelBuy
+ }, () => {
+ if (that.isFirst == 1) {
+ that.isFirst++;
+ if (rushList.length && !that.$data.stickyTop) {
+ wx.createSelectorQuery().select(".tab-nav-query").boundingClientRect(function (t) {
+ if (t && t.top) {
+ wcache.put('tabPos', t);
+ that.$data.stickyTop = t.top + t.height, that.$data.stickyBackTop = t.top;
+ } else {
+ let tabpos = wcache.get('tabPos', false);
+ if (tabpos) that.$data.stickyTop = tabpos.top + tabpos.height, that.$data.stickyBackTop = tabpos.top;
+ }
+ }).exec();
+ that.$data.scrollTop > that.$data.stickyTop && wx.pageScrollTo({
+ duration: 0,
+ scrollTop: that.$data.stickyTop + 4
+ });
+ }
+ }
+ that.getScrollHeight();
+ if (that.data.pageNum == 2 && res.data.list.length < 10) {
+ console.log('load_over_goods_list_begin')
+ that.$data.loadOver = true;
+ that.hasRefeshin = true;
+ that.setData({
+ loadMore: true
+ }, () => {
+ that.load_over_gps_goodslist();
+ });
+ }
+ });
+ } else if (res.data.code == 1) {
+ that.$data.loadOver = true;
+ that.load_over_gps_goodslist();
+ } else if (res.data.code == 2) {
+ //no login
+ that.setData({
+ needAuth: true,
+ couponRefresh: false
+ })
+ }
+ },
+ complete: function () {
+ that.$data.isLoadData = false;
+ // wx.hideLoading();
+ setTimeout(function () {
+ wx.hideLoading();
+ }, 1000);
+ }
+ })
+ } else {
+ that.load_over_gps_goodslist();
+ }
+ },
+
+ /**
+ * 组合倒计时时间
+ */
+ transTime: function (list) {
+ let that = this;
+ let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
+ e === 0 && list.map(function (t) {
+ t.end_time *= 1000;
+ that.$data.countDownMap[t.end_time] = t.end_time, that.$data.actEndMap[t.end_time] = t.end_time <= new Date().getTime() || t.spuCanBuyNum == 0;
+ })
+ return that.data.rushList.concat(list);
+ },
+
+ /**
+ * 获取售罄商品
+ */
+ load_over_gps_goodslist: function () {
+ var token = wx.getStorageSync('token');
+ var that = this;
+ // var cur_community = wx.getStorageSync('community');
+ var gid = that.data.classificationId;
+
+ if (!that.$data.hasOverGoods && that.$data.loadOver) {
+ that.$data.hasOverGoods = true;
+ that.setData({
+ loadMore: true
+ });
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.load_over_gps_goodslist',
+ token: token,
+ pageNum: that.$data.overPageNum,
+ head_id: '',
+ gid,
+ is_index_show: 1,
+ is_only_express: 1
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let rushList = that.transTime(res.data.list);
+ for (let s in that.$data.countDownMap) that.initCountDown(that.$data.countDownMap[s]);
+
+ that.$data.hasOverGoods = false;
+ that.$data.overPageNum += 1;
+ that.setData({
+ rushList: rushList,
+ loadMore: false,
+ tip: ''
+ }, () => {
+ if (that.isFirst == 1) {
+ that.isFirst++;
+ if (rushList.length && !that.$data.stickyTop) {
+ wx.createSelectorQuery().select(".tab-nav-query").boundingClientRect(function (t) {
+ if (t && t.top) {
+ wcache.put('tabPos', t);
+ that.$data.stickyTop = t.top + t.height, that.$data.stickyBackTop = t.top;
+ } else {
+ let tabpos = wcache.get('tabPos', false);
+ if (tabpos) that.$data.stickyTop = tabpos.top + tabpos.height, that.$data.stickyBackTop = tabpos.top;
+ }
+ }).exec();
+ that.$data.scrollTop > that.$data.stickyTop && wx.pageScrollTo({
+ duration: 0,
+ scrollTop: that.$data.stickyTop + 4
+ });
+ }
+ }
+ that.getScrollHeight();
+ });
+ } else if (res.data.code == 1) {
+ if (that.$data.overPageNum == 1 && that.data.rushList.length == 0) that.setData({
+ showEmpty: true
+ })
+ that.setData({
+ loadMore: false,
+ tip: '^_^已经到底了'
+ })
+ } else if (res.data.code == 2) {
+ that.setData({
+ needAuth: true,
+ couponRefresh: false
+ })
+ }
+ that.$data.isLoadData = false;
+ }
+ })
+ } else {
+ that.$data.isLoadData = false;
+ }
+ },
+
+ getScrollHeight: function () {
+ wx.createSelectorQuery().select('.rush-list-box').boundingClientRect((rect) => {
+ rect && rect.height && (this.$data.scrollHeight = rect.height || 1300);
+ console.log(this.$data.scrollHeight)
+ }).exec()
+ },
+
+ openSku: function (t) {
+ if (!this.authModal()) return;
+ var that = this,
+ e = t.detail;
+ var goods_id = e.actId;
+ var options = e.skuList;
+ that.setData({
+ addCar_goodsid: goods_id
+ })
+
+ let list = options.list || [];
+ let arr = [];
+ if (list && list.length > 0) {
+ for (let i = 0; i < list.length; i++) {
+ let sku = list[i]['option_value'][0];
+ console.log(sku)
+ let temp = {
+ name: sku['name'],
+ id: sku['option_value_id'],
+ index: i,
+ idx: 0
+ };
+ arr.push(temp);
+ }
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ var cur_sku_arr = options.sku_mu_list[id] || {};
+ that.setData({
+ sku: arr,
+ sku_val: 1,
+ cur_sku_arr: cur_sku_arr,
+ skuList: e.skuList,
+ visible: true,
+ showSku: true,
+ is_take_vipcard: e.is_take_vipcard || '',
+ is_mb_level_buy: e.is_mb_level_buy || ''
+ });
+ } else {
+ let goodsInfo = e.allData;
+ that.setData({
+ sku: [],
+ sku_val: 1,
+ skuList: [],
+ cur_sku_arr: goodsInfo
+ })
+ let formIds = {
+ detail: {
+ formId: ""
+ }
+ };
+ formIds.detail.formId = "the formId is a mock one";
+ that.gocarfrom(formIds);
+ }
+
+ },
+
+ /**
+ * 确认加入购物车
+ */
+ gocarfrom: function (e) {
+ var that = this;
+ wx.showLoading();
+ this.setData({
+ is_take_vipcard: '',
+ is_mb_level_buy: ''
+ })
+ a.collectFormIds(e.detail.formId);
+ that.goOrder();
+ },
+
+ /**
+ * 关闭购物车选项卡
+ */
+ closeSku: function () {
+ this.setData({
+ visible: 0,
+ stopClick: false,
+ });
+ },
+
+ selectSku: function (event) {
+ var that = this;
+ let str = event.currentTarget.dataset.type;
+ let obj = str.split("_");
+ let {
+ sku,
+ skuList,
+ sku_val
+ } = this.data;
+ let temp = {
+ name: obj[3],
+ id: obj[2],
+ index: obj[0],
+ idx: obj[1]
+ };
+ sku.splice(obj[0], 1, temp);
+ var id = '';
+ for (let i = 0; i < sku.length; i++) {
+ if (i == sku.length - 1) {
+ id = id + sku[i]['id'];
+ } else {
+ id = id + sku[i]['id'] + "_";
+ }
+ }
+ var cur_sku_arr = skuList.sku_mu_list[id];
+
+ let h = {};
+ sku_val = sku_val || 1;
+ if (sku_val > cur_sku_arr.canBuyNum) {
+ h.sku_val = cur_sku_arr.canBuyNum;
+ wx.showToast({
+ title: `最多只能购买${cur_sku_arr.canBuyNum}件`,
+ icon: 'none'
+ })
+ }
+
+ that.setData({
+ cur_sku_arr,
+ sku,
+ ...h
+ });
+ },
+
+ /**
+ * 数量加减
+ */
+ setNum: function (event) {
+ let types = event.currentTarget.dataset.type;
+ var that = this;
+ var num = 1;
+ let sku_val = this.data.sku_val * 1;
+ if (types == 'add') {
+ num = sku_val + 1;
+ } else if (types == 'decrease') {
+ if (sku_val > 1) {
+ num = sku_val - 1;
+ }
+ }
+
+ let arr = that.data.sku;
+ var options = this.data.skuList;
+
+ if (arr.length > 0) {
+ var id = '';
+ for (let i = 0; i < arr.length; i++) {
+ if (i == arr.length - 1) {
+ id = id + arr[i]['id'];
+ } else {
+ id = id + arr[i]['id'] + "_";
+ }
+ }
+ }
+
+ if (options.length > 0) {
+ let cur_sku_arr = options.sku_mu_list[id];
+ if (num > cur_sku_arr['canBuyNum']) {
+ num = num - 1;
+ }
+ } else {
+ let cur_sku_arr = this.data.cur_sku_arr;
+ if (num > cur_sku_arr['canBuyNum']) {
+ num = num - 1;
+ }
+ }
+
+ this.setData({
+ sku_val: num
+ })
+ },
+
+ skuConfirm: function () {
+ this.closeSku(), (0, status.cartNum)().then((res) => {
+ res.code == 0 && that.setData({
+ cartNum: res.data
+ })
+ });
+ },
+
+ goOrder: function() {
+ var that = this;
+ if (that.data.can_car) {
+ that.data.can_car = false;
+ }
+ var token = wx.getStorageSync('token');
+ var community = wx.getStorageSync('community');
+
+ var goods_id = that.data.addCar_goodsid;
+ var community_id = community.communityId;
+ var quantity = that.data.sku_val;
+
+ var cur_sku_arr = that.data.cur_sku_arr;
+
+ var sku_str = '';
+ var is_just_addcar = 1;
+
+ if (cur_sku_arr && cur_sku_arr.option_item_ids) {
+ sku_str = cur_sku_arr.option_item_ids;
+ }
+
+ let data = {
+ goods_id,
+ community_id,
+ quantity,
+ sku_str,
+ buy_type: 'dan',
+ pin_id: 0,
+ is_just_addcar
+ }
+ util.addCart(data).then(res=>{
+ if(res.showVipModal==1) {
+ let { pop_vipmember_buyimage } = res.data;
+ wx.hideLoading();
+ that.setData({ pop_vipmember_buyimage, showVipModal: true, visible: false })
+ } else {
+ if (res.data.code == 3 || res.data.code == 7) {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (res.data.code == 4) {
+ wx.hideLoading();
+ that.setData({ needAuth: true, showAuthModal: true, visible: false })
+ } else if (res.data.code == 6) {
+ let max_quantity = res.data.max_quantity || '';
+ (max_quantity > 0) && that.setData({ sku_val: max_quantity })
+ var msg = res.data.msg;
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ })
+ } else {
+ if (is_just_addcar == 1) {
+ that.closeSku();
+ (0, status.cartNum)(res.data.total);
+ that.setData({ cartNum: res.data.total })
+ wx.showToast({
+ title: "已加入购物车",
+ image: "../../images/addShopCart.png"
+ })
+ } else {
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/buy/index?type=' + that.data.order.buy_type
+ })
+ } else {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/buy/index?type=' + that.data.order.buy_type
+ })
+ }
+ }
+
+ }
+ }
+ }).catch(res=>{
+ app.util.message(res||'请求失败', '', 'error');
+ })
+ },
+
+ vipModal: function (t) {
+ this.setData(t.detail)
+ },
+
+ // 输入框获得焦点
+ handleFocus: function () {
+ this.focusFlag = true;
+ },
+
+ handleBlur: function (t) {
+ let a = t.detail;
+ let val = parseInt(a.value);
+ if (val == '' || isNaN(val)) {
+ this.setData({
+ sku_val: 1
+ })
+ }
+ },
+
+ // 监控输入框变化
+ changeNumber: function (t) {
+ let {
+ cur_sku_arr,
+ sku_val
+ } = this.data;
+ let max = cur_sku_arr.stock * 1;
+ let a = t.detail;
+ this.focusFlag = false;
+ if (a) {
+ let val = parseInt(a.value);
+ val = val < 1 ? 1 : val;
+ if (val > max) {
+ wx.showToast({
+ title: `最多只能购买${max}件`,
+ icon: 'none'
+ })
+ sku_val = max;
+ } else {
+ sku_val = val;
+ }
+ }
+ this.setData({
+ sku_val
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ onShareTimeline: function(res) {
+
+ }
+
+})
diff --git a/eaterplanet_ecommerce/moduleB/generalmall/index.json b/eaterplanet_ecommerce/moduleB/generalmall/index.json
new file mode 100644
index 0000000..d316cce
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/generalmall/index.json
@@ -0,0 +1,19 @@
+{
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-tabs": "../../components/tabs/index",
+ "i-img": "../../components/img/index",
+ "i-rush-spu-big": "../../components/rush-spu-big/index",
+ "i-sku": "../../components/sku/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-new-rush-spu": "../../components/new-rush-spu/index",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-rush-spu": "../../components/rush-spu-col/index",
+ "i-vip-price": "../../components/vipPrice/vipPrice",
+ "i-vip-modal": "../../components/vipModal/index",
+ "i-tabbar": "../../components/tabbar/index",
+ "i-tworow": "../../components/tworow/index",
+ "skeleton": "../../components/skeleton/skeleton"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/generalmall/index.wxml b/eaterplanet_ecommerce/moduleB/generalmall/index.wxml
new file mode 100644
index 0000000..2648335
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/generalmall/index.wxml
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.navname}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 仅剩
+ {{countDownMap[item.end_time].day}}天
+ {{countDownMap[item.end_time].hour}}:
+ {{countDownMap[item.end_time].minute}}:
+ {{countDownMap[item.end_time].second}}
+
+
+
+
+
+
+
+
+
+ 仅剩
+ {{countDownMap[item.end_time].day}}天
+ {{countDownMap[item.end_time].hour}}:
+ {{countDownMap[item.end_time].minute}}:
+ {{countDownMap[item.end_time].second}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂时没有商品
+ 我们正在为您准备更优惠的商品
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+ {{value.name}}
+
+
+
+ 数量
+
+
+
+
+
+
+
+
+
+
+ 每人限{{skuList[current].limitMemberNum}}单
+ 每单限{{skuList[current].limitOrderNum}}份
+
+
+ 还可以购买 {{skuList[current].canBuyNum-value}} 件
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/generalmall/index.wxss b/eaterplanet_ecommerce/moduleB/generalmall/index.wxss
new file mode 100644
index 0000000..a62231f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/generalmall/index.wxss
@@ -0,0 +1,8 @@
+@import "/eaterplanet_ecommerce/pages/index/index.wxss";
+
+.rush-list-title {
+ width: 336rpx;
+ height: 88rpx;
+ display: block;
+ margin: 20rpx auto;
+}
diff --git a/eaterplanet_ecommerce/moduleB/images/authority.png b/eaterplanet_ecommerce/moduleB/images/authority.png
new file mode 100644
index 0000000..cf733b9
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/authority.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/btn-bg.png b/eaterplanet_ecommerce/moduleB/images/btn-bg.png
new file mode 100644
index 0000000..95a3999
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/btn-bg.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/icon-video-started.gif b/eaterplanet_ecommerce/moduleB/images/icon-video-started.gif
new file mode 100644
index 0000000..56fc44c
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/icon-video-started.gif differ
diff --git a/eaterplanet_ecommerce/moduleB/images/invite-btn.png b/eaterplanet_ecommerce/moduleB/images/invite-btn.png
new file mode 100644
index 0000000..eb2e94f
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/invite-btn.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/invite.png b/eaterplanet_ecommerce/moduleB/images/invite.png
new file mode 100644
index 0000000..e924811
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/invite.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/live_end.png b/eaterplanet_ecommerce/moduleB/images/live_end.png
new file mode 100644
index 0000000..e11d2bb
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/live_end.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/live_hot.png b/eaterplanet_ecommerce/moduleB/images/live_hot.png
new file mode 100644
index 0000000..d7fda45
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/live_hot.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/live_ing.gif b/eaterplanet_ecommerce/moduleB/images/live_ing.gif
new file mode 100644
index 0000000..4b39cc7
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/live_ing.gif differ
diff --git a/eaterplanet_ecommerce/moduleB/images/live_star.png b/eaterplanet_ecommerce/moduleB/images/live_star.png
new file mode 100644
index 0000000..7d9d75b
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/live_star.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/location-green.png b/eaterplanet_ecommerce/moduleB/images/location-green.png
new file mode 100644
index 0000000..d1a3143
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/location-green.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/location-red.png b/eaterplanet_ecommerce/moduleB/images/location-red.png
new file mode 100644
index 0000000..7c1e283
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/location-red.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/new.png b/eaterplanet_ecommerce/moduleB/images/new.png
new file mode 100644
index 0000000..e7c53da
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/new.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/old.png b/eaterplanet_ecommerce/moduleB/images/old.png
new file mode 100644
index 0000000..21b2d71
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/old.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/play.png b/eaterplanet_ecommerce/moduleB/images/play.png
new file mode 100644
index 0000000..98c980c
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/play.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/redbag-bg.png b/eaterplanet_ecommerce/moduleB/images/redbag-bg.png
new file mode 100644
index 0000000..4672be1
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/redbag-bg.png differ
diff --git a/eaterplanet_ecommerce/moduleB/images/writeoff.png b/eaterplanet_ecommerce/moduleB/images/writeoff.png
new file mode 100644
index 0000000..2f00d04
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/images/writeoff.png differ
diff --git a/eaterplanet_ecommerce/moduleB/index/auth.js b/eaterplanet_ecommerce/moduleB/index/auth.js
new file mode 100644
index 0000000..aac1161
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/index/auth.js
@@ -0,0 +1,82 @@
+// eaterplanet_ecommerce/moduleB/index/auth.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/index/auth.json b/eaterplanet_ecommerce/moduleB/index/auth.json
new file mode 100644
index 0000000..0bd9096
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/index/auth.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "平台管理中心",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/index/auth.wxml b/eaterplanet_ecommerce/moduleB/index/auth.wxml
new file mode 100644
index 0000000..1838bf1
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/index/auth.wxml
@@ -0,0 +1,7 @@
+
+
+
+
+ 您好,您暂无浏览此页面权限!
+
+
diff --git a/eaterplanet_ecommerce/moduleB/index/auth.wxss b/eaterplanet_ecommerce/moduleB/index/auth.wxss
new file mode 100644
index 0000000..fca249c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/index/auth.wxss
@@ -0,0 +1 @@
+/* eaterplanet_ecommerce/moduleB/index/auth.wxss */
diff --git a/eaterplanet_ecommerce/moduleB/index/index.js b/eaterplanet_ecommerce/moduleB/index/index.js
new file mode 100644
index 0000000..7baca69
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/index/index.js
@@ -0,0 +1,82 @@
+// eaterplanet_ecommerce/moduleB/index/index.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/index/index.json b/eaterplanet_ecommerce/moduleB/index/index.json
new file mode 100644
index 0000000..f875122
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/index/index.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "平台管理中心",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/index/index.wxml b/eaterplanet_ecommerce/moduleB/index/index.wxml
new file mode 100644
index 0000000..d834289
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/index/index.wxml
@@ -0,0 +1,9 @@
+
+
+
+
+
+ 核销管理
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/index/index.wxss b/eaterplanet_ecommerce/moduleB/index/index.wxss
new file mode 100644
index 0000000..1b00eb3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/index/index.wxss
@@ -0,0 +1,13 @@
+.list {
+ padding-top: 30rpx;
+}
+
+.list .item {
+ width: 25%;
+ margin: 10rpx 0;
+}
+
+.list .item .icon {
+ width: 120rpx;
+ height: 120rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/index.js b/eaterplanet_ecommerce/moduleB/invite/index.js
new file mode 100644
index 0000000..fd2b377
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/index.js
@@ -0,0 +1,243 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ info: '',
+ list: [],
+ showSharePopup: true,
+ needAuth: false,
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getData();
+ this.getInvitelist();
+ },
+
+ onPullDownRefresh() {
+ this.getData();
+ this.getInvitelist();
+ },
+
+ getData() {
+ wx.showLoading();
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('invitegift.index', {token})
+ .then(res=>{
+ wx.stopPullDownRefresh();
+ this.setData({
+ info: res.data
+ }, ()=>{
+ this.drawImg(res.data);
+ });
+ // this.onRender(res.data);
+ })
+ .catch(err=>{
+ wx.stopPullDownRefresh();
+ app.util.message(err.msg, 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ // if(err.code==1&&err.msg=='未登录') {
+ // this.setData({
+ // needAuth: true,
+ // showAuthModal: true
+ // })
+ // }
+ })
+ },
+
+ getInvitelist() {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('invitegift.getInvitegiftRecord', { token, page:1, type: 'invite'})
+ .then(res=>{
+ this.setData({
+ list: res.data
+ });
+ })
+ },
+
+ goLink: function(event) {
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ checkInvitegift() {
+ let token = wx.getStorageSync('token');
+ wx.showLoading();
+ app.util.ProReq('invitegift.checkInvitegift', {token})
+ .then(res=>{
+ wx.hideLoading();
+ this.setData({ showSharePopup: false })
+ }).catch(err=>{
+ wx.hideLoading();
+ wx.showModal({
+ content: err.msg,
+ showCancel: false
+ })
+ })
+ },
+
+ hide_share_handler: function () {
+ this.setData({
+ showSharePopup: !this.data.showSharePopup
+ })
+ },
+
+ drawImg: function (info) {
+ let {
+ invite_poster_back_type,
+ invite_poster_back_color,
+ invite_poster_back_img,
+ invite_poster_qrcode_img,
+ invite_poster_qrcode_size,
+ invite_poster_qrcode_top,
+ invite_poster_qrcode_left,
+ invite_poster_qrcode_border_status,
+ invite_poster_qrcode_corner_type,
+ invite_poster_qrcode_bordercolor
+ } = info;
+ let background = '#FFFFFF';
+ let data = [];
+ if(invite_poster_back_type==0) {
+ background = invite_poster_back_color;
+ } else {
+ let bgImg = {
+ type: 'image',
+ url: invite_poster_back_img,
+ css: {
+ left: '0px',
+ top: '0px',
+ mode: 'widthFix',
+ width: '750px',
+ height: '1334px'
+ }
+ }
+ data.push(bgImg);
+ }
+ let poster = {
+ width: '750px',
+ height: '1334px',
+ background,
+ views: [
+ ...data,
+ {
+ type: 'image',
+ url: invite_poster_qrcode_img,
+ mode: 'widthFix',
+ css: {
+ left: invite_poster_qrcode_left + 'px',
+ top: invite_poster_qrcode_top + 'px',
+ width: invite_poster_qrcode_size + 'px',
+ height: invite_poster_qrcode_size + 'px',
+ radius: invite_poster_qrcode_corner_type==0?'10px':'0px',
+ border: invite_poster_qrcode_border_status==1?`1px solid ${invite_poster_qrcode_bordercolor}`:'none'
+ }
+ }
+ ]
+ };
+ console.log(poster);
+ this.setData({
+ template: poster
+ });
+ },
+
+ onImgOK(e) {
+ this.imagePath = e.detail.path;
+ this.setData({
+ image: this.imagePath
+ })
+ },
+
+ saveImage() {
+ let that = this;
+ wx.saveImageToPhotosAlbum({
+ filePath: this.imagePath,
+ success(res) {
+ that.setData({ showShareModal: false })
+ wx.showToast({
+ title: '保存成功!'
+ })
+ },
+ fail(res) {
+ wx.showToast({
+ title: '保存失败,请重试!',
+ icon: 'none'
+ })
+ }
+ });
+ },
+
+ handleShareModal: function () {
+ this.setData({
+ showSharePopup: true,
+ showShareModal: !this.data.showShareModal
+ })
+ },
+
+ handleTipModal(e) {
+ var type = e.currentTarget.dataset.type;
+ let tip = {
+ wait: '被邀请人的订单在售后期内,需要等待售后期结束才能获得活动奖励',
+ invalid: '被邀请人的订单在售后期内发生退款,需要被邀请人重新下单才可获得奖励',
+ };
+ wx.showModal({
+ title: '提示',
+ content: tip[type],
+ showCancel: false
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function (options) {
+ let { invite_share_title, invite_share_img, suid, invite_order_share_title, invite_order_share_img } = this.data.info;
+ var community = wx.getStorageSync('community');
+ var community_id = community.communityId;
+ let title = invite_share_title;
+ let imageUrl = invite_share_img;
+ let path = "eaterplanet_ecommerce/moduleB/invite/share?community_id=" + community_id + '&share_id=' + suid;
+ if( options && options.target && options.target.dataset.name == 'invite' ){
+ path = "eaterplanet_ecommerce/pages/index/index?community_id=" + community_id + '&share_id=' + suid;
+ title = invite_order_share_title;
+ imageUrl = invite_order_share_img;
+ }
+ return {
+ title,
+ path,
+ imageUrl,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/invite/index.json b/eaterplanet_ecommerce/moduleB/invite/index.json
new file mode 100644
index 0000000..d381d2c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/index.json
@@ -0,0 +1,13 @@
+{
+ "navigationBarTitleText": "邀请有礼",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-empty": "../../components/empty/index",
+ "i-painter": "../../components/painter/painter",
+ "i-modal": "../../components/modal/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/index.wxml b/eaterplanet_ecommerce/moduleB/invite/index.wxml
new file mode 100644
index 0000000..4f61839
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/index.wxml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+ 我的邀请战绩
+
+
+
+ 邀请成功
+
+
+
+ {{info.income.invitee_succ_count}}人
+
+
+
+
+ 累计邀请
+
+
+
+ {{info.income.invitee_count}}人
+
+
+
+
+ 累计奖励
+
+
+
+ {{info.income.inviter_total_count}}次
+
+
+
+
+
+ 立即邀请
+
+
+
+
+
+ 我邀请的好友
+
+
+
+
+
+
+
+ {{item.nickname}}
+
+ {{item.addtime}}
+ {{item.receive_content}}
+
+
+
+
+ {{item.reward_content}}
+
+
+
+
+
+ 查看更多
+
+
+ 还没邀请到好友,快去邀请把!
+
+
+
+
+
+ 活动规则
+
+
+
+
+
+
+
+
+
+
+ 分享
+
+
+
+
+
+
+
+
+ 海报
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存图片
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/invite/index.wxss b/eaterplanet_ecommerce/moduleB/invite/index.wxss
new file mode 100644
index 0000000..26dfb89
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/index.wxss
@@ -0,0 +1,138 @@
+page {
+ background: linear-gradient(90deg, #ff5734, #ff854f);
+}
+
+.box {
+ position: relative;
+ background: #FFFFFF;
+ width: 706rpx;
+ border-radius: 20rpx;
+ margin: 0 auto;
+ box-sizing: border-box;
+}
+
+.actColor {
+ color: #ff6139;
+}
+
+.actBg {
+ background: #ff6139;
+}
+
+.tag {
+ width: 32rpx;
+ height: 32rpx;
+ margin-right: 10rpx;
+}
+
+.btn {
+ position: relative;
+ width: 637rpx;
+ height: 97rpx;
+ line-height: 92rpx;
+ margin: 20rpx auto 15rpx;
+}
+
+.btn-bg {
+ width: 100%;
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 0;
+}
+
+.btn .title {
+ position: relative;
+ z-index: 1;
+ color: #FFFFFF;
+ font-size: 34rpx;
+}
+
+.invite-num {
+ font-size: 60rpx;
+}
+
+/*分享begin*/
+
+.ui-mask {
+ position: fixed;
+ display: block;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 999;
+ background: rgba(0, 0, 0, 0.6);
+}
+
+.model-services {
+ width: 100%;
+ position: fixed;
+ background-color: #fff;
+ bottom: 0;
+ z-index: 1000;
+ color: #333;
+ transition: all 0.3s;
+ transform: translate(0, 100%);
+}
+
+.model-services.show {
+ transform: translate(0);
+}
+
+.model-services .model-services-title {
+ font-size: 36rpx;
+ text-align: center;
+ height: 80rpx;
+ line-height: 80rpx;
+ border-bottom: 1px solid #f2f5f8;
+}
+
+.model-services .model-services-content {
+ padding: 40rpx;
+}
+
+.model-services .model-services-content .service-item {
+ margin-bottom: 20rpx;
+ width: 50%;
+ float: left;
+ text-align: center;
+}
+
+.model-services .model-services-content .service-icon {
+ font-size: 80rpx;
+ color: #50b674;
+}
+
+.service-name {
+ padding-left: 10rpx;
+}
+
+.none_btn {
+ border: none;
+ line-height: 1.1;
+ padding: 0px;
+ font-size: 26rpx;
+}
+
+button[plain] {
+ border: none;
+}
+
+.shareModal-box {
+ background: transparent!important;
+ left: 115rpx!important;
+ right: 115rpx!important;
+ bottom: initial!important;
+ top: 50%;
+ transform: translateY(-50%)!important;
+ width: 520rpx!important;
+}
+
+.shareModal {
+ width: 520rpx;
+}
+
+.shareBtn {
+ line-height: 84rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/record.js b/eaterplanet_ecommerce/moduleB/invite/record.js
new file mode 100644
index 0000000..b972059
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/record.js
@@ -0,0 +1,157 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ tab_index: 0,
+ list: [],
+ info: ''
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let type = options.type || 0;
+ this.getData();
+ this.setData({
+ tab_index: type
+ },()=>{
+ this.getList();
+ })
+ },
+ listPage: 1,
+
+ tabchange: function (e) {
+ var index = e.currentTarget.dataset.index;
+ this.listPage = 1;
+ this.setData({
+ list: [],
+ tab_index: index,
+ noMore: false,
+ noData: false
+ },()=>{
+ this.getList();
+ })
+ },
+
+ getList() {
+ let _this = this;
+ let token = wx.getStorageSync('token');
+ let type = ['invite', 'success'];
+ let data = {
+ token,
+ type: type[this.data.tab_index],
+ page: _this.listPage
+ };
+ wx.showLoading();
+ app.util.ProReq('invitegift.getInvitegiftRecord', data)
+ .then(res => {
+ _this.listLoading = false;
+ wx.stopPullDownRefresh();
+ let h = {};
+ if (_this.listPage == 1) {
+ h.list = res.data;
+ res.data.length==0?(h.noData=true):'';
+ } else {
+ h.list = [..._this.data.list, ...res.data];
+ }
+ if (res.data.length > 0) {
+ _this.listPage += 1;
+ } else {
+ _this.listPage = 0;
+ }
+ if(res.data.length < 10) {
+ h.noMore = true;
+ }
+ this.setData(h);
+ wx.hideLoading();
+ })
+ .catch(err => {
+ wx.hideLoading();
+ let h = {};
+ _this.listPage==1?(h.noData=true):'';
+ this.setData({
+ listLoading: false,
+ noMore: true,
+ ...h,
+ })
+ wx.stopPullDownRefresh();
+ });
+ },
+
+ getData() {
+ wx.showLoading();
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('invitegift.index', {token})
+ .then(res=>{
+ this.setData({
+ info: res.data
+ });
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ handleTipModal(e) {
+ var type = e.currentTarget.dataset.type;
+ let tip = {
+ wait: '被邀请人的订单在售后期内,需要等待售后期结束才能获得活动奖励',
+ invalid: '被邀请人的订单在售后期内发生退款,需要被邀请人重新下单才可获得奖励',
+ };
+ wx.showModal({
+ title: '提示',
+ content: tip[type],
+ showCancel: false
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ (this.data.noMore&&this.listPage!=1) || this.getList();
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ let { invite_order_share_title, invite_order_share_img } = this.data.info;
+ let suid = wx.getStorageSync('member_id') || '';
+ var community = wx.getStorageSync('community') || '';
+ var community_id = community&&community.communityId;
+ return {
+ title: invite_order_share_title,
+ path: "eaterplanet_ecommerce/pages/index/index?community_id=" + community_id + '&share_id=' + suid,
+ imageUrl: invite_order_share_img,
+ success: function() {},
+ fail: function() {}
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/invite/record.json b/eaterplanet_ecommerce/moduleB/invite/record.json
new file mode 100644
index 0000000..847a4c9
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/record.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "邀请记录",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-empty": "../../components/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/record.wxml b/eaterplanet_ecommerce/moduleB/invite/record.wxml
new file mode 100644
index 0000000..de0baa0
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/record.wxml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+ 已邀请好友
+
+
+ 邀请成功好友
+
+
+
+
+
+
+
+
+ 暂无记录~
+
+
+
+
+
+
+ {{item.nickname}}
+
+ {{item.addtime}}
+ {{item.receive_content}}
+
+
+
+
+ {{item.reward_content}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/record.wxss b/eaterplanet_ecommerce/moduleB/invite/record.wxss
new file mode 100644
index 0000000..f505def
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/record.wxss
@@ -0,0 +1,8 @@
+@charset "UTF-8";
+@import "./reward.wxss";
+
+.tag {
+ width: 32rpx;
+ height: 32rpx;
+ margin-right: 10rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/reward.js b/eaterplanet_ecommerce/moduleB/invite/reward.js
new file mode 100644
index 0000000..4572382
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/reward.js
@@ -0,0 +1,142 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ total_points: 0,
+ tab_index: 1
+ },
+ listPage: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.goodsList();
+ this.getScore();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ tabchange: function (e) {
+ var index = e.currentTarget.dataset.index;
+ this.listPage = 1;
+ this.setData({
+ list: [],
+ tab_index: index
+ })
+ console.log(index)
+ if(index==1) {
+ this.goodsList();
+ } else {
+ this.getScore();
+ }
+ },
+
+ goodsList() {
+ let _this = this;
+ let token = wx.getStorageSync('token');
+ let data = {
+ token,
+ page: _this.listPage
+ };
+ wx.showLoading();
+ app.util.ProReq('invitegift.getInvitegiftCouponList', data)
+ .then(res => {
+ _this.listLoading = false;
+ wx.stopPullDownRefresh();
+ let h = {};
+ if (_this.listPage == 1) {
+ h.list = res.data;
+ res.data.length==0?(h.noData=true):'';
+ } else {
+ h.list = [..._this.data.list, ...res.data];
+ }
+ if (res.data.length > 0) {
+ _this.listPage += 1;
+ } else {
+ _this.listPage = 0;
+ }
+ if(res.data.length < 10) {
+ h.noMore = true;
+ }
+ this.setData(h);
+ wx.hideLoading();
+ })
+ .catch(err => {
+ wx.hideLoading();
+ let h = {};
+ _this.listPage==1?(h.noData=true):'';
+ this.setData({
+ listLoading: false,
+ noMore: true,
+ ...h,
+ })
+ wx.stopPullDownRefresh();
+ });
+ },
+
+ getScore() {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('invitegift.getInvitegiftPoints', {token})
+ .then(res=>{
+ this.setData({
+ total_points: res.data.total_points
+ })
+ })
+ },
+
+ goLink: function(event) {
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/reward.json b/eaterplanet_ecommerce/moduleB/invite/reward.json
new file mode 100644
index 0000000..4d68ea7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/reward.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "邀请奖励",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-empty": "../../components/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/reward.wxml b/eaterplanet_ecommerce/moduleB/invite/reward.wxml
new file mode 100644
index 0000000..03d3ada
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/reward.wxml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+ 优惠券
+
+
+ 积分
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无记录~
+
+
+
+
+ 当前活动获得积分
+
+ 积分明细
+
+
+
+
+ {{total_points}}
+ 积分
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/invite/reward.wxss b/eaterplanet_ecommerce/moduleB/invite/reward.wxss
new file mode 100644
index 0000000..e44aa21
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/reward.wxss
@@ -0,0 +1,332 @@
+.tabs {
+ box-sizing: border-box;
+ position: relative;
+ overflow: hidden;
+ zoom: 1;
+ color: #666;
+}
+
+.tabs:after, .tabs:before {
+ content: " ";
+ display: table;
+}
+
+.tabs:after {
+ clear: both;
+ visibility: hidden;
+ font-size: 0;
+ height: 0;
+}
+
+.tabs-bar {
+ outline: none;
+ width: 100%;
+ background-color: #fff;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 10;
+}
+
+.tabs-link-bar {
+ z-index: 1;
+ position: absolute;
+ left: 0;
+ bottom: 2rpx;
+ box-sizing: border-box;
+ height: 2rpx;
+ background-color: #ff5777;
+ transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+ transform-origin: 0 0;
+}
+
+.tabs-bar {
+ border-bottom: 1px solid #d9d9d9;
+ box-sizing: border-box;
+}
+
+.tabs-nav--container {
+ overflow: hidden;
+ font-size: 14rpx;
+ line-height: 1.5;
+ box-sizing: border-box;
+ position: relative;
+ white-space: nowrap;
+ margin-bottom: -1px;
+ zoom: 1;
+}
+
+.tabs-nav--container:after, .tabs-nav--container:before {
+ content: " ";
+ display: table;
+}
+
+.tabs-nav--container:after {
+ clear: both;
+ visibility: hidden;
+ font-size: 0;
+ height: 0;
+}
+
+.tabs-tab-btn-disabled {
+ cursor: not-allowed;
+}
+
+.tabs-tab-btn-disabled, .tabs-tab-btn-disabled:hover {
+ color: #ccc;
+}
+
+.tabs-nav--wrap {
+ overflow: hidden;
+ margin-bottom: -1rpx;
+}
+
+.tabs-nav {
+ display: flex;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding-left: 0;
+ transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
+ position: relative;
+ margin: 0;
+ list-style: none;
+}
+
+.tabs-nav:after, .tabs-nav:before {
+ display: table;
+ content: " ";
+}
+
+.tabs-nav:after {
+ clear: both;
+}
+
+.tabs-nav .tabs-tab-disabled {
+ pointer-events: none;
+ cursor: default;
+ color: #ccc;
+}
+
+.tabs-nav .tabs-tab {
+ flex: 1;
+ display: block;
+ height: 90rpx;
+ line-height: 90rpx;
+ margin: 0 12rpx;
+ box-sizing: border-box;
+ position: relative;
+ transition: color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+ cursor: pointer;
+ text-decoration: none;
+ text-align: center;
+ font-size: 30rpx;
+ color: #333;
+}
+
+.tabs-nav .tabs-tab:active {
+ color: #f13e3a;
+}
+
+.tabs-nav .tabs-tab .anticon {
+ width: 14rpx;
+ height: 14rpx;
+ margin-right: 8rpx;
+}
+
+.tabs-nav .tabs-tab-active {
+ color: #ff4936;
+ border-bottom: 6rpx solid #ff4936;
+}
+
+.tabs.tabs-card>.tabs-bar .tabs-link-bar {
+ visibility: hidden;
+}
+
+.tabs.tabs-card>.tabs-bar .tabs-tab {
+ margin: 0;
+ border: 1px solid #d9d9d9;
+ border-bottom: 0;
+ border-radius: 6rpx 6rpx 0 0;
+ transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+ background: #f9f9f9;
+ margin-right: 2rpx;
+}
+
+.tabs.tabs-card>.tabs-bar .tabs-tab-active {
+ background: #fff;
+ transform: translateZ(0);
+ border-color: #d9d9d9;
+ color: #f13e3a;
+}
+
+.tabs.tabs-card>.tabs-bar .tabs-nav--wrap {
+ margin-bottom: 0;
+}
+
+.list {
+ padding-top: 100rpx;
+}
+
+.score {
+ font-size: 70rpx;
+}
+.details {
+ position: absolute;
+ right: 30rpx;
+ top: 10rpx;
+ color: #ff6139;
+ line-height: 1;
+}
+
+
+.coupon {
+ background-color: #fefefe;
+ position: relative;
+ padding: 0 20rpx;
+ border-radius: 6rpx;
+ margin-top: 24rpx;
+}
+
+.coupon:before, .coupon:after {
+ content: '';
+ position: absolute;
+ width: 20rpx;
+ height: 40rpx;
+ background: #f6f6f6;
+ top: 70rpx;
+ z-index: 1;
+}
+
+.coupon:before {
+ border-radius: 0 40rpx 40rpx 0;
+ left: 0;
+}
+
+.coupon:after {
+ border-radius: 40rpx 0 0 40rpx;
+ right: 0;
+}
+
+.coupon .header {
+ display: flex;
+ padding: 15rpx 0;
+ border-bottom: 2rpx dashed #dbdbdb;
+ height: 140rpx;
+}
+
+.coupon .footer {
+ color: #747474;
+ font-size: 24rpx;
+ padding: 22rpx 0 20rpx 0;
+}
+
+.coupon .price {
+ color: #333;
+ width: 175rpx;
+ text-align: center;
+ border-right: 2rpx dashed #dbdbdb;
+}
+
+.coupon .price .reduce-price {
+ color: #000;
+ font-size: 38rpx;
+ font-weight: bold;
+ padding-top: 30rpx;
+}
+
+.coupon .price .reduce-price text {
+ font-size: 24rpx;
+}
+
+.coupon .price .reduce-desc {
+ font-size: 20rpx;
+ margin-top: 10rpx;
+}
+
+.coupon .info {
+ padding-left: 30rpx;
+ flex: 1;
+}
+
+.coupon .info .reduce-title {
+ color: #000;
+ font-size: 28rpx;
+ font-weight: bold;
+ padding-top: 20rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+
+.coupon .info .reduce-type {
+ color: #fff;
+ font-weight: normal;
+ font-size: 20rpx;
+ background: #ec6b5a;
+ padding: 2rpx 8rpx;
+ border-radius: 4rpx;
+}
+
+.coupon .status {
+ width: 130rpx;
+ text-align: center;
+}
+
+.coupon .status image {
+ width: 90rpx;
+ height: 90rpx;
+ margin-top: 20rpx;
+}
+
+.coupon.used,
+.coupon.expired {
+ background: #fafafa;
+}
+
+.coupon.used .price,
+.coupon.expired .price {
+ color: #949494;
+}
+
+.coupon.used .reduce-price,
+.coupon.expired .reduce-price,
+.coupon.used .reduce-title,
+.coupon.expired .reduce-title {
+ color: #7a7a7a;
+}
+
+.coupon.used .reduce-type,
+.coupon.expired .reduce-type {
+ background: #eeaea6;
+}
+
+.coupon.used .footer,
+.coupon.expired .footer {
+ color: #b6b6b6;
+}
+
+.reduce-area {
+ font-size: 24rpx;
+ color: #666;
+ margin-top: 10rpx;
+}
+
+.go-shop {
+ border: 1rpx solid #ec6b5a;
+ border-radius: 30rpx;
+ color: #ec6b5a;
+ font-size: 24rpx;
+ margin-top: 60rpx;
+ margin-right: 12rpx;
+ line-height: 38rpx;
+}
+
+.footer-tag {
+ font-size: 20rpx;
+ border-radius: 5rpx;
+ color: #fff;
+ padding: 2rpx 5rpx;
+ text-align: center;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/scoreList.js b/eaterplanet_ecommerce/moduleB/invite/scoreList.js
new file mode 100644
index 0000000..5a92d05
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/scoreList.js
@@ -0,0 +1,126 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ is_login: true,
+ list: [],
+ showData: 1,
+ loadText: '加载中',
+ remark: {
+ goodsbuy: '商品购买送积分',
+ refundorder: '订单退款增加积分',
+ system_add: '系统后台增加积分',
+ system_del: '系统后台减少积分',
+ orderbuy: '商品购买扣除积分'
+ }
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ util.check_login() ? this.setData({ is_login: true }) : this.setData({ is_login: false });
+ this.getData();
+ },
+
+ getData: function () {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ wx.showLoading();
+ this.setData({ isHideLoadMore: false })
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'invitegift.getInvitegiftPointsList',
+ token,
+ page: that.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let h = {};
+ var list = that.data.list;
+ list = res.data.data && list.concat(res.data.data) || [];
+ h.showData = res.data.data==null ? 0 : 1;
+ that.setData({ list, isHideLoadMore: true, ...h })
+ } else if (res.data.code == 1) {
+ if (that.data.list.length == 0 && that.page == 1) that.setData({ showData: 0 });
+ that.setData({ isHideLoadMore: true, no_data: 1 })
+ return false;
+ } else if (res.data.code == 2) {
+ that.setData({ is_login: false })
+ }
+ },
+ fail: (error) => {
+ console.log(error)
+ wx.showLoading();
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/scoreDetails',
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (this.data.no_data == 1) return false;
+ this.page += 1;
+ this.getData();
+ this.setData({
+ isHideLoadMore: false
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/invite/scoreList.json b/eaterplanet_ecommerce/moduleB/invite/scoreList.json
new file mode 100644
index 0000000..18d17ea
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/scoreList.json
@@ -0,0 +1,11 @@
+{
+ "navigationBarTitleText": "积分明细",
+ "navigationBarTextStyle": "black",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-auth": "../../components/auth/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-card": "../../components/card/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/scoreList.wxml b/eaterplanet_ecommerce/moduleB/invite/scoreList.wxml
new file mode 100644
index 0000000..ac56bf6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/scoreList.wxml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ 暂无任何明细记录
+
+
+
+
+
+
+ {{item.remark?item.remark:remark[item.type]}}
+ {{item.in_out=='in'?'+':'-'}}{{item.score}}
+
+ 订单号: {{item.trans_id}}
+
+ {{item.addtime}}
+ 剩余积分:{{item.after_operate_score}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/scoreList.wxss b/eaterplanet_ecommerce/moduleB/invite/scoreList.wxss
new file mode 100644
index 0000000..ad2e50b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/scoreList.wxss
@@ -0,0 +1,76 @@
+.score-box {
+ padding-top: 30rpx;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-top: 200rpx;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.list {
+ padding: 0 20rpx;
+}
+
+.list .listData {
+ padding: 30rpx;
+ border-bottom: 0.1rpx solid #eee;
+}
+
+.list .listData:last-child {
+ border: none;
+}
+
+.list .listData .list-tit {
+ line-height: 28rpx;
+ margin-bottom: 24rpx;
+ display: flex;
+ justify-content: space-between;
+}
+
+.list .listData .list-tit .tit {
+ font-size: 30rpx;
+ color: #444;
+}
+
+.list .listData .list-tit .num {
+ font-size: 32rpx;
+ color: #ff5344;
+ font-weight: bold;
+}
+
+.list .listData .list-tit .num.yue {
+ color: #666;
+ font-weight: normal;
+ font-size: 30rpx;
+}
+
+.list .listData .list-tit .num2 {
+ color: #999;
+}
+
+.list .listData .list-orderNo {
+ font-size: 26rpx;
+ color: #444;
+ margin-bottom: 16rpx;
+}
+
+.list .listData .list-time {
+ font-size: 26rpx;
+ color: #aaa;
+ line-height: 22rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/invite/share.js b/eaterplanet_ecommerce/moduleB/invite/share.js
new file mode 100644
index 0000000..225870f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/share.js
@@ -0,0 +1,165 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+ mixins: [require('../../mixin/compoentCartMixin.js'), require('../../mixin/globalMixin.js')],
+ data: {
+ list: [],
+ topImg: '',
+ rules: '',
+ getRules: '',
+ showRulesPopup: false,
+ token: '',
+ can_collect_gift: 0,
+ coupon_info: '',
+ point: '',
+ isCollect: 0,
+ needAuth: false
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+ let share_id = '';
+ if (options.scene) {
+ var value = decodeURIComponent(options.scene);
+ if (typeof value === 'object') {
+ //记录推广人uid
+ if (value.share_id) share_id = value.share_id;
+ } else {
+ share_id = value;
+ }
+ }
+ if (options.share_id) share_id = options.share_id;
+ wx.setStorageSync('share_id', share_id);
+
+ //登錄後返回
+ let can_collect_gift = options.can_collect_gift;
+ let token = wx.getStorageSync('token') || '';
+ this.setData({
+ token,
+ can_collect_gift
+ })
+ if(can_collect_gift==1) this.collectInvitegift();
+ setTimeout(() => { this.getData() }, 100);
+ },
+
+ getData() {
+ let suid = wx.getStorageSync('share_id');
+ let token = wx.getStorageSync('token') || '';
+ app.util.ProReq('invitegift.invitegiftIndex', { suid, token })
+ .then(res=>{
+ let { invite_activity_open_topback_img, invite_activity_rules, invite_activity_use_rules, suid } = res.data;
+
+ this.setData({
+ topImg: invite_activity_open_topback_img,
+ rules: invite_activity_rules,
+ getRules: invite_activity_use_rules,
+ })
+ })
+ .catch(err=>{
+ app.util.message(err.msg, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function (res) {
+ console.log(res)
+ let can_collect_gift = res.detail.data.is_can_collect_gift;
+ // if(can_collect_gift==1) this.collectInvitegift();
+ this.setData({
+ needAuth: false,
+ can_collect_gift
+ }, ()=>{
+ this.collectInvitegift();
+ })
+ },
+
+ authModal: function(){
+ if(this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * 领取礼包
+ */
+ collectInvitegift() {
+ let token = wx.getStorageSync('token') || '';
+ app.util.ProReq('invitegift.collectInvitegift', {token})
+ .then(res=>{
+ this.setData({
+ coupon_info: res.data.coupon_info,
+ point: res.data.point,
+ isCollect: 1
+ })
+ })
+ .catch(err=>{
+ this.setData({ can_collect_gift: 0 })
+ app.util.message(err.msg, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error');
+ })
+ },
+
+ goLink: function(event) {
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ goIndex: function(event) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ },
+
+ handleRuleModal() {
+ this.setData({
+ showRulesPopup: !this.data.showRulesPopup
+ })
+ },
+
+ /**
+ * 立即领取按钮
+ */
+ getGift() {
+ // 1.判断登录
+ wx.showLoading();
+ let that = this;
+ util.check_login_new().then((res)=>{
+ if (res) {
+ let token = wx.getStorageSync('token') || '';
+ this.setData({ token })
+ wx.hideLoading();
+ } else {
+ that.setData({ needAuth: true, showAuthModal: true });
+ wx.hideLoading();
+ }
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/invite/share.json b/eaterplanet_ecommerce/moduleB/invite/share.json
new file mode 100644
index 0000000..8da4913
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/share.json
@@ -0,0 +1,14 @@
+{
+ "navigationBarTitleText": "新手福利",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh": false,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-modal": "../../components/modal/index",
+ "i-new-auth": "../../components/new-auth/index",
+ "parser":"../../components/parser/parser",
+ "sku": "../../components/sku/index",
+ "guess-like": "../../components/guess-like/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/invite/share.wxml b/eaterplanet_ecommerce/moduleB/invite/share.wxml
new file mode 100644
index 0000000..0e0b8da
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/share.wxml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+ 抱歉!您已是我们的老朋友啦
+ 该礼包仅限新加入的用户领取,您也可以通过邀请其他新用户进行参与,获得奖励!
+
+
+
+
+
+ 恭喜,已成功领取新人礼包!
+
+ 优惠券
+
+
+
+
+
+
+ 恭喜您获得
+
+ {{point}}积分
+
+
+
+
+
+
+
+
+ 领券规则
+
+
+
+
+
+
+
+
+
+
+
+
+ 活动规则
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/invite/share.wxss b/eaterplanet_ecommerce/moduleB/invite/share.wxss
new file mode 100644
index 0000000..922acd4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/invite/share.wxss
@@ -0,0 +1,179 @@
+.box {
+ position: relative;
+ background: #FFFFFF;
+ width: 706rpx;
+ border-radius: 20rpx;
+ margin: 0 auto;
+ box-sizing: border-box;
+}
+.rules {
+ position: absolute;
+ top: 20rpx;
+ right: 20rpx;
+}
+.actColor {
+ color: #ff6139;
+}
+
+.actBg {
+ background: #ff6139;
+}
+
+.point {
+ font-size: 64rpx;
+}
+
+.point-box {
+ background: linear-gradient(90deg, rgb(255,87,51), rgb(255,132,80));
+ padding: 30rpx;
+ border-radius: 30rpx;
+ color: rgb(255,230,163);
+}
+
+.line-h {
+ line-height: 1;
+}
+
+.coupon {
+ background-color: #fefefe;
+ position: relative;
+ padding: 0 20rpx;
+ border-radius: 6rpx;
+ margin-top: 24rpx;
+ box-shadow: 1px 6px 12px #ececec;
+}
+
+.coupon:before, .coupon:after {
+ content: '';
+ position: absolute;
+ width: 20rpx;
+ height: 40rpx;
+ background: #f6f6f6;
+ top: 70rpx;
+ z-index: 1;
+}
+
+.coupon:before {
+ border-radius: 0 40rpx 40rpx 0;
+ left: 0;
+}
+
+.coupon:after {
+ border-radius: 40rpx 0 0 40rpx;
+ right: 0;
+}
+
+.coupon .header {
+ display: flex;
+ padding: 15rpx 0;
+ border-bottom: 2rpx dashed #dbdbdb;
+ height: 140rpx;
+}
+
+.coupon .footer {
+ color: #747474;
+ font-size: 24rpx;
+ padding: 22rpx 0 20rpx 35rpx;
+}
+
+.coupon .price {
+ color: #333;
+ width: 175rpx;
+ text-align: center;
+ border-right: 2rpx dashed #dbdbdb;
+}
+
+.coupon .price .reduce-price {
+ color: #000;
+ font-size: 38rpx;
+ font-weight: bold;
+ padding-top: 30rpx;
+}
+
+.coupon .price .reduce-price text {
+ font-size: 24rpx;
+}
+
+.coupon .price .reduce-desc {
+ font-size: 20rpx;
+ margin-top: 10rpx;
+}
+
+.coupon .info {
+ padding-left: 30rpx;
+ flex: 1;
+}
+
+.coupon .info .reduce-title {
+ color: #000;
+ font-size: 28rpx;
+ font-weight: bold;
+ padding-top: 20rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+
+.coupon .info .reduce-type {
+ color: #fff;
+ font-weight: normal;
+ font-size: 20rpx;
+ background: #ec6b5a;
+ padding: 2rpx 8rpx;
+ border-radius: 4rpx;
+}
+
+.coupon .status {
+ width: 130rpx;
+ text-align: center;
+}
+
+.coupon .status image {
+ width: 90rpx;
+ height: 90rpx;
+ margin-top: 20rpx;
+}
+
+.coupon.used,
+.coupon.expired {
+ background: #fafafa;
+}
+
+.coupon.used .price,
+.coupon.expired .price {
+ color: #949494;
+}
+
+.coupon.used .reduce-price,
+.coupon.expired .reduce-price,
+.coupon.used .reduce-title,
+.coupon.expired .reduce-title {
+ color: #7a7a7a;
+}
+
+.coupon.used .reduce-type,
+.coupon.expired .reduce-type {
+ background: #eeaea6;
+}
+
+.coupon.used .footer,
+.coupon.expired .footer {
+ color: #b6b6b6;
+}
+
+.reduce-area {
+ font-size: 24rpx;
+ color: #666;
+ margin-top: 10rpx;
+}
+
+.go-shop {
+ border: 1rpx solid #ec6b5a;
+ border-radius: 30rpx;
+ color: #ec6b5a;
+ font-size: 24rpx;
+ margin-top: 60rpx;
+ margin-right: 12rpx;
+ line-height: 38rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/live/index.js b/eaterplanet_ecommerce/moduleB/live/index.js
new file mode 100644
index 0000000..3ed5f85
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/live/index.js
@@ -0,0 +1,160 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+var status = require('../../utils/index.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ roomInfo: [],
+ loadText: "加载中...",
+ noData: false,
+ loadMore: true,
+ live_status_tip: {
+ 101: '直播中',
+ 102: '未开始',
+ 103: '已结束',
+ 104: '禁播',
+ 105: '暂停中',
+ 106: '异常',
+ 107: '已过期'
+ }
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ app.setShareConfig();
+ status.setNavBgColor();
+ this.getData();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ that.setData({
+ needAuth: true
+ })
+ } else {
+ (0, status.cartNum)('', true).then((res) => {
+ that.setData({
+ cartNum: res.data
+ })
+ });
+ }
+ })
+ },
+
+ getData: function(){
+ let that = this;
+ wx.showLoading();
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'livevideo.get_roominfo',
+ page: this.page
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let list = res.data.data || [];
+ let h = {};
+ h.share = res.data.share;
+ if(h.share && h.share.name) wx.setNavigationBarTitle({ title: h.share.name })
+ h.showTabbar = res.data.showTabbar;
+ if(list.length<5) h.noMore = true, h.loadMore = false;
+ let roomInfo = that.data.roomInfo;
+ roomInfo = roomInfo.concat(list);
+ h.roomInfo = roomInfo;
+ that.page++;
+ that.setData(h);
+ } else {
+ let h = {};
+ if(that.page==1) h.noData = true;
+ h.showTabbar = res.data.showTabbar;
+ h.loadMore = false;
+ that.setData(h);
+ }
+ }
+ })
+ },
+
+ goLive: function(e){
+ let roomid = e.currentTarget.dataset.roomid;
+ // let idx = e.currentTarget.dataset.idx;
+ // let roomInfo = this.data.roomInfo;
+ // if(idx>=0 && roomInfo && roomInfo[idx] && roomInfo[idx]['has_replay']) {
+ // roomid && wx.navigateTo({
+ // url: `/eaterplanet_ecommerce/moduleB/live/replay?room_id=${roomid}`,
+ // })
+ // return;
+ // }
+ roomid && wx.navigateTo({
+ url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomid}`,
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ this.data.loadMore && this.getData();
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ let share = this.data.share || '';
+ let title = share.title || '';
+ let imageUrl = share.img || '';
+ let share_path = 'eaterplanet_ecommerce/moduleB/live/index';
+ return {
+ title,
+ imageUrl,
+ path: share_path,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ },
+
+ onShareTimeline: function () {
+ let share = this.data.share || '';
+ let title = share.title || '';
+ let imageUrl = share.img || '';
+ return {
+ title,
+ imageUrl,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/live/index.json b/eaterplanet_ecommerce/moduleB/live/index.json
new file mode 100644
index 0000000..ca022d1
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/live/index.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "",
+ "usingComponents": {
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index",
+ "i-tabbar": "../../components/tabbar/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/live/index.wxml b/eaterplanet_ecommerce/moduleB/live/index.wxml
new file mode 100644
index 0000000..2f7ea48
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/live/index.wxml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 直播中
+
+
+ 预告
+ {{item.date_text}}开播
+
+
+
+ 直播结束
+
+
+
+ {{live_status_tip[item.live_status]}}
+
+ 置顶
+
+
+ 推荐
+
+
+
+
+ {{item.name}}
+
+
+
+
+ {{item.anchor_name}}
+
+
+
+
+ ¥{{item.goods_list[0].price/100}}
+ ¥{{item.goods_list[0].price/100}}~{{item.goods_list[0].price2/100}}
+ ¥{{item.goods_list[0].price2/100}}
+
+
+
+
+ {{item.goods_list.length}}
+ 商品
+
+
+
+
+
+
+
+ 暂无内容~
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/live/index.wxss b/eaterplanet_ecommerce/moduleB/live/index.wxss
new file mode 100644
index 0000000..a484661
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/live/index.wxss
@@ -0,0 +1,226 @@
+.empty-list {
+ padding: 260rpx 150rpx;
+ font-size: 34rpx;
+}
+
+.empty-list .btn {
+ margin: 0;
+ border-radius: 100rpx;
+ height: 76rpx;
+ line-height: 76rpx;
+ width: 280rpx;
+ font-size: 30rpx;
+ padding: 0;
+}
+
+.empty-list .light {
+ height: 240rpx;
+ width: 240rpx;
+}
+
+.empty-list .text-cancel {
+ padding: 10rpx;
+ margin-bottom: 30rpx;
+ margin-top: 25rpx;
+ font-size: 30rpx;
+}
+
+.fui-live-list {
+ padding: 24rpx;
+}
+
+.fui-live-item {
+ margin-bottom: 24rpx;
+ border-radius: 24rpx;
+ background: #fff;
+ display: flex;
+ overflow: hidden;
+}
+
+.fui-live-item>.cover,.fui-live-item>.cover>image {
+ width: 400rpx;
+ height: 400rpx;
+ background: #f2f2f2;
+ position: relative;
+}
+
+.fui-live-item>.cover>.status {
+ position: absolute;
+ left: 8rpx;
+ top: 8rpx;
+ width: auto;
+ height: 48rpx;
+ border-radius: 24rpx;
+ background: rgba(0,0,0,0.2);
+ line-height: 48rpx;
+ color: #FFFFFF;
+ font-size: 24rpx;
+ display: flex;
+}
+
+.fui-live-item>.cover>.status .notice {
+ height: 48rpx;
+ background: #3DC637;
+ font-size: 24rpx;
+ line-height: 48rpx;
+ padding: 0 16rpx;
+ border-radius: 24rpx;
+ font-weight: 500;
+}
+
+.fui-live-item>.cover>.status>image {
+ height: 48rpx;
+ width: 48rpx;
+}
+
+.fui-live-item>.cover>.status text {
+ padding: 0 20rpx 0 12rpx;
+ font-weight: 400;
+}
+
+.fui-live-item>.cover>.status text.b {
+ font-weight: 700;
+}
+
+.fui-live-item>.cover>.top {
+ position: absolute;
+ left: 8rpx;
+ bottom: 8rpx;
+ height: 36rpx;
+ border-radius: 18rpx;
+ background: #FF661A;
+ padding: 0 16rpx;
+ line-height: 36rpx;
+ font-weight: 500;
+ font-size: 20rpx;
+ color: #FFFFFF;
+}
+
+.fui-live-item>.cover>.recommend {
+ position: absolute;
+ right: 8rpx;
+ bottom: 8rpx;
+ height: 36rpx;
+ border-radius: 18rpx;
+ background: #FB1732;
+ padding: 0 8rpx;
+ line-height: 30rpx;
+}
+
+.fui-live-item>.cover>.recommend>image {
+ width: 20rpx;
+ height: 20rpx;
+ display: inline-block;
+}
+
+.fui-live-item>.cover>.recommend>text {
+ color: #FFFFFF;
+ font-weight: 500;
+ font-size: 20rpx;
+}
+
+.fui-live-item>.info {
+ flex: 1;
+ padding: 36rpx 24rpx 0 24rpx;
+}
+
+.fui-live-item>.info>.title {
+ height: 80rpx;
+ font-size: 28rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ align-content: center;
+ font-weight: 700;
+ line-height: 40rpx;
+}
+
+.fui-live-item>.info>.anchor {
+ height: 60rpx;
+ width: 100%;
+ padding: 24rpx 0;
+ display: flex;
+ flex-direction: row;
+}
+
+.fui-live-item>.info>.anchor>.avatar,.fui-live-item>.info>.anchor>.avatar>image {
+ width: 60rpx;
+ height: 60rpx;
+ border-radius: 30rpx;
+}
+
+.fui-live-item>.info>.anchor>.nickname {
+ flex: 1;
+ font-size: 24rpx;
+ color: #56595B;
+ height: 60rpx;
+ line-height: 60rpx;
+ padding-left: 8rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 1;
+ -webkit-box-orient: vertical;
+ align-content: center;
+}
+
+.fui-live-item>.info>.goods-list {
+ height: 120rpx;
+ display: flex;
+ justify-content: space-between;
+}
+
+.fui-live-item>.info>.goods-list>.row,.fui-live-item>.info>.goods-list>.row>image {
+ width: 120rpx;
+ height: 120rpx;
+ border-radius: 8rpx;
+ background: #eee;
+}
+
+.fui-live-item>.info>.goods-list>.row {
+ position: relative;
+}
+
+.fui-live-item>.info>.goods-list>.row>.cover {
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background: rgba(0,0,0,0.2);
+ position: absolute;
+ padding-top: 86rpx;
+ text-align: center;
+ font-weight: 500;
+ font-size: 22rpx;
+ color: #fff;
+ border-radius: 8rpx;
+}
+
+.fui-live-item>.info>.goods-list>.row>.cover.br {
+ padding-top: 26rpx;
+ color: #fff;
+ font-weight: 500;
+ font-size: 24rpx;
+ line-height: 38rpx;
+}
+
+.replayImg {
+ width: 400rpx;
+ height: 400rpx;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background-color: rgba(0,0,0,0.6);
+}
+
+.replayImg image {
+ height: 128rpx;
+ width: 128rpx;
+ border-radius: 50%;
+ position: absolute;
+ left: 50%;
+ margin-left: -64rpx;
+ top: 136rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/live/replay.js b/eaterplanet_ecommerce/moduleB/live/replay.js
new file mode 100644
index 0000000..b8b7a23
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/live/replay.js
@@ -0,0 +1,108 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ replayInfo: '',
+ roominfo: ''
+ },
+ room_id: '',
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let room_id = options.room_id || 0;
+ this.room_id = room_id;
+ this.getData(room_id);
+
+ let showBackBtn = false;
+ let pages_all = getCurrentPages();
+ if (pages_all.length > 1) {
+ showBackBtn = true;
+ }
+ this.setData({ showBackBtn })
+ },
+
+ getData: function(room_id){
+ let that = this;
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'livevideo.get_replay',
+ room_id
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let replayInfo = res.data.data || '';
+ let roominfo = res.data.roominfo || '';
+ that.setData({ replayInfo, roominfo });
+ } else {
+ app.util.message('回放内容不存在', 'redirect:/eaterplanet_ecommerce/moduleB/live/index', 'error', '知道了');
+ }
+ }
+ })
+ },
+
+ goDetails: function(e) {
+ let url = e.currentTarget.dataset.link;
+ url = url.replace(".html", "");
+ if(!url) return;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({ url })
+ } else {
+ wx.navigateTo({ url })
+ }
+ },
+
+ clickStore: function() {
+ this.setData({ showStore: !this.data.showStore })
+ },
+
+ _backhome: function() {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ let roominfo = this.data.roominfo;
+ let share_title = roominfo.name;
+ let imageUrl = roominfo.share_img;
+ let room_id = this.room_id;
+ var share_path = `eaterplanet_ecommerce/moduleB/live/replay?room_id=${room_id}`;
+ console.log('回放分享地址:', share_path);
+ return {
+ title: share_title,
+ path: share_path,
+ imageUrl,
+ success: function (res) {
+ // 转发成功
+ },
+ fail: function (res) {
+ // 转发失败
+ }
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/live/replay.json b/eaterplanet_ecommerce/moduleB/live/replay.json
new file mode 100644
index 0000000..83a082f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/live/replay.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTextStyle": "white",
+ "navigationStyle": "custom",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/live/replay.wxml b/eaterplanet_ecommerce/moduleB/live/replay.wxml
new file mode 100644
index 0000000..b1873c2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/live/replay.wxml
@@ -0,0 +1,63 @@
+
+ var caclPrice = function (d) {
+ var str = d;
+ if(d) {
+ d = d.toString();
+ var len = d.length;
+ str = d.slice(0, len-2) + '.' + d.slice(-2);
+ }
+ return str;
+ }
+ module.exports = {
+ caclPrice : caclPrice,
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+ ¥ {{price.caclPrice(item.price)}}
+
+
+
+
+
+ 暂无商品
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/live/replay.wxss b/eaterplanet_ecommerce/moduleB/live/replay.wxss
new file mode 100644
index 0000000..b48927c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/live/replay.wxss
@@ -0,0 +1,284 @@
+page {
+ width: 100%;
+ height: 100%;
+ overflow-y: hidden;
+}
+
+.main {
+ display: block;
+ position: relative;
+ height: 100%;
+ z-index: 0;
+}
+
+.main::after {
+ content: ' ';
+ display: block;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 30%;
+ z-index: 1;
+ background-image: linear-gradient(to top, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.16) 40%, rgba(0, 0, 0, 0) 100%);
+}
+
+.main::before {
+ content: ' ';
+ display: block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 20%;
+ z-index: 1;
+ background-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.16) 40%, rgba(0, 0, 0, 0.24) 100%);
+}
+
+.main video {
+ width: 750rpx;
+ height: 100%;
+}
+
+.live-page {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 20;
+ padding-bottom: 24px;
+ box-sizing: border-box;
+ width: 100%;
+ height: 100%;
+}
+
+.operation {
+ position: fixed;
+ right: 17px;
+ bottom: 24px;
+ z-index: 10;
+}
+
+.operation .item {
+ width: 42px;
+ height: 42px;
+ background: #8385F3;
+ border-radius: 50%;
+ margin-bottom: 23px;
+ overflow: hidden;
+}
+
+.operation button.item {
+ background: transparent;
+}
+
+.operation .item .iconfont {
+ font-size: 24px;
+ color: #fff;
+}
+
+.operation .item.operation--mode-filter-black {
+ background: rgba(0, 0, 0, 0.25);
+ backdrop-filter: blur(20px);
+ border-radius: 50%;
+ overflow: hidden;
+}
+
+.operation button.item {
+ line-height: initial;
+ padding: 0;
+}
+
+.operation button.item::after {
+ content: none;
+}
+
+.store {
+ padding: 0 16px;
+ position: absolute;
+ z-index: 2;
+ left: 0;
+ right: 0;
+ bottom: 30px;
+}
+
+.store-list {
+ border-radius: 16px;
+ overflow: hidden;
+ position: relative;
+ bottom: -999px;
+}
+
+.store-list.fadeIn {
+ bottom: 0;
+ animation: fadeInStoreList 0.2s 1 forwards;
+}
+
+.store__mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 100%;
+ z-index: 1;
+}
+
+.mode-filter-black {
+ background-color: rgba(0, 0, 0, 0.25);
+ backdrop-filter: blur(20px);
+ border-radius: inherit;
+}
+
+.store-list__inner {
+ position: relative;
+ z-index: 5002;
+ padding: 16px 12px;
+ box-sizing: border-box;
+}
+
+.store-list__header {
+ position: relative;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ padding: 0 4px;
+ font-weight: 500;
+}
+
+.store-list__title {
+ font-size: 15px;
+ color: #ffffff;
+ text-shadow: 0.5px 0.5px 2px rgba(0, 0, 0, 0.1);
+}
+
+.store-list__body {
+ margin-top: 4px;
+ overflow: hidden;
+ padding: 2px 5px 0 0;
+ box-sizing: border-box;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.store-list__page__inner {
+ position: relative;
+ width: calc(100% + 20px);
+ box-sizing: border-box;
+ -webkit-mask-image: -webkit-gradient(linear, left bottom, left 96%, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 04)));
+}
+
+.store-list__item {
+ margin-bottom: 12px;
+ background: #ffffff;
+ border-radius: 8px;
+}
+
+.store-list__item:last-child {
+ margin-bottom: 0;
+}
+
+.store-list__item__inner {
+ display: flex;
+ justify-content: flex-start;
+ align-items: stretch;
+ padding: 8px;
+}
+
+.store-list__item__header {
+ position: relative;
+ margin-right: 9px;
+ font-size: 0;
+}
+
+.store-list__item__avatar {
+ width: 64px;
+ height: 64px;
+ border-radius: 2px;
+ box-sizing: border-box;
+}
+
+.store-list__item__index {
+ position: absolute;
+ top: 0;
+ left: 0;
+ background: rgba(0, 0, 0, 0.5);
+ border-radius: 2px 0px 8px 0px;
+ text-align: center;
+ padding: 0 2px;
+ min-width: 14px;
+ line-height: 12px;
+ font-size: 10px;
+ color: #ffffff;
+ text-align: center;
+}
+
+.store-list__item__page {
+ height: initial;
+}
+
+.store-list__item__title {
+ font-size: 15px;
+ color: rgba(0, 0, 0, 0.7);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ word-break: break-all;
+ line-height: 19.6px;
+ margin-bottom: 5px;
+}
+
+.store-list__item__price {
+ opacity: 0.9;
+ font-size: 14px;
+ color: #fa9d3b;
+}
+
+.store-list__item__price-before {
+ color: #B2B2B2;
+ text-decoration: line-through;
+}
+
+.store-list__empty {
+ text-align: center;
+ height: 287px;
+ line-height: 140px;
+ color: #fff;
+ font-size: 14px;
+}
+
+.nav-btn {
+ position: relative;
+ top: 0;
+ left: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 31px;
+ height: 31px;
+ line-height: 31px;
+ padding: 0;
+ min-width: 31px;
+ max-width: 31px;
+ text-align: center;
+ border-radius: 50%;
+ min-height: initial;
+ box-sizing: border-box;
+ background: rgba(0,0,0,0.25);
+ border: 1px solid rgba(255,255,255,0.05);
+ color: #fff;
+ backdrop-filter: blur(20px);
+}
+
+.nav-btn .img {
+ width: 20px;
+ height: 20px;
+ vertical-align: top;
+}
+
+.store-list__body__inner {
+ overflow-y: auto;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/manage/index.js b/eaterplanet_ecommerce/moduleB/manage/index.js
new file mode 100644
index 0000000..57321fb
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/manage/index.js
@@ -0,0 +1,163 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+ data: {
+ type: 0,
+ showTipDialog: false,
+ showTimeModal: false,
+ isPickerRender: false,
+ isPickerShow: false,
+ startTime: new Date().toLocaleDateString(),
+ endTime: new Date().toLocaleDateString(),
+ pickerConfig: {
+ endDate: true,
+ column: "day",
+ dateLimit: true,
+ initStartTime: new Date().toLocaleDateString(),
+ initEndTime: new Date().toLocaleDateString(),
+ limitStartTime: "2015-05-06",
+ limitEndTime: "2065-05-06"
+ }
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+
+ },
+
+ onShow: function () {
+ this.getData();
+ },
+
+ getData: function () {
+ wx.showLoading();
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('platformmobile.getIndexData', {
+ token
+ }).then(res => {
+ wx.hideLoading();
+ wx.stopPullDownRefresh();
+ let {
+ business_data,
+ goods_data,
+ sales_data,
+ todayOrderData,
+ user_data
+ } = res;
+ this.setData({
+ business_data,
+ goods_data,
+ sales_data,
+ todayOrderData,
+ user_data,
+ type: 0
+ })
+ }).catch(err => {
+ wx.hideLoading();
+ wx.stopPullDownRefresh();
+ app.util.message(err.message || '请求出错', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ sortData: function () {
+ // type 0 全部,1 今日 ,2 昨日 ,3 7日, 4 时间段
+ // begin_time
+ // end_time
+ let { type, startTime, endTime } = this.data;
+ wx.showLoading();
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('platformmobile.searchAnalySalesByTime', {
+ token,
+ type,
+ begin_time: startTime,
+ end_time: endTime
+ }).then(res => {
+ wx.hideLoading();
+ }).catch(err => {
+ wx.hideLoading();
+ this.setData({
+ sales_data: err.sales_data
+ })
+ })
+ },
+
+ changeNav: function (e) {
+ let type = e.currentTarget.dataset.type || 0;
+ this.setData({
+ type,
+ startTime: "",
+ endTime: ""
+ }, ()=>{
+ this.sortData();
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.getData();
+ },
+
+ confirmMessage: function () {
+ this.setData({
+ showTipDialog: !this.data.showTipDialog
+ })
+ },
+
+ handleModal: function () {
+ this.setData({
+ showTimeModal: !this.data.showTimeModal
+ })
+ },
+
+ pickerShow: function () {
+ this.setData({
+ isPickerShow: true,
+ isPickerRender: true,
+ chartHide: true
+ });
+ },
+
+ pickerHide: function () {
+ this.setData({
+ isPickerShow: false,
+ chartHide: false
+ });
+ },
+
+ bindPickerChange: function (e) {
+ this.getData(this.data.sensorList[e.detail.value].id);
+ this.setData({
+ index: e.detail.value,
+ sensorId: this.data.sensorList[e.detail.value].id
+ });
+ },
+
+ setPickerTime: function (val) {
+ let data = val.detail;
+ this.setData({
+ type: 4,
+ startTime: data.startTime,
+ endTime: data.endTime
+ }, ()=>{
+ this.sortData();
+ });
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/manage/index.json b/eaterplanet_ecommerce/moduleB/manage/index.json
new file mode 100644
index 0000000..42542a4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/manage/index.json
@@ -0,0 +1,12 @@
+{
+ "navigationBarTitleText": "平台管理",
+ "navigationBarTextStyle": "white",
+ "navigationBarBackgroundColor": "#EF485A",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-dialog": "../../components/dialog/index",
+ "i-modal": "../../components/modal/index",
+ "timePicker": "../../components/timePicker/timePicker"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/manage/index.wxml b/eaterplanet_ecommerce/moduleB/manage/index.wxml
new file mode 100644
index 0000000..587e147
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/manage/index.wxml
@@ -0,0 +1,189 @@
+
+
+ 销售统计
+ 自定义时间
+
+ 汇总
+ 今日
+ 昨日
+ 7日
+
+
+
+
+ {{sales_data.pay_order_count}}
+ 支付订单数
+
+
+ ¥{{sales_data.pay_order_money?sales_data.pay_order_money:0}}
+ 支付订单金额
+
+
+
+
+
+ {{sales_data.wait_send_count}}
+ 待发货订单
+
+
+
+ {{sales_data.sending_order_count}}
+ 配送中订单
+
+
+
+ {{sales_data.waitrefund_count}}
+ 待退款订单
+
+
+
+
+ 平台数据
+
+
+ {{todayOrderData.todaypay_order_count}}
+ 今日付款订单
+
+
+ ¥{{todayOrderData.todaypay_order_money}}
+ 今日付款总金额
+
+
+ {{todayOrderData.todaywait_send_count}}
+ 今日待付款订单
+
+
+
+
+
+ 平台用户
+
+
+ {{user_data.today_user_count}}
+ 今日新增会员
+
+
+ {{user_data.yes_user_count}}
+ 昨日新增会员
+
+
+ {{user_data.total_user_count}}
+ 总会员数
+
+
+
+
+ {{user_data.today_addhead_count}}
+ 今日新增团长
+
+
+ {{user_data.yes_addhead_count}}
+ 昨日新增团长
+
+
+ {{user_data.total_head_count}}
+ 总团长数
+
+
+
+
+
+ 商品数据
+
+
+ {{goods_data.count}}
+ 商品总数
+
+
+ {{goods_data.normal_count}}
+ 普通商品
+
+
+ {{goods_data.pingoods_count}}
+ 拼团商品
+
+
+
+
+ {{goods_data.integral_goods_count}}
+ 积分商品
+
+
+
+
+
+
+
+
+ 平台营业数据
+
+
+
+
+ ¥{{business_data.head_commiss_money}}
+ 商城团长总佣金
+
+
+ ¥{{business_data.today_win_money}}
+ 今日利润
+
+
+ {{business_data.payed_member_count}}
+ 付款人数
+
+
+
+
+ {{business_data.addorder_member_count}}
+ 下单人数
+
+
+
+
+
+
+
+
+
+
+ 提示
+
+
+
+ 订单金额: 统计订单金额不包含退款金额和已取消订单金额。
+ 团长总佣金:统计佣金订单金额不包含退款金额和已取消订单金额。
+ 今日利润:今日商城商品销量的全部金额-今日商城商品销量的全部成本金额-今日商城商品优惠金额=今日商品利润。
+ 今日商城商品销量的全部金额:商城今日销售的所有商品金额总和。
+ 今日商城商品销量的全部成本金额:商城今日销售的所有商品成本金额总。
+ 今日商城商品优惠金额:商城今日使用掉的优惠金额(积分抵扣的金额,优惠券金额,新人优惠金额等)。
+ 访问人数:浏览小程序的人数(包含已登录和未登录小程序的人数,每个IP计算一次,相同IP不重复统计)。
+ 下单人数:商城下过订单的会员人数(待付款的订单人数也统计在内)。
+ 付款人数:商城下单并且付款完成(已支付)的会员人数。
+
+
+
+
+
+
+
+
+ 自定义时间
+
+ 1111
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/manage/index.wxss b/eaterplanet_ecommerce/moduleB/manage/index.wxss
new file mode 100644
index 0000000..b427564
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/manage/index.wxss
@@ -0,0 +1,85 @@
+.diytime {
+ position: absolute;
+ right: 30rpx;
+ top: 32rpx;
+}
+
+.nav {
+ border: 1rpx solid #4facfe;
+ margin: 0 50rpx;
+ border-radius: 50rpx;
+ color: #4facfe;
+ overflow: hidden;
+}
+
+.nav .item {
+ padding: 10rpx 0;
+ border-left: 1rpx solid #4facfe;
+}
+
+.nav .item:first-child {
+ border-left: 0;
+}
+
+.nav .item.active {
+ background-color: #4facfe;
+ color: #ffffff;
+}
+
+.bg-line {
+ background: linear-gradient(160deg, #4facfe, #00f2fe);
+}
+
+.hide-dialog {
+ height: 100%;
+ width: 100%;
+ bottom: 0;
+ left: 0;
+ z-index: 19;
+ background: rgba(0, 0, 0, 0.3);
+ position: fixed;
+}
+
+.dialog-tips {
+ width: 700rpx;
+ min-height: 412rpx;
+ max-height: 75vh;
+ border-radius: 24rpx;
+ top: 0rpx;
+ left: 0rpx;
+ right: 0rpx;
+ bottom: 0rpx;
+ margin: auto;
+ position: fixed;
+ background: #fff;
+ z-index: 20;
+}
+
+.dialog-tips .dialog-title {
+ padding: 30rpx 0;
+ font-size: 32rpx;
+ color: #333;
+ text-align: center;
+ font-weight: 500;
+}
+
+.dialog-tips .dialog-content {
+ font-size: 28rpx;
+ padding: 0 50rpx;
+ color: #999;
+}
+
+.dialog-tips .dialog-btn {
+ bottom: 30rpx;
+ position: absolute;
+ text-align: center;
+ color: #fff;
+ background: #4facfe;
+ font-size: 32rpx;
+ height: 72rpx;
+ width: 432rpx;
+ line-height: 72rpx;
+ border-radius: 60rpx;
+ left: 50%;
+ margin-left: -216rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/offlineCode/index.js b/eaterplanet_ecommerce/moduleB/offlineCode/index.js
new file mode 100644
index 0000000..dfede4c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/offlineCode/index.js
@@ -0,0 +1,81 @@
+var app = getApp();
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ needAuth: false,
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ authSuccess: function() {
+ this.setData({ showAuthModal: false, needAuth: false });
+ },
+
+ formSubmit(e) {
+ console.log('form发生了submit事件,携带数据为:', e.detail.value)
+ let code_sn = e.detail.value.code_sn || "";
+ if(!code_sn) {
+ wx.showToast({
+ title: '请输入卡密',
+ icon: "none"
+ })
+ return;
+ }
+ wx.showLoading();
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('virtualcard.subOfflineCode', {
+ token,
+ code_sn
+ }).then(res => {
+ wx.hideLoading();
+ wx.showModal({
+ title: "提示",
+ content: "您已成功充值"+res.money+"元",
+ showCancel: false
+ })
+ }).catch(err => {
+ wx.hideLoading();
+ if(err.code==1) {
+ //未登录
+ this.setData({ showAuthModal: !this.data.showAuthModal, needAuth: true });
+ } else {
+ wx.showModal({
+ title: "提示",
+ content: err.message || "充值失败,请重试",
+ showCancel: false
+ })
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/offlineCode/index.json b/eaterplanet_ecommerce/moduleB/offlineCode/index.json
new file mode 100644
index 0000000..0ed5c28
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/offlineCode/index.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "卡密充值",
+ "navigationBarTextStyle": "black",
+ "navigationBarBackgroundColor": "#ffffff",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/offlineCode/index.wxml b/eaterplanet_ecommerce/moduleB/offlineCode/index.wxml
new file mode 100644
index 0000000..027237d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/offlineCode/index.wxml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/offlineCode/index.wxss b/eaterplanet_ecommerce/moduleB/offlineCode/index.wxss
new file mode 100644
index 0000000..5df684e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/offlineCode/index.wxss
@@ -0,0 +1,12 @@
+.btn {
+ margin: 50rpx;
+ font-size: 30rpx;
+ background-color: #4facfe;
+ color: #fff;
+}
+
+.ipt {
+ padding: 15rpx 20rpx;
+ border: 1rpx solid #e5e5e5;
+ border-radius: 5rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/order/share.js b/eaterplanet_ecommerce/moduleB/order/share.js
new file mode 100644
index 0000000..1d05449
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/order/share.js
@@ -0,0 +1,195 @@
+var app = getApp();
+var status = require('../../utils/index.js');
+var util = require('../../utils/util.js');
+
+Page({
+ mixins: [require('../../mixin/globalMixin.js'), require('../../mixin/compoentCartMixin.js')],
+ data: {
+ members: '',
+ order_goods_list: [],
+ orders: '',
+ cartNum: 0,
+ groupInfo: {
+ group_name: '社区',
+ owner_name: '团长'
+ },
+ },
+ isFirst: 1,
+
+ onLoad: function (options) {
+ let order_id = options.order_id || '';
+ if (!order_id) {
+ wx.showModal({
+ title: '提示',
+ content: '参数错误',
+ showCancel: false,
+ confirmColor: '#F75451',
+ success(res) {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ }
+ }
+ })
+ return false;
+ }
+ status.setGroupInfo().then((groupInfo) => { this.setData({ groupInfo }) });
+ this.getData(order_id);
+ },
+
+ getData: function (order_id) {
+ wx.showLoading();
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('order.share_order', {
+ token,
+ order_id
+ }).then(res => {
+ wx.hideLoading();
+ let {
+ members,
+ order_goods_list,
+ orders
+ } = res.data;
+ this.setData({
+ members,
+ order_goods_list,
+ orders
+ })
+ if(this.isFirst==1) this.compareCommunity(orders.head_info);
+ this.isFirst++;
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '请求出错', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ changeNotListCartNum: function (t) {
+ let that = this;
+ let e = t.detail;
+ (0, status.cartNum)(that.setData({
+ cartNum: e
+ }));
+ },
+
+ /**
+ * 比较社区
+ * shareCommunity: 这个接龙的所属社区
+ */
+ compareCommunity: function (shareCommunity='') {
+ console.log('shareCommunity', shareCommunity)
+ let that = this;
+ // 原来社区
+ let currentCommunity = wx.getStorageSync('community');
+ let currentCommunityId = currentCommunity.communityId || '';
+ const token = wx.getStorageSync('token');
+ let {
+ groupInfo
+ } = that.data;
+
+ let shareCommunityId = shareCommunity.id || '';
+ shareCommunityId && util.getCommunityById(shareCommunityId).then(res => {
+ let {
+ hide_community_change_btn,
+ default_head_info
+ } = res;
+ if (res.open_danhead_model == 1) {
+ // 开启单社区
+ app.globalData.community = default_head_info;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({
+ key: "community",
+ data: default_head_info
+ })
+ token && util.addhistory(default_head_info);
+ if (shareCommunityId != default_head_info.communityId) {
+ let {
+ groupInfo
+ } = that.data;
+ console.log('开启单社区');
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error', '知道了');
+ return;
+ }
+ } else {
+ // 社区是否存在
+ if (currentCommunityId != '' && shareCommunityId) {
+ // 存在并且不相同
+ console.log('currentCommunityId存在 比较社区')
+ if (currentCommunityId != shareCommunityId) {
+ console.log('currentCommunityId存在 社区不同')
+ console.log('禁止切换');
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error', '知道了');
+ return;
+ }
+ } else {
+ // 不存在社区id
+ //token 是否存在
+ if (token) {
+ util.getCommunityInfo().then(function (ret) {
+ //比较社区
+ console.log('token存在 比较社区')
+ if (ret.community_id && ret.community_id != shareCommunityId) {
+ app.util.message(`您只能访问自己${groupInfo.group_name}`, 'switchTo:/eaterplanet_ecommerce/pages/index/index', 'error', '知道了');
+ return;
+ }
+ }).catch((param) => {
+ console.log('step4 新人')
+ if (Object.keys(param) != '') util.addhistory(param, true);
+ });
+ } else {
+ console.log('token不存在 存社区')
+ // 直接存本地
+ app.globalData.community = res.data;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({
+ key: "community",
+ data: res.data
+ })
+ }
+ }
+ }
+ });
+ },
+
+ /**
+ * 切换提示
+ */
+ confrimChangeCommunity: function () {
+ let community = this.data.changeCommunity;
+ let token = wx.getStorageSync('token');
+ app.globalData.community = community;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({
+ key: "community",
+ data: community
+ })
+ token && util.addhistory(community);
+
+ this.setData({
+ showChangeCommunity: false
+ })
+ console.log('用户点击确定')
+ },
+
+ /**
+ * 取消切换
+ */
+ cancelChangeCommunity: function () {
+ let {
+ groupInfo
+ } = this.data;
+ wx.showModal({
+ title: '提示',
+ content: `此订单在您所属${groupInfo.group_name}不可参与`,
+ showCancel: false,
+ confirmColor: '#ff5041',
+ success(res) {
+ if (res.confirm) {
+ wx.switchTab({
+ url: `/eaterplanet_ecommerce/pages/index/index`
+ })
+ }
+ }
+ });
+ },
+})
diff --git a/eaterplanet_ecommerce/moduleB/order/share.json b/eaterplanet_ecommerce/moduleB/order/share.json
new file mode 100644
index 0000000..97f7529
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/order/share.json
@@ -0,0 +1,13 @@
+{
+ "navigationBarTitleText": "朋友的订单",
+ "navigationBarTextStyle": "black",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "i-new-auth": "../../components/new-auth/index",
+ "sku": "../../components/sku/index",
+ "i-new-rush-spu": "../../components/new-rush-spu/index",
+ "i-fixed-bottom": "../../components/fixed-bottom/index",
+ "i-change-community": "../../components/changeCommunity/index",
+ "i-vip-modal": "../../components/vipModal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/order/share.wxml b/eaterplanet_ecommerce/moduleB/order/share.wxml
new file mode 100644
index 0000000..7e2d90d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/order/share.wxml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+ {{orders.salesroom_info.room_name}}
+ {{orders.salesroom_info.room_address}}
+
+
+
+
+
+
+
+ {{orders.head_info.community_name}}
+ {{orders.head_info.fulladdress}}
+
+
+
+
+
+
+
+ {{members.username}}
+
+
+ 买了{{orders.goods_count}}件共花费¥{{orders.old_order_total}}
+ ,一共省了¥{{orders.save_money}}
+
+
+
+
+
+
+
+
+
+ 去购物车
+ 去首页逛逛
+
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/order/share.wxss b/eaterplanet_ecommerce/moduleB/order/share.wxss
new file mode 100644
index 0000000..0d2a708
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/order/share.wxss
@@ -0,0 +1,33 @@
+.tip {
+ position: relative;
+ background: rgb(255, 245, 244);
+ color: #FD4F5F;
+ padding: 10rpx 20rpx;
+ margin-top: 15px;
+}
+
+.tip::before {
+ content: "";
+ position: absolute;
+ top: -10px;
+ width: 0;
+ height: 0;
+ border-left: 10px solid transparent;
+ border-right: 10px solid transparent;
+ border-bottom: 20px solid rgb(255, 245, 244);
+}
+
+.price {
+ margin-left: 5rpx;
+}
+
+.cartbtn {
+ border: 1px solid #FD4F5F;
+ color: #FD4F5F;
+ margin-left: 30rpx;
+}
+
+.btn {
+ background: #FD4F5F;
+ color: #ffffff;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/presale/index.js b/eaterplanet_ecommerce/moduleB/presale/index.js
new file mode 100644
index 0000000..5665e24
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/presale/index.js
@@ -0,0 +1,233 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ needAuth: false,
+ has_slider: 0,
+ slider_list: [],
+ share_img: '',
+ share_title: '',
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: [],
+ },
+ pageNum: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+
+ onLoad: function (options) {
+ this.getData();
+ this.getList();
+ },
+
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if(res) {
+ that.setData({ needAuth: false })
+ } else {
+ this.setData({ needAuth: true });
+ }
+ })
+ },
+
+ authSuccess: function () {
+ let that = this;
+ this.pageNum = 1;
+ this.setData({
+ slider_list: [],
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: []
+ }, () => {
+ that.getData();
+ that.getList();
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ getData: function () {
+ app.util.ProReq('presalegoods.index', {}).then(res => {
+ let { has_slider, slider_list, presale_share_img, presale_share_title, presale_layout } = res.data;
+ this.setData({
+ presale_layout,
+ has_slider,
+ slider_list,
+ share_img: presale_share_img,
+ share_title: presale_share_title
+ })
+ })
+ },
+
+ /**
+ * 获取商品列表
+ */
+ getList: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let community = wx.getStorageSync('community');
+ let head_id = community.communityId || 0;
+
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'presalegoods.load_goods_list',
+ pageNum: this.pageNum,
+ token,
+ head_id,
+ pre_page: 10
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ wx.stopPullDownRefresh();
+ if (res.data.code == 0) {
+ let oldRushList = that.data.rushList;
+ if (that.pageNum == 1) oldRushList = [];
+
+ let h = {}, list = res.data.list;
+ if (that.pageNum == 1 && list.length == 0) h.showEmpty = true;
+ let rushList = oldRushList.concat(list);
+ let rdata = res.data;
+ let reduction = { full_money: rdata.full_money, full_reducemoney: rdata.full_reducemoney, is_open_fullreduction: rdata.is_open_fullreduction }
+ h.rushList = rushList;
+ h.reduction = reduction;
+ h.loadOver = true;
+ let loadMore = that.data.loadMore;
+ if(res.data.list.length<10) { loadMore = false }
+ h.loadMore = loadMore;
+ h.loadText = loadMore ? "加载中..." : "没有更多商品了~";
+ // h.pintuan_show_type = rdata.pintuan_show_type;
+ that.setData(h, function () {
+ that.pageNum += 1;
+ })
+ } else if (res.data.code == 1) {
+ let s = { loadMore: false }
+ if (that.pageNum == 1) s.showEmpty = true;
+ that.setData(s);
+ } else if (res.data.code == 2) {
+ //no login
+ that.setData({ needAuth: true })
+ }
+ }
+ })
+ },
+
+ /**
+ * 幻灯片跳转
+ */
+ goBannerUrl: function (t) {
+ let idx = t.currentTarget.dataset.idx;
+ let { slider_list, needAuth } = this.data;
+ if (slider_list.length > 0) {
+ let url = slider_list[idx].link;
+ let type = slider_list[idx].linktype;
+ if (util.checkRedirectTo(url, needAuth)) {
+ this.authModal();
+ return;
+ }
+ if (type == 0) {
+ // 跳转webview
+ url && wx.navigateTo({ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url) })
+ } else if (type == 1) {
+ if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
+ url && wx.switchTab({ url: url })
+ } else {
+ url && wx.navigateTo({ url: url })
+ }
+ } else if (type == 2) {
+ // 跳转小程序
+ let appid = slider_list[idx].appid;
+ appid && wx.navigateToMiniProgram({
+ appId: slider_list[idx].appid,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ // 打开成功
+ },
+ fail(error) {
+ console.log(error)
+ }
+ })
+ } else if (type == 6) {
+ //领券
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/moduleA/coupon/getCoupon?id='+url
+ })
+ }
+ }
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.getData();
+ let that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: []
+ }, () => {
+ that.getList();
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ console.log('这是我的底线');
+ this.data.loadMore && (this.setData({ loadOver: false }), this.getList());
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var member_id = wx.getStorageSync('member_id');
+ let { share_title, share_img } = this.data;
+ return {
+ title: share_title,
+ path: "eaterplanet_ecommerce/moduleB/presale/index?share_id=" + member_id,
+ imageUrl: share_img,
+ success: function () { },
+ fail: function () { }
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/presale/index.json b/eaterplanet_ecommerce/moduleB/presale/index.json
new file mode 100644
index 0000000..b2a5ec4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/presale/index.json
@@ -0,0 +1,13 @@
+{
+ "navigationBarTitleText": "预售中心",
+ "navigationBarTextStyle": "black",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-spu-col": "../components/presale-goodsone",
+ "i-spu-row": "../components/presale-goodsrow",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-img": "../../components/img/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/presale/index.wxml b/eaterplanet_ecommerce/moduleB/presale/index.wxml
new file mode 100644
index 0000000..7ae6dbc
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/presale/index.wxml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂时没有商品
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/presale/index.wxss b/eaterplanet_ecommerce/moduleB/presale/index.wxss
new file mode 100644
index 0000000..159d5a1
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/presale/index.wxss
@@ -0,0 +1,126 @@
+.swipe {
+ margin-top: 20rpx;
+ height: 320rpx;
+ margin-bottom: 20rpx;
+}
+
+.swiper-content {
+ width: 750rpx;
+ height: 320rpx;
+ border-radius: 12rpx;
+}
+
+.swiper-content swiper-item {
+ border-radius: 12rpx;
+ margin-right: 20rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.swiper-content swiper-item:last-child {
+ margin: 0;
+}
+
+.swiper-content .banner {
+ width: 710rpx;
+ height: 320rpx;
+ margin: 0 20rpx;
+ display: block;
+ border-radius: 12rpx;
+ position: relative;
+ overflow: hidden;
+}
+
+.swiper-content .banner .banner-img {
+ width: 710rpx;
+ height: 320rpx;
+ border-radius: 12rpx;
+ display: block;
+ overflow: hidden;
+}
+
+.search-bar {
+ padding: 20rpx 25rpx;
+ background-color: #fff;
+ width: 100%;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+}
+
+.search-box {
+ background-color: #f0f0f0;
+ height: 56rpx;
+ line-height: 56rpx;
+ border-radius: 28rpx;
+ color: #acacac;
+ display: flex;
+ align-content: center;
+ flex: 1;
+}
+
+.search-btn {
+ padding-left: 20rpx;
+ padding-right: 10rpx;
+ background: transparent;
+ line-height: 56rpx;
+ font-size: 32rpx;
+ padding-right: 5rpx;
+ width: 95rpx;
+}
+
+button.search-btn::after {
+ content: none;
+}
+
+.search-icon {
+ position: absolute;
+ left: 20rpx;
+ margin-left: 25rpx;
+ margin-right: 12rpx;
+}
+
+.search-icon .iconfont {
+ font-size: 34rpx;
+ padding-top: 10rpx;
+}
+
+.search-box .ipt {
+ padding: 0 30rpx 0 60rpx;
+ line-height: 56rpx;
+ height: 56rpx;
+ width: 100%;
+ box-sizing: border-box;
+}
+/* 搜索 E */
+
+
+.none-rush-list {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding-bottom: 140rpx;
+ padding-top: 140rpx;
+}
+
+.none-rush-list .img-block {
+ width: 240rpx;
+ height: 240rpx;
+ margin-bottom: 30rpx;
+}
+
+.none-rush-list .h1 {
+ font-size: 32rpx;
+ line-height: 32rpx;
+ color: #444;
+ margin-bottom: 20rpx;
+}
+
+.twoCol {
+ padding: 0 20rpx;
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/accountRecord.js b/eaterplanet_ecommerce/moduleB/rider/accountRecord.js
new file mode 100644
index 0000000..738d3ce
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/accountRecord.js
@@ -0,0 +1,96 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ is_login: true,
+ list: [],
+ showData: 1,
+ loadText: '加载中',
+ remark: ['未结算','已结算']
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ util.check_login() ? this.setData({ is_login: true }) : this.setData({ is_login: false });
+ this.getData();
+ },
+
+ getData: function () {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ wx.showLoading();
+ this.setData({ isHideLoadMore: false })
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'user.get_user_distribution_order',
+ token: token,
+ page: that.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ var list = that.data.list;
+ list = list.concat(res.data.data);
+ that.setData({ list, isHideLoadMore: true })
+ } else if (res.data.code == 1) {
+ if (that.data.list.length == 0 && that.page == 1) that.setData({ showData: 0 });
+ that.setData({ isHideLoadMore: true, no_data: 1 })
+ return false;
+ } else if (res.data.code == 2) {
+ that.setData({ is_login: false })
+ }
+ },
+ fail: (error) => {
+ console.log(error)
+ wx.showLoading();
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function () {
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/scoreDetails',
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (this.data.no_data == 1) return false;
+ this.page += 1;
+ this.getData();
+ this.setData({
+ isHideLoadMore: false
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/rider/accountRecord.json b/eaterplanet_ecommerce/moduleB/rider/accountRecord.json
new file mode 100644
index 0000000..93aa33f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/accountRecord.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "账户明细",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-auth": "../../components/auth/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-card": "../../components/card/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/accountRecord.wxml b/eaterplanet_ecommerce/moduleB/rider/accountRecord.wxml
new file mode 100644
index 0000000..078cabb
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/accountRecord.wxml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ 暂无任何明细记录
+
+
+
+
+
+
+ 配送费收入
+ + {{item.shipping_money}}
+
+ 订单号: {{item.order_num_alias}}
+
+ {{item.addtime}}
+ {{remark[item.is_statement]}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/accountRecord.wxss b/eaterplanet_ecommerce/moduleB/rider/accountRecord.wxss
new file mode 100644
index 0000000..63c73b8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/accountRecord.wxss
@@ -0,0 +1,78 @@
+@import "/common.wxss";
+
+.score-box {
+ padding-top: 30rpx;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-top: 200rpx;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
+
+.list {
+ padding: 0 20rpx;
+}
+
+.list .listData {
+ padding: 30rpx;
+ border-bottom: 0.1rpx solid #eee;
+}
+
+.list .listData:last-child {
+ border: none;
+}
+
+.list .listData .list-tit {
+ line-height: 28rpx;
+ margin-bottom: 24rpx;
+ display: flex;
+ justify-content: space-between;
+}
+
+.list .listData .list-tit .tit {
+ font-size: 30rpx;
+ color: #444;
+}
+
+.list .listData .list-tit .num {
+ font-size: 32rpx;
+ color: #ff5344;
+ font-weight: bold;
+}
+
+.list .listData .list-tit .num.yue {
+ color: #666;
+ font-weight: normal;
+ font-size: 30rpx;
+}
+
+.list .listData .list-tit .num2 {
+ color: #999;
+}
+
+.list .listData .list-orderNo {
+ font-size: 26rpx;
+ color: #444;
+ margin-bottom: 16rpx;
+}
+
+.list .listData .list-time {
+ font-size: 26rpx;
+ color: #aaa;
+ line-height: 22rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/rider/census.js b/eaterplanet_ecommerce/moduleB/rider/census.js
new file mode 100644
index 0000000..cbba941
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/census.js
@@ -0,0 +1,59 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ total_getorder_count: 0,
+ system_send_ordercount: 0,
+ has_send_count: 0,
+ total_commiss_money: 0
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.getData();
+ },
+
+ getData: function () {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('localtown.get_distribution_statics', { token }).then(res => {
+ console.log(res)
+ let { total_getorder_count, system_send_ordercount, has_send_count, total_commiss_money } = res.data;
+ this.setData({
+ total_getorder_count, system_send_ordercount, has_send_count, total_commiss_money
+ })
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '请求出错', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ }
+
+})
diff --git a/eaterplanet_ecommerce/moduleB/rider/census.json b/eaterplanet_ecommerce/moduleB/rider/census.json
new file mode 100644
index 0000000..387dc53
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/census.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-fixed-bottom": "../../components/fixed-bottom/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/census.wxml b/eaterplanet_ecommerce/moduleB/rider/census.wxml
new file mode 100644
index 0000000..a8a01b3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/census.wxml
@@ -0,0 +1,22 @@
+
+
+
+
+ {{total_getorder_count}}
+ 累计抢单数
+
+
+ {{system_send_ordercount}}
+ 系统分配订单数
+
+
+ {{has_send_count}}
+ 累计完成数量
+
+
+ {{total_commiss_money}}
+ 配送费收入
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/rider/census.wxss b/eaterplanet_ecommerce/moduleB/rider/census.wxss
new file mode 100644
index 0000000..052818c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/census.wxss
@@ -0,0 +1,12 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+@import 'tabbar.wxss';
+
+.box {
+ flex-wrap: wrap;
+}
+
+.box .item {
+ width: 50%;
+ margin: 30rpx 0;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/excharge.js b/eaterplanet_ecommerce/moduleB/rider/excharge.js
new file mode 100644
index 0000000..d48bfd5
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/excharge.js
@@ -0,0 +1,321 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+ mixins: [require('../../mixin/commonMixin.js')],
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ type: 1,
+ items: [{
+ name: '1',
+ value: '系统余额',
+ show: true,
+ checked: false
+ },
+ {
+ name: '2',
+ value: '微信零钱',
+ show: true,
+ checked: false
+ },
+ {
+ name: '3',
+ value: '支付宝',
+ show: true,
+ checked: false
+ },
+ {
+ name: '4',
+ value: '银行卡',
+ show: true,
+ checked: false
+ }
+ ],
+ info: [],
+ tixian_money: '',
+ final_money: 0
+ },
+ canTixian: true,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ wx.showLoading();
+ this.getData();
+ },
+
+ onShow: function() {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (res) {
+ that.setData({
+ needAuth: false
+ })
+ } else {
+ that.setData({
+ needAuth: true
+ })
+ }
+ })
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ wx.showLoading();
+ that.getData();
+ })
+ },
+
+ getData: function() {
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'localtown.get_distribution_commission_info',
+ token: token
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let commiss_tixian_publish = res.data.data.commiss_tixian_publish;
+ let items = that.data.items;
+ let rdata = res.data.data;
+ if (rdata.commiss_tixianway_yuer == 0) items[0].show = false;
+ if (rdata.commiss_tixianway_weixin == 0) items[1].show = false;
+ if (rdata.commiss_tixianway_alipay == 0) items[2].show = false;
+ if (rdata.commiss_tixianway_bank == 0) items[3].show = false;
+
+ let type = that.data.type;
+ for (let i = 0; i < items.length; i++) {
+ if (items[i].show) {
+ items[i].checked = true;
+ type = items[i].name;
+ break
+ }
+ }
+
+ that.setData({
+ info: res.data.data,
+ items,
+ type,
+ commiss_tixian_publish
+ })
+ } else {
+ wx.showModal({
+ title: '提示',
+ content: res.data.msg,
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+ formSubmit: function(e) {
+ const params = e.detail.value;
+ let isNull = 0;
+ let type = this.data.type;
+ let errortip = [{}, {}, {
+ bankusername: '微信真实姓名'
+ }, {
+ bankusername: '支付宝真实姓名',
+ bankaccount: '支付宝账户'
+ }, {
+ bankname: '银行卡名称',
+ bankusername: '持卡人姓名',
+ bankaccount: '银行卡账户'
+ }];
+ for (let item in params) {
+ params[item] = params[item].replace(/(^\s*)|(\s*$)/g, "");
+ if (!params[item]) {
+ const itemTip = errortip[type][item];
+ wx.showToast({
+ title: '请输入' + (itemTip || '正确的表单内容'),
+ icon: 'none'
+ })
+ isNull = 1;
+ break;
+ }
+ if (item == 'money' && params[item] * 1 <= 0) {
+ wx.showToast({
+ title: '请输入正确的金额',
+ icon: 'none'
+ })
+ return;
+ }
+ }
+
+ if (isNull == 1) return;
+ params.type = this.data.type;
+ console.log(params);
+
+ let tdata = this.data;
+ let tixian_money = parseFloat(tdata.tixian_money);
+ let max_tixian_money = tdata.info.money;
+ let community_min_money = parseFloat(tdata.info.commiss_min_tixian_money);
+
+ if (tixian_money == '' || community_min_money > tixian_money) {
+ wx.showToast({
+ title: '最小提现' + community_min_money + '元',
+ icon: "none",
+ })
+ return false;
+ }
+
+ if (tixian_money > max_tixian_money) {
+ wx.showToast({
+ title: '本次最大可提现' + max_tixian_money + '元',
+ icon: "none",
+ })
+ let fee = tdata.info.commiss_tixian_bili;
+ let final_money = (max_tixian_money * (100 - fee) / 100).toFixed(2);
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money
+ })
+ return false;
+ }
+
+ if (!this.canTixian) return;
+ this.canTixian = false;
+
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'localtown.tixian_sub',
+ token: token,
+ ...params
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ wx.showToast({
+ title: '已提交申请',
+ icon: 'none',
+ duration: 2000,
+ success: function () {
+ that.setData({
+ canPay: false,
+ tixian_money: '',
+ final_money: 0
+ })
+ that.getData();
+ }
+ })
+ } else {
+ wx.showToast({
+ title: res.data.msg ? res.data.msg : '提交失败,请重试',
+ icon: 'none'
+ })
+ }
+ that.canTixian = true;
+ }
+ })
+ },
+
+ /**
+ * 获得焦点
+ */
+ bindIptFocus: function() {
+ this.setData({
+ onFocus: true
+ })
+ },
+
+ /**
+ * 失去焦点
+ */
+ bindIptBlur: function() {
+ this.setData({
+ onFocus: false
+ })
+ },
+
+ radioChange(e) {
+ this.setData({
+ type: e.detail.value
+ })
+ },
+
+ bindTixianMoneyInput: function(t) {
+ let max_val = this.data.info.money;
+ var value = t.detail.value;
+ if (!(/^(\d?)+(\.\d{0,2})?$/.test(value))) {
+ value = value.substring(0, value.length - 1);
+ value = parseFloat(value);
+ }
+
+ if (value > max_val) {
+ wx.showToast({
+ title: '本次最大可提现' + max_val + '元',
+ icon: "none",
+ })
+ }
+ let fee = this.data.info.commiss_tixian_bili;
+ let final_money = (value * (100 - fee) / 100).toFixed(2);
+
+ let canPay = false;
+ value ? canPay = true : canPay = false;
+
+ this.setData({
+ tixian_money: value,
+ final_money: final_money,
+ canPay
+ })
+ return value;
+ },
+
+ getAll: function() {
+ const tdata = this.data;
+ var max_tixian_money = tdata.info.money * 1;
+ let fee = tdata.info.commiss_tixian_bili;
+ let final_money = (max_tixian_money * (100 - fee) / 100).toFixed(2);
+
+ let canPay = false;
+ max_tixian_money ? canPay = true : canPay = false;
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money,
+ canPay
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/rider/excharge.json b/eaterplanet_ecommerce/moduleB/rider/excharge.json
new file mode 100644
index 0000000..9b72cdd
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/excharge.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "提现",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-new-auth": "../../components/new-auth/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/excharge.wxml b/eaterplanet_ecommerce/moduleB/rider/excharge.wxml
new file mode 100644
index 0000000..7f7240c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/excharge.wxml
@@ -0,0 +1,58 @@
+
+
+
+
+ {{info.money}}
+ 可提现金额(元)
+
+ 提现记录
+
+
+
+ 提现规则:
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/rider/excharge.wxss b/eaterplanet_ecommerce/moduleB/rider/excharge.wxss
new file mode 100644
index 0000000..6e99b31
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/excharge.wxss
@@ -0,0 +1,5 @@
+@import "/eaterplanet_ecommerce/resource/css/excharge.wxss";
+
+page {
+ font-size: 28rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.js b/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.js
new file mode 100644
index 0000000..d1dc023
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.js
@@ -0,0 +1,120 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ loadText: '加载中',
+ loadMore: false,
+ noData: false,
+ state: ['提现中', '提现成功', '提现失败']
+ },
+ page: 1,
+ noMore: false,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ this.getData();
+ },
+
+ /**
+ * 授权成功回调
+ */
+ authSuccess: function() {
+ let that = this;
+ this.setData({
+ needAuth: false
+ }, () => {
+ that.getData();
+ })
+ },
+
+ getData: function() {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'localtown.tixian_record',
+ token: token,
+ page: this.page
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list })
+ } else {
+ // 无数据
+ if (that.page == 1) that.setData({ noData: true })
+ that.noMore = true;
+ that.setData({ loadMore: false })
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if (!res) {
+ wx.showModal({
+ title: '提示',
+ content: '您还未登录',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/user/me',
+ })
+ }
+ }
+ })
+ }
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ this.noMore || (this.setData({ loadMore: true }), this.getData());
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.json b/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.json
new file mode 100644
index 0000000..f2a60e0
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "提现记录",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.wxml b/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.wxml
new file mode 100644
index 0000000..7485215
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.wxml
@@ -0,0 +1,22 @@
+
+
+
+
+ 申请时间
+ 状态
+ 金额(元)
+
+
+
+ {{item.addtime}}
+ {{state[item.state]}}
+ {{item.money}}
+
+
+
+
+
+ 暂无任何明细记录
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.wxss b/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.wxss
new file mode 100644
index 0000000..c151d7b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/exchargeRecord.wxss
@@ -0,0 +1,61 @@
+
+.title {
+ left: 0;
+ right: 0;
+ display: flex;
+ align-items: center;
+ background-color: #fff;
+ color: #333;
+ line-height: 80rpx;
+ font-size: 28rpx;
+ text-align: center;
+ box-shadow: 1px 2px 3px rgba(0, 0, 0, .3);
+ font-weight: bold;
+}
+
+.time {
+ flex: 3;
+}
+
+.status {
+ flex: 1;
+}
+
+.money {
+ flex: 2;
+}
+
+.list {
+ padding-top: 80rpx;
+ text-align: center;
+ background-color: #fff;
+ font-size: 24rpx;
+}
+
+.list-item {
+ position: relative;
+ display: flex;
+ align-items: center;
+ line-height: 76rpx;
+ border-bottom: 1rpx solid #efefef;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-top: 200rpx;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/rider/grab.js b/eaterplanet_ecommerce/moduleB/rider/grab.js
new file mode 100644
index 0000000..4ab45e8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/grab.js
@@ -0,0 +1,168 @@
+var app = getApp();
+var timer = null;
+var location = require("../../utils/Location")
+const bgMusic = wx.getBackgroundAudioManager();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ noData: 0
+ },
+ _onPlay: false,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getData();
+ },
+
+ onReady: function() {
+ bgMusic.onEnded(()=>{
+ this._onPlay = false;
+ })
+ },
+
+ initFn: function(){
+ timer = setInterval(()=>{
+ this.getData();
+ }, 1500)
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.initFn();
+ },
+
+ onHide: function () {
+ clearInterval(timer);
+ timer = null;
+ },
+
+ onUnload: function () {
+ clearInterval(timer);
+ timer = null;
+ },
+
+ getData: function () {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('localtown.get_localtown_delivery', { token }).then(res => {
+ let list = res.data || [];
+ if(res.new_order_notice==1 && !this._onPlay) {
+ this._onPlay = true;
+ bgMusic.src = "https://demo.ch871.com/assets/ep/mp3/click.mp3";
+ bgMusic.title = '您有新订单';
+ bgMusic.play()
+ }
+ this.setData({
+ noData: false,
+ list
+ })
+ }).catch(err => {
+ console.log(err)
+ if(err.code==2) {
+ this.setData({
+ list: [],
+ noData: true
+ })
+ return;
+ }
+ app.util.message(err.msg || '请求出错', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ /**
+ * 查看地图
+ */
+ gotoMap: function (e) {
+ let idx = e.currentTarget.dataset.idx;
+ if(idx<0) { return; }
+ let list = this.data.list || [];
+ let item = list[idx];
+ let longitude = parseFloat(item.member_lon),
+ latitude = parseFloat(item.member_lat),
+ name = item.shop_name,
+ address = item.member_address;
+ wx.openLocation({
+ latitude: latitude,
+ longitude: longitude,
+ name: name,
+ address: address,
+ scale: 28
+ })
+ },
+
+ /**
+ * 抢单
+ */
+ rob: function(e){
+ let order_id = e.currentTarget.dataset.orderid;
+ if(!order_id) {
+ app.util.message('订单ID错误', '', 'error');
+ return;
+ }
+ let ps_lon=0, ps_lat=0;
+ location.getGps().then(res=>{
+ console.log('经纬度结果', res);
+ if(res.errCode==2) {
+ console.log(res.errMsg)
+ app.util.message('请检查手机定位是否开启', '', 'error');
+ return;
+ }
+ ps_lon = res.latitude
+ ps_lat = res.longitude
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('localtown.rob_distribution_order', { token, order_id, ps_lon, ps_lat }).then(res => {
+ app.util.message('抢单失败,请重试', '', 'error');
+ this.getData();
+ }).catch(err => {
+ if(err.code==1) {
+ app.util.message(err.msg || '抢单成功', '', 'error');
+ } else {
+ app.util.message(err.msg || '抢单失败', '', 'error');
+ }
+ this.getData();
+ })
+ }).catch(()=>{
+ app.util.message('请先开启定位服务', '', 'error');
+ return;
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ }
+
+})
diff --git a/eaterplanet_ecommerce/moduleB/rider/grab.json b/eaterplanet_ecommerce/moduleB/rider/grab.json
new file mode 100644
index 0000000..e84da95
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/grab.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "抢单",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-fixed-bottom": "../../components/fixed-bottom/index",
+ "i-empty": "../../components/empty/index",
+ "i-cashon_delivery": "../../components/cashon_delivery/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/grab.wxml b/eaterplanet_ecommerce/moduleB/rider/grab.wxml
new file mode 100644
index 0000000..6d0d4a2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/grab.wxml
@@ -0,0 +1,40 @@
+
+
+
+
+
+ 订单编号: {{item.order_num_alias}}
+ 货到付款
+
+
+ {{item.shop_name}}
+
+
+
+
+
+
+ {{item.shop_address}}
+
+
+
+
+ {{item.member_address}}
+
+
+
+
+ 收货人:{{item.shipping_name}}
+ 下单时间:{{item.pay_time}}
+ 商家拣货完毕:{{item.order_delivery_time}}
+ {{item.delivery_note}}
+
+
+
+
+暂无订单~
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/grab.wxss b/eaterplanet_ecommerce/moduleB/rider/grab.wxss
new file mode 100644
index 0000000..9132917
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/grab.wxss
@@ -0,0 +1,13 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+@import 'tabbar.wxss';
+
+.footer .btn {
+ background: #FED206;
+ padding: 12rpx 0;
+ text-align: center;
+ border-radius: 10rpx;
+ color: #000;
+ flex: 1;
+ margin: 0 30rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/index.js b/eaterplanet_ecommerce/moduleB/rider/index.js
new file mode 100644
index 0000000..85ee805
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/index.js
@@ -0,0 +1,163 @@
+// eaterplanet_ecommerce/moduleB/rider/index.js
+var app = getApp();
+var location = require("../../utils/Location")
+
+Page({
+ data: {
+ orderdistribution_info: {},
+ waite_get_count: 0,
+ sending_count: 0,
+ sended_count: 0,
+ waite_send_list: [],
+ sending_send_list: [],
+ scale:'15',
+ controls:'40',
+ latitude:'',
+ longitude:'',
+ markers: [],
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+ this.getMyLocal();
+ },
+
+ onReady: function (e) {
+ this.mapCtx = wx.createMapContext('myMap')
+ },
+
+ getMyLocal: function() {
+ let that = this;
+ location.getGps().then(ret=>{
+ that.setData({
+ scale: 12,
+ longitude: ret.longitude,
+ latitude: ret.latitude
+ })
+ // wx.getLocation({
+ // type: 'wgs84',
+ // success: (res) => {
+ // console.log("getMyLocal",res)
+ // that.setData({
+ // scale: 12,
+ // longitude: res.longitude,
+ // latitude: res.latitude
+ // })
+ // }
+ // });
+ }).catch(()=>{
+ app.util.message('地图功能开启失败', '', 'error');
+ })
+ },
+
+ getMemberMarkers: function(listData) {
+ var market = [];
+ // 待取货
+ if(listData[0] && listData[0].length) {
+ for (let item of listData[0]) {
+ let marker1 = this.createMarker(item);
+ market.push(marker1)
+ }
+ }
+ // 配送中
+ if(listData[1] && listData[1].length) {
+ for (let item of listData[1]) {
+ let marker1 = this.createMarker(item, 1);
+ market.push(marker1)
+ }
+ }
+ return market;
+ },
+
+ createMarker: function(point, type=0) {
+ let latitude = point.shop_lat;
+ let longitude = point.shop_lon;
+ if(type==1){
+ latitude = point.member_lat;
+ longitude = point.member_lon;
+ }
+ let marker = {
+ iconPath: type==0?"../images/location-red.png":"../images/location-green.png",
+ id: point.order_id+'_'+type,
+ title: type==0?'待取货':'配送中',
+ latitude,
+ longitude,
+ label:{
+ anchorX: -12,
+ anchorY: 0,
+ content: type==0?'商家':'客户'
+ },
+ width: 30,
+ height: 30
+ };
+ return marker;
+ },
+
+ markertap: function(e){
+ console.log(e.detail)
+ },
+
+ controltap: function(e) {
+ this.moveToLocation()
+ },
+
+ moveToLocation: function () {
+ this.mapCtx.moveToLocation()
+ },
+
+ regionchange: function(){
+
+ },
+
+ onShow: function () {
+ this.getData();
+ },
+
+ getData: function () {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('localtown.get_orderdistribution_info', { token }).then(res => {
+ let { orderdistribution_info, waite_get_count, sending_count, sended_count, waite_send_list, sending_send_list } = res.data;
+ let markers = this.getMemberMarkers([waite_send_list, sending_send_list]);
+ this.setData({
+ orderdistribution_info, waite_get_count, sending_count, sended_count, waite_send_list, sending_send_list, markers
+ })
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '请求出错', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ goLink: function(event) {
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ // 接单状态切换
+ switchState: function(e){
+ console.log(e.detail.value)
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/rider/index.json b/eaterplanet_ecommerce/moduleB/rider/index.json
new file mode 100644
index 0000000..cd9cd49
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/index.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "配送员中心",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-fixed-bottom": "../../components/fixed-bottom/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/index.wxml b/eaterplanet_ecommerce/moduleB/rider/index.wxml
new file mode 100644
index 0000000..498fa7f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/index.wxml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ {{orderdistribution_info.username}}
+ {{orderdistribution_info.mobile}}
+
+
+
+
+
+
+ {{waite_get_count}}
+ 待取货
+
+
+ {{sending_count}}
+ 配送中
+
+
+ {{sended_count}}
+ 已送达
+
+
+
+
+
+
+
+ 备注:
+ 待取货
+ 配送中
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/rider/index.wxss b/eaterplanet_ecommerce/moduleB/rider/index.wxss
new file mode 100644
index 0000000..7f2c79a
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/index.wxss
@@ -0,0 +1,16 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+@import 'tabbar.wxss';
+
+page {
+ font-size: 28rpx;
+}
+
+switch {
+ zoom: 0.7;
+}
+
+.map-tip-img {
+ width: 40rpx;
+ height: 40rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/me.js b/eaterplanet_ecommerce/moduleB/rider/me.js
new file mode 100644
index 0000000..a964b41
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/me.js
@@ -0,0 +1,71 @@
+var app = getApp();
+
+Page({
+ data: {
+ orderdistribution_info: {},
+ can_tixian_money: 0
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+
+ },
+
+ onShow: function () {
+ this.getData();
+ },
+
+ getData: function () {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('localtown.get_distribution_center_info', { token }).then(res => {
+ let { orderdistribution_info, can_tixian_money } = res.data;
+ this.setData({
+ orderdistribution_info, can_tixian_money
+ })
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '请求出错', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ goLink: function(event) {
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ switchNotice: function(e){
+ let token = wx.getStorageSync('token');
+ let is_new_notice = e.detail.value?1:0;
+ app.util.ProReq('localtown.change_distribution_notice', { token, is_new_notice }).then(res => {
+ this.getData();
+ }).catch(err => {
+ this.getData();
+ console.log(err)
+ })
+ }
+
+})
diff --git a/eaterplanet_ecommerce/moduleB/rider/me.json b/eaterplanet_ecommerce/moduleB/rider/me.json
new file mode 100644
index 0000000..387dc53
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/me.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-fixed-bottom": "../../components/fixed-bottom/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/me.wxml b/eaterplanet_ecommerce/moduleB/rider/me.wxml
new file mode 100644
index 0000000..4900f8e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/me.wxml
@@ -0,0 +1,30 @@
+
+
+
+
+
+ {{orderdistribution_info.username}}
+ {{orderdistribution_info.mobile}}
+
+
+
+ 小程序来单语音通知
+
+
+
+
+
+
+ {{can_tixian_money}}
+ 可提现金额(元)
+
+
+
+
+
+
+ 账户明细
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/rider/me.wxss b/eaterplanet_ecommerce/moduleB/rider/me.wxss
new file mode 100644
index 0000000..45f9ff6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/me.wxss
@@ -0,0 +1,26 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+@import 'tabbar.wxss';
+
+.money {
+ padding: 20rpx 30rpx;
+}
+
+.icon-right {
+ width: 12rpx;
+ height: 22rpx;
+}
+
+.recharge-money {
+ color: #ff758c;
+ font-size: 50rpx;
+}
+
+.recharge-tip {
+ color: #999;
+ font-size: 24rpx;
+}
+
+switch {
+ zoom: 0.7;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/order.js b/eaterplanet_ecommerce/moduleB/rider/order.js
new file mode 100644
index 0000000..7e39e39
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/order.js
@@ -0,0 +1,272 @@
+var app = getApp();
+var location = require("../../utils/Location")
+// 0 =>'未付款,未配送',1=>'已付款,未被抢',2=>'已付款,待配送,已被抢单',3=>'已拿货,配送中',4=>'已送达',5=>'已取消'
+
+Page({
+ data: {
+ tabs: [{
+ id: 2,
+ name: '待取货'
+ },
+ {
+ id: 3,
+ name: '配送中'
+ },
+ {
+ id: 4,
+ name: '已送达'
+ }
+ ],
+ status: 2,
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ },
+ page: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let status = options.status || 2;
+ this.setData({
+ status
+ }, () => {
+ this.initFn();
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ changeTabs: function (e) {
+ let that = this;
+ let status = e.currentTarget.dataset.type || 0;
+ this.page = 1;
+ this.setData({
+ status,
+ list: [],
+ showEmpty: false,
+ loadMore: true
+ }, () => {
+ that.initFn();
+ })
+ },
+
+ initFn: function () {
+ this.page = 1;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ }, () => {
+ this.getData();
+ })
+ },
+
+ getData: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let type = this.data.status;
+
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'localtown.get_distribution_orderlist',
+ token,
+ type,
+ page: this.page,
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.stopPullDownRefresh();
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length == 0) {
+ if (that.page == 1) {
+ h.noData = 1;
+ } else {
+ h.loadMore = false;
+ h.noMore = false;
+ h.loadText = "没有更多记录了~"
+ }
+ }
+ if (list.length < 10) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({
+ list,
+ ...h
+ })
+ } else if (res.data.code == 2) {
+ let h = {};
+ h.loadMore = false;
+ h.noMore = false;
+ h.loadText = "没有更多记录了~";
+ if(that.page==1) { h.noData = 1; }
+ that.setData(h)
+ } else {
+ app.util.message(res.data.msg, 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ /**
+ * 查看地图
+ */
+ gotoMap: function (e) {
+ let idx = e.currentTarget.dataset.idx;
+ if (idx < 0) {
+ return;
+ }
+ let list = this.data.list || [];
+ let item = list[idx];
+ let longitude = parseFloat(item.member_lon),
+ latitude = parseFloat(item.member_lat),
+ name = item.shop_name,
+ address = item.member_address;
+ wx.openLocation({
+ latitude: latitude,
+ longitude: longitude,
+ name: name,
+ address: address,
+ scale: 28
+ })
+ },
+
+ /**
+ * 确认取货
+ */
+ pickup: function (e) {
+ this.preConfirm('确认已取到商品?').then(() => {
+ let order_id = e.currentTarget.dataset.orderid;
+ if (!order_id) {
+ app.util.message('订单ID错误', '', 'error');
+ return;
+ }
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('localtown.distribution_deliverying_order', {
+ token,
+ order_id
+ }).then(res => {
+ app.util.message('取货失败,请重试', '', 'success');
+ this.initFn();
+ }).catch(err => {
+ app.util.message(err.msg || '取货成功', '', 'success');
+ this.initFn();
+ })
+ })
+ },
+
+ preConfirm: function (msg) {
+ return new Promise((resolve, reject) => {
+ wx.showModal({
+ title: '提示',
+ content: msg,
+ confirmColor: '#FED206',
+ success: function (res) {
+ if (res.confirm) {
+ resolve()
+ } else {
+ console.log('用户点击了取消')
+ }
+ }
+ })
+ })
+ },
+
+ /**
+ * 确认送达
+ */
+ arrived: function (e) {
+ this.preConfirm('确认已送达商品?').then(() => {
+ let order_id = e.currentTarget.dataset.orderid;
+ if (!order_id) {
+ app.util.message('订单ID错误', '', 'error');
+ return;
+ }
+ console.log('确认已送达商品 ---- 是');
+ let ps_lon=0, ps_lat=0;
+ location.getGps().then(res=>{
+ console.log('经纬度结果', res);
+ if(res.errCode==2) {
+ console.log(res.errMsg)
+ app.util.message('请检查手机定位是否开启', '', 'error');
+ return;
+ }
+ ps_lon = res.latitude
+ ps_lat = res.longitude
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('localtown.distribution_arrived_order', {
+ token,
+ order_id,
+ ps_lon,
+ ps_lat
+ }).then(ret => {
+ console.log('确认失败,请重试', ret);
+ app.util.message('确认失败,请重试', '', 'success');
+ this.initFn();
+ }).catch(err => {
+ console.log('成功', err);
+ if(err.code==3) {
+ app.util.message(err.msg, '', 'error');
+ } else {
+ app.util.message(err.msg || '确认成功', '', 'error');
+ this.initFn();
+ }
+ })
+ }).catch(()=>{
+ app.util.message('请先开启定位服务', '', 'error');
+ return;
+ })
+ })
+ },
+
+ /**
+ * 联系商家
+ */
+ phoneCall: function (e) {
+ let phoneNumber = e.currentTarget.dataset.tel || '';
+ phoneNumber && wx.makePhoneCall({
+ phoneNumber,
+ complete: function () {}
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.initFn();
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ console.log(this.data.noMore)
+ this.data.loadMore && this.getData();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/rider/order.json b/eaterplanet_ecommerce/moduleB/rider/order.json
new file mode 100644
index 0000000..6bd31eb
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/order.json
@@ -0,0 +1,11 @@
+{
+ "navigationBarTitleText": "配送订单列表",
+ "navigationBarBackgroundColor": "#FED206",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index",
+ "i-cashon_delivery": "../../components/cashon_delivery/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/rider/order.wxml b/eaterplanet_ecommerce/moduleB/rider/order.wxml
new file mode 100644
index 0000000..fd8b4c6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/order.wxml
@@ -0,0 +1,102 @@
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+ 订单编号: {{item.order_num_alias}}
+
+
+
+
+
+
+
+ {{goods.name}}
+ 货到付款
+
+ {{goods.option_str}}x{{goods.quantity}}
+ 小计¥{{goods.total}}
+
+
+ 合计¥{{item.order_info.total}}
+
+
+ {{item.shop_name}}
+
+
+
+
+
+ {{item.shop_address}}
+
+
+
+
+ {{item.member_address}}
+
+
+
+
+ 收货人:{{item.shipping_name}}
+ 下单时间:{{item.pay_time}}
+ {{item.delivery_note}}
+
+
+
+
+
+
+ 订单编号: {{item.order_num_alias}}
+
+
+
+
+
+
+
+ {{goods.name}}
+ 货到付款
+
+ {{goods.option_str}}x{{goods.quantity}}
+ 小计¥{{goods.total}}
+
+
+ 合计¥{{item.order_info.total}}
+
+
+
+
+ {{item.shop_address}}
+
+
+
+
+ {{item.member_address}}
+
+
+
+
+ 收货人:{{item.shipping_name}}
+
+ {{item.delivery_note}}
+
+
+
+
+
+
+ 暂无订单~
+
diff --git a/eaterplanet_ecommerce/moduleB/rider/order.wxss b/eaterplanet_ecommerce/moduleB/rider/order.wxss
new file mode 100644
index 0000000..dddc6fc
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/order.wxss
@@ -0,0 +1,50 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+
+.nav-bar {
+ width: 100%;
+ left: 0;
+ z-index: 10;
+}
+
+.nav-bar .nav-bar-inner {
+ display: flex;
+ justify-content: space-between;
+ padding: 0 40rpx;
+ background-color: white;
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(255, 255, 255, 0.25);
+}
+
+.nav-bar .nav-bar-item {
+ position: relative;
+ word-break: keep-all;
+ font-size: 28rpx;
+ font-weight: 500;
+ color: #666;
+ padding: 20rpx 0;
+}
+
+.nav-bar .current.nav-bar-item {
+ border-bottom: 3px solid #FED206;
+}
+
+.nav-bar-content {
+ margin-top: 49px;
+ padding-bottom: 30rpx;
+}
+
+.footer .btn {
+ background: #FED206;
+ padding: 12rpx 0;
+ text-align: center;
+ border-radius: 10rpx;
+ color: #000;
+ flex: 1;
+ margin: 0 30rpx;
+}
+
+.goods .img {
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 10rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/rider/tabbar.wxml b/eaterplanet_ecommerce/moduleB/rider/tabbar.wxml
new file mode 100644
index 0000000..e9683f2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/tabbar.wxml
@@ -0,0 +1,22 @@
+
+
+
+
+
+ 首页
+
+
+
+ 抢单
+
+
+
+ 统计
+
+
+
+ 我的
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/rider/tabbar.wxss b/eaterplanet_ecommerce/moduleB/rider/tabbar.wxss
new file mode 100644
index 0000000..4e95783
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/rider/tabbar.wxss
@@ -0,0 +1,32 @@
+.tabbar {
+ line-height: 1;
+}
+
+.tabbar.active {
+ color: #fe8464;
+}
+
+.tabbar .iconfont {
+ font-size: 44rpx;
+}
+
+.tabbar-home {
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-end;
+}
+
+.tabbar-home .iconfont {
+ display: inline-block;
+ position: absolute;
+ background: #fe8464;
+ border-radius: 50%;
+ width: 100rpx;
+ height: 100rpx;
+ line-height: 100rpx;
+ border: 10rpx solid #fff;
+ top: -50rpx;
+ left: 50%;
+ margin-left: -60rpx;
+ color: #fff;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/changePrice.js b/eaterplanet_ecommerce/moduleB/supply/changePrice.js
new file mode 100644
index 0000000..54572e3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/changePrice.js
@@ -0,0 +1,167 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ orders: '',
+ order_goods: [],
+ priceArr: [],
+ orderGoodsIdArr: [],
+ goodsTot: 0,
+ changePrice: 0
+ },
+ id: 0,
+ cansub: true,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let id = options.order_id || '';
+ if(!id) {
+ app.util.message('参数错误', '/eaterplanet_ecommerce/moduleB/supply/orderManage', 'error');
+ return;
+ }
+ this.id = id;
+ this.getData(id);
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ getData: function(order_id) {
+ wx.showLoading();
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('order.order_change', {token, order_id, is_supply: 1}).then(res=>{
+ let orders = res.orders;
+ let order_goods = res.order_goods;
+ let priceArr = [];
+ let orderGoodsIdArr = [];
+ order_goods.forEach(item=>{
+ orderGoodsIdArr.push(item.order_goods_id);
+ priceArr.push(0);
+ })
+ this.calcGoodsPrice(priceArr, orders);
+ this.setData({
+ orders,
+ order_goods,
+ priceArr,
+ orderGoodsIdArr
+ })
+ }).catch(err=>{
+ app.util.message(err.msg, 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ reduceIpt: function(e) {
+ let type = e.currentTarget.dataset.type;
+ let idx = e.currentTarget.dataset.idx;
+ let { priceArr, order_goods } = this.data;
+ let goodItem = order_goods[idx];
+ let curPrice = priceArr[idx]*1;
+ let max = goodItem.max_total*1;
+ let min = -max;
+ if(type=='add') {
+ priceArr[idx] = (curPrice+1).toFixed(2);
+ } else {
+ if((curPrice-1){
+ changePrice += item*1;
+ })
+ console.log(old_price)
+ buyer_total += changePrice;
+ changePrice += orders.changeprice*1;
+ this.setData({
+ goodsTot: (old_price+changePrice).toFixed(2),
+ changePrice: changePrice.toFixed(2),
+ buyer_total: buyer_total.toFixed(2)
+ })
+ },
+
+ subChange: function() {
+ if(!this.cansub) return;
+ this.cansub = false;
+ wx.showLoading();
+ let token = wx.getStorageSync('token');
+ let order_id = this.id;
+ let { priceArr, orderGoodsIdArr } = this.data;
+ let order_goods_id = orderGoodsIdArr.join(',');
+ let change_price = priceArr.join(',');
+ app.util.ProReq('order.order_changeprice', {token, order_id, is_supply: 1, order_goods_id,change_price}).then(res=>{
+ wx.showToast({
+ title: "改价成功",
+ icon: "none"
+ })
+ setTimeout(() => {
+ this.getData(order_id);
+ this.cansub = true;
+ }, 1500);
+ }).catch(err=>{
+ this.cansub = true;
+ app.util.message(err.msg, '', 'error');
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/supply/changePrice.json b/eaterplanet_ecommerce/moduleB/supply/changePrice.json
new file mode 100644
index 0000000..4a21511
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/changePrice.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "订单改价",
+ "navigationBarBackgroundColor": "#FE8464",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-input-number": "../../components/input-number/index",
+ "i-fixed-bottom": "../../components/fixed-bottom/index",
+ "i-img": "../../components/img/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/changePrice.wxml b/eaterplanet_ecommerce/moduleB/supply/changePrice.wxml
new file mode 100644
index 0000000..87944a2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/changePrice.wxml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+ {{goods.name}}
+ ¥{{goods.price}} x{{goods.quantity}}
+ 小计:{{goods.old_total}}
+
+
+
+ 最多可减金额
+ ¥{{goods.max_total}}
+
+
+ 涨价或减价
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 注:只有在订单未付款时才支持改价,商品改价后价格不能小于 0 元,订单修改的价格不包含优惠信息,运费价格是 0 的时候商品免运费
+ 买家实付 = 原价 + 运费 + 涨价或减价 - 优惠
+
+
+ 原价
+ + ¥{{orders.old_price}}
+
+
+ 运费
+ + ¥{{orders.shipping_fare}}
+
+
+ 涨价或减价
+ {{changePrice>=0?'+':'-'}} ¥{{changePrice>=0?changePrice:-changePrice}}
+
+
+ 优惠
+ - ¥{{orders.youhui_total}}
+
+
+
+ 买家实付: ¥{{buyer_total}}
+
+
+
+
+
+
+
+
+
+ 商品改价:
+ +¥{{changePrice}}
+ -¥{{-changePrice}}
+
+ 确认改价
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/supply/changePrice.wxss b/eaterplanet_ecommerce/moduleB/supply/changePrice.wxss
new file mode 100644
index 0000000..4d556bf
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/changePrice.wxss
@@ -0,0 +1,19 @@
+.item .img-class {
+ width: 160rpx;
+ height: 160rpx;
+ overflow: hidden;
+}
+
+.btn {
+ color: #ffffff;
+ padding: 25rpx 40rpx;
+ font-size: 30rpx;
+}
+
+.iptbtn {
+ font-size: 44rpx;
+}
+
+.iptnum {
+ width: 120rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/components/selectRider.js b/eaterplanet_ecommerce/moduleB/supply/components/selectRider.js
new file mode 100644
index 0000000..588a6b0
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/components/selectRider.js
@@ -0,0 +1,117 @@
+var app = getApp();
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ order_id: {
+ type: String,
+ value: 0
+ },
+ show: {
+ type: Boolean,
+ value: false
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ list: []
+ },
+
+ attached() {
+ this.initFn()
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ initFn: function(keyword=''){
+ this.page = 1;
+ this.keyword = keyword;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ },()=>{
+ this.getData();
+ })
+ },
+
+ goResult: function(e) {
+ let keyword = e.detail.value.replace(/\s+/g, '');
+ this.initFn(keyword);
+ },
+
+ getData: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let order_id = this.data.order_id;
+ let keyword = this.keyword;
+
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'order.choosemember',
+ token,
+ is_supply: 1,
+ order_id,
+ page: this.page,
+ keyword
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 10) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list, ...h })
+ } else if(res.data.code==2) {
+ app.util.message(res.data.msg, 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ } else {
+ let h = {};
+ if(that.page==1) h.noData = 1;
+ h.loadMore = false;
+ h.noMore = false;
+ h.loadText = "没有更多记录了~";
+ that.setData( h )
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ toLower: function() {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ },
+
+ selectItem: function(e) {
+ let distribution_id = e.currentTarget.dataset.id || '';
+ let order_id = this.data.order_id;
+ let token = wx.getStorageSync('token');
+ wx.showLoading();
+ order_id && app.util.ProReq('order.sub_orderchoose_distribution', {token, order_id, distribution_id, is_supply: 1}).then(res=>{
+ wx.showToast({ title: '设置成功' })
+ setTimeout(()=>{
+ this.triggerEvent('update');
+ }, 1500)
+ }).catch(err=>{
+ this.triggerEvent('update');
+ app.util.message(err.msg, '', 'error');
+ })
+ },
+
+ close: function() {
+ this.triggerEvent('close');
+ }
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/supply/components/selectRider.json b/eaterplanet_ecommerce/moduleB/supply/components/selectRider.json
new file mode 100644
index 0000000..1ce7f3f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/components/selectRider.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "i-load-more": "../../../components/load-more/index",
+ "i-modal": "../../../components/modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/components/selectRider.wxml b/eaterplanet_ecommerce/moduleB/supply/components/selectRider.wxml
new file mode 100644
index 0000000..ad9e216
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/components/selectRider.wxml
@@ -0,0 +1,27 @@
+
+
+
+ 选择配送员
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.username}}
+ {{item.mobile}}
+
+
+ 选择
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/components/selectRider.wxss b/eaterplanet_ecommerce/moduleB/supply/components/selectRider.wxss
new file mode 100644
index 0000000..48dfd48
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/components/selectRider.wxss
@@ -0,0 +1,33 @@
+@import "/common.wxss";
+@import "/icon.wxss";
+
+.search-box {
+ background-color: #f0f0f0;
+ height: 56rpx;
+ line-height: 56rpx;
+ border-radius: 28rpx;
+ color: #acacac;
+ display: flex;
+ align-content: center;
+ margin: 10rpx 30rpx;
+}
+
+.search-icon {
+ position: absolute;
+ left: 20rpx;
+ margin-left: 25rpx;
+ margin-right: 12rpx;
+}
+
+.search-icon .iconfont {
+ font-size: 34rpx;
+ padding-top: 10rpx;
+}
+
+.search-box .ipt {
+ padding: 0 30rpx 0 60rpx;
+ line-height: 56rpx;
+ height: 56rpx;
+ width: 100%;
+ box-sizing: border-box;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/editSku.js b/eaterplanet_ecommerce/moduleB/supply/editSku.js
new file mode 100644
index 0000000..5aecfcd
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/editSku.js
@@ -0,0 +1,86 @@
+let app = getApp();
+Page({
+ data: {
+ need_data: []
+ },
+ goods_id: 0,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+ let id = options.id || '';
+ if(!id) {
+ app.util.message('参数错误', '/eaterplanet_ecommerce/moduleB/supply/goodsManage', 'error');
+ return;
+ }
+ this.goods_id = id;
+ },
+
+ onShow: function () {
+ this.getData();
+ },
+
+ formSubmit: function(e) {
+ console.log(e.detail.value)
+ let res = e.detail.value || {};
+ let resArr = [];
+ Object.keys(res).forEach(k=>{
+ if(res[k]) {
+ let idsArr = k.split("_");
+ let num = parseInt(res[k]);
+ if(num!=='') {
+ let ids = idsArr[1]+'_'+num;
+ resArr.push(ids);
+ }
+ }
+ })
+ if(resArr.length==0) {
+ return wx.showToast({
+ title: '请输入修改数量',
+ icon: 'none'
+ })
+ }
+
+ let sku_list_str = resArr.join(',');
+ let token = wx.getStorageSync('token');
+ let params = {
+ token,
+ goods_id: this.goods_id,
+ is_has_option: 1,
+ sku_list_str
+ };
+ app.util.ProReq('supplymobile.modify_supply_goods_quantity', params).then(res=>{
+ app.util.message(res.msg || '修改成功', 'redirect:/eaterplanet_ecommerce/moduleB/supply/goodsManage', 'error');
+ }).catch(err=>{
+ app.util.message(err.msg || '请求出错', '', 'error');
+ })
+ },
+
+ getData: function() {
+ let token = wx.getStorageSync('token');
+ let params = {
+ token,
+ goods_id: this.goods_id
+ };
+ app.util.ProReq('supplymobile.get_supply_goods_sku', params).then(res=>{
+ let { goods_stock_notice, need_data } = res;
+ this.setData({ goods_stock_notice, need_data })
+ }).catch(err=>{
+ app.util.message(err.msg || '请求出错', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/supply/editSku.json b/eaterplanet_ecommerce/moduleB/supply/editSku.json
new file mode 100644
index 0000000..5f5b29e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/editSku.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "修改库存",
+ "navigationBarBackgroundColor": "#FE8464",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/editSku.wxml b/eaterplanet_ecommerce/moduleB/supply/editSku.wxml
new file mode 100644
index 0000000..a5721c3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/editSku.wxml
@@ -0,0 +1,23 @@
+
+
+
+ 名称
+ 剩余库存
+ 修改库存
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/supply/editSku.wxss b/eaterplanet_ecommerce/moduleB/supply/editSku.wxss
new file mode 100644
index 0000000..1f253ad
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/editSku.wxss
@@ -0,0 +1,15 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+
+.w100 {
+ width:200rpx;
+}
+
+.btn-area {
+ margin-top: 30rpx;
+}
+
+.btn-area button {
+ background: #fe8464;
+ color: #fff;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/excharge.js b/eaterplanet_ecommerce/moduleB/supply/excharge.js
new file mode 100644
index 0000000..7f190a8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/excharge.js
@@ -0,0 +1,256 @@
+var app = getApp();
+
+Page({
+ mixins: [require('../../mixin/commonMixin.js')],
+ data: {
+ type: 1,
+ tixian_money: '',
+ final_money: 0
+ },
+ canTixian: true,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ onShow: function () {
+ wx.showLoading();
+ this.getData();
+ },
+
+ getData: function () {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('supplymobile.supply_managemoney_panel', { token }).then(res => {
+ let {
+ supply_min_apply_money,
+ supply_commiss,
+ tixian_waylist,
+ supply_tixian_free,
+ supply_tixian_notice
+ } = res.data;
+
+ // 查询是否有自定义选中 没有则第一个显示的
+ let type = 0;
+ let tixian_waylist_keys = Object.keys(tixian_waylist);
+ tixian_waylist_keys.forEach(item=>{
+ if (tixian_waylist[item].is_default_check) {
+ type = item;
+ return
+ }
+ })
+
+ if(type==0) {
+ try {
+ tixian_waylist_keys.forEach(item=>{
+ if (tixian_waylist[item].is_show==1) {
+ type = item;
+ tixian_waylist[item].is_default_check = 1;
+ throw Error();
+ }
+ })
+ } catch (e) {
+ }
+ }
+
+ this.setData({
+ type,
+ supply_min_apply_money,
+ supply_commiss,
+ tixian_waylist,
+ supply_tixian_free,
+ supply_tixian_notice
+ })
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '请求出错', '', 'error');
+ })
+ },
+
+ formSubmit: function (e) {
+ const params = e.detail.value;
+ let isNull = 0;
+ let { type, tixian_money, supply_commiss, supply_min_apply_money, supply_tixian_free } = this.data;
+ let errortip = [{}, {
+ account: '微信真实姓名'
+ }, {
+ bankusername: '支付宝真实姓名',
+ account: '支付宝账户'
+ }, {
+ card_name: '银行卡名称',
+ card_username: '持卡人姓名',
+ account: '银行卡账户'
+ }, {
+ account: '微信真实姓名'
+ }];
+ for (let item in params) {
+ params[item] = params[item].replace(/(^\s*)|(\s*$)/g, "");
+ if (!params[item]) {
+ const itemTip = errortip[type][item];
+ wx.showToast({
+ title: '请输入' + (itemTip || '正确的表单内容'),
+ icon: 'none'
+ })
+ isNull = 1;
+ break;
+ }
+ if (item == 'money' && params[item] * 1 <= 0) {
+ wx.showToast({
+ title: '请输入正确的金额',
+ icon: 'none'
+ })
+ return;
+ }
+ }
+
+ if (isNull == 1) return;
+ params.type = type;
+
+ tixian_money = parseFloat(tixian_money);
+ let max_tixian_money = supply_commiss.money;
+ supply_min_apply_money = parseFloat(supply_min_apply_money);
+
+ if (tixian_money == '' || supply_min_apply_money > tixian_money) {
+ wx.showToast({
+ title: '最小提现' + supply_min_apply_money + '元',
+ icon: "none",
+ })
+ return false;
+ }
+
+ if (tixian_money > max_tixian_money) {
+ wx.showToast({
+ title: '本次最大可提现' + max_tixian_money + '元',
+ icon: "none",
+ })
+ let final_money = (max_tixian_money * (100 - supply_tixian_free) / 100).toFixed(2);
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money
+ })
+ return false;
+ }
+
+ if (!this.canTixian) return;
+ this.canTixian = false;
+
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ let that = this;
+ let data = {
+ supply_apply_type: params.type,
+ account: params.account || '',
+ card_name: params.card_name || '',
+ card_username: params.card_username || '',
+ ti_money: params.money,
+ token
+ }
+ app.util.ProReq('supplymobile.supply_applymoney', data).then(res => {
+ wx.showToast({
+ title: '已提交申请',
+ icon: 'none',
+ success: function () {
+ that.canTixian = true;
+ that.setData({
+ canPay: false,
+ tixian_money: '',
+ final_money: 0
+ })
+ that.getData();
+ }
+ })
+ }).catch(err=>{
+ that.canTixian = true;
+ wx.showToast({
+ title: err.msg || '提交失败,请重试',
+ icon: 'none'
+ })
+ })
+ },
+
+ /**
+ * 获得焦点
+ */
+ bindIptFocus: function () {
+ this.setData({
+ onFocus: true
+ })
+ },
+
+ /**
+ * 失去焦点
+ */
+ bindIptBlur: function () {
+ this.setData({
+ onFocus: false
+ })
+ },
+
+ radioChange(e) {
+ this.setData({
+ type: e.detail.value
+ })
+ },
+
+ bindTixianMoneyInput: function (t) {
+ let max_val = this.data.supply_commiss.money;
+ var value = t.detail.value;
+ if (!(/^(\d?)+(\.\d{0,2})?$/.test(value))) {
+ value = value.substring(0, value.length - 1);
+ value = parseFloat(value);
+ }
+
+ if (value > max_val) {
+ wx.showToast({
+ title: '本次最大可提现' + max_val + '元',
+ icon: "none",
+ })
+ }
+ let fee = this.data.supply_tixian_free;
+ let val = parseFloat(value) > 0 ? parseFloat(value) : 0;
+ let final_money = (val * (100 - fee) / 100).toFixed(2);
+
+ let canPay = false;
+ value ? canPay = true : canPay = false;
+
+ this.setData({
+ tixian_money: value,
+ final_money: final_money,
+ canPay
+ })
+ return value;
+ },
+
+ getAll: function () {
+ const tdata = this.data;
+ var max_tixian_money = tdata.supply_commiss.money * 1;
+ let fee = tdata.supply_tixian_free;
+ let final_money = (max_tixian_money * (100 - fee) / 100).toFixed(2);
+
+ let canPay = false;
+ max_tixian_money ? canPay = true : canPay = false;
+ this.setData({
+ tixian_money: max_tixian_money,
+ final_money: final_money,
+ canPay
+ })
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/excharge.json b/eaterplanet_ecommerce/moduleB/supply/excharge.json
new file mode 100644
index 0000000..a2b483d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/excharge.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "提现",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/excharge.wxml b/eaterplanet_ecommerce/moduleB/supply/excharge.wxml
new file mode 100644
index 0000000..dd0adaf
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/excharge.wxml
@@ -0,0 +1,58 @@
+
+
+
+
+ {{supply_commiss.money}}
+ 可提现金额(元)
+
+ 提现记录
+
+
+
+ 提现规则:
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/supply/excharge.wxss b/eaterplanet_ecommerce/moduleB/supply/excharge.wxss
new file mode 100644
index 0000000..0f4d806
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/excharge.wxss
@@ -0,0 +1,17 @@
+@import "/eaterplanet_ecommerce/resource/css/excharge.wxss";
+
+.wrap {
+ font-size: 28rpx;
+}
+
+.form-group label {
+ display: flex;
+ font-size: 26rpx;
+ align-items: center;
+ padding: 5rpx 0 15rpx;
+}
+
+.form-group label input {
+ flex: 1;
+ border: 0;
+}
diff --git a/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.js b/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.js
new file mode 100644
index 0000000..847be83
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.js
@@ -0,0 +1,76 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ loadText: '加载中',
+ loadMore: false,
+ noData: false
+ },
+ page: 1,
+ noMore: false,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ this.getData();
+ },
+
+ getData: function() {
+ wx.showLoading();
+ var token = wx.getStorageSync('token');
+ app.util.ProReq('supplymobile.supply_apply_flowlist', { token, page: this.page }).then(res => {
+ let list = res.data;
+ let oldList = this.data.list;
+ list = oldList.concat(list);
+ this.page++;
+ this.setData({ list })
+ }).catch(err => {
+ console.log(err)
+ if(err.code==1) {
+ let h = {};
+ if (this.page == 1) h.noData=true;
+ this.noMore = true;
+ h.loadMore = false;
+ this.setData(h)
+ } else {
+ app.util.message(err.msg || '请求出错', '', 'error');
+ }
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ this.noMore || (this.setData({ loadMore: true }), this.getData());
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.json b/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.json
new file mode 100644
index 0000000..f2a60e0
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "提现记录",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.wxml b/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.wxml
new file mode 100644
index 0000000..20e3607
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.wxml
@@ -0,0 +1,22 @@
+
+
+
+
+ 申请时间
+ 状态
+ 金额(元)
+
+
+
+ {{item.addtime}}
+ {{item.state_str}}
+ {{item.money}}
+
+
+
+
+
+ 暂无任何明细记录
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.wxss b/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.wxss
new file mode 100644
index 0000000..eb60357
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/exchargeRecord.wxss
@@ -0,0 +1,60 @@
+
+.title {
+ left: 0;
+ right: 0;
+ display: flex;
+ align-items: center;
+ background-color: #fff;
+ color: #333;
+ line-height: 80rpx;
+ font-size: 28rpx;
+ text-align: center;
+ font-weight: bold;
+}
+
+.time {
+ flex: 3;
+}
+
+.status {
+ flex: 1;
+}
+
+.money {
+ flex: 2;
+}
+
+.list {
+ padding-top: 80rpx;
+ text-align: center;
+ background-color: #fff;
+ font-size: 24rpx;
+}
+
+.list-item {
+ position: relative;
+ display: flex;
+ align-items: center;
+ line-height: 76rpx;
+ border-bottom: 1rpx solid #efefef;
+}
+
+.noDistributionList {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-top: 200rpx;
+}
+
+.noDistributionList .noDistributionListImg {
+ width: 218rpx;
+ height: 218rpx;
+ margin-bottom: 32rpx;
+}
+
+.noDistributionList .noDistributionListTit {
+ font-size: 30rpx;
+ color: #666;
+ line-height: 30rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/supply/goodsManage.js b/eaterplanet_ecommerce/moduleB/supply/goodsManage.js
new file mode 100644
index 0000000..9be2954
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/goodsManage.js
@@ -0,0 +1,407 @@
+var app = getApp();
+
+Page({
+ data: {
+ placeholdeImg: app.globalData.placeholdeImg,
+ navList: [{
+ name: "出售中",
+ status: "1"
+ }, {
+ name: "库存预警",
+ status: "8"
+ }, {
+ name: "已下架",
+ status: "0"
+ }, {
+ name: "待审核",
+ status: "4"
+ }
+ ],
+ currentTab: 1,
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ showActionsheet: false,
+ groups: [
+ { text: '删除', type: 'warn', value: 1 },
+ { text: '下架', value: 2 },
+ { text: '修改库存', value: 5 }
+ // { text: '编辑', value: 3 }
+ ],
+ buttons: [{text: '取消'}, {text: '确定'}],
+ editSkuNum: 0
+ },
+ page: 1,
+ keywords: '',
+ goodsId: '', //当前操作的商品id
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+ let currentTab = options.status || 1;
+ this.setData({
+ currentTab
+ }, ()=>{
+ this.initFn();
+ })
+ },
+
+ initFn: function(keywords=''){
+ this.page = 1;
+ this.keywords = keywords;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ },()=>{
+ this.getData();
+ })
+ },
+
+ /**
+ * 切换导航
+ */
+ switchNav: function (e) {
+ let that = this;
+ let curIdx = e.target.dataset.current*1;
+ if (this.data.currentTab === curIdx) return false;
+ let groups = [
+ { text: '删除', type: 'warn', value: 1 },
+ { text: '下架', value: 2 },
+ { text: '修改库存', value: 5 }
+ // { text: '编辑', value: 3 }
+ ]
+ if(curIdx==0) {
+ groups = [
+ { text: '删除', type: 'warn', value: 1 },
+ { text: '上架', value: 4 },
+ { text: '修改库存', value: 5 }
+ // { text: '编辑', value: 3 }
+ ]
+ } else if(curIdx==4){
+ groups = [
+ { text: '删除', type: 'warn', value: 1 },
+ { text: '修改库存', value: 5 }
+ // { text: '编辑', value: 3 }
+ ]
+ } else if(curIdx==8){
+ groups = [
+ { text: '删除', type: 'warn', value: 1 },
+ { text: '下架', value: 2 },
+ { text: '修改库存', value: 5 }
+ ]
+ }
+
+ this.setData({
+ currentTab: 1 * e.target.dataset.current,
+ groups
+ }, ()=>{
+ that.initFn();
+ });
+ },
+
+ goResult: function(e) {
+ let keyword = e.detail.value.replace(/\s+/g, '');
+ // if (!keyword) {
+ // wx.showToast({
+ // title: '请输入关键词',
+ // icon: 'none'
+ // })
+ // return;
+ // }
+ this.initFn(keyword);
+ },
+
+ getData: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let grounding = this.data.currentTab;
+ let keywords = this.keywords;
+
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'supplymobile.get_supply_goodslist',
+ token,
+ grounding,
+ page: this.page,
+ keywords
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length == 0) {
+ if(that.page==1) {
+ h.noData = 1;
+ } else {
+ h.loadMore = false;
+ h.noMore = false;
+ h.loadText = "没有更多记录了~"
+ }
+ }
+ if (list.length < 10) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list, ...h })
+ } else {
+ app.util.message(res.data.msg, 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ handleActionsheet: function (e) {
+ let idx = (e && e.currentTarget.dataset.index) || 0;
+ let id = (e && e.currentTarget.dataset.id) || 0;
+ let list = this.data.list;
+ let goodsItem = list[idx];
+ let h = {};
+ if(id) { h.goodsItem = goodsItem }
+ this.setData({
+ showActionsheet: !this.data.showActionsheet,
+ ...h
+ })
+ },
+
+ handleBtn(e) {
+ let goodsItem = this.data.goodsItem;
+ let goodsId = goodsItem.id;
+ let hasoption = goodsItem.hasoption;
+ let type = e.detail.value; // 1删除 2下架 3编辑 4上下架 5修改库存
+ this.handleActionsheet();
+ switch(type) {
+ case 1:
+ this.actionConfirm('是否删除该商品').then(()=>{
+ this.delGoods(goodsId)
+ });
+ break;
+ case 2:
+ this.actionConfirm('是否下架该商品').then(()=>{
+ this.undercarriage(goodsId)
+ });
+ break;
+ case 3:
+ console.log('3编辑')
+ break;
+ case 4:
+ this.actionConfirm('是否上架该商品').then(()=>{
+ this.upcarriage(goodsId)
+ });
+ break;
+ case 5:
+ // 修改库存
+ if(hasoption==1) {
+ wx.navigateTo({ url: `/eaterplanet_ecommerce/moduleB/supply/editSku?id=${goodsId}` })
+ } else {
+ // 显示弹窗
+ this.setData({ editSkuVisible: true, editSkuNum: goodsItem.total || 0 })
+ }
+ break;
+ default:
+ console.log('默认操作')
+ }
+ },
+
+ /**
+ * 下架
+ * @param {*} goods_id
+ */
+ undercarriage: function (goods_id) {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'supplymobile.down_supply_goods',
+ token,
+ goods_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let list = that.data.list || [];
+ list = list.filter(item=>item.id!=goods_id);
+ let h = {};
+ if(list.length==0) h.noData = 1;
+ h.list = list;
+ that.setData(h);
+ wx.showToast({
+ title: '下架成功',
+ icon: 'none'
+ })
+ } else {
+ app.util.message(res.data.msg, '', 'error');
+ }
+ }
+ })
+ },
+
+ /**
+ * 上架
+ * @param {*} goods_id
+ */
+ upcarriage: function (goods_id) {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'supplymobile.up_supply_goods',
+ token,
+ goods_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let list = that.data.list || [];
+ list = list.filter(item=>item.id!=goods_id);
+ let h = {};
+ if(list.length==0) h.noData = 1;
+ h.list = list;
+ that.setData(h);
+ wx.showToast({
+ title: '上架成功',
+ icon: 'none'
+ })
+ } else {
+ that.initFn();
+ app.util.message(res.data.msg, '', 'error');
+ }
+ }
+ })
+ },
+
+ delGoods: function (goods_id) {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'supplymobile.delete_supply_goods',
+ token,
+ goods_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let list = that.data.list || [];
+ list = list.filter(item=>item.id!=goods_id);
+ let h = {};
+ if(list.length==0) h.noData = 1;
+ h.list = list;
+ that.setData(h);
+ wx.showToast({
+ title: '删除成功',
+ icon: 'none'
+ })
+ } else {
+ app.util.message(res.data.msg, '', 'error');
+ }
+ }
+ })
+ },
+
+ actionConfirm: function(content) {
+ return new Promise((resolve, reject)=>{
+ wx.showModal({
+ title: '提示',
+ content,
+ showCancel: true,
+ success: (result) => {
+ if (result.confirm) {
+ resolve();
+ } else if (result.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ })
+ },
+
+ /**
+ * 修改库存
+ */
+ editSku: function(e){
+ if(e.detail.index==0) {
+ this.setData({ editSkuVisible: false })
+ } else {
+ let editSkuNum = this.data.editSkuNum;
+ if(editSkuNum==='') {
+ return wx.showToast({
+ title: '请输入正确的数量',
+ icon: 'none'
+ })
+ }
+ this.subSku();
+ }
+ },
+
+ subSku: function(){
+ let goodsItem = this.data.goodsItem;
+ let goodsId = goodsItem.id;
+ console.log(goodsId);
+ let editSkuNum = this.data.editSkuNum;
+ let token = wx.getStorageSync('token');
+ let params = {
+ token,
+ goods_id: goodsId,
+ is_has_option: 0,
+ quantity: editSkuNum
+ };
+ app.util.ProReq('supplymobile.modify_supply_goods_quantity', params).then(res=>{
+ let list = this.data.list || [];
+ list.map(item=>{ if(item.id == goodsId) item.total = editSkuNum; })
+ this.setData({ list, editSkuVisible: false, editSkuNum: 0, goodsItem: '' })
+ }).catch(err=>{
+ app.util.message(err.msg || '请求出错', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ bindSkuIpt: function(e) {
+ let val = e.detail.value || 0;
+ this.setData({ editSkuNum: parseInt(val) });
+ return parseInt(val)
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/supply/goodsManage.json b/eaterplanet_ecommerce/moduleB/supply/goodsManage.json
new file mode 100644
index 0000000..32e064c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/goodsManage.json
@@ -0,0 +1,13 @@
+{
+ "navigationBarTitleText": "商品管理",
+ "navigationBarBackgroundColor": "#FE8464",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-img": "../../components/img/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index",
+ "i-fixed-bottom": "../../components/fixed-bottom/index",
+ "mp-actionSheet": "../../components/actionsheet/actionsheet",
+ "mp-dialog": "../../components/mp-dialog/dialog"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/goodsManage.wxml b/eaterplanet_ecommerce/moduleB/supply/goodsManage.wxml
new file mode 100644
index 0000000..94fc1a0
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/goodsManage.wxml
@@ -0,0 +1,41 @@
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.goodsname}}
+ ¥{{item.price}}
+ 库存:{{item.total}}
+
+
+
+
+
+ 暂无商品~
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/goodsManage.wxss b/eaterplanet_ecommerce/moduleB/supply/goodsManage.wxss
new file mode 100644
index 0000000..56e5412
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/goodsManage.wxss
@@ -0,0 +1,79 @@
+@import 'tabbar.wxss';
+
+.nav {
+ left: 0;
+ right: 0;
+ transition: top 0.3s;
+ z-index: 10;
+ background: #fff;
+ height: 92rpx;
+ border-bottom: 2rpx solid #f2f2f2;
+ padding: 0 60rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.nav .orderList_item {
+ font-size: 28rpx;
+ font-family: PingFangSC-Medium;
+ font-weight: 500;
+ color: #666;
+ position: relative;
+ height: 94rpx;
+ line-height: 94rpx;
+}
+
+.nav .on {
+ position: relative;
+ color: #fe8464;
+ border-bottom: 4rpx solid #fe8464;
+}
+
+/* 搜索 */
+.search-bar {
+ padding: 12rpx 25rpx;
+ background-color: #fff;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.search-box {
+ background-color: #f0f0f0;
+ height: 56rpx;
+ line-height: 56rpx;
+ border-radius: 28rpx;
+ color: #acacac;
+ display: flex;
+ align-content: center;
+}
+
+.search-icon {
+ position: absolute;
+ left: 20rpx;
+ margin-left: 25rpx;
+ margin-right: 12rpx;
+}
+
+.search-icon .iconfont {
+ font-size: 34rpx;
+ padding-top: 10rpx;
+}
+
+.search-box .ipt {
+ padding: 0 30rpx 0 60rpx;
+ line-height: 56rpx;
+ height: 56rpx;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.item .img-class {
+ width: 160rpx;
+ height: 160rpx;
+ overflow: hidden;
+}
+
+.search-bar {
+ font-size: 28rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/supply/index.js b/eaterplanet_ecommerce/moduleB/supply/index.js
new file mode 100644
index 0000000..643f72c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/index.js
@@ -0,0 +1,99 @@
+var app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isIpx: app.globalData.isIpx,
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getData();
+ },
+
+ getData: function(){
+ let that = this;
+ const token = wx.getStorageSync('token');
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'supplymobile.supplyindex_info',
+ token
+ },
+ dataType: 'json',
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ let {
+ supply_info,
+ wait_send_count,
+ wait_refund_count,
+ today_order_count,
+ yestday_order_count,
+ total_order_count,
+ wait_statement_money,
+ has_statement_money,
+ has_get_money
+ } = res.data.data;
+
+ that.setData({
+ supply_info,
+ wait_send_count,
+ wait_refund_count,
+ today_order_count,
+ yestday_order_count,
+ total_order_count,
+ wait_statement_money,
+ has_statement_money,
+ has_get_money
+ });
+ } else {
+ app.util.message(res.data.msg, 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ }
+ }
+ })
+ },
+
+ goLink: function (event) {
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/supply/index.json b/eaterplanet_ecommerce/moduleB/supply/index.json
new file mode 100644
index 0000000..01e6fa3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/index.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "商户管理中心",
+ "navigationBarBackgroundColor": "#FE8464",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-fixed-bottom": "../../components/fixed-bottom/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/index.wxml b/eaterplanet_ecommerce/moduleB/supply/index.wxml
new file mode 100644
index 0000000..925908c
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/index.wxml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+ {{supply_info.shopname}}
+
+
+
+
+
+
+ 销售数据
+
+
+
+ {{today_order_count}}
+ 今日订单
+
+
+ {{yestday_order_count}}
+ 昨日订单
+
+
+ {{total_order_count}}
+ 总订单数
+
+
+
+
+
+
+
+
+ {{wait_statement_money}}
+
+ 待结算(元)
+
+
+
+ {{has_statement_money}}
+
+ 已结算(元)
+
+
+
+ {{has_get_money}}
+
+ 已提现(元)
+
+
+
+
+
+
+
+
+
+ 我的订单
+
+ 查看全部
+
+
+
+
+
+ 0
+
+ 库存预警
+
+
+ {{wait_send_count}}
+
+ 待发货
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/supply/index.wxss b/eaterplanet_ecommerce/moduleB/supply/index.wxss
new file mode 100644
index 0000000..63c9948
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/index.wxss
@@ -0,0 +1,240 @@
+@import 'tabbar.wxss';
+
+.groupCenter {
+ width: 100%;
+ position: relative;
+ overflow: hidden;
+}
+
+.groupCenter .basicInform {
+ width: 100%;
+ height: 226rpx;
+ background: #fe8464;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.groupCenter .basicInform .user-avatar {
+ width: 144rpx;
+ height: 144rpx;
+ margin: 10rpx 30rpx 0;
+}
+
+.groupCenter .basicInform .user-avatar .userAvatarUrl {
+ border-radius: 50%;
+ width: 140rpx;
+ height: 140rpx;
+ border: 2rpx solid rgba(255, 255, 255, 0.24);
+ overflow: hidden;
+ display: flex;
+}
+
+.groupCenter .basicInform .userInfo {
+ display: flex;
+ flex-direction: column;
+ padding-top: 10rpx;
+}
+
+.groupCenter .basicInform .userInfo .user-name {
+ height: 40rpx;
+ line-height: 40rpx;
+ color: #fff;
+ font-size: 40rpx;
+ margin-top: 45rpx;
+}
+
+.groupCenter .distributionCon {
+ width: 100%;
+ margin-top: -30rpx;
+ z-index: 9;
+}
+
+.groupCenter .distributionCon .distribution {
+ background: #fff;
+ border-radius: 10rpx;
+ padding: 24rpx 0;
+}
+
+.groupCenter .distributionCon .distribution .myDistribution {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 30rpx;
+ color: #333;
+ font-weight: 500;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon {
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon .income {
+ width: 33.3%;
+ padding: 20rpx 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon .income:last-child {
+ border: none;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon .income .incomeTop {
+ font-size: 36rpx;
+ color: #ff673f;
+ margin-bottom: 16rpx;
+ font-weight: 500;
+}
+
+.groupCenter .distributionCon .distribution .incomeCon .income .incomeBottom {
+ font-size: 24rpx;
+ color: #999;
+}
+
+.groupCenter .effectData {
+ width: 100%;
+ margin-top: 30rpx;
+}
+
+.groupCenter .effectData .effect {
+ background: #fff;
+ border-radius: 10rpx;
+ padding: 24rpx 0;
+ margin: 0 20rpx;
+}
+
+.groupCenter .effectData .effect .incomeCon {
+ margin-top: 30rpx;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.groupCenter .effectData .effect .incomeCon .income {
+ width: 33.3%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.groupCenter .effectData .effect .incomeCon .income:last-child {
+ border: none;
+}
+
+.groupCenter .effectData .effect .incomeCon .income .incomeTop {
+ font-size: 36rpx;
+ color: #333;
+ margin-bottom: 16rpx;
+ font-weight: 500;
+}
+
+.groupCenter .effectData .effect .incomeCon .income .incomeBottom {
+ font-size: 24rpx;
+ color: #999;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.groupCenter .effectData .effect .incomeCon .income .incomeBottom .distributionInstrIcon {
+ width: 28rpx;
+ height: 28rpx;
+ margin-right: 8rpx;
+}
+
+.groupCenter .groupCenterCon {
+ margin-top: 30rpx;
+}
+
+.groupCenter .groupCenterCon .order .myOrders {
+ height: 90rpx;
+ border-top-right-radius: 10rpx;
+ border-top-left-radius: 10rpx;
+ background: #fff;
+ border-bottom: 0.1rpx solid #e4e4e4;
+ padding: 0 30rpx;
+ font-size: 30rpx;
+ color: #333;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupCenter .groupCenterCon .order .myOrders .allGroupOrder {
+ font-size: 26rpx;
+ color: #999;
+}
+
+.groupCenter .groupCenterCon .order .myOrders .allGroupOrder .rightArrowImg {
+ width: 12rpx;
+ height: 22rpx;
+ color: #a7a7a7;
+ margin-left: 14rpx;
+ margin-bottom: -2rpx;
+}
+
+.groupCenter .groupCenterCon .order .orderTab {
+ padding: 30rpx 52rpx;
+ background-color: #fff;
+ overflow: hidden;
+ border-radius: 10rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status {
+ position: relative;
+ color: #58595b;
+ font-size: 26rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .num {
+ width: 34rpx;
+ height: 34rpx;
+ background: #fff;
+ font-size: 22rpx;
+ color: #fff;
+ background: #ff6557;
+ border-radius: 50%;
+ position: absolute;
+ right: 0;
+ top: -14rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ z-index: 1;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .distributionIcon {
+ width: 60rpx;
+ height: 50rpx;
+ margin-bottom: 16rpx;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .receiveIcon {
+ margin-bottom: 16rpx;
+ width: 54rpx;
+ height: 50rpx;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .completeIcon {
+ margin-bottom: 16rpx;
+ width: 50rpx;
+ height: 50rpx;
+}
+
+.groupCenter .groupCenterCon .order .orderTab .order_status .needPickIcon {
+ margin-bottom: 16rpx;
+ margin-left: 10rpx;
+ width: 58rpx;
+ height: 54rpx;
+}
diff --git a/eaterplanet_ecommerce/moduleB/supply/moneyManage.js b/eaterplanet_ecommerce/moduleB/supply/moneyManage.js
new file mode 100644
index 0000000..6840d68
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/moneyManage.js
@@ -0,0 +1,62 @@
+var app = getApp();
+
+Page({
+ data: {
+
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.getData();
+ },
+
+ getData: function(){
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('supplymobile.supply_managemoney_panel', {token}).then(res=>{
+ console.log(res)
+ let { member_info, supply_commiss } = res.data;
+ this.setData({ member_info, supply_commiss })
+ }).catch(err=>{
+ app.util.message(err.msg || '请求出错', '', 'error');
+ })
+ },
+
+ goLink: function (event) {
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/moneyManage.json b/eaterplanet_ecommerce/moduleB/supply/moneyManage.json
new file mode 100644
index 0000000..d86e8eb
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/moneyManage.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "资金管理",
+ "navigationBarBackgroundColor": "#FE8464",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index",
+ "i-fixed-bottom": "../../components/fixed-bottom/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/moneyManage.wxml b/eaterplanet_ecommerce/moduleB/supply/moneyManage.wxml
new file mode 100644
index 0000000..875ef69
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/moneyManage.wxml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ {{member_info.username}}
+
+
+
+
+ {{supply_commiss.money}}
+ 可提现金额(元)
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/supply/moneyManage.wxss b/eaterplanet_ecommerce/moduleB/supply/moneyManage.wxss
new file mode 100644
index 0000000..9ce9e5e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/moneyManage.wxss
@@ -0,0 +1,68 @@
+@import 'tabbar.wxss';
+
+.user-info .avatar {
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 20rpx;
+ border-radius: 50%;
+}
+
+.nickname {
+ font-size: 32rpx;
+ font-weight: bold;
+ color: #000;
+}
+
+.userid,
+invote {
+ font-size: 26rpx;
+ margin-top: 10rpx;
+}
+
+.money {
+ padding: 20rpx 30rpx;
+}
+
+.bor-bottom {
+ position: relative;
+}
+
+.bor-bottom::after {
+ content: '';
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ transform: scaleY(.5);
+ border-bottom: 1rpx solid #efefef;
+}
+
+.item-main {
+ padding: 32rpx 40rpx;
+}
+
+.item-title {
+ height: 40rpx;
+ width: 400rpx;
+ color: #444;
+ font-size: 28rpx;
+ display: flex;
+ align-items: center;
+}
+
+.icon-right {
+ width: 12rpx;
+ height: 22rpx;
+}
+
+.recharge-money {
+ font-family: DIN;
+ color: #ff758c;
+ font-size: 50rpx;
+}
+
+.recharge-tip {
+ color: #999;
+ font-size: 24rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/orderDetails.js b/eaterplanet_ecommerce/moduleB/supply/orderDetails.js
new file mode 100644
index 0000000..bc70b55
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/orderDetails.js
@@ -0,0 +1,121 @@
+let app = getApp();
+var status = require('../../utils/index.js');
+
+Page({
+ mixins: [require('static/orderMixin.js')],
+ data: {
+ common_header_backgroundimage: app.globalData.common_header_backgroundimage,
+ changePrice: 0
+ },
+ id: '',
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let id = options.id || '';
+ if(!id) {
+ app.util.message('参数错误', '/eaterplanet_ecommerce/moduleB/supply/orderManage', 'error');
+ return;
+ }
+ this.id = id;
+ status.setGroupInfo().then((groupInfo) => {
+ this.setData({ groupInfo })
+ });
+ this.initFn(id);
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ initFn: function(){
+ this.setData({showRaderList: false});
+ wx.showLoading();
+ let id = this.id;
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('order.order_info', {token, id, is_supply: 1}).then(res=>{
+ let order = res.data;
+ let { is_hidden_orderlist_phone, presale_info } = res;
+
+ let { real_total, shipping_fare, voucher_credit, fullreduction_money } = order.order_info;
+ var goodsTotal = parseFloat(real_total) - parseFloat(shipping_fare);
+ let disAmount = parseFloat(voucher_credit) + parseFloat(fullreduction_money);
+ disAmount = (disAmount > goodsTotal) ? goodsTotal : disAmount;
+
+ let changePrice = 0;
+ if(order.order_info.is_change_price==1) {
+ changePrice = Math.abs(order.order_info.admin_change_price);
+ }
+
+ let levelAmount = 0;
+ let order_goods_list = order.order_goods_list;
+ if(order_goods_list&&order_goods_list.length) {
+ order_goods_list.forEach(function(item){
+ let total = item.total * 1;
+ let old_total = item.old_total * 1;
+ if (item.is_level_buy==1 || item.is_vipcard_buy==1) {
+ levelAmount += old_total - total;
+ }
+ })
+ }
+
+ presale_info = Object.keys(presale_info).length ? presale_info : '';
+
+ this.setData({
+ order,
+ is_hidden_orderlist_phone,
+ goodsTotal: goodsTotal.toFixed(2),
+ disAmount: disAmount.toFixed(2),
+ levelAmount: levelAmount.toFixed(2),
+ changePrice: changePrice.toFixed(2),
+ presale_info
+ })
+ }).catch(err=>{
+ app.util.message(err.msg, 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ callTelphone: function (t) {
+ var e = this;
+ this.data.isCalling || (this.data.isCalling = true, wx.makePhoneCall({
+ phoneNumber: t.currentTarget.dataset.phone,
+ complete: function () {
+ e.data.isCalling = false;
+ }
+ }));
+ },
+
+ goExpress: function(){
+ let order_id = this.data.order.order_info.order_id;
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/pages/order/goods_express?id=' + order_id,
+ })
+ },
+
+ hideExpModal: function(){
+ this.setData({
+ showExpModal: false
+ })
+ }
+
+})
diff --git a/eaterplanet_ecommerce/moduleB/supply/orderDetails.json b/eaterplanet_ecommerce/moduleB/supply/orderDetails.json
new file mode 100644
index 0000000..fc94acc
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/orderDetails.json
@@ -0,0 +1,11 @@
+{
+ "navigationBarTitleText": "订单详情",
+ "navigationBarBackgroundColor": "#ff5344",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-img": "../../components/img/index",
+ "i-card": "../../components/card/index",
+ "i-modal": "../../components/modal/index",
+ "i-select-rider": "components/selectRider"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/orderDetails.wxml b/eaterplanet_ecommerce/moduleB/supply/orderDetails.wxml
new file mode 100644
index 0000000..d71ff8d
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/orderDetails.wxml
@@ -0,0 +1,339 @@
+
+
+
+
+
+
+
+ 备货中
+
+
+
+ 拼团中,已付款
+
+
+
+ 配送中
+
+
+
+ {{order.order_status_info.name?order.order_status_info.name:"可提货"}}
+
+
+
+ 已签收
+
+
+
+
+ 等待退款
+
+
+
+ 交易完成
+
+
+
+
+ 售后中
+
+
+
+
+ 交易取消
+
+
+
+
+ 已退款
+
+
+
+
+
+
+
+
+
+
+
+ 下单时间
+
+ {{order.order_info.date_added}}
+
+
+
+ 订单编号
+ {{order.order_info.order_num_alias}}
+
+
+ 买家
+ {{order.order_info.name}}
+
+
+ 支付方式
+ {{order.order_info.transaction_id}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 配送方式
+ {{groupInfo.delivery_express_name}}({{order.order_info.dispatchname}})
+
+ 查看物流
+
+
+
+
+ 快递单号
+ {{order.order_info.shipping_no}}
+
+
+
+ 配送方式
+ 同城配送
+
+
+ 配送方式
+ 到店核销
+
+
+ 配送方式
+ {{groupInfo.delivery_tuanzshipping_name}}
+
+
+ 期望送达时间
+
+ {{order.order_info.expected_delivery_time}}
+
+
+
+ 收货人
+
+ {{order.order_info.ziti_name}}
+
+
+ 联系收货人
+
+
+
+
+ 收货地址
+ {{order.shipping_province.name}}{{order.shipping_city.name}}{{order.shipping_country.name}}{{order.order_info.shipping_address}}
+
+
+ 收货地址
+ {{order.order_info.tuan_send_address}}
+
+
+
+
+
+
+
+
+
+
+
+ 配送方式
+
+ {{order.order_info.delivery_name}}
+
+
+
+ 收货人
+
+ {{order.order_info.ziti_name}}
+
+
+ 联系{{groupInfo.owner_name}}
+
+
+
+
+ 取货地址
+ {{order.order_info.shipping_address}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 拼团 {{goodsInfo.name}}
+
+ {{goodsInfo.option_str}}
+ ¥{{goodsInfo.price}}
+ 积分 x {{goodsInfo.quantity}}
+
+
+
+ 小计:¥{{goodsInfo.real_total}}
+ 积分
+
+
+
+
+
+
+
+
+ 商品合计
+
+ + ¥{{goodsTotal}}
+
+
+
+ 快递费
+ 配送费
+
+ + ¥{{order.order_info.shipping_fare}}
+
+
+
+
+ 配送费
+
+ + ¥{{order.order_info.fare_shipping_free}}
+
+
+
+ 满金额免配送费
+
+ - ¥{{order.order_info.fare_shipping_free}}
+
+
+
+
+ 积分抵扣
+
+ - ¥{{orderInfo.score_for_money}}
+
+
+
+ 会员优惠
+
+ - ¥{{levelAmount}}
+
+
+
+ 等级折扣
+
+ - ¥{{levelAmount}}
+
+
+
+ 总优惠
+
+ - ¥{{disAmount}}
+
+
+
+ 订单改价
+
+ {{order.order_info.admin_change_price>0?'+':'-'}} ¥{{changePrice}}
+
+
+
+
+
+ 实付款:¥{{order.order_info.total}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 订单发货
+
+ 联系人:{{expInfo.shipping_name}}
+ 收货地址:{{expInfo.shipping_name}}
+
+
+
+ 物流公司:{{expInfo.express_list[index].name}}
+
+
+
+
+ 物流单号:
+
+
+
+
+ 取消
+ 确认发货
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/supply/orderDetails.wxss b/eaterplanet_ecommerce/moduleB/supply/orderDetails.wxss
new file mode 100644
index 0000000..64994e7
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/orderDetails.wxss
@@ -0,0 +1,205 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+
+.head .little-img {
+ width: 230rpx;
+ height: 120rpx;
+}
+
+.back-img-wrap {
+ width: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: -1;
+}
+
+.back-img-wrap .back-img {
+ width: 100%;
+ height: 340rpx;
+}
+
+.to-pay-wrap {
+ text-align: center;
+ padding: 46rpx 0;
+ color: white;
+}
+
+.to-get-wrap {
+ display: flex;
+ justify-content: space-between;
+ padding: 50rpx 50rpx 0 50rpx;
+ color: white;
+}
+
+.trade-cancel-wrap {
+ padding: 50rpx 76rpx;
+ color: white;
+ text-align: center;
+}
+
+.cancel-box {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.cancel-img {
+ margin-right: 10rpx;
+ width: 40rpx;
+ height: 40rpx;
+}
+
+.font-bold-20 {
+ font-size: 40rpx;
+ font-weight: 500;
+}
+
+.content {
+ padding: 0 20rpx;
+ padding-bottom: 80rpx;
+}
+
+.header {
+ display: flex;
+ justify-content: space-between;
+ padding: 20rpx 30rpx;
+ color: #444;
+ font-size: 28rpx;
+ font-weight: 500;
+}
+
+.header .goods-num {
+ color: #aaa;
+}
+
+.header .goods-done {
+ color: #aaa;
+}
+
+.header .goods-ready {
+ color: #ff5344;
+}
+
+.header .goods-cancel {
+ color: #aaa;
+}
+
+.bold-text {
+ font-weight: 500;
+}
+
+.show-img {
+ float: left;
+ width: 120rpx;
+ height: 120rpx;
+}
+
+.name {
+ margin-top: -8rpx;
+ width: 510rpx;
+ font-size: 26rpx;
+ color: #444;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.mount {
+ font-size: 22rpx;
+ color: #aaa;
+ margin-top: 10rpx;
+}
+
+.bottom-info {
+ justify-content: space-between;
+ font-size: 28rpx;
+ color: #444;
+ margin-top: 18rpx;
+}
+
+.middle .middle-line {
+ height: 0.1rpx;
+ background: #efefef;
+}
+
+.middle .each-item {
+ box-sizing: border-box;
+ display: flex;
+ width: 100%;
+ padding: 32rpx 30rpx;
+}
+
+.content-wrap {
+ padding-bottom: 20rpx;
+}
+
+.content-wrap .item {
+ display: flex;
+ justify-content: space-between;
+ font-size: 26rpx;
+ padding: 16rpx 30rpx;
+ padding-bottom: 0;
+}
+
+.content-wrap .item .title {
+ color: #aaa;
+ min-width: 120rpx;
+}
+
+.content-wrap .item .detail {
+ color: #444;
+}
+
+.content-wrap .item .detail .phone {
+ margin-left: 20rpx;
+ padding: 0 20rpx;
+ height: 44rpx;
+ display: flex;
+ align-items: center;
+ border: 0.1rpx solid #efefef;
+ border-radius: 26rpx;
+}
+
+.content-wrap .item .detail .phone .icon-phone {
+ width: 20rpx;
+ height: 20rpx;
+ margin-right: 10rpx;
+}
+
+.footerContorl {
+ justify-content: flex-end;
+ margin-top: 20rpx;
+}
+
+.footerContorl .btn {
+ padding: 6rpx 15rpx;
+ margin-left: 20rpx;
+ border-radius: 10rpx;
+ color: #fff;
+}
+
+.exp-modal {
+ width: 80%;
+ overflow: hidden;
+}
+
+.btn {
+ position: relative;
+}
+
+.btn:last-child::before {
+ content: "";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ top: 0;
+ border-left: 1px solid #e5e5e5;
+ transform-origin: 0 0;
+ transform: scaleX(0.5);
+}
+
+.exp-modal .ipt {
+ border: 1rpx solid #e5e5e5;
+ padding: 10rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/orderManage.js b/eaterplanet_ecommerce/moduleB/supply/orderManage.js
new file mode 100644
index 0000000..c1d49f3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/orderManage.js
@@ -0,0 +1,169 @@
+var app = getApp();
+
+Page({
+ mixins: [require('static/orderMixin.js')],
+ data: {
+ placeholdeImg: app.globalData.placeholdeImg,
+ navList: [{
+ name: "全部",
+ status: "-1"
+ }, {
+ name: "待发货",
+ status: "1"
+ }, {
+ name: "配送中",
+ status: "14"
+ }, {
+ name: "待收货",
+ status: "4"
+ }, {
+ name: "待付款",
+ status: "3"
+ }
+ ],
+ currentTab: -1,
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true
+ },
+ page: 1,
+ keyword: '',
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+ let currentTab = options.status || -1;
+ this.setData({
+ currentTab
+ })
+ },
+
+ onShow: function () {
+ this.initFn();
+ },
+
+ initFn: function(keyword=''){
+ if(typeof keyword !=='string') keyword='';
+ this.page = 1;
+ this.keyword = keyword;
+ this.setData({
+ list: [],
+ loadText: "加载中...",
+ noData: 0,
+ loadMore: true,
+ showRaderList: false
+ },()=>{
+ this.getData();
+ })
+ },
+
+ /**
+ * 切换导航
+ */
+ switchNav: function (e) {
+ let that = this;
+ if (this.data.currentTab === 1 * e.target.dataset.current) return false;
+ this.setData({
+ currentTab: 1 * e.target.dataset.current
+ }, ()=>{
+ that.initFn();
+ });
+ },
+
+ goResult: function(e) {
+ let keyword = e.detail.value.replace(/\s+/g, '');
+ // if (!keyword) {
+ // wx.showToast({
+ // title: '请输入关键词',
+ // icon: 'none'
+ // })
+ // return;
+ // }
+ this.initFn(keyword);
+ },
+
+ getData: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let order_status = this.data.currentTab;
+ let keyword = this.keyword;
+
+ wx.showLoading();
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'order.orderlist',
+ token,
+ is_supply: 1,
+ order_status,
+ page: this.page,
+ keyword
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let h = {};
+ let list = res.data.data;
+ if (list.length < 10) h.noMore = true;
+ let oldList = that.data.list;
+ list = oldList.concat(list);
+ that.page++;
+ that.setData({ list, ...h })
+ } else if(res.data.code==2) {
+ app.util.message(res.data.msg, 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ } else {
+ let h = {};
+ if(that.page==1) h.noData = 1;
+ h.loadMore = false;
+ h.noMore = false;
+ h.loadText = "没有更多记录了~";
+ that.setData( h )
+ }
+ wx.hideLoading();
+ }
+ })
+ },
+
+ callPhone: function(e){
+ var phoneNumber = e.currentTarget.dataset.phone;
+ phoneNumber && wx.makePhoneCall({
+ phoneNumber: phoneNumber
+ });
+ },
+
+ hideExpModal: function(){
+ this.setData({
+ showExpModal: false
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (!this.data.loadMore) return false;
+ this.getData();
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/supply/orderManage.json b/eaterplanet_ecommerce/moduleB/supply/orderManage.json
new file mode 100644
index 0000000..d8e1850
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/orderManage.json
@@ -0,0 +1,14 @@
+{
+ "navigationBarTitleText": "订单管理",
+ "navigationBarBackgroundColor": "#FE8464",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-img": "../../components/img/index",
+ "i-load-more": "../../components/load-more/index",
+ "i-empty": "../../components/empty/index",
+ "i-fixed-bottom": "../../components/fixed-bottom/index",
+ "i-modal": "../../components/modal/index",
+ "i-card": "../../components/card/index",
+ "i-select-rider": "components/selectRider"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/orderManage.wxml b/eaterplanet_ecommerce/moduleB/supply/orderManage.wxml
new file mode 100644
index 0000000..acd0d69
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/orderManage.wxml
@@ -0,0 +1,103 @@
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 订单编号:{{item.order_num_alias}}
+ {{item.status_name}}
+
+
+
+ 收货人信息:{{item.shipping_name}} {{item.shipping_tel}}
+ 联系收货人
+
+
+
+
+
+
+ {{goods.name}}
+ ¥{{goods.price}} x{{goods.quantity}}
+ 小计:{{goods.total}}
+
+
+
+
+
+
+
+
+
+
+ 暂无订单~
+
+
+
+
+
+
+
+ 订单发货
+
+ 联系人:{{expInfo.shipping_name}}
+ 收货地址:{{expInfo.shipping_name}}
+
+
+
+ 物流公司:{{expInfo.express_list[index].name}}
+
+
+
+
+ 物流单号:
+
+
+
+
+ 取消
+ 确认发货
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/supply/orderManage.wxss b/eaterplanet_ecommerce/moduleB/supply/orderManage.wxss
new file mode 100644
index 0000000..ae5108b
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/orderManage.wxss
@@ -0,0 +1,61 @@
+@import 'tabbar.wxss';
+@import 'goodsManage.wxss';
+
+.orderItem {
+ margin: 20rpx auto;
+ font-size: 28rpx;
+}
+
+.red {
+ font-weight: 500;
+}
+
+.red.black {
+ color: #aaa;
+}
+
+.call {
+ padding: 5rpx 15rpx;
+ border-radius: 10rpx;
+ font-size: 24rpx;
+}
+
+.footer {
+ justify-content: flex-end;
+}
+
+.footer .btn {
+ padding: 4rpx 15rpx;
+ margin-left: 20rpx;
+ border-radius: 10rpx;
+ color: #fff;
+}
+
+.exp-modal {
+ width: 80%;
+ overflow: hidden;
+}
+
+.btn {
+ position: relative;
+}
+
+.btn:last-child::before {
+ content: "";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ top: 0;
+ border-left: 1px solid #e5e5e5;
+ transform-origin: 0 0;
+ transform: scaleX(0.5);
+}
+
+.exp-modal .ipt {
+ border: 1rpx solid #e5e5e5;
+ padding: 10rpx;
+}
+
+.search-bar {
+ font-size: 28rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/static/orderMixin.js b/eaterplanet_ecommerce/moduleB/supply/static/orderMixin.js
new file mode 100644
index 0000000..7e067b1
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/static/orderMixin.js
@@ -0,0 +1,218 @@
+let app = getApp();
+
+module.exports = {
+ data: {
+ index: 0,
+ shipping_no: '',
+ expInfo: '',
+ showRaderList: false,
+ selectOrderId: ''
+ },
+
+ actionConfirm: function(content) {
+ return new Promise((resolve, reject)=>{
+ wx.showModal({
+ title: '提示',
+ content,
+ showCancel: true,
+ success: (result) => {
+ if (result.confirm) {
+ resolve();
+ } else if (result.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ })
+ },
+
+ /**
+ * 获取快递列表
+ * @param {*} e
+ */
+ getExpList: function(e) {
+ this.actionConfirm('确认此订单发货吗?').then(()=>{
+ let token = wx.getStorageSync('token');
+ let order_id = e.currentTarget.dataset.id || '';
+ wx.showLoading();
+ app.util.ProReq('supplymobile.get_express_list', {token, order_id}).then(res=>{
+ //快递列表
+ let expInfo = { order_id, ...res.data };
+ this.setData({
+ expInfo,
+ showExpModal: true
+ })
+ //弹窗
+ }).catch(err=>{
+ app.util.message(err.msg, '', 'error');
+ })
+ })
+ },
+
+ bindPickerChange: function(e) {
+ console.log('picker发送选择改变,携带值为', e.detail.value)
+ this.setData({
+ index: e.detail.value
+ })
+ },
+
+ bindKeyInput: function (e) {
+ this.setData({
+ shipping_no: e.detail.value
+ })
+ },
+
+ /**
+ * 快递确认配送
+ * @param {*} order_id
+ */
+ expSend: function(e) {
+ console.log(e)
+ let token = wx.getStorageSync('token');
+ let order_id = e.currentTarget.dataset.id || '';
+ let { expInfo, index, shipping_no } = this.data;
+ let express_id = expInfo && expInfo.express_list[index].id || '';
+ if(express_id=='') {
+ wx.showToast({
+ title: '请选择物流公司',
+ icon: 'none'
+ })
+ return;
+ }
+ if(shipping_no=='') {
+ wx.showToast({
+ title: '请输入物流单号',
+ icon: 'none'
+ })
+ return;
+ }
+ wx.showLoading();
+ app.util.ProReq('supplymobile.do_send_order_express', {token, order_id, express_id, shipping_no}).then(res=>{
+ wx.showToast({ title: '确认配送成功' })
+ this.setData({ shipping_no: '', showExpModal: false, index: 0, expInfo: '' })
+ this.initFn();
+ }).catch(err=>{
+ app.util.message(err.msg, '', 'error');
+ })
+ },
+
+ /**
+ * 团长确认配送
+ * @param {*} e
+ */
+ tuanSend: function(e) {
+ this.actionConfirm('确认此订单发货吗?').then(()=>{
+ let token = wx.getStorageSync('token');
+ let order_id = e.currentTarget.dataset.id || '';
+ wx.showLoading();
+ order_id && app.util.ProReq('supplymobile.supply_do_opsend_tuanz', {token, order_id}).then(res=>{
+ wx.showToast({ title: '确认配送成功' })
+ this.initFn();
+ }).catch(err=>{
+ app.util.message(err.msg, '', 'error');
+ })
+ });
+ },
+
+ /**
+ * 同城配送确认配送
+ * @param {*} e
+ */
+ localtownSend: function(e) {
+ this.actionConfirm('确认此订单发货吗?').then(()=>{
+ let token = wx.getStorageSync('token');
+ let order_id = e.currentTarget.dataset.id || '';
+ wx.showLoading();
+ order_id && app.util.ProReq('order.order_delivery', {token, order_id, is_supply: 1}).then(res=>{
+ wx.showToast({ title: '确认配送成功' })
+ this.initFn();
+ }).catch(err=>{
+ app.util.message(err.msg, '', 'error');
+ })
+ });
+ },
+
+ /**
+ * 确认送达团长
+ * @param {*} e
+ */
+ tuanOver: function(e) {
+ this.actionConfirm('确认送达团长吗?').then(()=>{
+ let token = wx.getStorageSync('token');
+ let order_id = e.currentTarget.dataset.id || '';
+ wx.showLoading();
+ order_id && app.util.ProReq('supplymobile.supply_do_tuanz_over', {token, order_id}).then(res=>{
+ this.initFn();
+ }).catch(err=>{
+ app.util.message(err.msg, '', 'error');
+ })
+ });
+ },
+
+ /**
+ * 团长/快递确认收货 最后一步
+ * @param {*} e
+ */
+ opreceive: function(e) {
+ this.actionConfirm('确认订单收货吗?').then(()=>{
+ let token = wx.getStorageSync('token');
+ let order_id = e.currentTarget.dataset.id || '';
+ wx.showLoading();
+ order_id && app.util.ProReq('supplymobile.supply_do_opreceive', {token, order_id}).then(res=>{
+ wx.showToast({ title: '确认收货成功' })
+ this.initFn();
+ }).catch(err=>{
+ app.util.message(err.msg, '', 'error');
+ })
+ });
+ },
+
+ goLink: function (event) {
+ let link = event.currentTarget.dataset.link;
+ var pages_all = getCurrentPages();
+ if (pages_all.length > 3) {
+ wx.redirectTo({
+ url: link
+ })
+ } else {
+ wx.navigateTo({
+ url: link
+ })
+ }
+ },
+
+ /**
+ * 确认付款
+ */
+ confirmPay: function(e) {
+ this.actionConfirm('确认此订单已付款吗?').then(()=>{
+ let token = wx.getStorageSync('token');
+ let order_id = e.currentTarget.dataset.id || '';
+ wx.showLoading();
+ order_id && app.util.ProReq('order.order_pay', {token, order_id, is_supply:1}).then(res=>{
+ wx.showToast({ title: '付款成功' })
+ this.initFn();
+ }).catch(err=>{
+ app.util.message(err.msg, '', 'error');
+ })
+ });
+ },
+
+ /**
+ * 显示配送员列表
+ */
+ chooseRider: function(e) {
+ let selectOrderId = e.currentTarget.dataset.id || '';
+ this.setData({
+ selectOrderId,
+ showRaderList: true
+ })
+ },
+
+ closeRiderList: function() {
+ this.setData({
+ selectOrderId: '',
+ showRaderList: false
+ })
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/supply/tabbar.wxml b/eaterplanet_ecommerce/moduleB/supply/tabbar.wxml
new file mode 100644
index 0000000..41e1a27
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/tabbar.wxml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ 管理首页
+
+
+
+ 商品管理
+
+
+
+ 订单管理
+
+
+
+
+ 资金管理
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/supply/tabbar.wxss b/eaterplanet_ecommerce/moduleB/supply/tabbar.wxss
new file mode 100644
index 0000000..aeab0a5
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/supply/tabbar.wxss
@@ -0,0 +1,35 @@
+@import "/icon.wxss";
+@import "/common.wxss";
+
+.tabbar {
+ line-height: 1;
+}
+
+.tabbar.active {
+ color: #fe8464;
+}
+
+.tabbar .iconfont {
+ font-size: 44rpx;
+}
+
+.tabbar-home {
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-end;
+}
+
+.tabbar-home .iconfont {
+ display: inline-block;
+ position: absolute;
+ background: #fe8464;
+ border-radius: 50%;
+ width: 100rpx;
+ height: 100rpx;
+ line-height: 100rpx;
+ border: 10rpx solid #fff;
+ top: -50rpx;
+ left: 50%;
+ margin-left: -60rpx;
+ color: #fff;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/virtualcard/btn.png b/eaterplanet_ecommerce/moduleB/virtualcard/btn.png
new file mode 100644
index 0000000..8c40dba
Binary files /dev/null and b/eaterplanet_ecommerce/moduleB/virtualcard/btn.png differ
diff --git a/eaterplanet_ecommerce/moduleB/virtualcard/exchange.js b/eaterplanet_ecommerce/moduleB/virtualcard/exchange.js
new file mode 100644
index 0000000..6746068
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/virtualcard/exchange.js
@@ -0,0 +1,147 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ list: [],
+ tab_index: 1,
+ virtcard_publish: ''
+ },
+ listPage: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getData();
+ },
+
+ getData: function () {
+ app.util.ProReq('virtualcard.index', {}).then(res => {
+ let { virtcard_publish } = res.data;
+ this.setData({
+ virtcard_publish
+ })
+ })
+ },
+
+ preFormSubmit: function(e) {
+ wx.showLoading();
+ this.formSubmit(e);
+ },
+ formSubmit: util.debounce(function(e) {
+ console.log('form发生了submit事件,携带数据为:', e[0].detail.value)
+ let token = wx.getStorageSync('token');
+ let code_sn = e[0].detail.value.code;
+ app.util.ProReq('virtualcard.subCodeSn', { token, code_sn }).then(res => {
+ app.util.message(res.message || '兑换成功', '', 'error');
+
+ }).catch(err => {
+ console.log(err)
+ err.code==1&&app.util.message(err.message || '请先登录', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ err.code==2&&app.util.message(err.message || '兑换失败,请重试', '', 'error');
+ })
+ }),
+
+ tabchange: function (e) {
+ var index = e.currentTarget.dataset.index;
+ this.listPage = 1;
+ this.setData({
+ list: [],
+ tab_index: index
+ })
+ if(index==2) {
+ this.getList();
+ }
+ },
+
+ getList() {
+ let _this = this;
+ let token = wx.getStorageSync('token');
+ let data = {
+ token,
+ pageNum: _this.listPage
+ };
+ wx.showLoading();
+ app.util.ProReq('virtualcard.loadUseRecord', data)
+ .then(res => {
+ _this.listLoading = false;
+ wx.stopPullDownRefresh();
+ let h = {};
+ if (_this.listPage == 1) {
+ h.list = res.data;
+ res.data.length==0?(h.noData=true):'';
+ } else {
+ h.list = [..._this.data.list, ...res.data];
+ }
+ if (res.data.length > 0) {
+ _this.listPage += 1;
+ } else {
+ _this.listPage = 0;
+ }
+ if(res.data.length < 10) {
+ h.noMore = true;
+ }
+ this.setData(h);
+ wx.hideLoading();
+ })
+ .catch(err => {
+ wx.hideLoading();
+ if(err.code==1) {
+ app.util.message(err.message || '请先登录', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ } else {
+ let h = {};
+ _this.listPage==1?(h.noData=true):'';
+ this.setData({
+ listLoading: false,
+ noMore: true,
+ ...h,
+ })
+ }
+ wx.stopPullDownRefresh();
+ });
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if(!this.data.noData&&!this.data.noMore) {
+ this.getList();
+ }
+ },
+
+ handleRuleModal() {
+ this.setData({
+ showRulesPopup: !this.data.showRulesPopup
+ })
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/virtualcard/exchange.json b/eaterplanet_ecommerce/moduleB/virtualcard/exchange.json
new file mode 100644
index 0000000..dc49041
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/virtualcard/exchange.json
@@ -0,0 +1,11 @@
+{
+ "navigationBarTitleText": "兑换中心",
+ "navigationBarTextStyle": "black",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-empty": "../../components/empty/index",
+ "i-modal": "../../components/modal/index",
+ "parser":"../../components/parser/parser"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/virtualcard/exchange.wxml b/eaterplanet_ecommerce/moduleB/virtualcard/exchange.wxml
new file mode 100644
index 0000000..781138e
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/virtualcard/exchange.wxml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+ 兑换礼品
+
+
+ 兑换记录
+
+
+
+
+
+
+
+
+
+
+ {{item.code_sn}}
+ 兑换金额:¥{{item.money_format}}
+ 兑换时间:{{item.adddate}}
+
+ 已兑换
+
+ 暂无记录~
+
+
+
+
+
+兑换说明
+
+
+
+
+ 兑换说明
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/virtualcard/exchange.wxss b/eaterplanet_ecommerce/moduleB/virtualcard/exchange.wxss
new file mode 100644
index 0000000..efc2360
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/virtualcard/exchange.wxss
@@ -0,0 +1,200 @@
+.tabs {
+ box-sizing: border-box;
+ position: relative;
+ overflow: hidden;
+ zoom: 1;
+ color: #666;
+}
+
+.tabs:after,
+.tabs:before {
+ content: " ";
+ display: table;
+}
+
+.tabs:after {
+ clear: both;
+ visibility: hidden;
+ font-size: 0;
+ height: 0;
+}
+
+.tabs-bar {
+ outline: none;
+ width: 100%;
+ background-color: #fff;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 10;
+}
+
+.tabs-link-bar {
+ z-index: 1;
+ position: absolute;
+ left: 0;
+ bottom: 2rpx;
+ box-sizing: border-box;
+ height: 2rpx;
+ background-color: #ff5777;
+ transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+ transform-origin: 0 0;
+}
+
+.tabs-bar {
+ border-bottom: 1px solid #d9d9d9;
+ box-sizing: border-box;
+}
+
+.tabs-nav--container {
+ overflow: hidden;
+ font-size: 14rpx;
+ line-height: 1.5;
+ box-sizing: border-box;
+ position: relative;
+ white-space: nowrap;
+ margin-bottom: -1px;
+ zoom: 1;
+}
+
+.tabs-nav--container:after,
+.tabs-nav--container:before {
+ content: " ";
+ display: table;
+}
+
+.tabs-nav--container:after {
+ clear: both;
+ visibility: hidden;
+ font-size: 0;
+ height: 0;
+}
+
+.tabs-tab-btn-disabled {
+ cursor: not-allowed;
+}
+
+.tabs-tab-btn-disabled,
+.tabs-tab-btn-disabled:hover {
+ color: #ccc;
+}
+
+.tabs-nav--wrap {
+ overflow: hidden;
+ margin-bottom: -1rpx;
+}
+
+.tabs-nav {
+ display: flex;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding-left: 0;
+ transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
+ position: relative;
+ margin: 0;
+ list-style: none;
+}
+
+.tabs-nav:after,
+.tabs-nav:before {
+ display: table;
+ content: " ";
+}
+
+.tabs-nav:after {
+ clear: both;
+}
+
+.tabs-nav .tabs-tab-disabled {
+ pointer-events: none;
+ cursor: default;
+ color: #ccc;
+}
+
+.tabs-nav .tabs-tab {
+ flex: 1;
+ display: block;
+ height: 90rpx;
+ line-height: 90rpx;
+ margin: 0 12rpx;
+ box-sizing: border-box;
+ position: relative;
+ transition: color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+ cursor: pointer;
+ text-decoration: none;
+ text-align: center;
+ font-size: 30rpx;
+ color: #333;
+}
+
+.tabs-nav .tabs-tab:active {
+ color: #f13e3a;
+}
+
+.tabs-nav .tabs-tab .anticon {
+ width: 14rpx;
+ height: 14rpx;
+ margin-right: 8rpx;
+}
+
+.tabs-nav .tabs-tab-active {
+ color: #ff4936;
+ border-bottom: 6rpx solid #ff4936;
+}
+
+.tabs.tabs-card>.tabs-bar .tabs-link-bar {
+ visibility: hidden;
+}
+
+.tabs.tabs-card>.tabs-bar .tabs-tab {
+ margin: 0;
+ border: 1px solid #d9d9d9;
+ border-bottom: 0;
+ border-radius: 6rpx 6rpx 0 0;
+ transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+ background: #f9f9f9;
+ margin-right: 2rpx;
+}
+
+.tabs.tabs-card>.tabs-bar .tabs-tab-active {
+ background: #fff;
+ transform: translateZ(0);
+ border-color: #d9d9d9;
+ color: #f13e3a;
+}
+
+.tabs.tabs-card>.tabs-bar .tabs-nav--wrap {
+ margin-bottom: 0;
+}
+
+.list {
+ padding-top: 0rpx;
+}
+
+.ipt {
+ border: 1rpx solid #e5e5e5;
+ height: 72rpx;
+ line-height: 72rpx;
+ padding: 0 20rpx;
+ box-sizing: border-box;
+}
+
+.btn {
+ line-height: 72rpx;
+ border: 0;
+ border-radius: 20rpx;
+ font-size: 32rpx;
+ background-color: #fe8464;
+ color: #fff;
+}
+
+button.btn::after {
+ content: none;
+}
+
+.fixed-btn {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 10%;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/virtualcard/index.js b/eaterplanet_ecommerce/moduleB/virtualcard/index.js
new file mode 100644
index 0000000..c805322
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/virtualcard/index.js
@@ -0,0 +1,254 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ needAuth: false,
+ virtualcard_layout: '',
+ virtcard_publish: '',
+ virtcard_top_banner: '',
+ share_img: '',
+ share_title: '',
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: [],
+ },
+ pageNum: 1,
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ onLoad: function (options) {
+ this.getData();
+ this.getList();
+ },
+
+ onShow: function () {
+ let that = this;
+ util.check_login_new().then((res) => {
+ if(res) {
+ that.setData({ needAuth: false })
+ } else {
+ this.setData({ needAuth: true });
+ }
+ })
+ },
+
+ authSuccess: function () {
+ let that = this;
+ this.pageNum = 1;
+ this.setData({
+ slider_list: [],
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: []
+ }, () => {
+ that.getData();
+ that.getList();
+ })
+ },
+
+ authModal: function () {
+ if (this.data.needAuth) {
+ this.setData({ showAuthModal: !this.data.showAuthModal });
+ return false;
+ }
+ return true;
+ },
+
+ getData: function () {
+ app.util.ProReq('virtualcard.index', {}).then(res => {
+ let { virtcard_top_banner, virtcard_share_img, virtcard_share_title, virtualcard_layout, virtcard_publish, virtualcard_name_modify } = res.data;
+ wx.setNavigationBarTitle({
+ title: virtualcard_name_modify || '礼品卡中心',
+ })
+ this.setData({
+ virtualcard_layout,
+ virtcard_publish,
+ virtcard_top_banner,
+ share_img: virtcard_share_img,
+ share_title: virtcard_share_title
+ })
+ })
+ },
+
+ /**
+ * 获取商品列表
+ */
+ getList: function () {
+ let that = this;
+ let token = wx.getStorageSync('token');
+ let community = wx.getStorageSync('community');
+ let head_id = community.communityId || 0;
+
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'virtualcard.load_goods_list',
+ pageNum: this.pageNum,
+ token,
+ head_id,
+ pre_page: 10
+ },
+ dataType: 'json',
+ success: function (res) {
+ wx.hideLoading();
+ wx.stopPullDownRefresh();
+ if (res.data.code == 0) {
+ let oldRushList = that.data.rushList;
+ if (that.pageNum == 1) oldRushList = [];
+
+ let h = {}, list = res.data.list;
+ if (that.pageNum == 1 && list.length == 0) h.showEmpty = true;
+ list = that.calcEndTime(list);
+ let rushList = oldRushList.concat(list);
+ let rdata = res.data;
+ let reduction = { full_money: rdata.full_money, full_reducemoney: rdata.full_reducemoney, is_open_fullreduction: rdata.is_open_fullreduction }
+ h.rushList = rushList;
+ h.reduction = reduction;
+ h.loadOver = true;
+ let loadMore = that.data.loadMore;
+ if(res.data.list.length<10) { loadMore = false }
+ h.loadMore = loadMore;
+ h.loadText = loadMore ? "加载中..." : "没有更多商品了~";
+ // h.pintuan_show_type = rdata.pintuan_show_type;
+ that.setData(h, function () {
+ that.pageNum += 1;
+ })
+ } else if (res.data.code == 1) {
+ let s = { loadMore: false }
+ if (that.pageNum == 1) s.showEmpty = true;
+ that.setData(s);
+ } else if (res.data.code == 2) {
+ //no login
+ that.setData({ needAuth: true })
+ }
+ }
+ })
+ },
+
+ calcEndTime: function(list) {
+ var timestamp = Date.parse(new Date())/1000;
+ let newList = [];
+ if(Object.keys(list).length) {
+ list.forEach(item=>{
+ (item.end_time 0) {
+ let url = slider_list[idx].link;
+ let type = slider_list[idx].linktype;
+ if (util.checkRedirectTo(url, needAuth)) {
+ this.authModal();
+ return;
+ }
+ if (type == 0) {
+ // 跳转webview
+ url && wx.navigateTo({ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url) })
+ } else if (type == 1) {
+ if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
+ url && wx.switchTab({ url: url })
+ } else {
+ url && wx.navigateTo({ url: url })
+ }
+ } else if (type == 2) {
+ // 跳转小程序
+ let appid = slider_list[idx].appid;
+ appid && wx.navigateToMiniProgram({
+ appId: slider_list[idx].appid,
+ path: url,
+ extraData: {},
+ envVersion: 'release',
+ success(res) {
+ // 打开成功
+ },
+ fail(error) {
+ console.log(error)
+ }
+ })
+ } else if (type == 6) {
+ //领券
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/moduleA/coupon/getCoupon?id='+url
+ })
+ }
+ }
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.getData();
+ let that = this;
+ this.pageNum = 1;
+ this.setData({
+ loadMore: true,
+ loadText: "加载中...",
+ loadOver: false,
+ showEmpty: false,
+ rushList: []
+ }, () => {
+ that.getList();
+ })
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ console.log('这是我的底线');
+ this.data.loadMore && (this.setData({ loadOver: false }), this.getList());
+ },
+
+ goLink: function(event) {
+ let url = event.currentTarget.dataset.link;
+ url && wx.navigateTo({ url })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var member_id = wx.getStorageSync('member_id');
+ let { share_title, share_img } = this.data;
+ return {
+ title: share_title,
+ path: "eaterplanet_ecommerce/moduleB/presale/index?share_id=" + member_id,
+ imageUrl: share_img,
+ success: function () { },
+ fail: function () { }
+ };
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/virtualcard/index.json b/eaterplanet_ecommerce/moduleB/virtualcard/index.json
new file mode 100644
index 0000000..7c8edc2
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/virtualcard/index.json
@@ -0,0 +1,13 @@
+{
+ "navigationBarTitleText": "礼品卡中心",
+ "navigationBarTextStyle": "black",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "enablePullDownRefresh": true,
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-spu-col": "../components/virtualcard-goodsone",
+ "i-spu-row": "../components/virtualcard-goodsrow",
+ "i-new-auth": "../../components/new-auth/index",
+ "i-img": "../../components/img/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/virtualcard/index.wxml b/eaterplanet_ecommerce/moduleB/virtualcard/index.wxml
new file mode 100644
index 0000000..ad8bf7f
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/virtualcard/index.wxml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂时没有商品
+
+
+
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/virtualcard/index.wxss b/eaterplanet_ecommerce/moduleB/virtualcard/index.wxss
new file mode 100644
index 0000000..97ad4bb
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/virtualcard/index.wxss
@@ -0,0 +1,7 @@
+@import "../presale/index.wxss";
+
+.fixed-btn {
+ position: fixed;
+ right: 20rpx;
+ bottom: 30%;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/details.js b/eaterplanet_ecommerce/moduleB/writeoff/details.js
new file mode 100644
index 0000000..33b03e6
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/details.js
@@ -0,0 +1,232 @@
+var app = getApp();
+var canHexiao = true;
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ salesroom_id: '',
+ hxNum: 1
+ },
+ salesroom_id: '',
+ code: '',
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let code = options.code || '';
+ this.code = code;
+ this.salesroom_id = options.salesroom_id || '';
+ this.getHexiaoInfo(code);
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ actionConfirm: function(content) {
+ return new Promise((resolve, reject)=>{
+ wx.showModal({
+ title: '提示',
+ content,
+ showCancel: true,
+ success: (result) => {
+ if (result.confirm) {
+ resolve();
+ } else if (result.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ })
+ },
+
+ getHexiaoInfo: function(hexiao_volume_code) {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('hexiao.hexiao_order_info', { token, hexiao_volume_code }).then(res => {
+ let { orders, order_goods_count, order_goods_saleshexiao_list } = res.data;
+ this.setData({
+ orders, order_goods_count, order_goods_saleshexiao_list
+ })
+ }).catch(err => {
+ console.log(err)
+ wx.showModal({
+ title: '提示',
+ content: err.msg || '请求出错',
+ showCancel: false,
+ confirmColor: '#ff5041',
+ complete: function() {
+ app.util.navigateBack({});
+ }
+ });
+ })
+ },
+
+ goHexiao: function(event) {
+ let hexiao_id = event.currentTarget.dataset.id || '';
+ let type = event.currentTarget.dataset.type || 0;
+ let token = wx.getStorageSync('token');
+ let salesroom_id = this.salesroom_id;
+ let data = { token, hexiao_id, salesroom_id };
+ if(type==0) {
+ // 按订单核销
+ if(!canHexiao) return;
+ canHexiao = false;
+ this.orderHexiao(data);
+ } else {
+ // 按次数核销 弹窗显示具体信息
+ this.getNumHexiaoInfo(data);
+ }
+ },
+
+ /**
+ * 获取按次数核销信息
+ * @param {*} data
+ */
+ getNumHexiaoInfo: function(data){
+ wx.showLoading();
+ app.util.ProReq('hexiao.get_hxgoods_bytimes', data).then(res => {
+ wx.hideLoading();
+ let { hexiao_record_list, order_goods_info, saleshexiao_info } = res.data;
+ this.setData({ hexiao_record_list, order_goods_info, saleshexiao_info, showHexiaoModal: true })
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '请求出错', '', 'error');
+ })
+ },
+
+ /**
+ * 按订单核销
+ * @param {*} data
+ */
+ orderHexiao: function(data) {
+ wx.showLoading();
+ app.util.ProReq('hexiao.hx_order_goods', data).then(res => {
+ canHexiao = true;
+ app.util.message('核销成功', '', 'error');
+ this.getHexiaoInfo(this.code);
+ }).catch(err => {
+ console.log(err)
+ canHexiao = true;
+ app.util.message(err.msg || '请求出错', '', 'error');
+ })
+ },
+
+ /**
+ * 按次数核销
+ * @param {*} data
+ */
+ numHexiao: function(event) {
+ let hexiao_id = event.currentTarget.dataset.id || '';
+ let token = wx.getStorageSync('token');
+ let salesroom_id = this.salesroom_id;
+ let hx_times = this.data.hxNum;
+ let data = { token, hexiao_id, salesroom_id, hx_times };
+ wx.showLoading();
+ app.util.ProReq('hexiao.hx_order_goods_bytimes', data).then(res => {
+ wx.hideLoading();
+ this.handleHexiaoModal();
+ app.util.message('核销成功', '', 'error');
+ this.getHexiaoInfo(this.code);
+ }).catch(err => {
+ console.log(err)
+ wx.hideLoading();
+ app.util.message(err.msg || '请求出错', '', 'error');
+ })
+ },
+
+ /**
+ * 全部订单核销
+ * @param {*} event
+ */
+ allHexiao: function(event) {
+ this.actionConfirm('确认全部核销').then(()=>{
+ let order_goods_saleshexiao_list = this.data.order_goods_saleshexiao_list;
+ let order_ids = [];
+ order_goods_saleshexiao_list.map(item=>{
+ (item.is_hexiao_over==0)&&order_ids.push(item.order_id)
+ })
+ let order_id = order_ids.join(',');
+ let token = wx.getStorageSync('token');
+ let salesroom_id = this.salesroom_id;
+ app.util.ProReq('hexiao.all_hx_order', { token, order_id, salesroom_id }).then(res => {
+ this.getHexiaoInfo(this.code);
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '请求出错', '', 'error');
+ })
+ });
+ },
+
+ /**
+ * 单商品按次数全部核销
+ */
+ allHexiaoBytimes: function(event) {
+ this.actionConfirm('确认全部核销').then(()=>{
+ let hexiao_id = event.currentTarget.dataset.id || '';
+ let token = wx.getStorageSync('token');
+ let salesroom_id = this.salesroom_id;
+ app.util.ProReq('hexiao.all_hx_order_goods_bytimes', { token, hexiao_id, salesroom_id }).then(res => {
+ this.setData({showHexiaoModal: false});
+ this.getHexiaoInfo(this.code);
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '请求出错', '', 'error');
+ })
+ });
+ },
+
+ /**
+ * 次数核销弹窗
+ */
+ handleHexiaoModal: function() {
+ this.setData({
+ showHexiaoModal: !this.data.showHexiaoModal,
+ hxNum: 1
+ })
+ },
+
+ /**
+ * 输入框改变监控
+ * @param {*} t
+ */
+ changeNumber: function (t) {
+ var e = t.detail;
+ console.log(e)
+ e&&this.setData({ hxNum: e.value })
+ },
+
+ /**
+ * 输入极值限制
+ * @param {*} t
+ */
+ outOfMax: function (t) {
+ // var e = t.detail;
+ wx.showToast({
+ title: "不能再多了~",
+ icon: "none"
+ })
+ }
+})
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/details.json b/eaterplanet_ecommerce/moduleB/writeoff/details.json
new file mode 100644
index 0000000..f433760
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/details.json
@@ -0,0 +1,10 @@
+{
+ "navigationBarTitleText": "核销信息",
+ "navigationBarBackgroundColor": "#FFFFFF",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-input-number": "../../components/input-number/index",
+ "i-modal": "../../components/modal/index",
+ "i-cashon_delivery": "../../components/cashon_delivery/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/details.wxml b/eaterplanet_ecommerce/moduleB/writeoff/details.wxml
new file mode 100644
index 0000000..809d952
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/details.wxml
@@ -0,0 +1,88 @@
+
+
+
+ 用户信息
+
+
+
+ 昵称:{{orders.username}}
+ 收货人:{{orders.shipping_name}}
+ 手机号:{{orders.shipping_tel}}
+ 商品数量:{{order_goods_count}}
+
+
+
+
+
+ 核销内容
+
+ 全部核销
+
+
+
+
+
+
+
+
+ {{item.goods_name}}
+ 货到付款
+
+ {{item.option_sku}}
+ x {{item.quantity}}
+
+
+
+ 订单编号:{{item.order_num_alias}}
+ 核销日期:{{item.effect_begin_time}}~{{item.effect_begin_time}}
+ 核销类型:订单核销
+
+
+ 核销类型:按次核销
+ 总核销:{{item.hexiao_count}}次
+ 已核销:{{item.has_hexiao_count}}次
+ 可核销:{{item.remain_hexiao_count}}次
+
+ 订单状态:{{item.is_refund==1?'已退款':'部分退款'}}
+ 已退款
+ 已核销
+ 核销
+
+
+
+
+
+
+
+
+ 商品核销
+
+
+
+
+
+
+ {{order_goods_info.goods_name}}
+ x {{order_goods_info.quantity}}
+
+
+ 全部核销
+
+
+
+
+ 使用记录
+
+ 核销次数:{{item.hexiao_count}}
+ 核销时间:{{item.hx_time}}
+
+
+
+
+
+ 使用次数(剩余 {{saleshexiao_info.remain_hexiao_count}} 次)
+
+
+ 确认使用
+
+
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/details.wxss b/eaterplanet_ecommerce/moduleB/writeoff/details.wxss
new file mode 100644
index 0000000..f69a8cf
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/details.wxss
@@ -0,0 +1,32 @@
+
+.goodsimg {
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 20rpx;
+}
+
+.item {
+ padding-bottom: 20rpx;
+ margin-bottom: 20rpx;
+}
+
+.state {
+ height: 64rpx;
+ line-height: 64rpx;
+ text-align: center;
+ color: #ffffff;
+}
+
+.sku-card .icon-guanbi {
+ position: absolute;
+ right: 30rpx;
+ top: 30rpx;
+ font-size: 40rpx;
+}
+
+.allbtn {
+ background: #ff5344;
+ color: #ffffff;
+ padding: 8rpx 15rpx;
+ border-radius: 10rpx;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/index.js b/eaterplanet_ecommerce/moduleB/writeoff/index.js
new file mode 100644
index 0000000..e1a77ef
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/index.js
@@ -0,0 +1,121 @@
+var app = getApp();
+var util = require('../../utils/util.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ salesroomIdx: 0,
+ salesroom_list: [],
+ today_saleshexiao_count: 0,
+ saleshexiao_record_list: []
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.getData()
+ },
+
+ getData: function () {
+ let token = wx.getStorageSync('token');
+ app.util.ProReq('hexiao.hexiao_manage', { token }).then(res => {
+ let { salesroom_list, today_saleshexiao_count, saleshexiao_record_list, salesroom_member } = res.data;
+ let last_salesroom_id = salesroom_member.last_salesroom_id || '';
+ let salesroomIdx = 0;
+ if(salesroom_list) {
+ salesroomIdx = salesroom_list.findIndex(item=>item.id == last_salesroom_id);
+ }
+ this.setData({
+ salesroom_list, today_saleshexiao_count, saleshexiao_record_list,salesroomIdx: salesroomIdx>=0?salesroomIdx:0
+ })
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '请求出错', 'switchTo:/eaterplanet_ecommerce/pages/user/me', 'error');
+ })
+ },
+
+ handleHexiaoModal: function() {
+ this.setData({
+ showHexiaoModal: !this.data.showHexiaoModal
+ })
+ },
+
+ preFormSubmit: function(e) {
+ wx.showLoading();
+ this.formSubmit(e);
+ },
+ formSubmit: util.debounce(function(e) {
+ console.log('form发生了submit事件,携带数据为:', e[0].detail.value)
+ let code = e[0].detail.value.code;
+ this.goDetails(code);
+ }),
+
+ goDetails: function(code) {
+ let salesroom_id = this.data.salesroom_list[this.data.salesroomIdx].id;
+ if(code) {
+ wx.navigateTo({
+ url: '/eaterplanet_ecommerce/moduleB/writeoff/details?code='+code+'&salesroom_id='+salesroom_id,
+ success: function(res) {
+ wx.hideLoading();
+ }
+ })
+ } else {
+ wx.showToast({
+ title: '请输入手机号/券码',
+ icon: 'none'
+ })
+ }
+ },
+
+ goScan: function() {
+ let that = this;
+ wx.scanCode({
+ success (res) {
+ console.log(res)
+ let codeStr = res.result || '';
+ let code = codeStr.split('_')[1];
+ that.goDetails(code);
+ }
+ })
+ },
+
+ changeMendian: function(e) {
+ let token = wx.getStorageSync('token');
+ let salesroomIdx = e.currentTarget.dataset.idx;
+ let salesroom_id = this.data.salesroom_list[salesroomIdx].id;
+ app.util.ProReq('hexiao.hexiao_change_salesroom', { token, salesroom_id }).then(res => {
+ this.setData({ salesroomIdx, showHexiaoModal: !this.data.showHexiaoModal })
+ }).catch(err => {
+ console.log(err)
+ app.util.message(err.msg || '切换失败,请重试', '', 'error');
+ })
+ }
+
+})
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/index.json b/eaterplanet_ecommerce/moduleB/writeoff/index.json
new file mode 100644
index 0000000..d0f67e4
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/index.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "到店核销",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar",
+ "i-modal": "../../components/modal/index"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/index.wxml b/eaterplanet_ecommerce/moduleB/writeoff/index.wxml
new file mode 100644
index 0000000..7198938
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/index.wxml
@@ -0,0 +1,103 @@
+
+
+
+
+ {{salesroom_list[salesroomIdx].room_name}}
+ 切换店铺
+
+
+
+
+ 今日核销(次)
+ 10
+
+
+ 累计核销(次)
+ 100
+
+
+
+
+
+
+ 核销人员
+
+ 5
+
+
+
+
+
+ 商品核销
+
+
+
+
+
+
+
+
+
+ 选择核销方式
+
+
+
+ 扫码核销
+
+
+
+
+
+
+ 今日核销记录({{today_saleshexiao_count}}个)
+
+
+
+ 操作员:{{item.smember_name}}
+ 订单编号:{{item.order_num_alias}}
+ 用户手机号:{{item.shipping_tel}}
+
+
+
+
+ {{item.goods_name}}
+
+ {{item.option_sku}} x{{item.quantity}}
+
+ 小计 ¥{{item.total}}
+ 共 {{item.hexiao_count}} 次
+ 核销类型:订单核销
+
+ 核销类型:按次核销;本次核销消耗{{item.hexiao_count2}}次
+
+
+
+
+
+ 暂无记录~
+
+
+
+
+
+
+ 门店选择
+
+
+
+ {{item.room_name}}
+ {{item.room_address}}
+
+
+
+
+
+
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/index.wxss b/eaterplanet_ecommerce/moduleB/writeoff/index.wxss
new file mode 100644
index 0000000..859cbd8
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/index.wxss
@@ -0,0 +1,120 @@
+.three {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.three-item {
+ position: relative;
+ flex: 1;
+ text-align: center;
+}
+
+.three-item::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 1rpx;
+ border-left: 1rpx solid #cfcfcf;
+}
+
+.three-item:first-child::before {
+ content: none;
+}
+
+.three-title {
+ color: #999;
+ font-size: 24rpx;
+}
+
+.three-money {
+ margin-top: 15rpx;
+ font-size: 38rpx;
+ font-weight: bold;
+}
+
+.item-main {
+ padding: 32rpx 40rpx;
+}
+
+.item-title {
+ height: 40rpx;
+ width: 400rpx;
+ color: #444;
+ font-size: 28rpx;
+ display: flex;
+ align-items: center;
+}
+
+.icon-right {
+ width: 12rpx;
+ height: 22rpx;
+}
+
+.ipt {
+ border: 1rpx solid #e5e5e5;
+ height: 72rpx;
+ line-height: 72rpx;
+ padding: 0 20rpx;
+ box-sizing: border-box;
+}
+
+.btn {
+ line-height: 72rpx;
+ border: 0;
+ border-radius: 0;
+ font-size: 32rpx;
+}
+
+button.btn::after {
+ content: none;
+}
+
+.scan {
+ margin-top: 30rpx;
+ height: 300rpx;
+ border: 1rpx solid #e5e5e5;
+ border-radius: 20rpx;
+}
+
+.icon-erweima1 {
+ width: 100rpx;
+ height: 100rpx;
+ line-height: 100rpx;
+ background: #f5f5f5;
+ border-radius: 50%;
+ text-align: center;
+ font-size: 44rpx;
+}
+
+.list .item {
+ margin-bottom: 20rpx;
+ padding-bottom: 20rpx;
+}
+
+.state {
+ height: 64rpx;
+ line-height: 64rpx;
+ text-align: center;
+ color: #ffffff;
+}
+
+.empty {
+ padding: 50rpx 0;
+}
+
+.goodsimg {
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 20rpx;
+}
+
+.changemendian {
+ margin: 0 40rpx;
+}
+
+.changehead {
+ margin: 30rpx 0;
+ }
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/member.js b/eaterplanet_ecommerce/moduleB/writeoff/member.js
new file mode 100644
index 0000000..6b15eb3
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/member.js
@@ -0,0 +1,82 @@
+// eaterplanet_ecommerce/moduleB/writeoff/member.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+ handlerGobackClick(delta) {
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ wx.navigateBack({
+ delta: delta
+ });
+ } else {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ }
+ },
+ handlerGohomeClick(url) {
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index'
+ });
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/member.json b/eaterplanet_ecommerce/moduleB/writeoff/member.json
new file mode 100644
index 0000000..7414c29
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/member.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "到店核销",
+ "usingComponents": {
+ "ep-navBar": "../../components/navigation-bar"
+ }
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/member.wxml b/eaterplanet_ecommerce/moduleB/writeoff/member.wxml
new file mode 100644
index 0000000..1655036
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/member.wxml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/moduleB/writeoff/member.wxss b/eaterplanet_ecommerce/moduleB/writeoff/member.wxss
new file mode 100644
index 0000000..5e42851
--- /dev/null
+++ b/eaterplanet_ecommerce/moduleB/writeoff/member.wxss
@@ -0,0 +1,37 @@
+
+.search-bar {
+ padding: 12rpx 25rpx;
+ background-color: #fff;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.search-box {
+ background-color: #f0f0f0;
+ height: 56rpx;
+ line-height: 56rpx;
+ border-radius: 28rpx;
+ color: #acacac;
+ display: flex;
+ align-content: center;
+}
+
+.search-icon {
+ position: absolute;
+ left: 20rpx;
+ margin-left: 25rpx;
+ margin-right: 12rpx;
+}
+
+.search-icon .iconfont {
+ font-size: 34rpx;
+ padding-top: 10rpx;
+}
+
+.search-box .ipt {
+ padding: 0 30rpx 0 60rpx;
+ line-height: 56rpx;
+ height: 56rpx;
+ width: 100%;
+ box-sizing: border-box;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/resource/css/excharge.wxss b/eaterplanet_ecommerce/resource/css/excharge.wxss
new file mode 100644
index 0000000..1cd4838
--- /dev/null
+++ b/eaterplanet_ecommerce/resource/css/excharge.wxss
@@ -0,0 +1,195 @@
+.top {
+ position: relative;
+ padding: 30rpx;
+ text-align: center;
+ background: #fff;
+}
+
+.money {
+ padding-top: 30rpx;
+}
+
+.record {
+ position: absolute;
+ top: 30rpx;
+ right: 30rpx;
+ color: #408ce2;
+}
+
+.yue {
+ font-size: 54rpx;
+ color: #000;
+ font-weight: bold;
+}
+
+.card {
+ margin-top: 20rpx;
+ padding: 30rpx;
+ background-color: #fff;
+}
+
+.tip {
+ font-size: 24rpx;
+ color: #666;
+ margin-top: 15rpx;
+}
+
+.flex-ipt {
+ position: relative;
+ display: flex;
+ font-size: 40rpx;
+ color: #000;
+ justify-content: center;
+ align-content: center;
+ overflow: hidden;
+ border-bottom: 2rpx solid #ececec;
+ align-items: center;
+}
+
+.flex-ipt .money {
+ font-size: 30rpx;
+ flex: 1;
+ padding: 20rpx 0;
+}
+
+.flex-ipt .bottom-line {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 0;
+ height: 4rpx;
+ background-color: #2facff;
+ transition: 200ms all ease-in;
+}
+
+.flex-ipt .bottom-line.ipt-focus {
+ width: 100%;
+}
+
+.btn {
+ margin: 50rpx 30rpx;
+ background-color: #4facfe;
+ color: #fff;
+ text-align: center;
+ line-height: 88rpx;
+ font-size: 30rpx;
+ border-radius: 5rpx;
+}
+
+button.btn::after {
+ border: none;
+}
+
+.btn.disable {
+ background-color: #4facfe;
+}
+
+button.btn[disabled] {
+ color: #fff!important;
+ background: #4facfe!important;
+ border-radius: 20rpx;
+}
+
+.desc {
+ padding: 0 30rpx;
+ line-height: 1.6;
+ font-size: 26rpx;
+ color: #666;
+}
+
+.desc .h2 {
+ font-size: 30rpx;
+ margin-bottom: 10rpx;
+}
+
+.sucess {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: space-around;
+ height: 100vh;
+ text-align: center;
+ background: #fff;
+}
+
+.sucess .applyPassImg {
+ width: 172rpx;
+ color: #ff758c;
+ margin-bottom: 40rpx;
+}
+
+.sucess .h1 {
+ font-size: 32rpx;
+ margin-bottom: 20rpx;
+ color: #4facfe;
+ font-weight: bold;
+}
+
+.sucess .p {
+ font-size: 28rpx;
+ color: #999;
+}
+
+.sucess .link-btn {
+ color: #4facfe;
+ font-size: 28rpx;
+ margin-top: 100rpx;
+}
+
+.radio-group {
+ margin-top: 40rpx;
+}
+
+.radio {
+ position: relative;
+ margin-right: 20rpx;
+ width: 38rpx;
+}
+
+.radio text {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+radio {
+ width: 38rpx;
+}
+
+radio .wx-radio-input {
+ border-radius: 50%;
+ width: 28rpx;
+ height: 28rpx;
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before {
+ border-radius: 50%;
+ width: 44rpx;
+ height: 44rpx;
+ line-height: 44rpx;
+ text-align: center;
+ font-size: 28rpx;
+ color: #fff;
+ background: #2facff;
+ border-color: #2facff;
+}
+
+.form-box {
+ margin-top: 30rpx;
+}
+
+.form-group {
+ margin-bottom: 20rpx;
+ font-size: 30rpx;
+}
+
+.form-ipt {
+ position: relative;
+ border: 1rpx solid #e5e5e5;
+ padding: 5rpx 10rpx;
+ line-height: 52rpx;
+}
+
+.getall {
+ font-size: 28rpx;
+ color: #408ce2;
+}
diff --git a/eaterplanet_ecommerce/resource/css/vip.wxss b/eaterplanet_ecommerce/resource/css/vip.wxss
new file mode 100644
index 0000000..13f5a8c
--- /dev/null
+++ b/eaterplanet_ecommerce/resource/css/vip.wxss
@@ -0,0 +1,22 @@
+.vip {
+ background: linear-gradient(to right, #e3c28c, #fdd2a7);
+ height: 76rpx;
+ padding: 0 20rpx;
+ font-size: 24rpx;
+ color: #72491d;
+ border-radius: 10rpx;
+ margin-top: 30rpx;
+}
+
+.vip .goright.iconfont {
+ font-size: 24rpx;
+}
+
+.vip-logo {
+ width: 30rpx;
+ height: 30rpx;
+}
+
+.vip-name {
+ align-items: center;
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/utils/Location.js b/eaterplanet_ecommerce/utils/Location.js
new file mode 100644
index 0000000..b24e374
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/Location.js
@@ -0,0 +1,185 @@
+let app = getApp();
+var QQMapWX = require("./qqmap-wx-jssdk.min.js");
+
+function checkGPS(t, fn=null) {
+ wx.authorize({
+ scope: "scope.userLocation",
+ success: function () {
+ console.log("get GPS success"), wx.getLocation({
+ success: function (n) {
+ console.log("get GPS location success"), app.globalData.location = {
+ lat: n.latitude,
+ lng: n.longitude
+ }, app.globalData.canGetGPS = true, fn;
+ wx.setStorage({
+ key: "latitude",
+ data: n.latitude
+ })
+ wx.setStorage({
+ key: "longitude",
+ data: n.longitude
+ })
+ },
+ fail: function () {
+ console.log("get GPS location fail"), app.globalData.canGetGPS = false, fn&&fn();
+ }
+ });
+ },
+ fail: function () {
+ console.log("get GPS fail checkGPS"), app.globalData.canGetGPS = false, fn&&fn();
+ }
+ });
+}
+
+function openSetting(t) {
+ return new Promise(function (resolve, reject) {
+ wx.showModal({
+ content: "为了更好的服务您,需要您的地理位置",
+ confirmText: "去开启",
+ confirmColor: "#FF673F",
+ success: function(res1) {
+ if(res1.confirm) {
+ wx.openSetting({
+ success: function(result) {
+ console.log(result);
+ if(result.authSetting["scope.userLocation"]){
+ wx.getLocation({
+ success: function(res) {
+ console.log("get GPS location success");
+ getApp().globalData.location = {
+ lat: res.latitude,
+ lng: res.longitude
+ },
+ getApp().globalData.canGetGPS = true;
+ resolve(res);
+ },
+ fail: function (error) {
+ console.log("get GPS fail openSetting");
+ getApp().globalData.canGetGPS = false;
+ reject('取消', error);
+ }
+ });
+ } else {
+ reject('未开启');
+ }
+ },
+ fail: function(error) {
+ reject(error);
+ }
+ });
+ } else if(res1.cancel) {
+ reject('用户点击取消');
+ console.log('用户点击取消')
+ }
+ }
+ });
+ });
+}
+
+/**
+ * 获取定位城市
+ */
+function getGps() {
+ let that = this;
+ return new Promise(function (resolve, reject) {
+ wx.getLocation({
+ type: 'gcj02', //编码方式,
+ success: function (res) {
+ console.log("getGps-res", res);
+ resolve(res);
+ wx.setStorage({
+ key: "latitude",
+ data: res.latitude
+ })
+ wx.setStorage({
+ key: "longitude",
+ data: res.longitude
+ })
+ },
+ fail: (error) => {
+ console.log("getGps-error", error);
+ if (error.errMsg == "getLocation:fail auth deny"){
+ that.openSetting().then(function(res){
+ console.log(res);
+ // reject(res)
+ }).catch(function(){
+ console.log(error);
+ reject(error);
+ });
+ } else {
+ // reject(error);
+ console.log(error);
+ // reject(error);
+ }
+ }
+ })
+ })
+}
+
+/**
+ * 通过GPS获取详细位置
+ */
+function getGpsLocation(lat, lon) {
+ var tx_map_key = wx.getStorageSync('tx_map_key');
+ if (tx_map_key) {
+ return new Promise(function (resolve, reject) {
+ analyzeGps(tx_map_key, lat, lon).then((res)=>{
+ resolve(res);
+ });
+ })
+ } else {
+ return new Promise(function (resolve, reject) {
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.get_community_config'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ tx_map_key = res.data.tx_map_key;
+ wx.setStorage({
+ key: "tx_map_key",
+ data: tx_map_key
+ })
+ analyzeGps(tx_map_key, lat, lon).then((res) => {
+ resolve(res);
+ });
+ }
+ }
+ })
+ })
+ }
+}
+
+/**
+ * 解析GPS
+ */
+function analyzeGps(tx_map_key, lat, lon) {
+ var demo = new QQMapWX({
+ key: tx_map_key
+ });
+ return new Promise(function (resolve, reject) {
+ demo.reverseGeocoder({
+ //腾讯地图api 逆解析方法 首先设置经纬度
+ location: {
+ latitude: lat,
+ longitude: lon
+ }, //逆解析成功回调函数
+ success: function (res) {
+ console.log(res)
+ let address_component = res.result.address_component || {};
+ let address_reference = res.result.address_reference;
+ address_component.town = address_reference.town&&address_reference.town.title || '';
+ resolve(address_component);
+ }
+ })
+ })
+}
+
+module.exports = {
+ checkGPS,
+ openSetting,
+ getGps,
+ getGpsLocation
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/utils/WxValidate.js b/eaterplanet_ecommerce/utils/WxValidate.js
new file mode 100644
index 0000000..59ce0be
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/WxValidate.js
@@ -0,0 +1,418 @@
+/**
+ * 表单验证
+ *
+ * @param {Object} rules 验证字段的规则
+ * @param {Object} messages 验证字段的提示信息
+ *
+ */
+class WxValidate {
+ constructor(rules = {}, messages = {}) {
+ Object.assign(this, {
+ data: {},
+ rules,
+ messages,
+ })
+ this.__init()
+ }
+
+ /**
+ * __init
+ */
+ __init() {
+ this.__initMethods()
+ this.__initDefaults()
+ this.__initData()
+ }
+
+ /**
+ * 初始化数据
+ */
+ __initData() {
+ this.form = {}
+ this.errorList = []
+ }
+
+ /**
+ * 初始化默认提示信息
+ */
+ __initDefaults() {
+ this.defaults = {
+ messages: {
+ required: '这是必填字段。',
+ email: '请输入有效的电子邮件地址。',
+ tel: '请输入11位的手机号码。',
+ url: '请输入有效的网址。',
+ date: '请输入有效的日期。',
+ dateISO: '请输入有效的日期(ISO),例如:2009-06-23,1998/01/22。',
+ number: '请输入有效的数字。',
+ digits: '只能输入数字。',
+ idcard: '请输入18位的有效身份证。',
+ equalTo: this.formatTpl('输入值必须和 {0} 相同。'),
+ contains: this.formatTpl('输入值必须包含 {0}。'),
+ minlength: this.formatTpl('最少要输入 {0} 个字符。'),
+ maxlength: this.formatTpl('最多可以输入 {0} 个字符。'),
+ rangelength: this.formatTpl('请输入长度在 {0} 到 {1} 之间的字符。'),
+ min: this.formatTpl('请输入不小于 {0} 的数值。'),
+ max: this.formatTpl('请输入不大于 {0} 的数值。'),
+ range: this.formatTpl('请输入范围在 {0} 到 {1} 之间的数值。'),
+ }
+ }
+ }
+
+ /**
+ * 初始化默认验证方法
+ */
+ __initMethods() {
+ const that = this
+ that.methods = {
+ /**
+ * 验证必填元素
+ */
+ required(value, param) {
+ if (!that.depend(param)) {
+ return 'dependency-mismatch'
+ } else if (typeof value === 'number') {
+ value = value.toString()
+ } else if (typeof value === 'boolean') {
+ return !0
+ }
+
+ return value.length > 0
+ },
+ /**
+ * 验证电子邮箱格式
+ */
+ email(value) {
+ return that.optional(value) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value)
+ },
+ /**
+ * 验证手机格式
+ */
+ tel(value) {
+ return that.optional(value) || /^1[23456789]\d{9}$/.test(value)
+ },
+ /**
+ * 验证URL格式
+ */
+ url(value) {
+ return that.optional(value) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value)
+ },
+ /**
+ * 验证日期格式
+ */
+ date(value) {
+ return that.optional(value) || !/Invalid|NaN/.test(new Date(value).toString())
+ },
+ /**
+ * 验证ISO类型的日期格式
+ */
+ dateISO(value) {
+ return that.optional(value) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value)
+ },
+ /**
+ * 验证十进制数字
+ */
+ number(value) {
+ return that.optional(value) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)
+ },
+ /**
+ * 验证整数
+ */
+ digits(value) {
+ return that.optional(value) || /^\d+$/.test(value)
+ },
+ /**
+ * 验证身份证号码
+ */
+ idcard(value) {
+ return that.optional(value) || /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value)
+ },
+ /**
+ * 验证两个输入框的内容是否相同
+ */
+ equalTo(value, param) {
+ return that.optional(value) || value === that.data[param]
+ },
+ /**
+ * 验证是否包含某个值
+ */
+ contains(value, param) {
+ return that.optional(value) || value.indexOf(param) >= 0
+ },
+ /**
+ * 验证最小长度
+ */
+ minlength(value, param) {
+ return that.optional(value) || value.length >= param
+ },
+ /**
+ * 验证最大长度
+ */
+ maxlength(value, param) {
+ return that.optional(value) || value.length <= param
+ },
+ /**
+ * 验证一个长度范围[min, max]
+ */
+ rangelength(value, param) {
+ return that.optional(value) || (value.length >= param[0] && value.length <= param[1])
+ },
+ /**
+ * 验证最小值
+ */
+ min(value, param) {
+ return that.optional(value) || value >= param
+ },
+ /**
+ * 验证最大值
+ */
+ max(value, param) {
+ return that.optional(value) || value <= param
+ },
+ /**
+ * 验证一个值范围[min, max]
+ */
+ range(value, param) {
+ return that.optional(value) || (value >= param[0] && value <= param[1])
+ },
+ }
+ }
+
+ /**
+ * 添加自定义验证方法
+ * @param {String} name 方法名
+ * @param {Function} method 函数体,接收两个参数(value, param),value表示元素的值,param表示参数
+ * @param {String} message 提示信息
+ */
+ addMethod(name, method, message) {
+ this.methods[name] = method
+ this.defaults.messages[name] = message !== undefined ? message : this.defaults.messages[name]
+ }
+
+ /**
+ * 判断验证方法是否存在
+ */
+ isValidMethod(value) {
+ let methods = []
+ for (let method in this.methods) {
+ if (method && typeof this.methods[method] === 'function') {
+ methods.push(method)
+ }
+ }
+ return methods.indexOf(value) !== -1
+ }
+
+ /**
+ * 格式化提示信息模板
+ */
+ formatTpl(source, params) {
+ const that = this
+ if (arguments.length === 1) {
+ return function() {
+ let args = Array.from(arguments)
+ args.unshift(source)
+ return that.formatTpl.apply(this, args)
+ }
+ }
+ if (params === undefined) {
+ return source
+ }
+ if (arguments.length > 2 && params.constructor !== Array) {
+ params = Array.from(arguments).slice(1)
+ }
+ if (params.constructor !== Array) {
+ params = [params]
+ }
+ params.forEach(function(n, i) {
+ source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function() {
+ return n
+ })
+ })
+ return source
+ }
+
+ /**
+ * 判断规则依赖是否存在
+ */
+ depend(param) {
+ switch (typeof param) {
+ case 'boolean':
+ param = param
+ break
+ case 'string':
+ param = !!param.length
+ break
+ case 'function':
+ param = param()
+ default:
+ param = !0
+ }
+ return param
+ }
+
+ /**
+ * 判断输入值是否为空
+ */
+ optional(value) {
+ return !this.methods.required(value) && 'dependency-mismatch'
+ }
+
+ /**
+ * 获取自定义字段的提示信息
+ * @param {String} param 字段名
+ * @param {Object} rule 规则
+ */
+ customMessage(param, rule) {
+ const params = this.messages[param]
+ const isObject = typeof params === 'object'
+ if (params && isObject) return params[rule.method]
+ }
+
+ /**
+ * 获取某个指定字段的提示信息
+ * @param {String} param 字段名
+ * @param {Object} rule 规则
+ */
+ defaultMessage(param, rule) {
+ let message = this.customMessage(param, rule) || this.defaults.messages[rule.method]
+ let type = typeof message
+
+ if (type === 'undefined') {
+ message = `Warning: No message defined for ${rule.method}.`
+ } else if (type === 'function') {
+ message = message.call(this, rule.parameters)
+ }
+
+ return message
+ }
+
+ /**
+ * 缓存错误信息
+ * @param {String} param 字段名
+ * @param {Object} rule 规则
+ * @param {String} value 元素的值
+ */
+ formatTplAndAdd(param, rule, value) {
+ let msg = this.defaultMessage(param, rule)
+
+ this.errorList.push({
+ param: param,
+ msg: msg,
+ value: value,
+ })
+ }
+
+ /**
+ * 验证某个指定字段的规则
+ * @param {String} param 字段名
+ * @param {Object} rules 规则
+ * @param {Object} data 需要验证的数据对象
+ */
+ checkParam(param, rules, data) {
+
+ // 缓存数据对象
+ this.data = data
+
+ // 缓存字段对应的值
+ const value = data[param] !== null && data[param] !== undefined ? data[param] : ''
+
+ // 遍历某个指定字段的所有规则,依次验证规则,否则缓存错误信息
+ for (let method in rules) {
+
+ // 判断验证方法是否存在
+ if (this.isValidMethod(method)) {
+
+ // 缓存规则的属性及值
+ const rule = {
+ method: method,
+ parameters: rules[method]
+ }
+
+ // 调用验证方法
+ const result = this.methods[method](value, rule.parameters)
+
+ // 若result返回值为dependency-mismatch,则说明该字段的值为空或非必填字段
+ if (result === 'dependency-mismatch') {
+ continue
+ }
+
+ this.setValue(param, method, result, value)
+
+ // 判断是否通过验证,否则缓存错误信息,跳出循环
+ if (!result) {
+ this.formatTplAndAdd(param, rule, value)
+ break
+ }
+ }
+ }
+ }
+
+ /**
+ * 设置字段的默认验证值
+ * @param {String} param 字段名
+ */
+ setView(param) {
+ this.form[param] = {
+ $name: param,
+ $valid: true,
+ $invalid: false,
+ $error: {},
+ $success: {},
+ $viewValue: ``,
+ }
+ }
+
+ /**
+ * 设置字段的验证值
+ * @param {String} param 字段名
+ * @param {String} method 字段的方法
+ * @param {Boolean} result 是否通过验证
+ * @param {String} value 字段的值
+ */
+ setValue(param, method, result, value) {
+ const params = this.form[param]
+ params.$valid = result
+ params.$invalid = !result
+ params.$error[method] = !result
+ params.$success[method] = result
+ params.$viewValue = value
+ }
+
+ /**
+ * 验证所有字段的规则,返回验证是否通过
+ * @param {Object} data 需要验证数据对象
+ */
+ checkForm(data) {
+ this.__initData()
+
+ for (let param in this.rules) {
+ this.setView(param)
+ this.checkParam(param, this.rules[param], data)
+ }
+
+ return this.valid()
+ }
+
+ /**
+ * 返回验证是否通过
+ */
+ valid() {
+ return this.size() === 0
+ }
+
+ /**
+ * 返回错误信息的个数
+ */
+ size() {
+ return this.errorList.length
+ }
+
+ /**
+ * 返回所有错误信息
+ */
+ validationErrors() {
+ return this.errorList
+ }
+}
+
+export default WxValidate
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/utils/countDown.js b/eaterplanet_ecommerce/utils/countDown.js
new file mode 100644
index 0000000..4334e12
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/countDown.js
@@ -0,0 +1,59 @@
+function t(obj, attr, newAttr) {
+ return attr in obj ? Object.defineProperty(obj, attr, {
+ value: newAttr,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ }) : obj[attr] = newAttr, obj;
+}
+
+
+var timeFormat = require("timeFormat"),
+ app = getApp();
+
+exports.default = {
+ initCountDown: function (e) {
+ var that = this,
+ r = {
+ day: "0",
+ second: "00",
+ minute: "00",
+ hour: "00"
+ };
+ if (e - new Date().getTime() <= 0) {
+ var i;
+ this.setData((i = {}, t(i, "countDownMap." + e, r), t(i, "actEndMap." + e, !0), i));
+ } else {
+ this.$data.timer[e] = app.globalData.timer.add(function () {
+ that.interval(e);
+ });
+ }
+ },
+ interval: function (t) {
+ var n = {}, r = t - new Date().getTime();
+
+ if (r <= 0) {
+ return app.globalData.timer.remove(this.$data.timer[t]),
+ this.$data.actEndMap[t] || (n["actEndMap." + t] = true),
+ n["countDownMap." + t] = {
+ day: "0",
+ second: "00",
+ minute: "00",
+ hour: "00"
+ },
+ void this.setData(n);
+ }
+ var i = Math.ceil(r / 1000),
+ o = parseInt(i / 86400),
+ u = i % 86400,
+ s = (0, timeFormat.formatNumber)(parseInt(u / 3600));
+ u %= 3600;
+ var d = {
+ day: o,
+ hour: s,
+ minute: (0, timeFormat.formatNumber)(parseInt(u / 60)),
+ second: (0, timeFormat.formatNumber)(u % 60)
+ };
+ this.$data.actEndMap[t] && (n["actEndMap." + t] = !1), n["countDownMap." + t] = d, this.setData(n);
+ }
+};
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/utils/index.js b/eaterplanet_ecommerce/utils/index.js
new file mode 100644
index 0000000..9f9d3af
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/index.js
@@ -0,0 +1,417 @@
+var app = getApp();
+var util = require('./util.js');
+var wcache = require('./wcache.js');
+
+function loadStatus() {
+ return new Promise(function (resolve) {
+ util.check_login_new().then((res) => {
+ let appLoadStatus = 1;
+ if (res) {
+ if (!app.globalData.hasDefaultCommunity) {
+ appLoadStatus = 2;
+ }
+ } else {
+ appLoadStatus = 0;
+ }
+ app.globalData.appLoadStatus = appLoadStatus;
+ resolve();
+ })
+ });
+};
+
+function changeCommunity(community, city) {
+ let token = wx.getStorageSync('token') || '';
+ if (community.communityId && community.communityId !== app.globalData.community.communityId) {
+ app.globalData.timer.del();
+ app.globalData.changedCommunity = true;
+ app.globalData.community = community;
+ app.globalData.refresh = true;
+ app.globalData.hasDefaultCommunity = true;
+ wx.setStorage({
+ key: "community",
+ data: community
+ });
+ app.globalData.city = city;
+ wx.setStorage({
+ key: "city",
+ data: city
+ });
+
+ var data = {
+ community: community,
+ city: city
+ };
+
+ var historyCommunity = app.globalData.historyCommunity || [];
+ if (0 === historyCommunity.length || historyCommunity[0] && historyCommunity[0].communityId !== community.communityId) {
+ historyCommunity.length > 1 && historyCommunity.shift();
+ historyCommunity.push(data);
+ app.globalData.historyCommunity = historyCommunity;
+ wx.setStorage({
+ key: "historyCommunity",
+ data: historyCommunity
+ })
+ }
+
+ app.globalData.changedCommunity = true;
+ app.globalData.goodsListCarCount = [];
+ if (token) {
+ console.log('changeCommunity step2')
+ // 请求提交社区id
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.switch_history_community',
+ token: token,
+ head_id: community.communityId
+ },
+ dataType: 'json',
+ success: function (res) {
+ swithNavBack(community)
+ }
+ })
+ } else {
+ swithNavBack(community)
+ }
+ } else {
+ if (!app.globalData.community.disUserHeadImg) {
+ app.globalData.community = community;
+ wx.setStorage({
+ key: "community",
+ data: community
+ })
+ }
+ app.globalData.changedCommunity = true;
+ app.globalData.goodsListCarCount = [];
+ wx.switchTab({
+ url: "/eaterplanet_ecommerce/pages/index/index"
+ });
+ }
+}
+
+// 切换社区跳转
+function swithNavBack(community) {
+ app.globalData.community_id = community.communityId;
+ let navBackUrl = app.globalData.navBackUrl;
+ if (navBackUrl) {
+ let tabUrls = ['/eaterplanet_ecommerce/pages/index/index', '/eaterplanet_ecommerce/pages/order/shopCart', '/eaterplanet_ecommerce/pages/user/me', '/eaterplanet_ecommerce/pages/type/index'];
+ if (tabUrls.indexOf(navBackUrl) != -1) {
+ wx.switchTab({
+ url: navBackUrl,
+ success: () => {
+ app.globalData.navBackUrl = '';
+ }
+ })
+ } else {
+ wx.redirectTo({
+ url: navBackUrl,
+ success: () => {
+ app.globalData.navBackUrl = '';
+ }
+ })
+ }
+ } else {
+ wx.switchTab({
+ url: "/eaterplanet_ecommerce/pages/index/index"
+ });
+ }
+}
+
+function isIdCard(t) {
+ return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t);
+};
+
+/**
+ * 购物车数量
+ */
+function cartNum() {
+ function getTab(cb) {
+ let token = wx.getStorageSync('token') || '';
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'car.count',
+ token: token,
+ community_id: app.globalData.community.communityId
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ app.globalData.cartNum = res.data.data;
+ wx.setStorageSync("cartNum", res.data.data);
+ setTab(res.data.data);
+ cb(res.data);
+ }
+ }
+ })
+ }
+
+ function setTab(t) {
+ if ("number" == typeof t && t) {
+ // wx.setTabBarBadge({
+ // index: 1,
+ // text: t + "",
+ // fail: function (error) {
+ // console.log(error);
+ // }
+ // })
+ } else {
+ // wx.removeTabBarBadge({
+ // index: 1,
+ // fail: function (error) {
+ // console.log(error);
+ // }
+ // });
+ }
+ }
+ var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
+ i = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
+ return new Promise(function (resolve) {
+ if (i) {
+ getTab(resolve);
+ } else {
+ var nowTime = new Date().getTime();
+ if (app.globalData.cartNumStamp < nowTime) {
+ getTab(resolve);
+ } else {
+ ("number" == typeof n && (app.globalData.cartNum = n), setTab(app.globalData.cartNum), resolve(n))
+ }
+ app.globalData.cartNumStamp = new Date().getTime() + 60000;
+ }
+ });
+}
+
+function getRect(t, e, r) {
+ return new Promise(function (n) {
+ wx.createSelectorQuery().in(t)[r ? "selectAll" : "select"](e).boundingClientRect(function (t) {
+ r && Array.isArray(t) && t.length && n(t), !r && t && n(t);
+ }).exec();
+ });
+}
+
+/**
+ * 设置缓存过期时间
+ */
+function getInNum() {
+ return new Promise((resolve, reject) => {
+ let timestamp = Date.parse(new Date());
+ let inNum = parseInt(wx.getStorageSync('inNum')) || 0;
+ let inNumExp = parseInt(wx.getStorageSync('inNumExp')) || 0;
+ let today = new Date(new Date().toLocaleDateString()).getTime();
+
+ if ((timestamp - inNumExp) > 86400000 || inNumExp == 0) {
+ console.log('过期了');
+ inNum = 1;
+ wx.setStorage({
+ key: 'inNumExp',
+ data: today
+ })
+ } else {
+ inNum += 1;
+ }
+ wx.setStorage({
+ key: 'inNum',
+ data: inNum
+ })
+ let isThree = inNum > 3 ? false : true;
+ resolve(isThree);
+ })
+}
+
+/**
+ * 设置导航颜色
+ */
+function setNavBgColor() {
+ let navBgColor = wcache.get('navBgColor', 1);
+ let navFontColor = wcache.get('navFontColor', 1);
+ if (navBgColor == 1 || navFontColor == 1) {
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.get_nav_bg_color'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let nav_bg_color = res.data.data || '#4d9ee9';
+ let nav_font_color = res.data.nav_font_color || '#ffffff';
+ wx.setNavigationBarColor({
+ frontColor: nav_font_color,
+ backgroundColor: nav_bg_color
+ })
+ wcache.put('navBgColor', nav_bg_color, 100);
+ wcache.put('navFontColor', nav_font_color, 100);
+ }
+ }
+ })
+ } else {
+ wx.setNavigationBarColor({
+ frontColor: navFontColor,
+ backgroundColor: navBgColor
+ })
+ }
+}
+
+/**
+ * 获取配置名字 团长快递等
+ */
+function setGroupInfo() {
+ return new Promise(function (resolve, reject) {
+ // let groupInfo = wcache.get('groupInfo', 1);
+ // if (groupInfo == 1) {
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.get_group_info'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let obj = res.data.data;
+ console.log(obj);
+ obj.commiss_diy_name = obj.commiss_diy_name || '分销';
+ obj.group_name = obj.group_name || '社区';
+ obj.owner_name = obj.owner_name || '团长';
+ obj.delivery_ziti_name = obj.delivery_ziti_name || '社区自提';
+ obj.delivery_tuanzshipping_name = obj.delivery_tuanzshipping_name || '团长配送';
+ obj.delivery_express_name = obj.delivery_express_name || '快递配送';
+ obj.placeorder_tuan_name = obj.placeorder_tuan_name;
+ obj.placeorder_trans_name = obj.placeorder_trans_name;
+ obj.localtown_modifypickingname = obj.localtown_modifypickingname
+ // wcache.put('groupInfo', obj, 60);
+ resolve(obj);
+ }
+ }
+ })
+ // } else {
+ // resolve(groupInfo);
+ // }
+ })
+}
+
+/**
+ * 获取首页、购物车图标
+ */
+function setIcon() {
+ let tabList = wcache.get('tabList', 1);
+ return new Promise(function (resolve, reject) {
+ if (tabList == 1) {
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'index.get_tabbar'
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let list = res.data.data;
+ let iconArr = {
+ home: '',
+ car: '',
+ user: ''
+ };
+ iconArr.home = list['i1'] || '/eaterplanet_ecommerce/images/icon-tab-index1.png';
+ iconArr.car = list['i2'] || '/eaterplanet_ecommerce/images/icon-tab-shop1.png';
+ iconArr.user = list['i3'] || '/eaterplanet_ecommerce/images/icon-tab-me.png';
+ resolve(iconArr);
+ }
+ }
+ })
+ } else {
+ let iconArr = {
+ home: '',
+ car: ''
+ };
+ iconArr.home = tabList.list[0].iconPath;
+ iconArr.car = tabList.list[2].iconPath;
+ iconArr.user = tabList.list[3].iconPath;
+ resolve(iconArr);
+ }
+ })
+}
+
+function getPx(t) {
+ return Math.round(app.globalData.systemInfo.windowWidth / 375 * t);
+}
+
+/**
+ * canvas画文字
+ */
+function drawText(context, obj, o, a, n, i) {
+ var r = o.split(""),
+ l = "",
+ u = [];
+ context.setFillStyle(obj.color);
+ // context.fillStyle = obj.color;
+ context.textAlign = obj.textAlign;
+ context.setFontSize(obj.size);
+ // context.font = obj.size +'px Arial';
+ for (var s = 0; s < r.length; s++) {
+ context.measureText(l).width < i || (u.push(l), l = ""), l += r[s];
+ }
+ u.push(l);
+ for (var m = 0; m < u.length; m++) {
+ context.fillText(u[m], a, n + 12 * m);
+ }
+}
+
+/**
+ * 下载图片至本地
+ */
+function download(t) {
+ return new Promise(function (e) {
+ wx.downloadFile({
+ url: t,
+ success: function (t) {
+ 200 === t.statusCode && e(t);
+ },
+ fail: function (t) {
+ console.log(t), wx.hideLoading();
+ }
+ });
+ });
+}
+
+/**
+ * 更新首页列表购物车数量
+ * actId: 商品id
+ * num:数量
+ */
+function indexListCarCount(actId, num = 0) {
+ let obj = {
+ actId,
+ num
+ };
+ if (!actId) return;
+ let goodsListCarCount = app.globalData.goodsListCarCount || [];
+ if(Object.prototype.toString.call(goodsListCarCount) !== '[object Array]') {
+ goodsListCarCount = [];
+ }
+ if (goodsListCarCount.length == 0) {
+ goodsListCarCount.push(obj);
+ } else {
+ let k = goodsListCarCount.findIndex((n) => n.actId == obj.actId);
+ if (k == -1) {
+ goodsListCarCount.push(obj);
+ } else {
+ goodsListCarCount[k].num = obj.num;
+ }
+ }
+ app.globalData.goodsListCarCount = goodsListCarCount;
+}
+
+module.exports = {
+ changeCommunity,
+ loadStatus,
+ isIdCard,
+ cartNum,
+ getRect,
+ getInNum,
+ setNavBgColor,
+ setGroupInfo,
+ setIcon,
+ getPx,
+ drawText,
+ download,
+ indexListCarCount
+}
diff --git a/eaterplanet_ecommerce/utils/mixins.js b/eaterplanet_ecommerce/utils/mixins.js
new file mode 100644
index 0000000..cb5c906
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/mixins.js
@@ -0,0 +1,54 @@
+// 保存原生的 Page 函数
+const originPage = Page
+
+Page = (options) => {
+ const mixins = options.mixins
+ // mixins 必须为数组
+ if (Array.isArray(mixins)) {
+ delete options.mixins
+ // mixins 注入并执行相应逻辑
+ options = merge(mixins, options)
+ }
+ // 释放原生 Page 函数
+ originPage(options)
+}
+
+// 定义小程序内置的属性/方法
+const originProperties = ['data', 'properties', 'options']
+const originMethods = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onPageScroll', 'onTabItemTap']
+
+function merge(mixins, options) {
+ if (!Object.entries) {
+ Object.entries = function (obj) {
+ var ownProps = Object.keys(obj),
+ i = ownProps.length,
+ resArray = new Array(i); // preallocate the Array
+ while (i--)
+ resArray[i] = [ownProps[i], obj[ownProps[i]]];
+ return resArray;
+ };
+ }
+ mixins.forEach((mixin) => {
+ if (Object.prototype.toString.call(mixin) !== '[object Object]') {
+ throw new Error('mixin 类型必须为对象!')
+ }
+ // 遍历 mixin 里面的所有属性
+ for (let [key, value] of Object.entries(mixin)) {
+ if (originProperties.includes(key)) {
+ // 内置对象属性混入
+ options[key] = { ...value, ...options[key] }
+ } else if (originMethods.includes(key)) {
+ // 内置方法属性混入,优先执行混入的部分
+ const originFunc = options[key]
+ options[key] = function (...args) {
+ value.call(this, ...args)
+ return originFunc && originFunc.call(this, ...args)
+ }
+ } else {
+ // 自定义方法混入
+ options = { ...mixin, ...options }
+ }
+ }
+ })
+ return options
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/utils/public.js b/eaterplanet_ecommerce/utils/public.js
new file mode 100644
index 0000000..c2e6489
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/public.js
@@ -0,0 +1,90 @@
+var app = getApp(), flag = true;
+
+/**
+ * 加入购物车
+ */
+function addToCart(data, fn) {
+ if (flag){
+ flag = false;
+ // 请求数据
+ // 成功
+ wx.hideLoading();
+ wx.showToast({
+ title: "已加入购物车",
+ image: "../../images/addShopCart.png"
+ })
+ flag = true;
+ app.globalData.cartNum += data.goodsNum;
+ fn && fn();
+ // 失败
+ flag = true;
+ fn && fn();
+ }
+}
+
+/**
+ * 购物车提交
+ */
+function skuConfirm(data, fn) {
+ //请求
+ //成功
+ fn && fn();
+ // app.globalData.settleInfo = res.data;
+ wx.navigateTo({
+ url: "/eaterplanet_ecommerce/pages/order/placeOrder"
+ });
+ // 失败
+ // 100008 === t.head.error && wx.showToast({
+ // title: "购买单数已达到上限,无法购买此商品",
+ // icon: "none"
+ // });
+}
+
+/**
+ * 手机formID
+ */
+function collectFormIds(e) {
+ console.log(e)
+ var formIds = app.globalData.formIds;
+ if (!formIds)
+ {
+ formIds = [];
+ }
+ formIds.push(e), app.globalData.formIds = formIds;
+ var token = wx.getStorageSync('token');
+
+ app.util.request({
+ 'url': 'entry/wxapp/index',
+ 'data': {
+ controller: 'user.get_member_form_id',
+ token: token,
+ from_id: e
+ },
+ dataType: 'json',
+ success: function (res) {
+ }
+ })
+
+}
+
+/**
+ * 手机验证
+ */
+function checkMobile(t) {
+ return /^1[1-9][0-9]\d{8}$/.test(t);
+}
+
+/**
+ * 身份证验证
+ */
+function isIdCard(t) {
+ return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t);
+}
+
+module.exports = {
+ addToCart,
+ skuConfirm,
+ collectFormIds,
+ checkMobile,
+ isIdCard
+}
diff --git a/eaterplanet_ecommerce/utils/qqmap-wx-jssdk.min.js b/eaterplanet_ecommerce/utils/qqmap-wx-jssdk.min.js
new file mode 100644
index 0000000..b92f25a
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/qqmap-wx-jssdk.min.js
@@ -0,0 +1,2 @@
+var _createClass=function(){function a(e,c){for(var b=0;b r ? "今日" + [u.hour, u.minute].map(t).join(":") + "开抢" : a < r && a + 864e5 > r ? "明日" + [u.hour, u.minute].map(t).join(":") + "开抢" : "即将开抢";
+};
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/utils/timeQueue.js b/eaterplanet_ecommerce/utils/timeQueue.js
new file mode 100644
index 0000000..6e552ef
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/timeQueue.js
@@ -0,0 +1,43 @@
+exports.default = class {
+ constructor(name) {
+ this.queue = {};
+ this.timer = -1;
+ }
+
+ action(){
+ if ("{}" !== JSON.stringify(this.queue)) {
+ for (let i in this.queue) this.queue[i][0]();
+ this.timer = -1, this.begin();
+ } else {
+ this.stop();
+ }
+ }
+
+ add(e){
+ var t = "" + new Date().getTime() + Math.ceil(1000 * Math.random());
+ return this.queue["" + t] = [e], -1 === this.timer && this.start(), t;
+ }
+
+ remove(e) {
+ delete this.queue["" + e], "{}" === JSON.stringify(this.queue) && (this.timer = -1);
+ }
+
+ del() {
+ this.queue = {}, "{}" === JSON.stringify(this.queue) && (this.timer = -1);
+ }
+
+ stop() {
+ clearTimeout(this.timer), this.timer = -1;
+ }
+
+ start() {
+ this.timer > -1 || this.action();
+ }
+
+ begin() {
+ var that = this;
+ this.timer = setTimeout(function () {
+ that.action();
+ }, 1000);
+ }
+}
diff --git a/eaterplanet_ecommerce/utils/util.js b/eaterplanet_ecommerce/utils/util.js
new file mode 100644
index 0000000..0142459
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/util.js
@@ -0,0 +1,707 @@
+function getdomain() {
+ var app = getApp();
+
+ var new_domain = app.siteInfo.uniacid + '_' + app.siteInfo.siteroot;
+
+ var api = new_domain;
+ return api;
+}
+
+function api() {
+ var api = 'https://www.eaterplanet.com/api/';
+ return api;
+}
+
+function check_login() {
+ let token = wx.getStorageSync('token');
+ let member_id = wx.getStorageSync('member_id');
+
+ if (token && member_id != undefined && member_id.length > 0) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+/**
+ * 检查登录状态
+ * return promise [Boolean]
+ */
+function check_login_new() {
+ let token = wx.getStorageSync('token');
+ let member_id = wx.getStorageSync('member_id');
+ return new Promise(function (resolve, reject) {
+ wx.checkSession({
+ success() {
+ console.log('checkSession 未过期');
+ if (token && member_id != undefined && member_id.length > 0) {
+ resolve(true)
+ } else {
+ resolve(false)
+ }
+ },
+ fail() {
+ console.log('checkSession 过期');
+ resolve(false)
+ }
+ })
+ })
+}
+
+/**
+ * 检查跳转权限控制
+ * return [Boolean]
+ */
+function checkRedirectTo(url, needAuth) {
+ let status = false;
+ if (needAuth) {
+ const needAuthUrl = [
+ "/eaterplanet_ecommerce/moduleA/groupCenter/apply",
+ "/eaterplanet_ecommerce/pages/supply/apply",
+ "/eaterplanet_ecommerce/pages/user/charge",
+ "/eaterplanet_ecommerce/pages/order/index",
+ "/eaterplanet_ecommerce/moduleA/solitaire/index",
+ "/eaterplanet_ecommerce/moduleA/vip/upgrade",
+ "eaterplanet_ecommerce/moduleA/coupon/getCoupon"
+ ];
+ let idx = needAuthUrl.indexOf(url);
+ if (idx !== -1) status = true;
+ }
+ return status;
+}
+
+/**
+ * s_link: 回调链接
+ * type:跳转方式 0 redirectTo, 1 switchTab
+ */
+function login(s_link, type = 0) {
+ var app = getApp();
+ var share_id = wx.getStorageSync('share_id');
+ if (share_id == undefined) {
+ share_id = '0';
+ }
+
+ wx.login({
+ success: function (res) {
+ if (res.code) {
+ console.log(res.code);
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'user.applogin',
+ 'code': res.code
+ },
+ dataType: 'json',
+ success: function (res) {
+ console.log(res);
+ wx.setStorage({
+ key: "token",
+ data: res.data.token
+ })
+ wx.getUserInfo({
+ success: function (msg) {
+ var userInfo = msg.userInfo
+ wx.setStorage({
+ key: "userInfo",
+ data: userInfo
+ })
+ console.log(msg.userInfo);
+ app.util.request({
+ 'url': 'entry/wxapp/user',
+ 'data': {
+ controller: 'user.applogin_do',
+ 'token': res.data.token,
+ share_id: share_id,
+ nickName: msg.userInfo.nickName,
+ avatarUrl: msg.userInfo.avatarUrl,
+ encrypteddata: msg.encryptedData,
+ iv: msg.iv
+ },
+ method: 'post',
+ dataType: 'json',
+ success: function (res) {
+ wx.setStorage({
+ key: "member_id",
+ data: res.data.member_id
+ })
+ wx.showToast({
+ title: '资料已更新',
+ icon: 'success',
+ duration: 2000,
+ success: function () {
+ //s_link
+ if (s_link && s_link.length > 0) {
+ if (type == 1) {
+ wx.switchTab({
+ url: s_link,
+ })
+ } else {
+ wx.redirectTo({
+ url: s_link
+ })
+ }
+ }
+ }
+ })
+ }
+ })
+ },
+ fail: function (msg) {
+ // console.log(msg);
+ }
+ })
+ }
+ });
+ } else {
+ //console.log('获取用户登录态失败!' + res.errMsg)
+ }
+ }
+ })
+}
+
+function login_prosime(needPosition = true, userInfo = {}) {
+ return new Promise(function (resolve, reject) {
+ getCode().then(token => {
+ wxGetUserInfo(needPosition, token, userInfo).then(res => {
+ resolve(res)
+ }).catch(res => {
+ console.log(res);
+ reject(res)
+ });
+ })
+ })
+}
+
+function login_promise(needPosition = true, userInfo = {}) {
+ return new Promise(function (resolve, reject) {
+ getCode().then(token => {
+ let member_info = wx.getStorageSync('member_info')
+ console.log(typeof (member_info))
+ let wxGetUserInfoFunc = member_info !== null ? wxGetMemberInfo : wxGetUserInfo;
+ function handleResponse(res) {
+ resolve(res)
+ }
+ function handleError(res) {
+ reject(res)
+ }
+ wxGetUserInfoFunc(needPosition, token, userInfo, member_info).then(handleResponse).catch(handleError);
+ })
+ })
+}
+
+function getCode() {
+ return new Promise(function (resolve, reject) {
+ var app = getApp();
+ wx.login({
+ success: function (res) {
+ if (res.code) {
+ console.log(res.code);
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.applogin',
+ code: res.code
+ },
+ dataType: 'json',
+ success: function (res) {
+ resolve(res.data.token);
+ wx.setStorage({
+ key: "token",
+ data: res.data.token
+ })
+ wx.setStorage({
+ key: "member_info",
+ data: res.data.member_info
+ })
+ console.log(res.data)
+ }
+ });
+ } else {
+ reject(res.errMsg)
+ }
+ }
+ })
+ })
+}
+
+function wxGetMemberInfo(needPosition, token, userInfo, member_info) {
+ return new Promise(function (resolve, reject) {
+ var app = getApp();
+ var share_id = wx.getStorageSync('share_id');
+ var member_info = wx.getStorageSync('member_info');
+ if (share_id == undefined) {
+ share_id = '0';
+ }
+ var community = wx.getStorageSync('community');
+ var community_id = community && (community.communityId || 0);
+ community && wx.setStorageSync('lastCommunity', community);
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.applogin_do',
+ token,
+ member_info,
+ share_id: share_id,
+ nickName: member_info.username,
+ avatarUrl: member_info.avatar,
+ community_id
+ },
+ method: 'post',
+ dataType: 'json',
+ success: function (res) {
+ let isblack = res.data.isblack || 0;
+ let isparse_formdata = res.data.isparse_formdata || 0;
+ if (isblack == 1) {
+ app.globalData.isblack = 1;
+ wx.removeStorageSync('token');
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ } else if (isparse_formdata == 1) {
+ wx.setStorageSync('isparse_formdata', 1);
+ wx.setStorage({
+ key: "member_id",
+ data: res.data.member_id
+ })
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ } else {
+ wx.setStorage({
+ key: "member_id",
+ data: res.data.member_id
+ })
+ console.log('needPosition', needPosition)
+ needPosition && getCommunityInfo();
+ }
+ resolve(res);
+ },
+ fail: (err) => {
+ console.log("9applogin_do")
+ reject(err);
+ }
+ })
+ })
+}
+
+function wxGetUserInfo(needPosition, token, userInfo) {
+ return new Promise(function (resolve, reject) {
+ var app = getApp();
+ var share_id = wx.getStorageSync('share_id');
+ if (share_id == undefined) {
+ share_id = '0';
+ }
+ var community = wx.getStorageSync('community');
+ var community_id = community && (community.communityId || 0);
+ community && wx.setStorageSync('lastCommunity', community);
+
+ app.util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'user.applogin_do',
+ token,
+ share_id: share_id,
+ nickName: userInfo.nickName,
+ avatarUrl: userInfo.avatarUrl,
+ community_id
+ },
+ method: 'post',
+ dataType: 'json',
+ success: function (res) {
+ let isblack = res.data.isblack || 0;
+ let isparse_formdata = res.data.isparse_formdata || 0;
+
+ if (isblack == 1) {
+ app.globalData.isblack = 1;
+ wx.removeStorageSync('token');
+ wx.switchTab({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ } else if (isparse_formdata == 1) {
+ wx.setStorageSync('isparse_formdata', 1);
+ wx.setStorage({
+ key: "member_id",
+ data: res.data.member_id
+ })
+ wx.reLaunch({
+ url: '/eaterplanet_ecommerce/pages/index/index',
+ })
+ } else {
+ wx.setStorage({
+ key: "member_id",
+ data: res.data.member_id
+ })
+ console.log('needPosition', needPosition)
+ needPosition && getCommunityInfo();
+ }
+ resolve(res);
+ },
+ fail: (err) => {
+ reject(err);
+ }
+ })
+ })
+}
+
+function stringToJson(data) {
+ return JSON.parse(data);
+}
+
+function jsonToString(data) {
+ return JSON.stringify(data);
+}
+
+function imageUtil(e) {
+ var imageSize = {};
+ var originalWidth = e.detail.width; //图片原始宽
+ var originalHeight = e.detail.height; //图片原始高
+ var originalScale = originalHeight / originalWidth; //图片高宽比
+
+ //获取屏幕宽高
+ wx.getSystemInfo({
+ success: function (res) {
+ var windowWidth = res.windowWidth;
+ var windowHeight = res.windowHeight;
+ var windowscale = windowHeight / windowWidth; //屏幕高宽比
+
+ //console.log('windowWidth: ' + windowWidth)
+ //console.log('windowHeight: ' + windowHeight)
+ if (originalScale < windowscale) { //图片高宽比小于屏幕高宽比
+ //图片缩放后的宽为屏幕宽
+ imageSize.imageWidth = windowWidth;
+ imageSize.imageHeight = (windowWidth * originalHeight) / originalWidth;
+ } else { //图片高宽比大于屏幕高宽比
+ //图片缩放后的高为屏幕高
+ imageSize.imageHeight = windowHeight;
+ imageSize.imageWidth = (windowHeight * originalWidth) / originalHeight;
+ }
+ }
+ })
+ //console.log('缩放后的宽: ' + imageSize.imageWidth)
+ //console.log('缩放后的高: ' + imageSize.imageHeight)
+ return imageSize;
+}
+
+const formatTime = date => {
+ const year = date.getFullYear()
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ const hour = date.getHours()
+ const minute = date.getMinutes()
+ const second = date.getSeconds()
+
+ return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
+}
+
+const formatNumber = n => {
+ n = n.toString()
+ return n[1] ? n : '0' + n
+}
+
+//获取社区存本地
+const getCommunityInfo = function (param = {}) {
+ // let community = wx.getStorageSync('community');
+ let app = getApp();
+ // let that = this;
+ var token = wx.getStorageSync('token');
+ return new Promise(function (resolve, reject) {
+ // if (!community){
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.load_history_community',
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) {
+ let history_communities = res.data.list;
+ if (Object.keys(history_communities).length > 0 || history_communities.communityId != 0) {
+ wx.setStorageSync('community', history_communities);
+ app.globalData.community = history_communities;
+ resolve(history_communities);
+ } else {
+ resolve('');
+ }
+ } else if (res.data.code == 1) {
+ console.log(param)
+ if (check_login() && param.communityId === void 0) {
+ wx.redirectTo({
+ url: '/eaterplanet_ecommerce/pages/position/community',
+ })
+ resolve('');
+ } else {
+ resolve(param);
+ }
+ } else {
+ // 未登录
+ resolve('');
+ }
+ }
+ })
+ // } else {
+ // resolve('')
+ // }
+ })
+}
+
+/**
+ * 通过社区id获取社区信息
+ * 单社区控制
+ * data:该id社区信息
+ * open_danhead_model:是否开启单社区
+ * default_head_info: 自定义单社区信息
+ */
+const getCommunityById = function (community_id) {
+ return new Promise(function (resolve, reject) {
+ getApp().util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.get_community_info',
+ community_id
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (res.data.code == 0) resolve(res.data);
+ }
+ })
+ })
+}
+
+/**
+ * 历史社区
+ */
+const addhistory = function (community, isNew = false) {
+ var community_id = community.communityId;
+ console.log('addhistory');
+ var token = wx.getStorageSync('token');
+ getApp().util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.addhistory_community',
+ community_id,
+ token: token
+ },
+ dataType: 'json',
+ success: function (res) {
+ if (isNew) {
+ console.log('新人 社区')
+ app.util.request({
+ url: 'entry/wxapp/index',
+ data: {
+ controller: 'index.get_community_info',
+ community_id: community_id
+ },
+ dataType: 'json',
+ success: function (result) {
+ if (result.data.code == 0) {
+ let community = result.data.data;
+ app.globalData.community = community;
+ app.globalData.changedCommunity = true;
+ wx.setStorage({
+ key: "community",
+ data: community
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+}
+
+/**
+ * 获取wx的版本号
+ */
+const getWxVersion = function () {
+ return wx.getSystemInfoSync().SDKVersion
+}
+
+/**
+ * 微信版本比较, v1 大于 v2,返回1,否则返回 0
+ * @param {Object} v1
+ * @param {Object} v2
+ */
+const wxCompareVersion = function (v1, v2) {
+ v1 = v1.split('.')
+ v2 = v2.split('.')
+ const len = Math.max(v1.length, v2.length)
+ while (v1.length < len) {
+ v1.push('0')
+ }
+ while (v2.length < len) {
+ v2.push('0')
+ }
+ for (let i = 0; i < len; i++) {
+ const num1 = parseInt(v1[i])
+ const num2 = parseInt(v2[i])
+
+ if (num1 > num2) {
+ return 1
+ } else if (num1 < num2) {
+ return -1
+ }
+ }
+ return 0
+}
+
+const addCart = function (option) {
+ return new Promise((resolve, reject) => {
+ let token = wx.getStorageSync('token');
+ getApp().util.request({
+ url: 'entry/wxapp/user',
+ data: {
+ controller: 'car.add',
+ token,
+ ...option
+ },
+ dataType: 'json',
+ method: 'POST',
+ success: function (res) {
+ if (res.data.code == 7) {
+ let {
+ has_image,
+ pop_vipmember_buyimage
+ } = res.data;
+ if (has_image == 1 && pop_vipmember_buyimage) {
+ res.showVipModal = 1;
+ res.data.pop_vipmember_buyimage = pop_vipmember_buyimage;
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ } else {
+ resolve(res)
+ }
+ },
+ fail: function (res) {
+ reject(res)
+ }
+ })
+ })
+}
+
+const filterTel = function (shipping_tel) {
+ if (shipping_tel) {
+ var pat = /(\d{7})\d*(\d{0})/;
+ return shipping_tel.replace(pat, '$1****$2');
+ }
+ return shipping_tel;
+}
+
+/*函数节流*/
+function throttle(fn, interval) {
+ var enterTime = 0; //触发的时间
+ var gapTime = interval || 300; //间隔时间,如果interval不传,则默认300ms
+ return function () {
+ var context = this;
+ var backTime = new Date(); //第一次函数return即触发的时间
+ if (backTime - enterTime > gapTime) {
+ fn.call(context, arguments);
+ enterTime = backTime; //赋值给第一次触发的时间,这样就保存了第二次触发的时间
+ }
+ };
+}
+
+/*函数防抖*/
+function debounce(fn, interval) {
+ var timer;
+ var gapTime = interval || 1000; //间隔时间,如果interval不传,则默认1000ms
+ return function () {
+ clearTimeout(timer);
+ var context = this;
+ var args = arguments; //保存此处的arguments,因为setTimeout是全局的,arguments不是防抖函数需要的。
+ timer = setTimeout(function () {
+ fn.call(context, args);
+ }, gapTime);
+ };
+}
+
+const fileSystem = wx.getFileSystemManager()
+/**
+ * 缓存图片
+ */
+const getStorageImage = (web_image) => {
+ return new Promise((resolve, reject) => {
+ let webImages = wx.getStorageSync('webImages') || []
+ let webImage = webImages.find(y => y.web_path === web_image)
+ if (webImage) {
+ try {
+ fileSystem.accessSync(webImage.local_path)
+ resolve(webImage.local_path)
+ return webImage.local_path
+ } catch (e) {
+ // let webImageIdx = webImages.findIndex(y => y.web_path === web_image)
+ // webImages.splice(webImageIdx, 1)
+ wx.setStorageSync('webImages', webImages)
+ }
+ resolve(web_image)
+ } else {
+ wx.downloadFile({
+ url: web_image,
+ success(res) {
+ if (res.statusCode === 200) {
+ let filePath = res.tempFilePath
+ // let webImageStorage = wx.getStorageSync('webImages') || []
+ let webImageStorage = []
+ wx.getImageInfo({
+ src: filePath,
+ success(ret) {
+ let windowWidth = getApp().globalData.systemInfo.windowWidth || 375;
+ let h = ret.height;
+ let w = ret.width;
+ let height = h * windowWidth / w;
+ let storage = {
+ web_path: web_image,
+ local_path: filePath,
+ height,
+ last_time: Date.parse(new Date()),
+ }
+ webImageStorage.push(storage)
+ wx.setStorageSync('webImages', webImageStorage)
+ resolve(web_image)
+ },
+ fail(err) {
+ console.log(err)
+ reject()
+ }
+ })
+ } else {
+ reject()
+ }
+ },
+ fail() {
+ reject()
+ }
+ })
+ }
+ // return web_image
+ })
+}
+
+module.exports = {
+ formatTime: formatTime,
+ login: login,
+ check_login: check_login,
+ api: api,
+ getdomain: getdomain,
+ imageUtil: imageUtil,
+ jsonToString: jsonToString,
+ stringToJson: stringToJson,
+ login_prosime,
+ login_promise,
+ wxGetMemberInfo,
+ getCommunityInfo,
+ check_login_new,
+ checkRedirectTo,
+ getCommunityById,
+ addhistory,
+ wxGetUserInfo,
+ getWxVersion,
+ wxCompareVersion,
+ addCart,
+ filterTel,
+ throttle,
+ debounce,
+ getStorageImage
+}
\ No newline at end of file
diff --git a/eaterplanet_ecommerce/utils/wcache.js b/eaterplanet_ecommerce/utils/wcache.js
new file mode 100644
index 0000000..313fb70
--- /dev/null
+++ b/eaterplanet_ecommerce/utils/wcache.js
@@ -0,0 +1,48 @@
+var dtime = '_deadtime';
+
+function put(k, v, t) {
+ wx.setStorageSync(k, v)
+ var seconds = parseInt(t);
+ if (seconds > 0) {
+ var timestamp = Date.parse(new Date());
+ timestamp = timestamp / 1000 + seconds;
+ wx.setStorageSync(k + dtime, timestamp + "")
+ } else {
+ wx.removeStorageSync(k + dtime)
+ }
+}
+
+function get(k, def) {
+ var deadtime = parseInt(wx.getStorageSync(k + dtime))
+ if (deadtime) {
+ if (parseInt(deadtime) < Date.parse(new Date()) / 1000) {
+ if (def) {
+ return def;
+ } else {
+ return;
+ }
+ }
+ }
+ var res = wx.getStorageSync(k);
+ if (res) {
+ return res;
+ } else {
+ return def;
+ }
+}
+
+function remove(k) {
+ wx.removeStorageSync(k);
+ wx.removeStorageSync(k + dtime);
+}
+
+function clear() {
+ wx.clearStorageSync();
+}
+
+module.exports = {
+ put: put,
+ get: get,
+ remove: remove,
+ clear: clear,
+}
\ No newline at end of file