Bladeren bron

工具区分设备 显示不同位置

hjr 3 maanden geleden
bovenliggende
commit
c2698f9298

+ 0 - 16
src/components/book-detail/info.ux

@@ -11,24 +11,8 @@
       ></rating>
       <text class="text-remark">{{ info.novelAuthor }}</text>
       <text class="text-remark">{{ info.novelWords }}万字</text>
-      <!-- <text class="button" onclick="onBtnClick">到书城查看更多好书 </text> -->
     </div>
   </div>
-  <!-- <div class="info">
-    <image class="info-left" src="{{ info.image }}"></image>
-    <div class="info-right">
-      <text class="text-title">{{ info.title }}</text>
-      <rating
-        class="rate"
-        numstars="5"
-        rating="{{Number(info.score)}}"
-        indicator="true"
-      ></rating>
-      <text class="text-remark">{{ info.author }}</text>
-      <text class="text-remark">{{ info.words }}万字</text>
-      <text class="button" onclick="onBtnClick">{{ 到书城查看更多好书 }}</text>
-    </div>
-  </div> -->
 </template>
 
 <script>

+ 6 - 9
src/components/common/center-modal.ux

@@ -49,13 +49,11 @@
         default: '提示'
       }
     },
-    methods: {
-      // 关闭弹窗的方法
-      closeModal() {
-        // 通过 $emit 触发一个自定义事件 'close'
-        // 父组件可以监听这个事件来更新 show 属性
-        this.$emit('close');
-      }
+    // 关闭弹窗的方法
+    closeModal() {
+      // 通过 $emit 触发一个自定义事件 'close'
+      // 父组件可以监听这个事件来更新 show 属性
+      this.$emit('close');
     }
   }
 </script>
@@ -124,8 +122,7 @@
     color: #666666;
     /* 内容过多时可滚动 */
     flex: 1;
-    overflow-y: auto;
-    max-height: 60vh;
+    max-height: 500px;
   }
 
   /* 弹窗底部 */

+ 1 - 1
src/components/library/index.ux

@@ -12,7 +12,7 @@
       hot-list="{{hotList}}"
       brand="{{ brand }}"
     >
-      <div class="sub-container">
+      <div class="sub-container" if="{{ brand == 'vivo' }}">
         <swiper autoplay="true" class="swiper">
           <image
             class="swiper-image"

+ 16 - 2
src/components/my/index.ux

@@ -35,6 +35,14 @@
        </div>
         <text>></text> 
      </div>
+     <div class="item_tab" if="{{ showTool }}" @click="toPage('components/tools-mall')">
+     <!-- <div class="item_tab" if="{{ showTool }}" @click="toPage('pages/tools-mall')"> -->
+       <div>
+        <text class="iconfont">&#xe648;</text>
+        <text style="margin-left: 10px;">工具</text> 
+       </div>
+        <text>></text> 
+     </div>
   </div>
 </template>
 
