123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <template>
- <view class="content">
- <view class="item_demo" @click="onClickTest"> 测试更换数据 </view>
- <view class="item_demo" @click="onClickNav">跳转</view>
- <view class="container">
- <template-book3 :dataList='book_3_data_list'></template-book3>
- <template-book-list></template-book-list>
- </view>
- </view>
- </template>
- <script setup lang="ts">
- import { onLoad } from '@dcloudio/uni-app';
- import { ref } from 'vue';
- import { util } from '../../framework/util';
- import { tools } from '../../framework/tools';
- import templateBook3 from '../bookstore/template/template-book-3.vue'
- import templateBookList from '../bookstore/template/template-book-list.vue'
-
- let book_3_data_list = ref<Array<string>>([])
- var bool:boolean = true
-
- onLoad((options)=>{
- console.log('bookstore-options=',options)
- tools.setNavigationBar()
- requestData(bool)
- })
-
- function requestData(is:boolean) {
- if(is) {
- book_3_data_list.value = ['4','5','6']
- } else {
- book_3_data_list.value = ['1','1','1']
- }
- }
-
- function onClickTest() {
- util.showLoading()
- setTimeout(()=>{
- util.hideLoading()
- bool = !bool
- requestData(bool)
- },200)
-
- // util.showInfoToast('信息')
- // util.showSuccessToast('成功')
- // util.showErrorToast('失败')
-
- // util.showModal('标题',null,()=>{
- // console.log('11111111')
- // },null,'是吧')
-
- // util.showModalNoCancel('标题',null)
-
- // util.showActionSheet('你好', ['1','2','3'], (index:number)=>{
- // console.log('确定index=',index)
- // })
- }
-
- function onClickNav() {
- uni.navigateTo({
- url:'/pages/search/search' + '?' + 'id=123',
- })
- }
-
- </script>
- <style lang="scss">
- .content{
- display: flex;
- flex-direction: column;
- width: 100%;
-
- .container{
- display: flex;
- flex-direction: column;
- }
- }
-
- .item_demo{
- display: flex;
- margin-top: 30rpx;
- height: 100rpx;
- font-size: 30px;
- background-color: red;
- justify-content: center;
- align-items: center;
- }
-
- </style>
|