Explorar o código

新增同步文件

yongzonghuang %!s(int64=3) %!d(string=hai) anos
pai
achega
8f9d00788f

+ 2 - 0
Dockerfile

@@ -0,0 +1,2 @@
+FROM registry.cn-shenzhen.aliyuncs.com/sumply-shop/nginx
+COPY unpackage/dist/build/h5/ /home/ui-h5/

+ 24 - 0
components/GlobalLoading/index.js

@@ -0,0 +1,24 @@
+import Vue from 'vue'
+import store from "../../store";
+import GlobalLoading from "./index.vue";
+export function showLoading(info=''){
+    store.commit("SET_SHOW_LOADING",{flag:true,info})
+}
+
+export function hideLoading(){
+    store.commit("SET_SHOW_LOADING",{flag:false,info:''})
+}
+
+export function showLoadingAuto(info='',time = 2000){
+    store.commit("SET_SHOW_LOADING",{flag:true,info})
+    setTimeout(()=>{
+        store.commit("SET_SHOW_LOADING",{flag:false,info:''})
+    },time)
+}
+
+Vue.prototype.$showLoading = showLoading
+Vue.prototype.$hideLoading = hideLoading
+Vue.prototype.$showLoadingAuto = showLoadingAuto
+// Vue.component("globalLoading",GlobalLoading)
+
+// export default GlobalLoading

+ 89 - 0
components/GlobalLoading/index.vue

@@ -0,0 +1,89 @@
+<template>
+  <view class="loading-content" v-if="loadingFlag"  @touchmove.stop.prevent="moveHandle"
+              @click.stop.prevent="moveHandle">
+    <!-- 遮罩 -->
+    <view catchtouchmove="true" class="full-mask" v-if="false"/>
+    <!-- loading -->
+    <view class="loading-gif">
+      <view class="flex mask">
+        <image src="@/static/images/loading/loading.gif"></image>
+<!--        <p> {{ loadingInfo }} </p>-->
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import {mapGetters} from 'vuex'
+
+export default {
+  name: "GlobalLoading",
+  methods: {
+    moveHandle() {
+      return;
+    }
+  },
+  mounted() {
+    console.log("+++++++++++++++++++__++++++++++++++++++++")
+    console.log(this.loadingFlag, this.loadingInfo)
+  },
+  computed: {
+    ...mapGetters(["loadingFlag", "loadingInfo"])
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.loading-content {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  z-index: 9999;
+  //pointer-events: none;
+
+  .mask {
+    //background-color: rgba(75, 53, 53, 0.52);
+  }
+
+  .full-mask {
+    position: absolute;
+    width: 100vw;
+    height: 100vh;
+    background-color: rgba(0, 0, 0, 0.52);
+    z-index: 9998;
+    pointer-events: none;
+  }
+
+  .loading-gif {
+    z-index: 9999;
+    position: relative;
+    width: 100%;
+    height: 100%;
+
+    .flex {
+      width: 200rpx;
+      height: 200rpx;
+      position: absolute;
+      border-radius: 15rpx;
+      top: 50%;
+      left: 50%;
+      transform: translate(-50%, -50%);
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      flex-direction: column;
+
+      image {
+        width: 150rpx;
+        height: 150rpx;
+      }
+
+      p {
+        color: #fff;
+      }
+    }
+  }
+}
+</style>

+ 118 - 0
components/canvasShow/basics/header/app/index.vue

@@ -0,0 +1,118 @@
+<template>
+  <view class="header">
+    <view class="top-box">
+      <image v-if="componentContent.logoType === 1" class="logo"
+             :src="componentContent.imageUrl"
+             mode="heightFix"></image>
+      <view v-else class="h3" :style="{fontSize:componentContent.fontSizeNum+'px',fontWeight:componentContent.textFontW,color:componentContent.titColor}">{{componentContent.title}}</view>
+      <view class="search-btn" @click="searchPro">
+        <image class="search-icon"
+               src="https://ceres.zkthink.com/static/img/search.png"
+               mode="widthFix"></image>
+      </view>
+    </view>
+    <view class="tabs-nav-warp">
+      <scroll-view class="tabs-nav" scroll-x="true">
+        <view class="ul">
+          <view class="li" :class="{'on':activeTab===0}" @click="tabChange(0)">首页</view>
+          <view class="li" :class="{'on':activeTab===index+1}" v-for="(item,index) in classifyData" :key="index" @click="tabChange(index+1,item.id)">
+            {{item.categoryName}}
+          </view>
+        </view>
+      </scroll-view>
+    </view>
+  </view>
+</template>
+
+<script>
+import {commonMixin} from '../mixin'
+export default {
+  mixins: [commonMixin],
+  data () {
+    return {
+      activeTab: 0
+    }
+  },
+  computed: {
+
+  },
+  methods:{
+    tabChange (index, id) {
+      this.activeTab = index
+      this.$emit('tabChange', index, id)
+    },
+    searchPro(key, type) {
+      uni.navigateTo({
+        url: `/pages_category_page1/search/index/index`
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  .header {
+    .top-box {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding-left: 30upx;
+      width: 100%;
+      .logo {
+        // width: 280upx;
+        height: 70upx;
+        margin-top: 0upx;
+      }
+
+      .search-btn {
+        height: 66upx;
+        background: rgba(255, 255, 255, 1);
+        border-radius: 33upx;
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+        margin-right: 30upx;
+        .search-icon {
+          width: 60upx;
+          height: 60upx;
+        }
+      }
+    }
+  }
+  .tabs-nav-warp{
+    margin-top: 20upx;
+    padding:0 30upx;
+    overflow: hidden;
+    .tabs-nav{
+      .ul{
+        display: flex;
+        flex-wrap: nowrap;
+        justify-content: space-between;
+        .li{
+          flex: 1 0 auto;
+          margin-left: 36upx;
+          font-size: 30upx;
+          color: #999999;
+          position: relative;
+          padding-bottom: 18upx;
+          text-align: center;
+          &:first-child{
+            margin-left: 0;
+          }
+          &.on{
+            &:after{
+              content: '';
+              width: 100%;
+              height: 4upx;
+              background: #C5AA7B;
+              position: absolute;
+              left: 0;
+              bottom: 0;
+            }
+            font-weight:bold;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 45 - 0
components/canvasShow/basics/header/mixin.js

@@ -0,0 +1,45 @@
+import api from '../../config/api'
+import {funMixin} from '../../config/mixin'
+
+export const commonMixin = {
+  name: 'headerComponent',
+  mixins: [funMixin],
+  props: {
+    terminal: {
+      type: Number,
+      default: 4
+    },
+    typeId: {
+      type: Number,
+      default: 1
+    },
+    shopId: {
+      type: Number,
+      default: 0
+    },
+    componentContent: {
+      type: Object
+    }
+  },
+  data () {
+    return {
+      classifyData: []
+    }
+  },
+  mounted() {
+      this.getData()
+  },
+  methods: {
+    getData() {
+      const _ = this
+      _.sendReq({
+        url: `${api.getClassify}?page=1&pageSize=20`,
+        method: 'GET'
+      }, (res) => {
+        _.classifyData = res.data
+        console.log(_.classifyData)
+      },(err)=>{
+      })
+    }
+  }
+}

+ 36 - 0
config/requestApi.js

@@ -0,0 +1,36 @@
+import { hideLoading, showLoading } from "../components/GlobalLoading";
+
+/**
+ * @FileDescription:
+ * @Author: kahu
+ * @Date: 2022/9/29
+ * @LastEditors: kahu
+ * @LastEditTime: 2022/9/29
+ */
+// const NET = require('../utils/request')
+const API = require('../config/api')
+export function doPointRequest(data){
+   // return NET.request(API.doPointer, data, 'post')
+    return new Promise((resolve, reject) => {
+        let header = {
+            "Content-Type": "application/json"
+        }
+        const res = uni.getStorageSync('storage_key');
+        const token = res.token
+        if (token) {
+            header['Authorization'] = token
+        }
+        uni.request({
+            url: API.doPointer,
+            data: data,
+            method: 'post',
+            header: header,
+            success: res => {
+                resolve(res)
+            },
+            fail: res => {
+                reject(res)
+            },
+        })
+    });
+}

BIN=BIN
static/images/loading/loading.gif


+ 53 - 0
store/index.js

@@ -0,0 +1,53 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+import {doPointRequest} from '../config/requestApi'
+
+Vue.use(Vuex);//vue的插件机制
+
+const state = {
+    globalLoading: {
+        showLoading: false,
+        showInfo: ''
+    }
+
+}
+const getters = {
+    loadingFlag: (state) => state.globalLoading.showLoading,
+    loadingInfo: (state) => state.globalLoading.showInfo
+}
+const mutations = {
+    ["SET_SHOW_LOADING"](state, obj) {
+        state.globalLoading.showLoading = obj.flag
+        state.globalLoading.showInfo = obj.info
+    }
+}
+const actions = {
+    /**
+     *
+     * @param context
+     * @param data {{eventType:1-浏览商品 2-添加购物车 3-提交订单,productIds:字符串逗号分割}}
+     * @returns {Promise<void>}
+     */
+    async doPointer(context, data) {
+        //判断是否登录
+        let item = {}
+        if (uni.getStorageSync('storage_key')) {
+            item = uni.getStorageSync('storage_key');
+        }
+        if (JSON.stringify(item) === '{}') {
+            return
+        }
+        const res = await doPointRequest(data)
+        // const res = await NET.request(API.doPointer, data, 'post')
+        console.log("埋点----------------------------------", res)
+    }
+}
+
+//Vuex.Store 构造器选项
+const store = new Vuex.Store({
+    state,
+    getters,
+    mutations,
+    actions,
+})
+export default store