@@ -43,10 +51,16 @@ import router from '@system.router'
 export default {
   props: [],
   data: {
-    page: 1
+    page: 1,
+    showTool:false,
   },
   onReady() {
-
+    var that = this
+      $utils.getStorage('brand').then(value => {
+        if(value !='vivo'){
+          that.showTool = true
+        }
+      })
   },
   toPage(path) {
     router.push({

+ 56 - 0
src/components/top-button.ux

@@ -0,0 +1,56 @@
+<template>
+  <div class="fab-btn" @click="onTap">
+    <slot>
+      <div style="background-color: #fff;border-radius: 50%; padding:10px;">
+        <text class="iconfont" style="font-size: 50px;color:#306df1; ">&#xe60e;</text>
+      </div>
+      <!-- <image class="shake-fast" style="width: 50px;height: 80px;" src="https://ytnovels.oss-cn-shanghai.aliyuncs.com/appStatic/images/source/redPacket.png"></image> -->
+    </slot>
+  </div>
+</template>
+
+<script>
+import router from '@system.router'
+
+export default {
+  props: {
+    },
+    onTap() {
+      router.push({
+        uri:'pages/commonModule/redPacket',
+        params: { key: 1 }
+      })
+      // this.$emit('tap')
+    }
+}
+</script>
+
+<style lang="less">
+@font-face {
+  font-family: iconfont;
+  src: url("/assets/iconfont/iconfont.ttf");
+}
+.iconfont {
+  font-family: iconfont;
+}
+.fab-btn {
+  position: fixed;
+  right: 40px;
+  bottom: 300px;
+  width: 90px;
+  height: 90px;
+  /* background-color: #399bfc; */
+  /* border-radius: 50%; */
+  /* box-shadow: 0 4px 16px rgba(0,0,0,0.18); */
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  /* z-index: 999; */
+}
+.fab-icon {
+  color: #fff;
+  font-size: 60px;
+  font-weight: bold;
+  text-align: center;
+}
+</style>

+ 4 - 1
src/manifest.json

@@ -97,6 +97,9 @@
       "pages/tools-mall": {
         "component": "index"
       },
+      "components/tools-mall": {
+        "component": "index"
+      },
       "pages/tools/yiJianShengDian": {
         "component": "index"
       },
@@ -214,7 +217,7 @@
       "pages/contents": {
         "titleBarText": "目录"
       },
-      "pages/tools-mall": {
+      "components/tools-mall": {
         "titleBarText": "工具"
       },
       "pages/tools/yiJianShengDian": {

+ 4 - 1
src/pages/main/index.ux

@@ -16,7 +16,7 @@
         ></bookshelf>
         <library></library>
         <!-- <search-book></search-book> -->
-        <tools-mall></tools-mall>
+        <tools-mall if="{{ brand == 'vivo' }}"></tools-mall>
         <my></my>
       </tab-content>
       <tab-bar mode="fixed" class="tab-bar">
@@ -77,6 +77,9 @@ export default {
     device.getInfo({
      success: function(ret) {
         that.brand = ret.brand
+        if(that.brand != 'vivo'){
+          that.tabList.splice(2,1)
+        }
         $utils.setStorage('brand',ret.brand)
         // const data = await $utils.getStorage('brand')
         console.log(`handling success, brand = ${ JSON.stringify(ret) }`)

+ 21 - 10
src/pages/tools/quWeiCePing/index.ux

@@ -4,14 +4,14 @@
       <div class="box">
         <block if="{{!finishStatus}}">
           <div class="title mgb-50">
-            <text> {{ curIndex + 1 }}、{{ QList[curIndex].title }}</text>
+            <text style="color: #333;font-size: 32px;font-weight: 500;"> {{ curIndex + 1 }}、{{ QList[curIndex].title }}</text>
           </div>
           <div
-            for="(key, a) in QList[curIndex].AlistArr"
+            for="(key, a) in AlistArr"
             @click="chooseA(a.key)"
             class="Aitem {{curChoose === a.key ? 'active' : ''}}">
-            <text>{{ a.key }}、</text>
-            <text>{{ a.value }}</text>
+            <text style="color: {{ curChoose === a.key ? '#399bfc':'#666' }}">{{ a.key }}、</text>
+            <text style="color: {{ curChoose === a.key ? '#399bfc':'#666' }}">{{ a.value }}</text>
           </div>
         </block>
         <block if="{{finishStatus}}">
@@ -19,7 +19,7 @@
         </block>
         <div class="btn w-300 bottom-30" @click="nextFn">
           <text class="btn-read" if="{{ curIndex == QList.length - 1 }}">
-            显示结果
+            {{ finishStatus?'重新测评':'显示结果' }}
           </text>
           <text class="btn-read" if="{{ curIndex != QList.length - 1 }}">
                下一题
@@ -48,6 +48,11 @@ export default {
       resultText: ''
     }
   },
+  computed: {
+    AlistArr() {
+      return this.QList[this.curIndex].AlistArr
+    }
+  },
   onInit() {
     // 把 Alist 转成数组方便 for 渲染
     this.QList.forEach(q => {
@@ -69,12 +74,18 @@ export default {
          this.curChoose = null;
         this.curIndex += 1;
       } else {
+        if(this.finishStatus){ // 重新测评
+          this.curIndex = 0
+          this.chooseList = []
+          this.curChoose = null
+          this.finishStatus = false
+          return
+        }
         this.finishStatus = true;
         this.resultText = this.generatePersonality();
          $utils.showToast('提交成功!')
-      return
+        return
       }
-      
     },
     generatePersonality() {
       if (this.chooseList.length !== 5) return "请完成所有问题";
@@ -127,7 +138,7 @@ export default {
 }
 .box {
   margin-top: 100px;
-  height: 850px;
+  height: 800px;
   width: 100%;
   flex-direction: column;
   background-color: #fff;
@@ -146,11 +157,11 @@ export default {
   text-align: center;
 }
 .Aitem {
-  border: 1px solid #000;
+  border: 1px solid #666;
   height: 80px;
   line-height: 80px;
   border-radius: 22px;
-  margin-bottom: 20px;
+  margin-bottom: 30px;
   padding: 0 20px;
 }
 .btn{

+ 0 - 4
src/pages/tools/yunDongJiBu/index.ux

@@ -31,10 +31,6 @@
             </div>
           </div> -->
         </div>
-      <!-- <div slot="footer">
-        <button class="btn btn_cancel" @tap="closeModal"><text>关闭</text></button>
-        <button class="btn btn_sure" @tap="doSomething"><text>确认</text></button>
-      </div> -->
     </center-modal>
   </div>
 </template>