panhui 3 年 前
コミット
1f3a93735f
1 ファイル変更9 行追加1 行削除
  1. 9 1
      src/components/RiceDoor.vue

+ 9 - 1
src/components/RiceDoor.vue

@@ -5,13 +5,14 @@
         @touchstart="onTouchStart"
         @touchmove="onTouchMove"
         @touchend="onTouchend"
+        v-if="showRice"
     >
         <img src="@assets/rice-door.png" @click.stop="$router.push('/rice')" alt="" />
     </div>
 </template>
 
 <script setup>
-import { ref, computed, inject, getCurrentInstance } from 'vue';
+import { ref, computed, inject, getCurrentInstance, onMounted } from 'vue';
 
 const {
     appContext: {
@@ -60,6 +61,13 @@ function onTouchMove(e) {
     pageX.value = e.touches[0].pageX;
     pageY.value = e.touches[0].pageY;
 }
+
+const showRice = ref(false);
+onMounted(() => {
+    global.$http.get('/sysConfig/get/rice_show').then(res => {
+        showRice.value = res.value == true || res.value === '1';
+    });
+});
 </script>
 
 <style lang="less" scoped>