✨ 全局:默认暂时写死
							parent
							
								
									d4bbe55126
								
							
						
					
					
						commit
						3280d65be5
					
				| 
						 | 
				
			
			@ -1,18 +1,6 @@
 | 
			
		|||
import request from '@/sheep/request';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  // 系统初始化
 | 
			
		||||
  init: (templateId) =>
 | 
			
		||||
    request({
 | 
			
		||||
      url: 'init',
 | 
			
		||||
      params: {
 | 
			
		||||
        templateId,
 | 
			
		||||
      },
 | 
			
		||||
      custom: {
 | 
			
		||||
        showError: false,
 | 
			
		||||
        showLoading: false,
 | 
			
		||||
      },
 | 
			
		||||
    }),
 | 
			
		||||
  // 自定义页面
 | 
			
		||||
  page: (id) =>
 | 
			
		||||
    request({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,14 +0,0 @@
 | 
			
		|||
import request2 from '@/sheep/request2';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  decorate: () =>
 | 
			
		||||
    request2({
 | 
			
		||||
      url: 'promotion/decorate/list?page=1',
 | 
			
		||||
      method: 'GET',
 | 
			
		||||
    }),
 | 
			
		||||
  spids: () =>
 | 
			
		||||
    request2({
 | 
			
		||||
      url: 'product/spu/page?recommendType=best&pageNo=1&pageSize=10',
 | 
			
		||||
      method: 'GET',
 | 
			
		||||
    }),
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			@ -1,16 +1,6 @@
 | 
			
		|||
import request from '@/sheep/request';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	// 预支付
 | 
			
		||||
	prepay: (data) =>
 | 
			
		||||
		request({
 | 
			
		||||
			url: 'pay/prepay',
 | 
			
		||||
			method: 'POST',
 | 
			
		||||
			data,
 | 
			
		||||
			custom: {
 | 
			
		||||
				loadingMsg: '支付中',
 | 
			
		||||
			},
 | 
			
		||||
		}),
 | 
			
		||||
	// 发起提现
 | 
			
		||||
	withdraw: {
 | 
			
		||||
		list: (params) =>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,7 +50,7 @@ const app = defineStore({
 | 
			
		|||
  actions: {
 | 
			
		||||
    // 获取Shopro应用配置和模板
 | 
			
		||||
    async init(templateId = null) {
 | 
			
		||||
      //检查网络
 | 
			
		||||
      // 检查网络
 | 
			
		||||
      const networkStatus = await $platform.checkNetwork();
 | 
			
		||||
      if (!networkStatus) {
 | 
			
		||||
        $router.error('NetworkError');
 | 
			
		||||
| 
						 | 
				
			
			@ -58,19 +58,36 @@ const app = defineStore({
 | 
			
		|||
 | 
			
		||||
      // 加载装修配置
 | 
			
		||||
      await adaptTemplate(this.template, templateId)
 | 
			
		||||
      const res = await appApi.init(templateId);
 | 
			
		||||
      if (res.error === 0) {
 | 
			
		||||
        this.info = res.data.app;
 | 
			
		||||
        this.platform = res.data.platform;
 | 
			
		||||
 | 
			
		||||
        // TODO 芋艿:未接入
 | 
			
		||||
        // this.template = res.data.template;
 | 
			
		||||
        // this.has_wechat_trade_managed = res.data.has_wechat_trade_managed;
 | 
			
		||||
        // if (!res.data.template) {
 | 
			
		||||
        //   $router.error('TemplateError');
 | 
			
		||||
        // }
 | 
			
		||||
        // TODO 芋艿:未接入
 | 
			
		||||
        // this.chat = res.data.chat;
 | 
			
		||||
      // TODO 芋艿:未来支持管理后台可配;对应 https://api.shopro.sheepjs.com/shop/api/init
 | 
			
		||||
      if (true) {
 | 
			
		||||
        this.info = {
 | 
			
		||||
          name: '芋道商城',
 | 
			
		||||
          logo: 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png',
 | 
			
		||||
          version: '1.1.13',
 | 
			
		||||
          copyright: '全部开源,个人与企业可 100% 免费使用',
 | 
			
		||||
          copytime: 'Copyright© 2018-2024',
 | 
			
		||||
 | 
			
		||||
          cdnurl: 'https://file.sheepjs.com', // 云存储域名
 | 
			
		||||
          filesystem: 'qcloud', // 云存储平台
 | 
			
		||||
        };
 | 
			
		||||
        this.platform = {
 | 
			
		||||
          share: {
 | 
			
		||||
            methods: [ "poster", "link" ],
 | 
			
		||||
            linkAddress: "https://shopro.sheepjs.com/#/",
 | 
			
		||||
            posterInfo: {
 | 
			
		||||
              "user_bg": "/static/img/shop/config/user-poster-bg.png",
 | 
			
		||||
              "goods_bg": "/static/img/shop/config/goods-poster-bg.png",
 | 
			
		||||
              "groupon_bg": "/static/img/shop/config/groupon-poster-bg.png"
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          bind_mobile: 0
 | 
			
		||||
        };
 | 
			
		||||
        this.chat = {
 | 
			
		||||
          chat_domain: "https://api.shopro.sheepjs.com/chat",
 | 
			
		||||
          room_id: "admin"
 | 
			
		||||
        }
 | 
			
		||||
        this.has_wechat_trade_managed = 0;
 | 
			
		||||
 | 
			
		||||
        // 加载主题
 | 
			
		||||
        const sysStore = sys();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue