|
@@ -1,43 +1,88 @@
|
|
|
<template>
|
|
|
- <view> 书城 </view>
|
|
|
- <view style="display: flex; margin-top: 30px; height: 50px; font-size: 30px; background-color: red; justify-content: center; align-items: center;"
|
|
|
- @click="onClickTest"> 测试 </view>
|
|
|
+ <view class="content">
|
|
|
+ <view> 书城 </view>
|
|
|
+ <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 >
|
|
|
+ <script setup lang="ts">
|
|
|
+ import { onLoad } from '@dcloudio/uni-app';
|
|
|
+ import { ref } from 'vue';
|
|
|
import { util } from '../../framework/util';
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
- },
|
|
|
- methods: {
|
|
|
- onClickTest() {
|
|
|
- util.showLoading()
|
|
|
- setTimeout(()=>{
|
|
|
- util.hideLoading()
|
|
|
- },1500)
|
|
|
-
|
|
|
- // util.showInfoToast('信息')
|
|
|
- // util.showSuccessToast('成功')
|
|
|
- // util.showErrorToast('失败')
|
|
|
-
|
|
|
- // util.showModal('标题',null,()=>{
|
|
|
- // console.log('11111111')
|
|
|
- // },null,'是吧')
|
|
|
-
|
|
|
- // util.showModalNoCancel('标题')
|
|
|
-
|
|
|
- // util.showActionSheet('你好', ['1','2','3'], (index)=>{
|
|
|
- // console.log('确定index=',index)
|
|
|
- // })
|
|
|
- }
|
|
|
+ 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)
|
|
|
+ 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>
|