doum
3 天以前 7a4b8764b68e0dbaeb90e292a8a4bd47cb379e68
small-program/unpackage/dist/dev/mp-weixin/shop/pages/mine/mine.js
@@ -165,6 +165,8 @@
  value: true
});
exports.default = void 0;
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 34));
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 36));
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
var _vuex = __webpack_require__(/*! vuex */ 37);
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -178,59 +180,128 @@
  components: {
    CustomTabbar: CustomTabbar
  },
  computed: _objectSpread(_objectSpread({}, (0, _vuex.mapState)(['navHeight', 'statusbarHeight', 'shopInfo', 'shopToken'])), {}, {
    shopDisplayName: function shopDisplayName() {
      return this.shopInfo.shopName || '';
    },
    managerName: function managerName() {
      return this.shopInfo.contactName || this.shopInfo.managerName || '';
    }
  }),
  data: function data() {
    return {
      navActionIcon: '',
      settingIcon: '',
      info: {},
      storeAvatar: '',
      bannerImage: '',
      orderMenus: [{
        title: '待核验',
        badge: 12,
        icon: '/static/icon/mine_ic_daifukuan@2x.png',
        url: '/shop/pages/write-off/write-off'
      }, {
        title: '待收货',
        badge: 2,
        icon: '/static/icon/mine_ic_daishouhuo@2x.png',
        url: ''
      }, {
        title: '退款/售后',
        badge: '',
        icon: '/static/icon/mine_ic_tuikuan@2x.png',
        url: ''
      }],
      /* orderMenus: [
         { title: '待核验', badge: 12, icon: '/static/icon/mine_ic_daifukuan@2x.png', url: '/shop/pages/write-off/write-off' },
         { title: '待收货', badge: 2, icon: '/static/icon/mine_ic_daishouhuo@2x.png', url: '' },
         { title: '退款/售后', badge: '', icon: '/static/icon/mine_ic_tuikuan@2x.png', url: '' }
      ], */
      menuList: [{
        title: '规范须知',
        url: ''
        title: '门店合作协议',
        url: '/pages/rich-text/rich-text',
        type: 2
      }, {
        title: '门店隐私政策',
        url: '/pages/rich-text/rich-text',
        type: 3
      }, {
        title: '风险承诺',
        url: '/pages/rich-text/rich-text',
        type: 6
      }, {
        title: '行李寄存须知',
        url: '/pages/rich-text/rich-text',
        type: 7
      }, {
        title: '代理点合作协议',
        url: '/pages/rich-text/rich-text',
        type: 8
      }, {
        title: '在线客服',
        url: ''
        url: null,
        type: -1
      }, {
        title: '关于我们',
        url: ''
        url: '/pages/rich-text/rich-text',
        type: 5
      }]
    };
  },
  computed: _objectSpread(_objectSpread({}, (0, _vuex.mapState)(['navHeight', 'statusbarHeight', 'shopInfo'])), {}, {
    shopDisplayName: function shopDisplayName() {
      return this.shopInfo.shopName || '中铁快运南站旗舰店';
    },
    managerName: function managerName() {
      return this.shopInfo.contactName || this.shopInfo.managerName || '蔡子瑶';
    }
  }),
  onShow: function onShow() {
    this.info = {};
    this.getMyShop();
  },
  onLoad: function onLoad(options) {},
  methods: {
    previewImage: function previewImage(images) {
      var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      uni.previewImage({
        current: index,
        urls: images
      });
    },
    getMyShop: function getMyShop(index) {
      var _this = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
        var that, res;
        return _regenerator.default.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                that = _this;
                _context.next = 3;
                return that.$u.api.getShopInfoDetail();
              case 3:
                res = _context.sent;
                if (res.code === 200) {
                  _this.info = res.data;
                  console.log(_this.info.laborContractImgUrls, _this.info.laborContractImgUrls.length, "====================");
                  console.log(_this.info, "====================");
                }
              case 5:
              case "end":
                return _context.stop();
            }
          }
        }, _callee);
      }))();
    },
    junp: function junp() {
      uni.navigateTo({
        url: '/shop/pages/settings/settings'
      });
    },
    handleLogout: function handleLogout() {
      uni.showToast({
        title: '请接入登出逻辑',
        icon: 'none'
      });
      var _this2 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
        var that, res;
        return _regenerator.default.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                that = _this2;
                _context2.next = 3;
                return that.$u.api.logOutShop();
              case 3:
                res = _context2.sent;
                if (res.code === 200) {
                  uni.clearStorageSync("shopInfo");
                  uni.clearStorageSync("shopToken");
                  uni.navigateTo({
                    url: '/shop/pages/login/login'
                  });
                }
              case 5:
              case "end":
                return _context2.stop();
            }
          }
        }, _callee2);
      }))();
    },
    goAllOrders: function goAllOrders() {
      uni.showToast({
@@ -240,10 +311,10 @@
    },
    handleOrderClick: function handleOrderClick(item) {
      if (!item.url) {
        uni.showToast({
          title: '请补充跳转链接',
          icon: 'none'
        });
        /* uni.showToast({
           title: '请补充跳转链接',
           icon: 'none'
        }) */
        return;
      }
      uni.navigateTo({
@@ -252,15 +323,21 @@
    },
    handleMenuClick: function handleMenuClick(item) {
      if (!item.url) {
        uni.showToast({
          title: '请补充页面链接',
          icon: 'none'
        });
        /* uni.showToast({
           title: '请补充页面链接',
           icon: 'none'
        }) */
        return;
      }
      uni.navigateTo({
        url: item.url
      });
      if (item.type > 0) {
        uni.navigateTo({
          url: '/pages/rich-text/rich-text?type=' + item.type
        });
      } else {
        uni.navigateTo({
          url: item.url
        });
      }
    }
  }
};